aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/efi_32.c
diff options
context:
space:
mode:
authorDavid Fries <david@fries.net>2008-08-17 23:03:40 -0500
committerIngo Molnar <mingo@elte.hu>2008-08-18 08:50:19 +0200
commite532c06f2a835b5cc4f4166f467437d9b09c1d0e (patch)
tree762fa0f0c22dc1af7d9d6e918f4d48ced8910a4e /arch/x86/kernel/efi_32.c
parentx86: mpparse.c: fix section mismatch warning (diff)
downloadlinux-dev-e532c06f2a835b5cc4f4166f467437d9b09c1d0e.tar.xz
linux-dev-e532c06f2a835b5cc4f4166f467437d9b09c1d0e.zip
x86: fix i486 suspend to disk CR4 oops
arch/x86/power/cpu_32.c __save_processor_state calls read_cr4() only a i486 CPU doesn't have the CR4 register. Trying to read it produces an invalid opcode oops during suspend to disk. Use the safe rc4 reading op instead. If the value to be written is zero the write is skipped. arch/x86/power/hibernate_asm_32.S done: swapped the use of %eax and %ecx to use jecxz for the zero test and jump over store to %cr4. restore_image: s/%ecx/%eax/ to be consistent with done: In addition to __save_processor_state, acpi_save_state_mem, efi_call_phys_prelog, and efi_call_phys_epilog had checks added (acpi restore was in assembly and already had a check for non-zero). There were other reads and writes of CR4, but MCE and virtualization shouldn't be executed on a i486 anyway. Signed-off-by: David Fries <david@fries.net> Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/efi_32.c')
-rw-r--r--arch/x86/kernel/efi_32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/efi_32.c b/arch/x86/kernel/efi_32.c
index 4b63c8e1f13b..5cab48ee61a4 100644
--- a/arch/x86/kernel/efi_32.c
+++ b/arch/x86/kernel/efi_32.c
@@ -53,7 +53,7 @@ void efi_call_phys_prelog(void)
* directory. If I have PAE, I just need to duplicate one entry in
* page directory.
*/
- cr4 = read_cr4();
+ cr4 = read_cr4_safe();
if (cr4 & X86_CR4_PAE) {
efi_bak_pg_dir_pointer[0].pgd =
@@ -91,7 +91,7 @@ void efi_call_phys_epilog(void)
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
- cr4 = read_cr4();
+ cr4 = read_cr4_safe();
if (cr4 & X86_CR4_PAE) {
swapper_pg_dir[pgd_index(0)].pgd =