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>
This commit is contained in:
Keir Fraser committed 2009-07-02 16:16:15 +01:00
1 parent 47eb698d53
commit 4cb90ae29a
1 file changed
+12
+12
View File
@@ -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) )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.