aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/mm/wild_bctr.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-11-15selftests/powerpc: Adjust wild_bctr to build with old binutilsGustavo Romero1-2/+3
Currently the selftest wild_bctr can fail to build when an old gcc is used, notably on gcc using a binutils version <= 2.27, because the assembler does not support the integer suffix UL. This patch adjusts the wild_bctr test so the REG_POISON value is still treated as an unsigned long for the shifts on compilation but the UL suffix is absent on the stringification, so the inline asm code generated has no UL suffixes. Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com> [mpe: Wrap long line] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-11-12selftests/powerpc: Fix wild_bctr test to work on ppc64Michael Ellerman1-1/+15
The selftest I recently added to test branching to an out-of-bounds NIP doesn't work on 64-bit big endian. It does fail but not in the right way. That is it SEGVs trying to load from the opd at BAD_NIP, but it never gets as far as branching to BAD_NIP. To fix it we need to create an opd which is reachable but which holds the bad address. Fixes: b7683fc66eba ("selftests/powerpc: Add a test of wild bctr") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-10-20selftests/powerpc: Add a test of wild bctrMichael Ellerman1-0/+155
This tests that a bctr (Branch to counter and link), ie. a function call, to a wildly out-of-bounds address is handled correctly. Some old kernel versions didn't handle it correctly, see eg: "powerpc/slb: Force a full SLB flush when we insert for a bad EA" https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-April/157397.html Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>