aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
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)
325 return 0; 325 return 0;
326} 326}
327 327
328static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries)
329{
330 unsigned pages = roundup(entries * LDT_ENTRY_SIZE, PAGE_SIZE);
331 void *v = ldt;
332 int i;
333
334 for(i = 0; i < pages; i += PAGE_SIZE)
335 make_lowmem_page_readonly(v + i);
336}
337
338static void xen_free_ldt(struct desc_struct *ldt, unsigned entries)
339{
340 unsigned pages = roundup(entries * LDT_ENTRY_SIZE, PAGE_SIZE);
341 void *v = ldt;
342 int i;
343
344 for(i = 0; i < pages; i += PAGE_SIZE)
345 make_lowmem_page_readwrite(v + i);
346}
347
328static void xen_set_ldt(const void *addr, unsigned entries) 348static void xen_set_ldt(const void *addr, unsigned entries)
329{ 349{
330 struct mmuext_op *op; 350 struct mmuext_op *op;
@@ -1220,6 +1240,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
1220 .load_gs_index = xen_load_gs_index, 1240 .load_gs_index = xen_load_gs_index,
1221#endif 1241#endif
1222 1242
1243 .alloc_ldt = xen_alloc_ldt,
1244 .free_ldt = xen_free_ldt,
1245
1223 .store_gdt = native_store_gdt, 1246 .store_gdt = native_store_gdt,
1224 .store_idt = native_store_idt, 1247 .store_idt = native_store_idt,
1225 .store_tr = xen_store_tr, 1248 .store_tr = xen_store_tr,