2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 19:53:59 +08:00
linux-next/arch/x86/kernel/acpi/realmode
Kees Cook 7a3136666b x86, suspend: Restore MISC_ENABLE MSR in realmode wakeup
Some BIOSes will reset the Intel MISC_ENABLE MSR (specifically the
XD_DISABLE bit) when resuming from S3, which can interact poorly with
ebba638ae7. In 32bit PAE mode, this can
lead to a fault when EFER is restored by the kernel wakeup routines,
due to it setting the NX bit for a CPU that (thanks to the BIOS reset)
now incorrectly thinks it lacks the NX feature. (64bit is not affected
because it uses a common CPU bring-up that specifically handles the
XD_DISABLE bit.)

The need for MISC_ENABLE being restored so early is specific to the S3
resume path. Normally, MISC_ENABLE is saved in save_processor_state(),
but this happens after the resume header is created, so just reproduce
the logic here. (acpi_suspend_lowlevel() creates the header, calls
do_suspend_lowlevel, which calls save_processor_state(), so the saved
processor context isn't available during resume header creation.)

[ hpa: Consider for stable if OK in mainline ]

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Link: http://lkml.kernel.org/r/20110707011034.GA8523@outflux.net
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: <stable@kernel.org> 2.6.38+
2011-07-06 20:09:34 -07:00
..
.gitignore Update .gitignore files 2008-04-25 12:27:32 -07:00
bioscall.S x86, setup: "glove box" BIOS calls -- infrastructure 2009-04-09 16:08:11 -07:00
copy.S x86: move suspend wakeup code to C 2008-04-17 17:41:37 +02:00
Makefile gcov: enable GCOV_PROFILE_ALL for x86_64 2009-06-18 13:03:58 -07:00
regs.c x86, setup: "glove box" BIOS calls -- infrastructure 2009-04-09 16:08:11 -07:00
video-bios.c x86: move suspend wakeup code to C 2008-04-17 17:41:37 +02:00
video-mode.c x86: move suspend wakeup code to C 2008-04-17 17:41:37 +02:00
video-vesa.c x86: move suspend wakeup code to C 2008-04-17 17:41:37 +02:00
video-vga.c x86: move suspend wakeup code to C 2008-04-17 17:41:37 +02:00
wakemain.c x86: move suspend wakeup code to C 2008-04-17 17:41:37 +02:00
wakeup.h x86, suspend: Restore MISC_ENABLE MSR in realmode wakeup 2011-07-06 20:09:34 -07:00
wakeup.lds.S x86, trampoline: Use the unified trampoline setup for ACPI wakeup 2011-02-17 21:05:06 -08:00
wakeup.S x86, suspend: Restore MISC_ENABLE MSR in realmode wakeup 2011-07-06 20:09:34 -07:00