All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Dominik Brodowski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com,
	linux@dominikbrodowski.net, torvalds@linux-foundation.org,
	dsafonov@virtuozzo.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, luto@kernel.org
Subject: [tip:x86/pti] selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
Date: Wed, 14 Feb 2018 16:25:11 -0800	[thread overview]
Message-ID: <tip-4105c69703cdeba76f384b901712c9397b04e9c2@git.kernel.org> (raw)
In-Reply-To: <20180211111013.16888-5-linux@dominikbrodowski.net>

Commit-ID:  4105c69703cdeba76f384b901712c9397b04e9c2
Gitweb:     https://git.kernel.org/tip/4105c69703cdeba76f384b901712c9397b04e9c2
Author:     Dominik Brodowski <linux@dominikbrodowski.net>
AuthorDate: Tue, 13 Feb 2018 09:13:21 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 15 Feb 2018 01:15:48 +0100

selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c

On 64-bit builds, we should not rely on "int $0x80" working (it only does if
CONFIG_IA32_EMULATION=y is enabled). To keep the "Set TF and check int80"
test running on 64-bit installs with CONFIG_IA32_EMULATION=y enabled, build
this test only if we can also build 32-bit binaries (which should be a
good approximation for that).

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kselftest@vger.kernel.org
Cc: shuah@kernel.org
Link: http://lkml.kernel.org/r/20180211111013.16888-5-linux@dominikbrodowski.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/testing/selftests/x86/Makefile              | 2 ++
 tools/testing/selftests/x86/single_step_syscall.c | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 91fbfa8..73b8ef6 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -30,11 +30,13 @@ CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c)
 ifeq ($(CAN_BUILD_I386),1)
 all: all_32
 TEST_PROGS += $(BINARIES_32)
+EXTRA_CFLAGS += -DCAN_BUILD_32
 endif
 
 ifeq ($(CAN_BUILD_X86_64),1)
 all: all_64
 TEST_PROGS += $(BINARIES_64)
+EXTRA_CFLAGS += -DCAN_BUILD_64
 endif
 
 all_32: $(BINARIES_32)
diff --git a/tools/testing/selftests/x86/single_step_syscall.c b/tools/testing/selftests/x86/single_step_syscall.c
index a48da95..ddfdd63 100644
--- a/tools/testing/selftests/x86/single_step_syscall.c
+++ b/tools/testing/selftests/x86/single_step_syscall.c
@@ -119,7 +119,9 @@ static void check_result(void)
 
 int main()
 {
+#ifdef CAN_BUILD_32
 	int tmp;
+#endif
 
 	sethandler(SIGTRAP, sigtrap, 0);
 
@@ -139,12 +141,13 @@ int main()
 		      : : "c" (post_nop) : "r11");
 	check_result();
 #endif
-
+#ifdef CAN_BUILD_32
 	printf("[RUN]\tSet TF and check int80\n");
 	set_eflags(get_eflags() | X86_EFLAGS_TF);
 	asm volatile ("int $0x80" : "=a" (tmp) : "a" (SYS_getpid)
 			: INT80_CLOBBERS);
 	check_result();
+#endif
 
 	/*
 	 * This test is particularly interesting if fast syscalls use

  parent reply	other threads:[~2018-02-15  0:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11 11:10 [PATCH 0/5] selftests/x86: fixes for !CONFIG_IA32_EMULATION and vsyscall=none Dominik Brodowski
2018-02-11 11:10 ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 11:10 ` linux
2018-02-11 11:10 ` [PATCH 1/5] selftests/x86: 5lvl test has been moved Dominik Brodowski
2018-02-11 11:10   ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 11:10   ` linux
2018-02-11 12:13   ` [tip:x86/urgent] selftests/x86: Fix build bug caused by the 5lvl test which has been moved to the VM directory tip-bot for Dominik Brodowski
2018-02-13  9:05   ` [tip:x86/pti] " tip-bot for Dominik Brodowski
2018-02-11 11:10 ` [PATCH 2/5] selftests/x86: fix vDSO selftest segfault for vsyscall=none Dominik Brodowski
2018-02-11 11:10   ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 11:10   ` linux
2018-02-11 11:21   ` Ingo Molnar
2018-02-11 11:21     ` [Linux-kselftest-mirror] " Ingo Molnar
2018-02-11 11:21     ` mingo
2018-02-11 12:17     ` Dominik Brodowski
2018-02-11 12:17       ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 12:17       ` linux
2018-02-11 13:00       ` Dominik Brodowski
2018-02-11 13:00         ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 13:00         ` linux
2018-02-11 18:24         ` Ingo Molnar
2018-02-11 18:24           ` [Linux-kselftest-mirror] " Ingo Molnar
2018-02-11 18:24           ` mingo
2018-02-11 20:59           ` [PATCH] selftests/x86: clarify that there is no buffer overflow on sscanf usage Dominik Brodowski
2018-02-11 20:59             ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 20:59             ` linux
2018-02-12 17:58             ` Shuah Khan
2018-02-12 17:58               ` [Linux-kselftest-mirror] " Shuah Khan
2018-02-12 17:58               ` shuah
2018-02-13  9:04             ` [tip:x86/pti] selftests/x86: Clean up and document sscanf() usage tip-bot for Dominik Brodowski
2018-02-13  9:04   ` [tip:x86/pti] selftests/x86: Fix vDSO selftest segfault for vsyscall=none tip-bot for Dominik Brodowski
2018-02-11 11:10 ` [PATCH 3/5] selftests/x86: do not rely on int $0x80 in test_mremap_vdso.c Dominik Brodowski
2018-02-11 11:10   ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 11:10   ` linux
2018-02-11 12:13   ` [tip:x86/urgent] selftests/x86: Do not rely on "int $0x80" " tip-bot for Dominik Brodowski
2018-02-13  9:06   ` [tip:x86/pti] " tip-bot for Dominik Brodowski
2018-02-11 11:10 ` [PATCH 4/5] selftests/x86: do not rely on int $0x80 in single_step_syscall.c Dominik Brodowski
2018-02-11 11:10   ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 11:10   ` linux
2018-02-11 12:14   ` [tip:x86/urgent] selftests/x86: Do not rely on "int $0x80" " tip-bot for Dominik Brodowski
2018-02-13  9:06   ` [tip:x86/pti] " tip-bot for Ingo Molnar
2018-02-15  0:25   ` tip-bot for Dominik Brodowski [this message]
2018-02-11 11:10 ` [PATCH 5/5] selftests/x86: disable tests requiring 32bit support on pure 64bit systems Dominik Brodowski
2018-02-11 11:10   ` [Linux-kselftest-mirror] " Dominik Brodowski
2018-02-11 11:10   ` linux
2018-02-11 12:14   ` [tip:x86/urgent] selftests/x86: Disable tests requiring 32-bit support on pure 64-bit systems tip-bot for Dominik Brodowski
2018-02-13  9:07   ` [tip:x86/pti] " tip-bot for Ingo Molnar
2018-02-15  0:25   ` tip-bot for Dominik Brodowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-4105c69703cdeba76f384b901712c9397b04e9c2@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=dsafonov@virtuozzo.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.