diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2011-06-15 16:16:41 +0100 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2011-06-15 16:16:41 +0100 |
commit | 2de77fa3cdbc08f76942db9bcf38dc6885cb4786 (patch) | |
tree | 4fe9cb641aa95fe477c2ec5a9b1cc4f7d0edc559 /xen/arch/x86/crash.c | |
parent | f6239c2a1e56e2795effe44fcf88467c501ca9d0 (diff) | |
download | xen-2de77fa3cdbc08f76942db9bcf38dc6885cb4786.tar.gz xen-2de77fa3cdbc08f76942db9bcf38dc6885cb4786.tar.bz2 xen-2de77fa3cdbc08f76942db9bcf38dc6885cb4786.zip |
KEXEC: correctly revert x2apic state when kexecing
Introduce the boolean variable 'kexecing' which indicates to functions
whether we are on the kexec path or not. This is used by
disable_local_APIC() to try and revert the APIC mode back to how it
was found on boot.
We also need some fudging of the x2apic_enabled variable. It is used
in multiple places over the codebase to mean multiple things,
including:
What did the user specifify on the command line?
Did the BIOS boot me in x2apic mode?
Is the BSP Local APIC in x2apic mode?
What mode is my Local APIC in?
Therefore, set it up to prevent a protection fault when disabling the
IOAPICs. (In this case, it is used in the "What mode is my Local APIC
in?" case, so the processor doesnt suffer a protection fault because
of trying to use x2apic MSRs when it should be using xapic MMIO)
Finally, make sure that interrupts are disabled when jumping into the
purgatory code. It would be bad to service interrupts in the Xen
context when the next kernel is booting.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/arch/x86/crash.c')
-rw-r--r-- | xen/arch/x86/crash.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c index 19508550df..ab18abb4d1 100644 --- a/xen/arch/x86/crash.c +++ b/xen/arch/x86/crash.c @@ -27,6 +27,7 @@ #include <asm/hvm/support.h> #include <asm/apic.h> #include <asm/io_apic.h> +#include <xen/iommu.h> static atomic_t waiting_for_crash_ipi; static unsigned int crashing_cpu; @@ -82,6 +83,12 @@ static void nmi_shootdown_cpus(void) iommu_crash_shutdown(); __stop_this_cpu(); + + /* This is a bit of a hack due to the problems with the x2apic_enabled + * variable, but we can't do any better without a significant refactoring + * of the APIC code */ + x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC); + disable_IO_APIC(); } |