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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 07 Mar 2008 07:58:56 +0000
From:	"Jan Beulich" <jbeulich@...ell.com>
To:	"Ingo Molnar" <mingo@...e.hu>
Cc:	"Miguel Boton" <mboton.lkml@...il.com>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	<linux-kernel@...r.kernel.org>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: mach_reboot_fixups()

>>> Ingo Molnar <mingo@...e.hu> 06.03.08 18:43 >>>
>
>* Jan Beulich <jbeulich@...ell.com> wrote:
>
>> Ingo,
>> 
>> was it intentional to remove the call to mach_reboot_fixups() during 
>> the merge of reboot_{32,64}.c? If so, it seems odd that 
>> reboot_fixups_32.c was left in the tree (and there was even stuff 
>> added to it). But it would rather seem that those machines dealt with 
>> in that file would not reboot properly anymore (for one of my boxes I 
>> added an entry in that table to make it boot properly, which is why I 
>> noticed the code not being called anymore)...
>
>good catch Jan! The patch below should fix it.
>
>Can you see any other material difference due to the unification? 
>reboot_mode is now written to 0x472 unconditionally, but we can consider 
>that a bugfix. Otherwise the mode and ordering of reboot sequences seems 
>to be equivalent to me.

Not exactly - when rebooting through EFI or BIOS, the old code didn't
go through mach_reboot_fixups(), and I think that is the correct
behavior (albeit, when the EFI path fell back to the triple fault
mechanism, it should have honored the fixup logic, and I think it is
more correct that the new code tries the keyboard method first).
Perhaps the most reasonable way to go is to honor all reboot=
settings without using the override code first:

--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -329,6 +329,10 @@ static inline void kb_wait(void)
 	}
 }
 
+void __attribute__((weak)) mach_reboot_fixups(void)
+{
+}
+
 static void native_machine_emergency_restart(void)
 {
 	int i;
@@ -337,9 +341,11 @@ static void native_machine_emergency_res
 	*((unsigned short *)__va(0x472)) = reboot_mode;
 
 	for (;;) {
+
 		/* Could also try the reset bit in the Hammer NB */
 		switch (reboot_type) {
 		case BOOT_KBD:
+			mach_reboot_fixups(); /* for board specific fixups */
 			for (i = 0; i < 10; i++) {
 				kb_wait();
 				udelay(50);

(with the exception that reboot=keyboard will still have the effect
of honoring the fixups, but I think this is better than further
complicating the logic).

In case you want to take this,
Signed-off-by: Jan Beulich <jbeulich@...ell.com>

Jan

--
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