]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc: Fixup clobbers for TM tests
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 14 Oct 2019 02:30:43 +0000 (13:30 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 29 Oct 2019 09:53:49 +0000 (20:53 +1100)
commitcf5b3c82ebfc0f9eb9c10288ae178f1f17b228c9
treee567ae6e97ac2b51d4e315798fe290d5c9b044f8
parentf449a46d1cae5d14984dbc0b95946f2680eec1cf
selftests/powerpc: Fixup clobbers for TM tests

Some of our TM (Transactional Memory) tests, list "r1" (the stack
pointer) as a clobbered register.

GCC >= 9 doesn't accept this, and the build breaks:

  ptrace-tm-spd-tar.c: In function 'tm_spd_tar':
  ptrace-tm-spd-tar.c:31:2: error: listing the stack pointer register 'r1' in a clobber list is deprecated [-Werror=deprecated]
     31 |  asm __volatile__(
        |  ^~~
  ptrace-tm-spd-tar.c:31:2: note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement

We do have some fairly large inline asm blocks in these tests, and
some of them do change the value of r1. However they should all return
to C with the value in r1 restored, so I think it's legitimate to say
r1 is not clobbered.

As Segher points out, the r1 clobbers may have been added because of
the use of `or 1,1,1`, however that doesn't actually clobber r1.

Segher also points out that some of these tests do clobber LR, because
they call functions, and that is not listed in the clobbers, so add
that where appropriate.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191029095324.14669-1-mpe@ellerman.id.au
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c
tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c
tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c