Re: [PATCH] Fix i486 suspend to disk CR4 oops

From: Ingo Molnar
Date: Mon Aug 18 2008 - 02:41:59 EST



* David Fries <david@xxxxxxxxx> wrote:

> 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.
>
> Added the check (boot_cpu_data.x86 >= 5) before reading the register.
> 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@xxxxxxxxx>

applied to tip/x86/urgent, thanks David. I've changed the conditions to
read_cr4_safe() instead - that's cleaner. Could you please check whether
the patch below works fine too on your box?

Rafael, Pavel - does the commit below look good to you too?

Ingo

---------------------->