aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/kexec.c
diff options
context:
space:
mode:
authorAndrew Cooper <andrew.cooper3@citrix.com>2011-06-15 16:16:41 +0100
committerAndrew Cooper <andrew.cooper3@citrix.com>2011-06-15 16:16:41 +0100
commit2de77fa3cdbc08f76942db9bcf38dc6885cb4786 (patch)
tree4fe9cb641aa95fe477c2ec5a9b1cc4f7d0edc559 /xen/common/kexec.c
parentf6239c2a1e56e2795effe44fcf88467c501ca9d0 (diff)
downloadxen-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/common/kexec.c')
-rw-r--r--xen/common/kexec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index f889e5bb22..bddf23c535 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -29,6 +29,8 @@
#include <compat/kexec.h>
#endif
+bool_t kexecing = FALSE;
+
static DEFINE_PER_CPU_READ_MOSTLY(void *, crash_notes);
static Elf_Note *xen_crash_note;
@@ -220,6 +222,8 @@ void kexec_crash(void)
if ( !test_bit(KEXEC_IMAGE_CRASH_BASE + pos, &kexec_flags) )
return;
+ kexecing = TRUE;
+
kexec_common_shutdown();
kexec_crash_save_cpu();
machine_crash_shutdown();
@@ -232,6 +236,8 @@ static long kexec_reboot(void *_image)
{
xen_kexec_image_t *image = _image;
+ kexecing = TRUE;
+
kexec_common_shutdown();
machine_reboot_kexec(image);