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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 9 Sep 2013 01:53:30 +0000
From:	"Liu, Chuansheng" <chuansheng.liu@...el.com>
To:	"H. Peter Anvin" <hpa@...or.com>, "Li, Fei" <fei.li@...el.com>
CC:	Ingo Molnar <mingo@...nel.org>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"x86@...nel.org" <x86@...nel.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"holt@....com" <holt@....com>,
	"rmk+kernel@....linux.org.uk" <rmk+kernel@....linux.org.uk>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] reboot: perform warm/cold reset correctly for CF9 type

Hello hpa,

> I could be wrong and the cold/warm reset values in CF9 end up having
> exactly the same function as the magic BIOS signature does; if so, then
> I would like to be told so explicitly, ideally with an explanation about
> how it works on the hw level (or a pointer to relevant documentation,
> Intel internal docs are fine.)
The Intel link is here for SandyBridge platform:
https://houston.fm.intel.com/wiki/doku.php?id=svwiki:projects:sandybridge:testplans:reset:start
And we have one internal baytrail platform doc refered it also.

> 
> Finally, again, does this solve a real problem?
Yes, we already have the 0xCF9 rebooting function, why not support the COLD/WARM reset both?
Thanks.


For safety and compatibility, we prepared the below patch, do you think is it making sense?



From: liu chuansheng <chuansheng.liu@...el.com>
Subject: [PATCH] X86, reboot: supporting COLD reset thru 0xcf9 port

Current X86 rebooting function supports the platform reset thru
port 0xcf9, but currently it hardcoded only for WARM reset that
writing 0x6 into port 0xcf9.

Here we added the support the COLD reset that writing 0xe thru
port 0xcf9, and the actual reset type is determined by reboot_mode
variable.

Also for safety and compatibility, we will set the default reboot
mode as WARM reset for several Apple MacBooks.

Signed-off-by: Li Fei <fei.li@...el.com>
Signed-off-by: liu chuansheng <chuansheng.liu@...el.com>
---
 arch/x86/kernel/reboot.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 563ed91..b4a1cb4 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -116,6 +116,12 @@ static int __init set_pci_reboot(const struct dmi_system_id *d)
 {
        if (reboot_type != BOOT_CF9) {
                reboot_type = BOOT_CF9;
+
+               /* The default reboot_mode value is COLD reset(0) for X86 platform,
+                * here for safety and compatibility, we set the default reboot
+                * mode as WARM reset for several Apple MacBooks.
+               */
+               reboot_mode = REBOOT_WARM;
                pr_info("%s series board detected. Selecting %s-method for reboots.\n",
                        "PCI", d->ident);
        }
@@ -511,10 +517,20 @@ static void native_machine_emergency_restart(void)
 
                case BOOT_CF9_COND:
                        if (port_cf9_safe) {
-                               u8 cf9 = inb(0xcf9) & ~6;
+                               u8 reboot_val;
+                               u8 cf9;
+
+                               if (reboot_mode == REBOOT_WARM)
+                                       reboot_val = 0x6;
+                               else
+                                       reboot_val = 0xe;
+
+                               cf9 = inb(0xcf9) & ~reboot_val;
                                outb(cf9|2, 0xcf9); /* Request hard reset */
                                udelay(50);
-                               outb(cf9|6, 0xcf9); /* Actually do the reset */
+
+                               /* Actually do the reset */
+                               outb(cf9|reboot_val, 0xcf9);
                                udelay(50);
                        }
                        reboot_type = BOOT_KBD;
-- 
1.7.0.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ