summaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-07-23 23:21:18 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-24 12:30:06 +0200
commit38ffbe66d59051fd9cfcfc8545f164700e2fa3bc (patch)
tree37e76db49cc86b3da550a62f36d101c7269d262e /arch/x86/xen/enlighten.c
parentMerge branch 'x86/auditsc' of git://git.kernel.org/pub/scm/linux/kernel/git/f... (diff)
downloadlinux-38ffbe66d59051fd9cfcfc8545f164700e2fa3bc.tar.xz
linux-38ffbe66d59051fd9cfcfc8545f164700e2fa3bc.zip
x86/paravirt/xen: properly fill out the ldt ops
LTP testing showed that Xen does not properly implement sys_modify_ldt(). This patch does the final little bits needed to make the ldt work properly. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 9ff6e3cbf08f..06219e60e9c8 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -325,6 +325,26 @@ static unsigned long xen_store_tr(void)
return 0;
}
+static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries)
+{
+ unsigned pages = roundup(entries * LDT_ENTRY_SIZE, PAGE_SIZE);
+ void *v = ldt;
+ int i;
+
+ for(i = 0; i < pages; i += PAGE_SIZE)
+ make_lowmem_page_readonly(v + i);
+}
+
+static void xen_free_ldt(struct desc_struct *ldt, unsigned entries)
+{
+ unsigned pages = roundup(entries * LDT_ENTRY_SIZE, PAGE_SIZE);
+ void *v = ldt;
+ int i;
+
+ for(i = 0; i < pages; i += PAGE_SIZE)
+ make_lowmem_page_readwrite(v + i);
+}
+
static void xen_set_ldt(const void *addr, unsigned entries)
{
struct mmuext_op *op;
@@ -1220,6 +1240,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
.load_gs_index = xen_load_gs_index,
#endif
+ .alloc_ldt = xen_alloc_ldt,
+ .free_ldt = xen_free_ldt,
+
.store_gdt = native_store_gdt,
.store_idt = native_store_idt,
.store_tr = xen_store_tr,