Received: by 10.223.185.116 with SMTP id b49csp1024472wrg; Wed, 21 Feb 2018 10:45:38 -0800 (PST) X-Google-Smtp-Source: AH8x225g9Bk31b14+vOEtL5IwR2x6Auqclq8H1cEDWBZTYE/zUdpA0S2EBE2pHqkFWW1OZrb2wOp X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr4016120plx.208.1519238737976; Wed, 21 Feb 2018 10:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519238737; cv=none; d=google.com; s=arc-20160816; b=AQQFzs64H6mJSAzNKDx24hOawQxoo4WZ7JCBno/cEQ5pqQvHhi05viOba5+5n7waSj UZ+sALuV+4IdnyvmLmxKN5qBDWLPVL4P9kVj4xoZrXTDvAwrEufT/rngNnbJa7WI4r19 xm+MOXkVE+RMAe7OS4mpZ8zLLSf9TxH86vEWiACCYVOldlJEc0+rQnmZPfj57JmijNoj FBo5j07A656/fgIwpdVfvr28wvKpp0rHfDvdMoBlpdbCVriRouMF/n36nHEXL1m9Vvbu AnAbOJoE643o/e3kLCZIuKzf+Wxx+pGbmiW8eZkBBn6vA40HeUtoOcMifNa7nKYcPQXK RsHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eFe0DU0BvPBY/zUF+MrwaFuNW/XjQy8UfNgP8iZv2Sk=; b=JuW9PvsUKVzBOgEQYLml6z3TM6rmzZy1iZ9RpM/oExlvDEBJbhMdXL1y+bgHCwGWNG G2wRVsLn10xBYmvClga1L35vBWSXfwivpaW5/rXZ+kGFRAh7O/rExXnjdsAGITijdrWZ VODqiTUAs7/srXm/HfhU5uQwXcIY4hxnoQtT30fsc1OO1q5lp3BdO+fGinSK71nwUJSJ VZz61ZkWC/HLRfdntjjJllESTtb0xN0tYrj2yZaDrmFYUpfo2s79vjXa2mfgZl9SDVrP o+6gZC291TGg5fUaHrOTZ0N/OlAobToYbLop5f0uelYqL5lmLq+XphExHTbLgGouXkHy AVjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si1750465pll.90.2018.02.21.10.45.23; Wed, 21 Feb 2018 10:45:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937000AbeBUNhm (ORCPT + 99 others); Wed, 21 Feb 2018 08:37:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42634 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936170AbeBUNIx (ORCPT ); Wed, 21 Feb 2018 08:08:53 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 29EB911E5; Wed, 21 Feb 2018 13:08:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dominik Brodowski , Andy Lutomirski , Dmitry Safonov , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , linux-kselftest@vger.kernel.org, shuah@kernel.org, Ingo Molnar Subject: [PATCH 4.15 074/163] selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c Date: Wed, 21 Feb 2018 13:48:23 +0100 Message-Id: <20180221124534.553066850@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dominik Brodowski commit 4105c69703cdeba76f384b901712c9397b04e9c2 upstream. 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 Cc: Andy Lutomirski Cc: Dmitry Safonov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner 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 Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/x86/Makefile | 2 ++ tools/testing/selftests/x86/single_step_syscall.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -30,11 +30,13 @@ CAN_BUILD_X86_64 := $(shell ./check_cc.s 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) --- 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