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

[Xen-ia64-devel] [patch 03/16] Kexec: Unpin shared_info and mapped_regs TR in ia64_do_tlb_purge



Unpinning shared_info and mapped_regs seems to be missing
from ia64_do_tlb_purge and seems to be needed for kexec.

Like VHPT, the pinned value is recored in a percpu variable
so that the correct value can be unpinned.

Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: xen-unstable.hg/xen/arch/ia64/linux-xen/mca_asm.S
===================================================================
--- xen-unstable.hg.orig/xen/arch/ia64/linux-xen/mca_asm.S      2008-02-05 
16:18:50.000000000 +0900
+++ xen-unstable.hg/xen/arch/ia64/linux-xen/mca_asm.S   2008-02-05 
16:18:51.000000000 +0900
@@ -26,6 +26,7 @@
 #include <asm/mca.h>
 #ifdef XEN
 #include <asm/vhpt.h>
+#include <public/arch-ia64.h>
 #endif
 
 /*
@@ -320,7 +321,30 @@ ia64_do_tlb_purge:
        srlz.i
        ;;
 #ifdef XEN
-       // 5. VHPT
+       // 5. shared_info
+       // v->domain->arch.shared_info_va may not be the
+       // value of shared_info currently pinned into the TLB
+       GET_THIS_PADDR(r2, inserted_shared_info);;
+       ld8 r16=[r2]
+       mov r18=XSI_SHIFT<<2
+       ;;
+       ptr.d r16,r18
+       ;;
+       srlz.d
+       ;;
+
+       // 6. mapped_regs
+       mov r2=XMAPPEDREGS_OFS
+       mov r18=XMAPPEDREGS_SHIFT<<2
+       ;;
+       add r16=r16,r2
+       ;;
+       ptr.d r16,r18
+       ;;
+       srlz.d
+       ;;
+
+       // 7. VHPT
 #if VHPT_ENABLED
        // GET_VA_VCPU_VHPT_MADDR() may not give the
        // value of the VHPT currently pinned into the TLB
Index: xen-unstable.hg/xen/arch/ia64/xen/regionreg.c
===================================================================
--- xen-unstable.hg.orig/xen/arch/ia64/xen/regionreg.c  2008-02-05 
16:18:50.000000000 +0900
+++ xen-unstable.hg/xen/arch/ia64/xen/regionreg.c       2008-02-05 
16:18:51.000000000 +0900
@@ -231,6 +231,7 @@ set_rr(unsigned long rr, unsigned long r
 #if VHPT_ENABLED
 DEFINE_PER_CPU(unsigned long, inserted_vhpt);
 #endif
+DEFINE_PER_CPU(unsigned long, inserted_shared_info);
 
 // validates and changes a single region register
 // in the currently executing domain
@@ -268,6 +269,8 @@ int set_one_rr(unsigned long rr, unsigne
 #if VHPT_ENABLED
                __get_cpu_var(inserted_vhpt) = __va_ul(vcpu_vhpt_maddr(v));
 #endif
+               __get_cpu_var(inserted_shared_info) =
+                                       v->domain->arch.shared_info_va;
                ia64_new_rr7(vmMangleRID(newrrv.rrval),v->domain->shared_info,
                             v->arch.privregs, v->domain->arch.shared_info_va,
                             __va_ul(vcpu_vhpt_maddr(v)));

-- 

-- 
Horms


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


 


Rackspace

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