diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2011-06-15 20:44:44 +0100 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2011-06-15 20:44:44 +0100 |
commit | 4515b5c379e2ae97d0ae15e748c1f7d90785529e (patch) | |
tree | 1220aba22e6dd8ce7e749861c7432ea7901b6c32 | |
parent | 8a25fcd681aa0353610a9b9991b327792bf6ffe6 (diff) | |
download | xen-4515b5c379e2ae97d0ae15e748c1f7d90785529e.tar.gz xen-4515b5c379e2ae97d0ae15e748c1f7d90785529e.tar.bz2 xen-4515b5c379e2ae97d0ae15e748c1f7d90785529e.zip |
x86/apic: fix potential Protection Fault during shutdown
This is a rare case, but if the BIOS is set to uniprocessor, and Xen
is booted with 'lapic x2apic', Xen will switch into x2apic mode, which
will cause a protection fault when disabling the local APIC. This
leads to a general protection fault as this code is also in the fault
handler.
When x2apic mode is enabled, the only tranlsation which does
not result in a protection fault is to clear both the EN and EXTD
bits, which is safe to do in all cases, even if you are in xapic
mode rather than x2apic mode.
The linux code from which this is derrived is protected by an
if ( ! x2apic_mode ...) clause which is how they get away with it.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 23512:0feb98534a87
xen-unstable date: Tue Jun 14 12:47:45 2011 +0100
-rw-r--r-- | xen/arch/x86/apic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index 3a0f6fb725..587042c4fb 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -351,7 +351,8 @@ void disable_local_APIC(void) if (enabled_via_apicbase) { uint64_t msr_content; rdmsrl(MSR_IA32_APICBASE, msr_content); - wrmsrl(MSR_IA32_APICBASE, msr_content & ~MSR_IA32_APICBASE_ENABLE); + wrmsrl(MSR_IA32_APICBASE, msr_content & + ~(MSR_IA32_APICBASE_ENABLE|MSR_IA32_APICBASE_EXTD)); } } |