[GIT,PULL] kselftest fixes update for Linux-4.19-rc7
diff mbox series

Message ID ec2d8d2b-c5ac-5ac2-57fd-74efaa7ed0b6@kernel.org
State Accepted
Headers show
Series
  • [GIT,PULL] kselftest fixes update for Linux-4.19-rc7
Related show

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-4.19-rc7

Commit Message

shuah Oct. 3, 2018, 2:42 p.m. UTC
Hi Greg,

Please pull the following kselftest for 4.19-rc7.

linux-kselftest-4.19-rc7

This fixes update for 4.19-rc7 consists one fix to rseq test to prevent
it from seg-faulting when compiled with -fpie.

diff is attached.

thanks,
-- Shuah

----------------------------------------------------------------

The following changes since commit 7876320f88802b22d4e2daf7eb027dd14175a0f8:

  Linux 4.19-rc4 (2018-09-16 11:52:37 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-4.19-rc7

for you to fetch changes up to ce01a1575f45bf319e374592656441021a7f5823:

  rseq/selftests: fix parametrized test with -fpie (2018-09-27 12:59:19 -0600)

----------------------------------------------------------------
linux-kselftest-4.19-rc7

This fixes update for 4.19-rc7 consists one fix to rseq test to prevent
it from seg-faulting when compiled with -fpie.

----------------------------------------------------------------
Mathieu Desnoyers (1):
      rseq/selftests: fix parametrized test with -fpie

 tools/testing/selftests/rseq/param_test.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

----------------------------------------------------------------

Comments

Greg KH Oct. 3, 2018, 6:07 p.m. UTC | #1
On Wed, Oct 03, 2018 at 08:42:13AM -0600, Shuah Khan wrote:
> Hi Greg,
> 
> Please pull the following kselftest for 4.19-rc7.
> 
> linux-kselftest-4.19-rc7
> 
> This fixes update for 4.19-rc7 consists one fix to rseq test to prevent
> it from seg-faulting when compiled with -fpie.

Now merged, thanks.

greg k-h

Patch
diff mbox series

diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/selftests/rseq/param_test.c
index 642d4e12abea..eec2663261f2 100644
--- a/tools/testing/selftests/rseq/param_test.c
+++ b/tools/testing/selftests/rseq/param_test.c
@@ -56,15 +56,13 @@  unsigned int yield_mod_cnt, nr_abort;
 			printf(fmt, ## __VA_ARGS__);	\
 	} while (0)
 
-#if defined(__x86_64__) || defined(__i386__)
+#ifdef __i386__
 
 #define INJECT_ASM_REG	"eax"
 
 #define RSEQ_INJECT_CLOBBER \
 	, INJECT_ASM_REG
 
-#ifdef __i386__
-
 #define RSEQ_INJECT_ASM(n) \
 	"mov asm_loop_cnt_" #n ", %%" INJECT_ASM_REG "\n\t" \
 	"test %%" INJECT_ASM_REG ",%%" INJECT_ASM_REG "\n\t" \
@@ -76,9 +74,16 @@  unsigned int yield_mod_cnt, nr_abort;
 
 #elif defined(__x86_64__)
 
+#define INJECT_ASM_REG_P	"rax"
+#define INJECT_ASM_REG		"eax"
+
+#define RSEQ_INJECT_CLOBBER \
+	, INJECT_ASM_REG_P \
+	, INJECT_ASM_REG
+
 #define RSEQ_INJECT_ASM(n) \
-	"lea asm_loop_cnt_" #n "(%%rip), %%" INJECT_ASM_REG "\n\t" \
-	"mov (%%" INJECT_ASM_REG "), %%" INJECT_ASM_REG "\n\t" \
+	"lea asm_loop_cnt_" #n "(%%rip), %%" INJECT_ASM_REG_P "\n\t" \
+	"mov (%%" INJECT_ASM_REG_P "), %%" INJECT_ASM_REG "\n\t" \
 	"test %%" INJECT_ASM_REG ",%%" INJECT_ASM_REG "\n\t" \
 	"jz 333f\n\t" \
 	"222:\n\t" \
@@ -86,10 +91,6 @@  unsigned int yield_mod_cnt, nr_abort;
 	"jnz 222b\n\t" \
 	"333:\n\t"
 
-#else
-#error "Unsupported architecture"
-#endif
-
 #elif defined(__s390__)
 
 #define RSEQ_INJECT_INPUT \