mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Milan Oravec <moravec@ukf.sk>
To: Marco Scardovi <scardracs@disroot.org>
Cc: bp@alien8.de, crecklin@redhat.com, dave.hansen@linux.intel.com,
	hpa@zytor.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, mingo@redhat.com, pavel@kernel.org,
	rafael@kernel.org, regressions@leemhuis.info,
	regressions@lists.linux.dev, tglx@kernel.org, x86@kernel.org
Subject: Re: [PATCH v2 0/4] PM: hibernate: Add relaxed_memmap option for x86 E820 integrity check
Date: Mon, 29 Jun 2026 15:04:04 +0200	[thread overview]
Message-ID: <4346170f-6685-40c6-8eeb-e3adab19275c@ukf.sk> (raw)
In-Reply-To: <20260623165724.10753-1-scardracs@disroot.org>

[-- Attachment #1: Type: text/plain, Size: 4214 bytes --]

Hello, I wanted to try this new set of patches, but I was unable to 
apply them. Tested with 7.1.2 and master too.

migo@migo-HP:~/build/linux-test/linux$ patch -p1 < ../hibernate2.patch
patching file include/linux/suspend.h
patching file kernel/power/hibernate.c
Hunk #2 FAILED at 1431.
1 out of 2 hunks FAILED -- saving rejects to file 
kernel/power/hibernate.c.rej
patching file arch/x86/power/hibernate.c
Hunk #1 FAILED at 61.
Hunk #2 succeeded at 78 with fuzz 1.
Hunk #3 FAILED at 144.
Hunk #4 FAILED at 166.
3 out of 4 hunks FAILED -- saving rejects to file 
arch/x86/power/hibernate.c.rej
patching file Documentation/admin-guide/kernel-parameters.txt
Hunk #1 FAILED at 1967.
1 out of 1 hunk FAILED -- saving rejects to file 
Documentation/admin-guide/kernel-parameters.txt.rej

Thank you,

Milan

s pozdravom

Milan Oravec

CIKT UKF Nitra
Mobil/Signal: +421907670270
email: moravec@ukf.sk

--------------------------------------------------------------------

Tuto spravu nepreveril ziadny antivirus - nebolo treba...

On 6/23/26 18:47, Marco Scardovi wrote:
> Hi Rafael, Milan,
>
>> ...
>>
>> Hibernation in Linux simply cannot cope with a changing memory map in
>> general, sorry about that.
> You are totally agree. While mine is still a solution for these like @Milan
> with a buggy firmware, it's not a solution to make it unconditional for every
> device so I came with a solution to introduce the boot flag
> hybernate=relaxed_memmap. This is still a bit hacky and I don't like it at
> all at the end of the day but works better than nothing, at least until HP
> releases a proper firmware with it fixed.
>
> This v2 of the patch address hibernation E820 map integrity check failures
> on UEFI platforms where firmware dynamically shifts reserved or ACPI memory
> ranges across boots (such as the HP OmniBook X Flip).
>
> In v1, I attempted to restrict the integrity check to only E820_TYPE_RAM
> ranges by default. As pointed out by Rafael, this is risky because the
> resumed kernel could attempt to access shifted ACPI tables or UEFI runtime
> services at stale addresses, leading to post-resume crashes or corruption.
>
> To address this feedback while still allowing hibernation to function on
> affected platforms, v2 introduces the 'hibernate=relaxed_memmap' command-line
> parameter.
>
> - Patch 1: Declare the 'hibernate_relaxed_memmap' flag in the PM core header.
> - Patch 2: Define the flag and add parsing logic to kernel/power/hibernate.c.
> - Patch 3: Implement the relaxed E820 memory map check on x86, which compares
>             a secondary RAM-only checksum if the main checksum mismatches,
>             warning the user but proceeding with resume.
> - Patch 4: Document the option in Documentation/admin-guide/kernel-parameters.txt.
>
> 1. By default, the E820 checksum verification remains strict to ensure
>     safety for all systems.
> 2. If 'hibernate=relaxed_memmap' is specified, the kernel will perform
>     a secondary check on only the usable RAM regions (E820_TYPE_RAM) if the
>     main E820 checksum mismatches.
>     - If the RAM regions differ, the resume is aborted (to prevent direct map
>       mismatches and kernel paging faults during page restoration).
>     - If the RAM regions match, the resume is allowed to proceed and a warning
>       is logged about the non-RAM changes.
>
> To support this, a secondary 'e820_ram_checksum' field is added to the
> x86-specific 'restore_data_record', and 'RESTORE_MAGIC' is incremented to
> signal the header layout change.
>
> Marco Scardovi (4):
>    PM: hibernate: Declare hibernate_relaxed_memmap
>    PM: hibernate: Define and parse hibernate=relaxed_memmap parameter
>    x86/power: Implement relaxed E820 memory map integrity check
>    Documentation: Document hibernate=relaxed_memmap parameter option
>
>   .../admin-guide/kernel-parameters.txt         |  5 +++
>   arch/x86/power/hibernate.c                    | 40 +++++++++++++++++--
>   include/linux/suspend.h                       |  1 +
>   kernel/power/hibernate.c                      |  3 ++
>   4 files changed, 45 insertions(+), 4 deletions(-)
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4983 bytes --]

  parent reply	other threads:[~2026-06-29 13:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-20  8:15 [PATCH 0/1] x86/power: only verify usable RAM regions during hibernation E820 check Marco Scardovi
2026-06-20  8:15 ` [PATCH 1/1] " Marco Scardovi
2026-06-20  9:20   ` Milan Oravec
2026-06-23 12:59   ` Rafael J. Wysocki
2026-06-23 15:11     ` Milan Oravec
2026-06-23 16:47       ` [PATCH v2 0/4] PM: hibernate: Add relaxed_memmap option for x86 E820 integrity check Marco Scardovi
2026-06-23 16:47         ` [PATCH v2 1/4] PM: hibernate: Declare hibernate_relaxed_memmap Marco Scardovi
2026-06-23 16:47         ` [PATCH v2 2/4] PM: hibernate: Define and parse hibernate=relaxed_memmap parameter Marco Scardovi
2026-06-23 16:47         ` [PATCH v2 3/4] x86/power: Implement relaxed E820 memory map integrity check Marco Scardovi
2026-06-23 16:47         ` [PATCH v2 4/4] Documentation: Document hibernate=relaxed_memmap parameter option Marco Scardovi
2026-06-29 13:04         ` Milan Oravec [this message]
2026-06-29 19:53           ` [PATCH v2 0/4] PM: hibernate: Add relaxed_memmap option for x86 E820 integrity check Marco Scardovi
2026-06-30  6:52             ` Milan Oravec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4346170f-6685-40c6-8eeb-e3adab19275c@ukf.sk \
    --to=moravec@ukf.sk \
    --cc=bp@alien8.de \
    --cc=crecklin@redhat.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@kernel.org \
    --cc=rafael@kernel.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=scardracs@disroot.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®