Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/8xx: DTLB Miss cleanup

Use symbolic constant for PRESENT and avoid branching.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Joakim Tjernlund and committed by
Benjamin Herrenschmidt
990d89c6 2321f337

+11 -6
+11 -6
arch/powerpc/kernel/head_8xx.S
··· 438 438 * r11 = ((r10 & PRESENT) & ((r10 & ACCESSED) >> 5)); 439 439 * r10 = (r10 & ~PRESENT) | r11; 440 440 */ 441 - rlwinm r11, r10, 32-5, 31, 31 441 + rlwinm r11, r10, 32-5, _PAGE_PRESENT 442 442 and r11, r11, r10 443 - rlwimi r10, r11, 0, 31, 31 443 + rlwimi r10, r11, 0, _PAGE_PRESENT 444 444 445 445 /* Honour kernel RO, User NA */ 446 - andi. r11, r10, _PAGE_USER | _PAGE_RW 447 - bne- cr0, 5f 448 - ori r10,r10, 0x200 /* Extended encoding, bit 22 */ 449 - 5: xori r10, r10, _PAGE_RW /* invert RW bit */ 446 + /* 0x200 == Extended encoding, bit 22 */ 447 + /* r11 = (r10 & _PAGE_USER) >> 2 */ 448 + rlwinm r11, r10, 32-2, 0x200 449 + or r10, r11, r10 450 + /* r11 = (r10 & _PAGE_RW) >> 1 */ 451 + rlwinm r11, r10, 32-1, 0x200 452 + or r10, r11, r10 453 + /* invert RW and 0x200 bits */ 454 + xori r10, r10, _PAGE_RW | 0x200 450 455 451 456 /* The Linux PTE won't go exactly into the MMU TLB. 452 457 * Software indicator bits 22 and 28 must be clear.