aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5776dc270297..48b399bd6e0d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -284,12 +284,11 @@ static void xen_set_ldt(const void *addr, unsigned entries)
284 284
285static void xen_load_gdt(const struct desc_ptr *dtr) 285static void xen_load_gdt(const struct desc_ptr *dtr)
286{ 286{
287 unsigned long *frames;
288 unsigned long va = dtr->address; 287 unsigned long va = dtr->address;
289 unsigned int size = dtr->size + 1; 288 unsigned int size = dtr->size + 1;
290 unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; 289 unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE;
290 unsigned long frames[pages];
291 int f; 291 int f;
292 struct multicall_space mcs;
293 292
294 /* A GDT can be up to 64k in size, which corresponds to 8192 293 /* A GDT can be up to 64k in size, which corresponds to 8192
295 8-byte entries, or 16 4k pages.. */ 294 8-byte entries, or 16 4k pages.. */
@@ -297,9 +296,6 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
297 BUG_ON(size > 65536); 296 BUG_ON(size > 65536);
298 BUG_ON(va & ~PAGE_MASK); 297 BUG_ON(va & ~PAGE_MASK);
299 298
300 mcs = xen_mc_entry(sizeof(*frames) * pages);
301 frames = mcs.args;
302
303 for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) { 299 for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
304 int level; 300 int level;
305 pte_t *ptep = lookup_address(va, &level); 301 pte_t *ptep = lookup_address(va, &level);
@@ -314,13 +310,15 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
314 310
315 frames[f] = mfn; 311 frames[f] = mfn;
316 312
313 printk("xen_load_gdt: %d va=%p mfn=%lx pfn=%lx va'=%p\n",
314 f, (void *)va, mfn, pfn, virt);
315
317 make_lowmem_page_readonly((void *)va); 316 make_lowmem_page_readonly((void *)va);
318 make_lowmem_page_readonly(virt); 317 make_lowmem_page_readonly(virt);
319 } 318 }
320 319
321 MULTI_set_gdt(mcs.mc, frames, size / sizeof(struct desc_struct)); 320 if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct)))
322 321 BUG();
323 xen_mc_issue(PARAVIRT_LAZY_CPU);
324} 322}
325 323
326static void load_TLS_descriptor(struct thread_struct *t, 324static void load_TLS_descriptor(struct thread_struct *t,