diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-19 10:58:20 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-19 10:58:20 -0700 |
commit | d91dfbb41bb2e9bdbfbd2cc7078ed7436eab027a (patch) | |
tree | c0bb21ec3474a5e3f6f25fa45139fec22f7e8575 /arch/x86/lguest/boot.c | |
parent | af8f937274437fa81b95e4e2d461460220636cb8 (diff) | |
parent | 38cfe968040250b89c3554a17219a9fda45b9665 (diff) | |
download | kernel_replicant_linux-d91dfbb41bb2e9bdbfbd2cc7078ed7436eab027a.tar.gz kernel_replicant_linux-d91dfbb41bb2e9bdbfbd2cc7078ed7436eab027a.tar.bz2 kernel_replicant_linux-d91dfbb41bb2e9bdbfbd2cc7078ed7436eab027a.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-lguest-and-virtio
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-lguest-and-virtio:
lguest: document 32-bit and PAE requirements
lguest: tell git to ignore Documentation/lguest/lguest
virtio: fix suspend when using virtio_balloon
lguest: fix guest crash on non-linear addresses in gdt pvops
lguest: fix crash on vmlinux images
Diffstat (limited to 'arch/x86/lguest/boot.c')
-rw-r--r-- | arch/x86/lguest/boot.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index e94a11e42f98..a2085368a3dc 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -273,15 +273,15 @@ static void lguest_load_idt(const struct desc_ptr *desc) * controls the entire thing and the Guest asks it to make changes using the * LOAD_GDT hypercall. * - * This is the opposite of the IDT code where we have a LOAD_IDT_ENTRY - * hypercall and use that repeatedly to load a new IDT. I don't think it - * really matters, but wouldn't it be nice if they were the same? Wouldn't - * it be even better if you were the one to send the patch to fix it? + * This is the exactly like the IDT code. */ static void lguest_load_gdt(const struct desc_ptr *desc) { - BUG_ON((desc->size + 1) / 8 != GDT_ENTRIES); - kvm_hypercall2(LHCALL_LOAD_GDT, __pa(desc->address), GDT_ENTRIES); + unsigned int i; + struct desc_struct *gdt = (void *)desc->address; + + for (i = 0; i < (desc->size+1)/8; i++) + kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b); } /* For a single GDT entry which changes, we do the lazy thing: alter our GDT, @@ -291,7 +291,9 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, const void *desc, int type) { native_write_gdt_entry(dt, entrynum, desc, type); - kvm_hypercall2(LHCALL_LOAD_GDT, __pa(dt), GDT_ENTRIES); + /* Tell Host about this new entry. */ + kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, entrynum, + dt[entrynum].a, dt[entrynum].b); } /* OK, I lied. There are three "thread local storage" GDT entries which change |