1 // SPDX-License-Identifier: GPL-2.0
4 * Copyright 2015, Laurent Dufour, IBM Corp.
6 * Test the kernel's signal returning code to check reclaim is done if the
7 * sigreturn() is called while in a transaction (suspended since active is
8 * already dropped trough the system call path).
10 * The kernel must discard the transaction when entering sigreturn, since
11 * restoring the potential TM SPRS from the signal frame is requiring to not be
19 #include <sys/types.h>
38 "std%X[ret] 3, %[ret] ;"
41 : "memory", "3", "cr0");
47 * We return from the signal handle while in a suspended transaction
52 int tm_sigreturn(void)
58 SKIP_IF(!is_ppc64le());
60 memset(&sa, 0, sizeof(sa));
61 sa.sa_handler = handler;
62 sigemptyset(&sa.sa_mask);
64 if (sigaction(SIGSEGV, &sa, NULL))
71 "std 3,0(3) ;" /* trigger SEGV */
73 "std%X[ret] 3,%[ret] ;"
78 "std%X[ret] 3,%[ret] ;"
82 : "memory", "3", "cr0");
92 return test_harness(tm_sigreturn, "tm_sigreturn");