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  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:	Fri, 01 Jun 2007 12:50:33 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Chandramouli Narayanan <mouli@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org, ak@...e.de, akpm@...ux-foundation.org
Subject: Re: [PATCH 2.6.21 2/3] x86_64: EFI64 support

Chandramouli Narayanan <mouli@...ux.intel.com> writes:

> diff -uprN -X linux-2.6.21rc7-git2-orig/Documentation/dontdiff
> linux-2.6.21rc7-git2-orig/arch/x86_64/kernel/reboot.c
> linux-2.6.21rc7-git2-uefi-finaltest/arch/x86_64/kernel/reboot.c
> --- linux-2.6.21rc7-git2-orig/arch/x86_64/kernel/reboot.c 2007-02-04
> 10:44:54.000000000 -0800
> +++ linux-2.6.21rc7-git2-uefi-finaltest/arch/x86_64/kernel/reboot.c 2007-04-19
> 13:01:02.000000000 -0700
> @@ -7,6 +7,7 @@
>  #include <linux/ctype.h>
>  #include <linux/string.h>
>  #include <linux/pm.h>
> +#include <linux/efi.h>
>  #include <asm/io.h>
>  #include <asm/kdebug.h>
>  #include <asm/delay.h>
> @@ -116,9 +117,15 @@ void machine_emergency_restart(void)
>  {
>  	int i;
>  
> +	/* If EFI enabled, reset system through EFI protocol. */
> +	if (efi_enabled) {
> +		efi.reset_system(EFI_RESET_WARM, EFI_SUCCESS, 0, NULL);
> +		return;
> +	}
> +
>  	/* Tell the BIOS if we want cold or warm reboot */
>  	*((unsigned short *)__va(0x472)) = reboot_mode;
> -       
> +

Don't do this.

Instead add an architecture specific pointer that the EFI
initialization code can override.  That should be a lot less
intrusive and more maintainable.

>  	for (;;) {
>  		/* Could also try the reset bit in the Hammer NB */
>  		switch (reboot_type) { 
> diff -uprN -X linux-2.6.21rc7-git2-orig/Documentation/dontdiff
> linux-2.6.21rc7-git2-orig/arch/x86_64/kernel/setup.c
> linux-2.6.21rc7-git2-uefi-finaltest/arch/x86_64/kernel/setup.c
> --- linux-2.6.21rc7-git2-orig/arch/x86_64/kernel/setup.c 2007-04-19
> 12:39:39.000000000 -0700
> +++ linux-2.6.21rc7-git2-uefi-finaltest/arch/x86_64/kernel/setup.c 2007-04-19
> 13:01:02.000000000 -0700
> @@ -44,6 +44,7 @@
>  #include <linux/dmi.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/ctype.h>
> +#include <linux/efi.h>
>  
>  #include <asm/mtrr.h>
>  #include <asm/uaccess.h>
> @@ -69,6 +70,10 @@
>   * Machine setup..
>   */
>  
> +#ifdef CONFIG_EFI
> +int efi_enabled = 0;
> +EXPORT_SYMBOL(efi_enabled);
> +#endif

Please remove this variable.

I didn't see a single use where it appears to be actually needed.

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