selftests/powerpc/64: Test all paths through copy routines
The hand-coded assembler 64-bit copy routines include feature sections that select one code path or another depending on which CPU we are executing on. The self-tests for these copy routines end up testing just one path. This adds a mechanism for selecting any desired code path at compile time, and makes 2 or 3 versions of each test, each using a different code path, so as to cover all the possible paths. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> [mpe: Add -mcpu=power4 to CFLAGS for older compilers] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Michael Ellerman

vecāks
a7c81ce398
revīzija
98c45f51f7
@@ -12,6 +12,11 @@
|
||||
#include <asm/asm-compat.h>
|
||||
#include <asm/feature-fixups.h>
|
||||
|
||||
#ifndef SELFTEST_CASE
|
||||
/* 0 == most CPUs, 1 == POWER6, 2 == Cell */
|
||||
#define SELFTEST_CASE 0
|
||||
#endif
|
||||
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#define sLd sld /* Shift towards low-numbered address. */
|
||||
#define sHd srd /* Shift towards high-numbered address. */
|
||||
@@ -73,6 +78,7 @@ _GLOBAL(__copy_tofrom_user_base)
|
||||
* At the time of writing the only CPU that has this combination of bits
|
||||
* set is Power6.
|
||||
*/
|
||||
test_feature = (SELFTEST_CASE == 1)
|
||||
BEGIN_FTR_SECTION
|
||||
nop
|
||||
FTR_SECTION_ELSE
|
||||
@@ -82,6 +88,7 @@ ALT_FTR_SECTION_END(CPU_FTR_UNALIGNED_LD_STD | CPU_FTR_CP_USE_DCBTZ, \
|
||||
.Ldst_aligned:
|
||||
addi r3,r3,-16
|
||||
r3_offset = 16
|
||||
test_feature = (SELFTEST_CASE == 0)
|
||||
BEGIN_FTR_SECTION
|
||||
andi. r0,r4,7
|
||||
bne .Lsrc_unaligned
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user