[1/1] powerpc/tm: Abort syscalls in active transactions (v2)

Michael Ellerman mpe at ellerman.id.au
Fri Jun 19 17:12:14 AEST 2015


On Fri, 2015-12-06 at 01:06:32 UTC, Sam bobroff wrote:
> This patch changes the syscall handler to doom (tabort) active
> transactions when a syscall is made and return very early without
> performing the syscall and keeping side effects to a minimum (no CPU
> accounting or system call tracing is performed). Also included is a
> new HWCAP2 bit, PPC_FEATURE2_HTM_NOSC, to indicate this
> behaviour to userspace.

> ---
>  Documentation/powerpc/transactional_memory.txt  | 32 ++++++++++++-------------
>  arch/powerpc/include/asm/cputable.h             | 10 ++++----
>  arch/powerpc/include/uapi/asm/cputable.h        |  1 +
>  arch/powerpc/include/uapi/asm/tm.h              |  2 +-
>  arch/powerpc/kernel/cputable.c                  |  4 +++-
>  arch/powerpc/kernel/entry_64.S                  | 28 ++++++++++++++++++++++
>  tools/testing/selftests/powerpc/tm/tm-syscall.c |  3 ++-

You forgot to add the tm-syscall test back into the Makefile, when I do that I get:

  In file included from tm-syscall.c:21:0:
  tm-syscall.c: In function ‘tm_syscall’:
  tm-syscall.c:86:7: error: ‘PPC_FEATURE2_HTM_NOSC’ undeclared (first use in this function)
       & PPC_FEATURE2_HTM_NOSC));
         ^

Because the toolchain headers don't contain that definition.

To fix it you need to include the generated kernel headers:

diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 1b616fa79e93..4bea62a319dc 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -5,7 +5,7 @@ all: $(TEST_PROGS)
 $(TEST_PROGS): ../harness.c
 
 tm-syscall: tm-syscall-asm.S
-tm-syscall: CFLAGS += -mhtm
+tm-syscall: CFLAGS += -mhtm -I../../../../../usr/include
 
 include ../../lib.mk
 

I've fixed it up for you.

cheers


More information about the Linuxppc-dev mailing list