[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] The attached patch replaces the three hypercalls with a signle



ChangeSet 1.1731, 2005/06/23 10:19:35+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        The attached patch replaces the three hypercalls with a signle
        multi-call in switch_mm, as x86 xenlinux does.
        
        Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>



 mmu_context.h |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h 
b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h
--- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h  
2005-06-23 07:05:34 -04:00
+++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h  
2005-06-23 07:05:34 -04:00
@@ -33,20 +33,40 @@
                             struct task_struct *tsk)
 {
        unsigned cpu = smp_processor_id();
+       struct mmuext_op _op[3], *op = _op;
+
        if (likely(prev != next)) {
                /* stop flush ipis for the previous mm */
                clear_bit(cpu, &prev->cpu_vm_mask);
-#ifdef CONFIG_SMP
+#if 0  /* XEN: no lazy tlb */
                write_pda(mmu_state, TLBSTATE_OK);
                write_pda(active_mm, next);
 #endif
                set_bit(cpu, &next->cpu_vm_mask);
-                load_cr3(next->pgd);
-                xen_new_user_pt(__pa(__user_pgd(next->pgd)));
-               if (unlikely(next->context.ldt != prev->context.ldt)) 
-                       load_LDT_nolock(&next->context, cpu);
+
+               /* load_cr3(next->pgd) */
+               per_cpu(cur_pgd, smp_processor_id()) = next->pgd;
+               op->cmd = MMUEXT_NEW_BASEPTR;
+               op->mfn = pfn_to_mfn(__pa(next->pgd) >> PAGE_SHIFT);
+               op++;
+
+               /* xen_new_user_pt(__pa(__user_pgd(next->pgd))) */
+               op->cmd = MMUEXT_NEW_USER_BASEPTR;
+               op->mfn = pfn_to_mfn(__pa(__user_pgd(next->pgd)) >> PAGE_SHIFT);
+               op++;
+               
+               if (unlikely(next->context.ldt != prev->context.ldt)) {
+                       /* load_LDT_nolock(&next->context, cpu) */
+                       op->cmd = MMUEXT_SET_LDT;
+                       op->linear_addr = (unsigned long)next->context.ldt;
+                       op->nr_ents     = next->context.size;
+                       op++;
+               }
+
+               BUG_ON(HYPERVISOR_mmuext_op(_op, op-_op, NULL, DOMID_SELF));
        }
-#ifdef CONFIG_SMP
+
+#if 0 /* XEN: no lazy tlb */
        else {
                write_pda(mmu_state, TLBSTATE_OK);
                if (read_pda(active_mm) != next)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.