aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-04 15:26:00 -0800
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-30 09:25:25 -0700
commit3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85 (patch)
treed6f35ab3b371e490fcc35d2e0990217a648d1bab /arch/x86/xen
parent6ed6bf428aff64fe37cdc54b239d598fee6016f1 (diff)
downloadkernel_samsung_crespo-3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85.zip
kernel_samsung_crespo-3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85.tar.gz
kernel_samsung_crespo-3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85.tar.bz2
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/xen')
-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 5776dc2..48b399b 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)
static void xen_load_gdt(const struct desc_ptr *dtr)
{
- unsigned long *frames;
unsigned long va = dtr->address;
unsigned int size = dtr->size + 1;
unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE;
+ unsigned long frames[pages];
int f;
- struct multicall_space mcs;
/* A GDT can be up to 64k in size, which corresponds to 8192
8-byte entries, or 16 4k pages.. */
@@ -297,9 +296,6 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
BUG_ON(size > 65536);
BUG_ON(va & ~PAGE_MASK);
- mcs = xen_mc_entry(sizeof(*frames) * pages);
- frames = mcs.args;
-
for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
int level;
pte_t *ptep = lookup_address(va, &level);
@@ -314,13 +310,15 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
frames[f] = mfn;
+ printk("xen_load_gdt: %d va=%p mfn=%lx pfn=%lx va'=%p\n",
+ f, (void *)va, mfn, pfn, virt);
+
make_lowmem_page_readonly((void *)va);
make_lowmem_page_readonly(virt);
}
- MULTI_set_gdt(mcs.mc, frames, size / sizeof(struct desc_struct));
-
- xen_mc_issue(PARAVIRT_LAZY_CPU);
+ if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct)))
+ BUG();
}
static void load_TLS_descriptor(struct thread_struct *t,