# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1198130029 -32400
# Node ID e532cad65b1cf039ef3ce7859c0fd6c4ef6fd7f4
# Parent 8558c0017136dc43f799fc30844bff5091e9973e
fix ia64_reload_tr in mca_asm.S
- DTR for stack comparison should be done with xen heap.
- cpu_kr current offset contains (physicall address >> IA64_GRANULE_SHIFT)
so the comparison was done with the wrong value.
- When mapping VHPT area, overlapping should be avoided.
PATCHNAME: fix_ia64_reload_tr
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
diff -r 8558c0017136 -r e532cad65b1c xen/arch/ia64/linux-xen/mca_asm.S
--- a/xen/arch/ia64/linux-xen/mca_asm.S Tue Dec 18 15:38:46 2007 +0900
+++ b/xen/arch/ia64/linux-xen/mca_asm.S Thu Dec 20 14:53:49 2007 +0900
@@ -479,14 +479,26 @@ ia64_reload_tr:
;;
// 4. Reload DTR for stack.
#ifdef XEN
- // avoid overlapping with kernel TR
- movl r17=KERNEL_START
+ // avoid overlapping with xenheap TR
+ mov r17=ip
+ ;;
+ tpa r17=r17
+ ;;
+ dep r17=0,r17,0,KERNEL_TR_PAGE_SHIFT
+ ;;
+ shr.u r17=r17,IA64_GRANULE_SHIFT
+ ;;
GET_THIS_PADDR(r2,cpu_kr);;
add r2=IA64_KR_CURRENT_OFFSET,r2;;
ld8 r16=[r2];;
;;
- dep r16=0,r16,0,KERNEL_TR_PAGE_SHIFT
- ;;
+#if KERNEL_TR_PAGE_SHIFT < IA64_GRANULE_SHIFT
+# error "KERNEL_TR_PAGE_SHIFT < IA64_GRANULE_SHIFT shouldn't happen"
+#endif
+#if KERNEL_TR_PAGE_SHIFT > IA64_GRANULE_SHIFT
+ dep r16=0,r16,0,KERNEL_TR_PAGE_SHIFT-IA64_GRANULE_SHIFT
+ ;;
+#endif
cmp.eq p7,p0=r17,r16
(p7) br.cond.sptk .reload_vhpt
@@ -522,6 +534,25 @@ ia64_reload_tr:
// 5. VHPT
#if VHPT_ENABLED
GET_VA_VCPU_VHPT_MADDR(r2,r3);;
+ dep r3=0,r2,0,KERNEL_TR_PAGE_SHIFT
+ ;;
+ shr.u r3=r3,IA64_GRANULE_SHIFT
+ ;;
+ cmp.eq p7,p0=r3,r17
+(p7) br.cond.sptk .overlap_vhpt
+ ;;
+
+ // avoid overlapping with stack TR
+ shr.u r17=r2,IA64_GRANULE_SHIFT
+ GET_THIS_PADDR(r3, cpu_kr);;
+ add r3=IA64_KR_CURRENT_STACK_OFFSET,r3
+ ;;
+ ld8 r3=[r3]
+ ;;
+ cmp.eq p7,p0=r3,r17
+(p7) br.cond.sptk .overlap_vhpt
+ ;;
+
dep r16=0,r2,0,IA64_GRANULE_SHIFT
movl r20=PAGE_KERNEL
;;
@@ -538,6 +569,7 @@ ia64_reload_tr:
;;
srlz.d
;;
+.overlap_vhpt:
#endif
#endif
br.sptk.many done_tlb_purge_and_reload
16642_e532cad65b1c_fix_ia64_reload_tr.patch
Description: Text Data
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|