* zach@xxxxxxxxxx (zach@xxxxxxxxxx) wrote: > Add Xen accessors for LDT updates. > > Todo: Bring back return values from write_ldt_entry. > > Signed-off-by: Zachary Amsden <zach@xxxxxxxxxx> > Index: linux-2.6.13/arch/i386/kernel/ldt.c > =================================================================== > --- linux-2.6.13.orig/arch/i386/kernel/ldt.c 2005-08-08 21:13:56.000000000 -0700 > +++ linux-2.6.13/arch/i386/kernel/ldt.c 2005-08-08 21:16:15.000000000 -0700 > @@ -18,6 +18,7 @@ > #include <asm/system.h> > #include <asm/ldt.h> > #include <asm/desc.h> > +#include <hypervisor_hooks.h> This is a departure from what we've done so far, which is to push things into subarch for relevant header. I don't think we want to be specifying the hypervisor interface here/yet. Esp. with generic term like these. > #ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ > static void flush_ldt(void *null) > @@ -58,16 +59,22 @@ > #ifdef CONFIG_SMP > cpumask_t mask; > preempt_disable(); > + make_pages_readonly(pc->ldt, (pc->size * LDT_ENTRY_SIZE) / > + PAGE_SIZE); As I mentioned earlier, this needs a different name. It can map to readonly pages internal to hook. This is about ldt handling. > load_LDT(pc); > mask = cpumask_of_cpu(smp_processor_id()); > if (!cpus_equal(current->mm->cpu_vm_mask, mask)) > smp_call_function(flush_ldt, NULL, 1, 1); > preempt_enable(); > #else > + make_pages_readonly(pc->ldt, (pc->size * LDT_ENTRY_SIZE) / > + PAGE_SIZE); > load_LDT(pc);