[PATCH v2 2/4] PM: hibernate: Define and parse hibernate=relaxed_memmap parameter

Marco Scardovi <[email protected]> Tue, 23 Jun 2026 18:47:28 +0200
Newsgroups dev.linux.lists.regressions,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm
Message-ID <[email protected]>
Define the 'hibernate_relaxed_memmap' global variable and parse the
'relaxed_memmap' option under the 'hibernate=' kernel boot parameter.
This enables users to relax E820 memory map integrity checks during resume.

Assisted-by: Antigravity:gemini-3.5-flash

Signed-off-by: Marco Scardovi <[email protected]>
---
 kernel/power/hibernate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index d2479c69d71a..62ce708f37bd 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -41,6 +41,7 @@
 static int nocompress;
 static int noresume;
 static int nohibernate;
+bool hibernate_relaxed_memmap;
 static int resume_wait;
 static unsigned int resume_delay;
 static char resume_file[256] = CONFIG_PM_STD_PARTITION;
@@ -1430,6 +1431,8 @@ static int __init hibernate_setup(char *str)
 	} else if (!strncmp(str, "no", 2)) {
 		noresume = 1;
 		nohibernate = 1;
+	} else if (!strncmp(str, "relaxed_memmap", 14)) {
+		hibernate_relaxed_memmap = true;
 	} else if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)
 		   && !strncmp(str, "protect_image", 13)) {
 		enable_restore_image_protection();
-- 
2.54.0