aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-04 18:26:00 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-30 12:25:25 -0400
commit3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85 (patch)
treed6f35ab3b371e490fcc35d2e0990217a648d1bab /arch/x86
parent6ed6bf428aff64fe37cdc54b239d598fee6016f1 (diff)
xen: make xen_load_gdt simpler
Remove use of multicall machinery which is unused (gdt loading is never performance critical). This removes the implicit use of percpu variables, which simplifies understanding how the percpu code's use of load_gdt interacts with this code. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86')
-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,