aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/machine_kexec.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-07-02 16:16:15 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-07-02 16:16:15 +0100
commit4cb90ae29a9c8615d7087773362062545f052d0f (patch)
tree989412c904eb4e0421fcd83831ae32db920d710d /xen/arch/x86/machine_kexec.c
parent47eb698d5335072855b86064baf5adb0aaa6b131 (diff)
downloadxen-4cb90ae29a9c8615d7087773362062545f052d0f.tar.gz
xen-4cb90ae29a9c8615d7087773362062545f052d0f.tar.bz2
xen-4cb90ae29a9c8615d7087773362062545f052d0f.zip
kexec: switch to a known good/static GDT before kexec
kexec has been failing (at least on 32on64, didn't try others) since 18771:8e18dd41c6c7 "x86: reduce GDT switching". Ensure that we are using a known good GDT before attempting to switch to compatability mode. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/arch/x86/machine_kexec.c')
-rw-r--r--xen/arch/x86/machine_kexec.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c
index 7488834593..f44aba2b5b 100644
--- a/xen/arch/x86/machine_kexec.c
+++ b/xen/arch/x86/machine_kexec.c
@@ -113,6 +113,18 @@ void machine_reboot_kexec(xen_kexec_image_t *image)
void machine_kexec(xen_kexec_image_t *image)
{
+ struct desc_ptr gdt_desc = {
+ .base = (unsigned long)(boot_cpu_gdt_table - FIRST_RESERVED_GDT_ENTRY),
+ .limit = LAST_RESERVED_GDT_BYTE
+ };
+
+ /*
+ * compat_machine_kexec() returns to idle pagetables, which requires us
+ * to be running on a static GDT mapping (idle pagetables have no GDT
+ * mappings in their per-domain mapping area).
+ */
+ asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
+
#ifdef CONFIG_COMPAT
if ( is_pv_32on64_domain(dom0) )
{