diff options
author | Christian Ehrhardt <lk@c--e.de> | 2007-09-03 14:32:38 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-04 21:37:57 -0400 |
commit | ce29a1f8bd99aac409904b4ca4fd700e67802556 (patch) | |
tree | e395c08c986be5bc9b7ac7781227a896c2f8caa0 /arch/i386/boot/pm.c | |
parent | 40ffbfad6bb79a99cc7627bdaca0ee22dec526f6 (diff) |
[x86 setup] Work around bug in Xen HVM
Apparently XEN does not keep the contents of the 48-bit gdt_48 data
structure that is passed to lgdt in the XEN machine state. Instead it
appears to save the _address_ of the 48-bit descriptor
somewhere. Unfortunately this data happens to reside on the stack and
is probably no longer availiable at the time of the actual protected
mode jump.
This is Xen bug but given that there is a one-line patch to work
around this problem, the linux kernel should probably do this. My fix
is to make the gdt_48 description in setup_gdt static (in setup_idt
this is already the case). This allows the kernel to boot under
Xen HVM again.
Signed-off-by: Christian Ehrhardt <lk@c--e.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/i386/boot/pm.c')
-rw-r--r-- | arch/i386/boot/pm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/i386/boot/pm.c b/arch/i386/boot/pm.c index 6be9ca811d17..09fb342cc62e 100644 --- a/arch/i386/boot/pm.c +++ b/arch/i386/boot/pm.c | |||
@@ -122,7 +122,11 @@ static void setup_gdt(void) | |||
122 | /* DS: data, read/write, 4 GB, base 0 */ | 122 | /* DS: data, read/write, 4 GB, base 0 */ |
123 | [GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093, 0, 0xfffff), | 123 | [GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093, 0, 0xfffff), |
124 | }; | 124 | }; |
125 | struct gdt_ptr gdt; | 125 | /* Xen HVM incorrectly stores a pointer to the gdt_ptr, instead |
126 | of the gdt_ptr contents. Thus, make it static so it will | ||
127 | stay in memory, at least long enough that we switch to the | ||
128 | proper kernel GDT. */ | ||
129 | static struct gdt_ptr gdt; | ||
126 | 130 | ||
127 | gdt.len = sizeof(boot_gdt)-1; | 131 | gdt.len = sizeof(boot_gdt)-1; |
128 | gdt.ptr = (u32)&boot_gdt + (ds() << 4); | 132 | gdt.ptr = (u32)&boot_gdt + (ds() << 4); |