Received: by 10.223.185.116 with SMTP id b49csp714800wrg; Wed, 21 Feb 2018 05:51:43 -0800 (PST) X-Google-Smtp-Source: AH8x226yx6oPlFREEEuvuL7jg7hAiFK1GhCFrEhU68HKBBHdTDXPBhmFDpLW9xUgJ9luMAFvczx7 X-Received: by 2002:a17:902:9a02:: with SMTP id v2-v6mr3245170plp.312.1519221103758; Wed, 21 Feb 2018 05:51:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519221103; cv=none; d=google.com; s=arc-20160816; b=v0mPkYFWP4+JsJkSjo5+/xqBgahwPovyLMdG7sbpwtYKWW/FjlZAvC/wPpYpidqpq6 xEK8BHTuc6d3i3Ne/LBtve1g9Uwu9sybkIGKWDsXxmmURFM6iKMSGUxW/2r9I8OeDUq+ 43p1dj/yreEyr8r048mFRidrWbhpuDCrses711JOkpZHYKBmQ0DGjy0r89p1RAx1S7o7 o+wWf4UJI5vluX/6PQ3Idfoe1uMAqAUxXb4eAvXxvHAm3E3ZZ0nsSJx1Lx+5mP/kY2Dk +ZZSFUx9Y7W6vYBbnaP1LBgoGZOo+fBi/PCkY+n5x0AUASPgha3sfoQK6c4roxEaOTQM bYEQ== 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=fYhbAyBa1ZxojxECUdhhR3E+zSSJ0nce+7qEfp/xQ00=; b=fz40VkKr0wFadjXkfy7bqLpuud3yJ1kFHwxKk1YJMu29r9S9HoE5wM3FbCRErvgZNh S9S5RSvlhB3G/qe8SsKxzHu4sbqhp+IaW6F2Sw8Q5AsfwM55qUZWxq3FTmqvrH7aXXSU Y6aB6h1Jjt87TwKA+nUrl13ra+csTKQxPquPG0YZVjldhIEIFRcXlScz75TPPvuZVxcE NWGjEzCtqGZEZqgnPGfqXznA6NUaFhw1GPRNGIPPKMYDb2mgEgh6cw8QTdbr3nkOhZ6m 3gZMeEaXDhgSCgtE3ojZknCq5uCa7SZYTdoe1jrJzItiq4RIHVoZWrbVQ2FTY1XKXcKL gltA== 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 m9si2550839pgp.542.2018.02.21.05.51.29; Wed, 21 Feb 2018 05:51:43 -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 S936987AbeBUNhV (ORCPT + 99 others); Wed, 21 Feb 2018 08:37:21 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42664 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936174AbeBUNI7 (ORCPT ); Wed, 21 Feb 2018 08:08:59 -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 15AF711DA; Wed, 21 Feb 2018 13:08:58 +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 075/163] selftests/x86: Disable tests requiring 32-bit support on pure 64-bit systems Date: Wed, 21 Feb 2018 13:48:24 +0100 Message-Id: <20180221124534.621749390@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 9279ddf23ce78ff2676e8e8e19fec0f022c26d04 upstream. The ldt_gdt and ptrace_syscall selftests, even in their 64-bit variant, use hard-coded 32-bit syscall numbers and call "int $0x80". This will fail on 64-bit systems with CONFIG_IA32_EMULATION=y disabled. Therefore, do not build these tests if we cannot build 32-bit binaries (which should be a good approximation for CONFIG_IA32_EMULATION=y being enabled). 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-6-linux@dominikbrodowski.net Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/x86/Makefile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -5,16 +5,26 @@ include ../lib.mk .PHONY: all all_32 all_64 warn_32bit_failure clean -TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt ptrace_syscall test_mremap_vdso \ - check_initial_reg_state sigreturn ldt_gdt iopl mpx-mini-test ioperm \ +UNAME_M := $(shell uname -m) +CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32) +CAN_BUILD_X86_64 := $(shell ./check_cc.sh $(CC) trivial_64bit_program.c) + +TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt test_mremap_vdso \ + check_initial_reg_state sigreturn iopl mpx-mini-test ioperm \ protection_keys test_vdso test_vsyscall TARGETS_C_32BIT_ONLY := entry_from_vm86 syscall_arg_fault test_syscall_vdso unwind_vdso \ test_FCMOV test_FCOMI test_FISTTP \ vdso_restorer TARGETS_C_64BIT_ONLY := fsgsbase sysret_rip +# Some selftests require 32bit support enabled also on 64bit systems +TARGETS_C_32BIT_NEEDED := ldt_gdt ptrace_syscall -TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY) +TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY) $(TARGETS_C_32BIT_NEEDED) TARGETS_C_64BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_64BIT_ONLY) +ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),11) +TARGETS_C_64BIT_ALL += $(TARGETS_C_32BIT_NEEDED) +endif + BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32) BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) @@ -23,10 +33,6 @@ BINARIES_64 := $(patsubst %,$(OUTPUT)/%, CFLAGS := -O2 -g -std=gnu99 -pthread -Wall -no-pie -UNAME_M := $(shell uname -m) -CAN_BUILD_I386 := $(shell ./check_cc.sh $(CC) trivial_32bit_program.c -m32) -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)