[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080818091522.GA6635@atrey.karlin.mff.cuni.cz>
Date: Mon, 18 Aug 2008 11:15:23 +0200
From: Pavel Machek <pavel@...e.cz>
To: Ingo Molnar <mingo@...e.hu>
Cc: David Fries <david@...es.net>, linux-kernel@...r.kernel.org,
"Rafael J. Wysocki" <rjw@...k.pl>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] Fix i486 suspend to disk CR4 oops
>
> * David Fries <david@...es.net> 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@...es.net>
>
> 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
>
> ---------------------->
> >From e437fa5586f2e3b2aaeba649fae52be1f9a6eabb Mon Sep 17 00:00:00 2001
> From: David Fries <david@...es.net>
> Date: Sun, 17 Aug 2008 23:03:40 -0500
> Subject: [PATCH] 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@...es.net>
> Signed-off-by: Ingo Molnar <mingo@...e.hu>
Acked-by: Pavel Machek <pavel@...e.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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