Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80297
b: refs/heads/master
c: 4dbf7af
h: refs/heads/master
i:
  80295: ad6fe34
v: v3
  • Loading branch information
Jan Beulich authored and Ingo Molnar committed Jan 30, 2008
1 parent 5cad147 commit a24bb23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0400030b28e95fd477fdfe8ba8acb0af21e5c15
refs/heads/master: 4dbf7af6442a9a882855bed0d999659ac413e3ac
7 changes: 3 additions & 4 deletions trunk/arch/x86/kernel/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>

#include <asm/uaccess.h>
#include <asm/system.h>
Expand Down Expand Up @@ -40,7 +39,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
else
newldt = kmalloc(mincount * LDT_ENTRY_SIZE, GFP_KERNEL);
newldt = (void *)__get_free_page(GFP_KERNEL);

if (!newldt)
return -ENOMEM;
Expand Down Expand Up @@ -78,7 +77,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
if (oldsize * LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(oldldt);
else
kfree(oldldt);
put_page(virt_to_page(oldldt));
}
return 0;
}
Expand Down Expand Up @@ -129,7 +128,7 @@ void destroy_context(struct mm_struct *mm)
if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
kfree(mm->context.ldt);
put_page(virt_to_page(mm->context.ldt));
mm->context.size = 0;
}
}
Expand Down
9 changes: 1 addition & 8 deletions trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,12 @@ static unsigned long xen_store_tr(void)

static void xen_set_ldt(const void *addr, unsigned entries)
{
unsigned long linear_addr = (unsigned long)addr;
struct mmuext_op *op;
struct multicall_space mcs = xen_mc_entry(sizeof(*op));

op = mcs.args;
op->cmd = MMUEXT_SET_LDT;
if (linear_addr) {
/* ldt my be vmalloced, use arbitrary_virt_to_machine */
xmaddr_t maddr;
maddr = arbitrary_virt_to_machine((unsigned long)addr);
linear_addr = (unsigned long)maddr.maddr;
}
op->arg1.linear_addr = linear_addr;
op->arg1.linear_addr = (unsigned long)addr;
op->arg2.nr_ents = entries;

MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
Expand Down

0 comments on commit a24bb23

Please sign in to comment.