aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lguest
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-05-08 04:50:00 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-08 04:50:00 -0400
commitf066a155334642b8a206eec625b1925d88c48aeb (patch)
treecb12975e60b70d1dae3b7397bab955de78a4d01e /arch/x86/lguest
parente7c064889606aab3569669078c69b87b2c527e72 (diff)
parent33df4db04a79660150e1948e3296eeb451ac121b (diff)
Merge branch 'x86/urgent' into x86/xen
Conflicts: arch/frv/include/asm/pgtable.h arch/x86/include/asm/required-features.h arch/x86/xen/mmu.c Merge reason: x86/xen was on a .29 base still, move it to a fresher branch and pick up Xen fixes as well, plus resolve conflicts Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/lguest')
-rw-r--r--arch/x86/lguest/boot.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index cfb2d68dc795..8f935c6d5512 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -279,15 +279,15 @@ static void lguest_load_idt(const struct desc_ptr *desc)
279 * controls the entire thing and the Guest asks it to make changes using the 279 * controls the entire thing and the Guest asks it to make changes using the
280 * LOAD_GDT hypercall. 280 * LOAD_GDT hypercall.
281 * 281 *
282 * This is the opposite of the IDT code where we have a LOAD_IDT_ENTRY 282 * This is the exactly like the IDT code.
283 * hypercall and use that repeatedly to load a new IDT. I don't think it
284 * really matters, but wouldn't it be nice if they were the same? Wouldn't
285 * it be even better if you were the one to send the patch to fix it?
286 */ 283 */
287static void lguest_load_gdt(const struct desc_ptr *desc) 284static void lguest_load_gdt(const struct desc_ptr *desc)
288{ 285{
289 BUG_ON((desc->size + 1) / 8 != GDT_ENTRIES); 286 unsigned int i;
290 kvm_hypercall2(LHCALL_LOAD_GDT, __pa(desc->address), GDT_ENTRIES); 287 struct desc_struct *gdt = (void *)desc->address;
288
289 for (i = 0; i < (desc->size+1)/8; i++)
290 kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b);
291} 291}
292 292
293/* For a single GDT entry which changes, we do the lazy thing: alter our GDT, 293/* For a single GDT entry which changes, we do the lazy thing: alter our GDT,
@@ -297,7 +297,9 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum,
297 const void *desc, int type) 297 const void *desc, int type)
298{ 298{
299 native_write_gdt_entry(dt, entrynum, desc, type); 299 native_write_gdt_entry(dt, entrynum, desc, type);
300 kvm_hypercall2(LHCALL_LOAD_GDT, __pa(dt), GDT_ENTRIES); 300 /* Tell Host about this new entry. */
301 kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, entrynum,
302 dt[entrynum].a, dt[entrynum].b);
301} 303}
302 304
303/* OK, I lied. There are three "thread local storage" GDT entries which change 305/* OK, I lied. There are three "thread local storage" GDT entries which change
@@ -667,7 +669,7 @@ static unsigned long lguest_tsc_khz(void)
667 669
668/* If we can't use the TSC, the kernel falls back to our lower-priority 670/* If we can't use the TSC, the kernel falls back to our lower-priority
669 * "lguest_clock", where we read the time value given to us by the Host. */ 671 * "lguest_clock", where we read the time value given to us by the Host. */
670static cycle_t lguest_clock_read(void) 672static cycle_t lguest_clock_read(struct clocksource *cs)
671{ 673{
672 unsigned long sec, nsec; 674 unsigned long sec, nsec;
673 675