Received: by 10.223.185.116 with SMTP id b49csp759824wrg; Wed, 21 Feb 2018 06:31:37 -0800 (PST) X-Google-Smtp-Source: AH8x227/alTv2Y26JumcojrvayEicUQYnRkBtc+KX/+z0Y60ydekp0yPE6goc7TQIITcUWRtx2o+ X-Received: by 2002:a17:902:461:: with SMTP id 88-v6mr3333789ple.88.1519223497881; Wed, 21 Feb 2018 06:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519223497; cv=none; d=google.com; s=arc-20160816; b=wV/l7dx/4wnG5++0+7ma1DhEDsMvAa7NC1tIviDq5wSVs/uWwV1QGH6VdUac0poo9I kWNllaCAB+NJvOdvQ1GNPw31vxVDotP4AdpwBK15/heW1DlAjOLjgUnB5YScpRjJ2Aet YahsOjU8JUqiqHo66IIXi5/FONQGvWrqKXHGC5/deksqqpE2v3vXnGcTg32lMCUh8qDb uaUH1G4WYj5g10SC6BTCa9Q8NvrYc/NTrmvaPfdaPNaiBnQwlWuZJ3yl02r5PncApF3L +GCxCM/oY/cQnB4bqBdEI1h4O7iQ/CBjY8fHT6IFOGzSGVksd1xPqRxqagUA50EkLarp MHLw== 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=xSGdFAOge+ggrr+Mr9cfaaoioIc4nsNctXl6vcvDWV8=; b=ViGkz+m4n+WlhDB63bR7XwIRzvIXNq2U6sdUkOAPVfnfckgu0cvaEg03V7vGxoD/zp bC+oHyHRVB5kFdW1sC9lDFCOYQ/swj7enIqqxOwWHBINxAR07eRy6LJO9NyXfb1A8PVa ZymXB8vy9LIldLC7dfi78B0wnsRIt81BHdT1BJlrUKlLAjGc2skDTUKiIeDIwMoBNK1B UWjG3pu4yj7gC+KiZCybIHSMTzc1Jw0JX7o01K0ZD8hKJOwT6V47ZTOj7+NQhO4IhVa7 vKOuXHUap+1xLJYg5sFEZwI6d7XmuLGXynCS1+pNmYyUAYuGJTLKXA6gSg/AFuodtNAj V2XQ== 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 u23si3395322pgv.121.2018.02.21.06.31.23; Wed, 21 Feb 2018 06:31: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 S937625AbeBUOaF (ORCPT + 99 others); Wed, 21 Feb 2018 09:30:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35418 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934482AbeBUM4k (ORCPT ); Wed, 21 Feb 2018 07:56:40 -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 770F7E2F; Wed, 21 Feb 2018 12:56:35 +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.9 59/77] selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c Date: Wed, 21 Feb 2018 13:49:08 +0100 Message-Id: <20180221124434.697287368@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124432.172390020@linuxfoundation.org> References: <20180221124432.172390020@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.9-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 @@ -26,11 +26,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