lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1215754154.1617.61.camel@rzhang-dt>
Date:	Fri, 11 Jul 2008 13:29:14 +0800
From:	Zhang Rui <rui.zhang@...el.com>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-acpi <linux-acpi@...r.kernel.org>,
	linux-pm <linux-pm@...ts.linux-foundation.org>
Cc:	"Rafael J. Wysocki" <rjw@...k.pl>, Pavel Machek <pavel@...e.cz>,
	Henrique de Moraes Holschuh <hmh@....eng.br>,
	Andi Kleen <andi@...stfloor.org>, Ingo Molnar <mingo@...e.hu>
Subject: [linux-next] [PATCH V2 4/4] introduce new kernel parameter
	acpi_sleep=s4_nvs_nosave


Introduce new kernel parameter acpi_sleep=s4_nvs_nosave.

This can be used to prevent OS from saving/restoring ACPI NVS memory.

Signed-off-by: Zhang Rui <rui.zhang@...el.com>
---
 Documentation/kernel-parameters.txt |    5 ++++-
 arch/x86/kernel/acpi/sleep.c        |    3 +++
 drivers/acpi/sleep/main.c           |    3 +++
 include/asm-x86/acpi.h              |    3 +++
 4 files changed, 13 insertions(+), 1 deletion(-)

Index: linux-next/Documentation/kernel-parameters.txt
===================================================================
--- linux-next.orig/Documentation/kernel-parameters.txt	2008-07-11 13:04:46.000000000 +0800
+++ linux-next/Documentation/kernel-parameters.txt	2008-07-11 13:05:15.000000000 +0800
@@ -147,7 +147,8 @@
 			default: 0
 
 	acpi_sleep=	[HW,ACPI] Sleep options
-			Format: { s3_bios, s3_mode, s3_beep, old_ordering }
+			Format: { s3_bios, s3_mode, s3_beep, old_ordering,
+				  s4_nvs_nosave }
 			See Documentation/power/video.txt for s3_bios and s3_mode.
 			s3_beep is for debugging; it makes the PC's speaker beep
 			as soon as the kernel's real-mode entry point is called.
@@ -155,6 +156,8 @@
 			control method, wrt putting devices into low power
 			states, to be enforced (the ACPI 2.0 ordering of _PTS is
 			used by default).
+			s4_nvs_nosave prevents kernel from saving/restoring
+			ACPI NVS memory during hibernation.
 
 	acpi_sci=	[HW,ACPI] ACPI System Control Interrupt trigger mode
 			Format: { level | edge | high | low }
Index: linux-next/arch/x86/kernel/acpi/sleep.c
===================================================================
--- linux-next.orig/arch/x86/kernel/acpi/sleep.c	2008-07-11 13:04:46.000000000 +0800
+++ linux-next/arch/x86/kernel/acpi/sleep.c	2008-07-11 13:05:15.000000000 +0800
@@ -15,6 +15,7 @@
 
 unsigned long acpi_wakeup_address;
 unsigned long acpi_realmode_flags;
+int acpi_sleep_flags;
 
 /* address in low memory of the wakeup routine. */
 static unsigned long acpi_realmode;
@@ -142,6 +143,8 @@
 			acpi_realmode_flags |= 4;
 		if (strncmp(str, "old_ordering", 12) == 0)
 			acpi_old_suspend_ordering();
+		if (strncmp(str, "s4_nvs_nosave", 13) == 0)
+			acpi_sleep_flags |= ACPI_HIBERNATION_NVS_NOSAVE;
 		str = strchr(str, ',');
 		if (str != NULL)
 			str += strspn(str, ", \t");
Index: linux-next/drivers/acpi/sleep/main.c
===================================================================
--- linux-next.orig/drivers/acpi/sleep/main.c	2008-07-11 13:04:46.000000000 +0800
+++ linux-next/drivers/acpi/sleep/main.c	2008-07-11 13:05:15.000000000 +0800
@@ -297,6 +297,9 @@
 {
 	struct nvs_page *pos, *next;
 
+	if (acpi_sleep_flags & ACPI_HIBERNATION_NVS_NOSAVE)
+		return 0;
+
 	while (start <= end) {
 		pos = kzalloc(sizeof(struct nvs_page), GFP_KERNEL);
 		if (!pos)
Index: linux-next/include/asm-x86/acpi.h
===================================================================
--- linux-next.orig/include/asm-x86/acpi.h	2008-07-10 13:29:18.000000000 +0800
+++ linux-next/include/asm-x86/acpi.h	2008-07-11 13:05:15.000000000 +0800
@@ -94,6 +94,9 @@
 extern int acpi_sci_override_gsi;
 void acpi_pic_sci_set_trigger(unsigned int, u16);
 
+#define ACPI_HIBERNATION_NVS_NOSAVE 1
+extern int acpi_sleep_flags;
+
 static inline void disable_acpi(void)
 {
 	acpi_disabled = 1;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ