[PATCH] ppc64 - fix spinlock recursion in native_hpte_clear

R Sharada sharada at in.ibm.com
Thu Feb 23 03:13:08 EST 2006


Ok, I realized I did not have to add the extra variables and could have done it
cleaner. Also, Michael suggested adding a comment why we were replacing the
call to tlbie() with __tlbie(). So, here is a revised version.
With this fix, I am able to kexec and kdump boot successfully on p630 non-lpar
mode running 2.6.16-rc4.
Since without this fix kexec is currently broken on non-lpar, please consider 
for inclusion in 2.6.16

Thanks and Regards,
Sharada


native_hpte_clear has a spinlock recursion problem with the native_tlbie_lock
being called twice, once in native_hpte_clear() and once within tlbie().
Fix the problem by changing the call to tlbie() in native_hpte_clear() to
__tlbie(). It still supports only 4k pages for now.


Signed-off-by: R Sharada <sharada at in.ibm.com>
---


diff -puN arch/powerpc/mm/hash_native_64.c~fix_native_hpte_clear arch/powerpc/mm/hash_native_64.c
--- linux-2.6.16-rc4/arch/powerpc/mm/hash_native_64.c~fix_native_hpte_clear	2006-02-22 21:22:42.000000000 +0530
+++ linux-2.6.16-rc4-sharada/arch/powerpc/mm/hash_native_64.c	2006-02-22 21:26:25.000000000 +0530
@@ -403,12 +403,16 @@ static void native_hpte_clear(void)
 		 */
 		hpte_v = hptep->v;
 
+		/* tlbie() takes the native_tlbie_lock. hence change the
+		 * tlbie() call here to __tlbie()
+		 */
 		if (hpte_v & HPTE_V_VALID) {
 			hptep->v = 0;
-			tlbie(slot2va(hpte_v, slot), MMU_PAGE_4K, 0);
+			__tlbie(slot2va(hpte_v, slot), MMU_PAGE_4K);
 		}
 	}
 
+	asm volatile("eieio; tlbsync; ptesync":::"memory");
 	spin_unlock(&native_tlbie_lock);
 	local_irq_restore(flags);
 }
_



More information about the Linuxppc64-dev mailing list