===== arch/ppc64/kernel/head.S 1.20 vs edited ===== --- 1.20/arch/ppc64/kernel/head.S Tue Jan 6 00:21:31 2004 +++ edited/arch/ppc64/kernel/head.S Fri Jan 16 11:30:10 2004 @@ -1225,18 +1225,6 @@ mulld r20,r20,r21 clrldi r20,r20,28 /* r20 = vsid */ - /* Search the SLB for a free entry */ - li r22,1 -1: - slbmfee r23,r22 - rldicl r23,r23,37,63 - cmpwi r23,0 - beq 4f /* Found an invalid entry */ - - addi r22,r22,1 - cmpldi r22,64 - blt 1b - /* No free entry - just take the next entry, round-robin */ /* XXX we should get the number of SLB entries from the naca */ SLB_NUM_ENTRIES = 64 @@ -1250,6 +1238,12 @@ /* r20 = vsid, r22 = entry */ + /* Check to see if old entry is invalid. If so, no need to slbie */ + slbmfee r21,r22 + rldicl r23,r21,37,63 + cmpwi r23,0 + beq 4f + /* * Never cast out the segment for our kernel stack. Since we * dont invalidate the ERAT we could have a valid translation @@ -1269,8 +1263,13 @@ cmpd r21,r23 beq- 2b -4: - /* Put together the vsid portion of the entry. */ + /* Invalidate the old entry */ + lis r23,-2049 + ori r23,r23,65535 + and r21,r21,r23 + slbie r21 + +4: /* Put together the vsid portion of the entry. */ li r21,0 rldimi r21,r20,12,0 ori r20,r21,1024 @@ -1278,13 +1277,6 @@ ori r20,r20,256 /* map kernel region with large ptes */ #endif - /* Invalidate the old entry */ - slbmfee r21,r22 - lis r23,-2049 - ori r23,r23,65535 - and r21,r21,r23 - slbie r21 - /* Put together the esid portion of the entry. */ mfspr r21,DAR /* Get the new esid */ rldicl r21,r21,36,28 /* Permits a full 36b of ESID */