aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2008-01-30 07:33:14 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:14 -0500
commit4dbf7af6442a9a882855bed0d999659ac413e3ac (patch)
tree333c2fa09ac2740ef8c260053a0c1e6340361d52 /arch/x86/xen
parentc0400030b28e95fd477fdfe8ba8acb0af21e5c15 (diff)
x86: adjust/fix LDT handling for Xen
Based on patch from Jan Beulich <jbeulich@novell.com>. Don't rely on kmalloc(PAGE_SIZE) returning PAGE_SIZE aligned memory (Xen requires GDT *and* LDT to be page-aligned). Using the page allocator interface also removes the (albeit small) slab allocator overhead. The same change being done for 64-bits for consistency. Further, the Xen hypercall interface expects the LDT address to be virtual, not machine. [ Adjusted to unified ldt.c - Jeremy ] Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/enlighten.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 72dd14d0685c..845b4fd94463 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -275,19 +275,12 @@ static unsigned long xen_store_tr(void)
275 275
276static void xen_set_ldt(const void *addr, unsigned entries) 276static void xen_set_ldt(const void *addr, unsigned entries)
277{ 277{
278 unsigned long linear_addr = (unsigned long)addr;
279 struct mmuext_op *op; 278 struct mmuext_op *op;
280 struct multicall_space mcs = xen_mc_entry(sizeof(*op)); 279 struct multicall_space mcs = xen_mc_entry(sizeof(*op));
281 280
282 op = mcs.args; 281 op = mcs.args;
283 op->cmd = MMUEXT_SET_LDT; 282 op->cmd = MMUEXT_SET_LDT;
284 if (linear_addr) { 283 op->arg1.linear_addr = (unsigned long)addr;
285 /* ldt my be vmalloced, use arbitrary_virt_to_machine */
286 xmaddr_t maddr;
287 maddr = arbitrary_virt_to_machine((unsigned long)addr);
288 linear_addr = (unsigned long)maddr.maddr;
289 }
290 op->arg1.linear_addr = linear_addr;
291 op->arg2.nr_ents = entries; 284 op->arg2.nr_ents = entries;
292 285
293 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); 286 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);