Date: Thu, 12 Jul 2007 15:37:43 +0900
Subject: [PATCH] Kexec: Purge the VHPT entry in the TLB on kexec
From: Simon Horman <horms@verge.net.au>

Should relocate_new_kernel(), which is run by the hypervisor, purge the
VHPT on XEN like ia64_do_purge_tlb() (code in the hypervisor) does?

There is a hypervisor portion of this patch which modifies
machine_kexec() to pass the appropriate extra argument to
ia64_do_purge_tlb().

Signed-off-by: Simon Horman <horms@verge.net.au>

Index: x/arch/ia64/kernel/relocate_kernel.S
===================================================================
--- x/arch/ia64/kernel/relocate_kernel.S	2007-07-05 18:52:40.000000000 +0900
+++ x/arch/ia64/kernel/relocate_kernel.S	2007-07-05 19:00:16.000000000 +0900
@@ -21,7 +21,7 @@
 GLOBAL_ENTRY(relocate_new_kernel)
 	.prologue
 #ifdef CONFIG_XEN
-	alloc r31=ar.pfs,7,0,0,0
+	alloc r31=ar.pfs,8,0,0,0
 #else
 	alloc r31=ar.pfs,4,0,0,0
 #endif
@@ -160,6 +160,20 @@ GLOBAL_ENTRY(relocate_new_kernel)
         srlz.i
 	;;
 
+#ifdef XEN
+	/* XXX: Is this neccessary ??? */
+	// purge TR entry for VHPT
+	mov r16=in7
+	;;
+	dep r16=0,r16,0,IA64_GRANULE_SHIFT
+	mov r18=IA64_GRANULE_SHIFT<<2
+        ;;
+        ptr.d r16,r18
+        ;;
+        srlz.i
+	;;
+#endif
+
 	//copy segments
 	movl r16=PAGE_MASK
         mov  r30=in0                    // in0 is page_list
