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

[SPARC64]: Fix _PAGE_EXEC_4U check in sun4u I-TLB miss handler.

It was using an immediate _PAGE_EXEC_4U value in an 'and'
instruction to perform the test. This doesn't work because
the immediate field is signed 13-bit, this the mask being
tested against the PTE was 0x1000 sign-extended to 32-bits
instead of just plain 0x1000.

Signed-off-by: David S. Miller <davem@davemloft.net>

+2 -2
+2 -2
arch/sparc64/kernel/itlb_miss.S
··· 11 11 /* ITLB ** ICACHE line 2: TSB compare and TLB load */ 12 12 bne,pn %xcc, tsb_miss_itlb ! Miss 13 13 mov FAULT_CODE_ITLB, %g3 14 - andcc %g5, _PAGE_EXEC_4U, %g0 ! Executable? 14 + sethi %hi(_PAGE_EXEC_4U), %g4 15 + andcc %g5, %g4, %g0 ! Executable? 15 16 be,pn %xcc, tsb_do_fault 16 17 nop ! Delay slot, fill me 17 18 stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load TLB 18 19 retry ! Trap done 19 - nop 20 20 21 21 /* ITLB ** ICACHE line 3: */ 22 22 nop