Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3094812rwb; Mon, 15 Aug 2022 18:00:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bmnRROtSmJ6dCyXPQ2bFdjqAM1w1gVLn6dGslpDFITJxmihto4dNlZxbGxRCcxM1lHJq3 X-Received: by 2002:aa7:d597:0:b0:43d:5bcf:f251 with SMTP id r23-20020aa7d597000000b0043d5bcff251mr16622917edq.15.1660611623474; Mon, 15 Aug 2022 18:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611623; cv=none; d=google.com; s=arc-20160816; b=psqUe1LOJyiAe/A/UW0KsQJZuzqFClgWoDA+5mYk5o0ECxWrEmhnR4KXal/wMwzvvc R5s6H8vhiR/EmyN2BrQOEcx6QCw6QUAXR0QA9KM1hf8wFCrG6RVaWpXDc2e/XdcL3dIf jeIdJqd+uSfmp/U6rYEsUA2909j6gMkqiMQkhWwMijNgbk4iGNnpCOtTOi2GwKLVFRrr HUQG3bOguWioxsHAEg7nVJZgPp9fExenZ7FABe7+AG+6OZNpIE7m6Ah+TiWz44GuUnZ4 r/nhgFW2AfKTJVQdb+US3EcexAs5jiGKibXmk+fqZPn6bIt5up9l+jzSAXXfDQ/JDbeO jIzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wf9l9CxmlQcpYukfaHu/awnrVYNQL4CctlBakx6ECFw=; b=mmAuAFN2eYgbZMs9y0Oc49lh+cmTJT8qRqgQ2vQVCtXlM+Cxf3hNVGVaDjIsadOUmx 5z1sFgRpBiNvHaWow6STkJ2b+oSZQSrhH+PF70KCP8Z+oYmCASYS3Wd+1m7GKFr2LIiD T9/yIIJr634gg3GX+ELBTpOxp6Q8ap151vQzZRuNQ5/yooKHnQADDmtSDLTJeWwxTZ51 WvyAeHrLdwqYw1tFK6YGsZblKE+gVn4ZZqXs8fPNt6JWTkDJTXidTJYADvl1ocDIoNJ1 8MO2hO17YrwB2erXJC/q7z5KZuHbz1xc6ShHrgZHJ3wMthpCeaE5sFck6hbZEfA6x6iF CPZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T4b0LBhE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020a1709061dd700b00722e7756f3dsi7926331ejh.462.2022.08.15.17.59.49; Mon, 15 Aug 2022 18:00:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T4b0LBhE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346958AbiHPAvW (ORCPT + 99 others); Mon, 15 Aug 2022 20:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348756AbiHPAqZ (ORCPT ); Mon, 15 Aug 2022 20:46:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3C2B3B0F; Mon, 15 Aug 2022 13:44:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4C0CAB80EB1; Mon, 15 Aug 2022 20:44:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2BBFC433D6; Mon, 15 Aug 2022 20:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596278; bh=mPAZIivBhuehrA9rWZjos+F/5rsjO/MsLGLXHKosBsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T4b0LBhEg9hKKvrLNoWHxQ8IvFX8YwUmN88SRZQu16Y54tGZ3ep+YDdEkm/lx5Ate OVt57mJX8YXPwKT257wmipMZic0x67a2kqUu9Gx0xQ/GGg1DjpJpuo5ZLu78BArKOK tJvG/MGdzBiluB07ufAdb/vj5nbBkMDZsGRTaueE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrea Righi , Ingo Molnar , Sasha Levin Subject: [PATCH 5.19 1028/1157] x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y Date: Mon, 15 Aug 2022 20:06:24 +0200 Message-Id: <20220815180521.063709898@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Righi [ Upstream commit de979c83574abf6e78f3fa65b716515c91b2613d ] With CONFIG_PREEMPTION disabled, arch/x86/entry/thunk_$(BITS).o becomes an empty object file. With some old versions of binutils (i.e., 2.35.90.20210113-1ubuntu1) the GNU assembler doesn't generate a symbol table for empty object files and objtool fails with the following error when a valid symbol table cannot be found: arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table To prevent this from happening, build thunk_$(BITS).o only if CONFIG_PREEMPTION is enabled. BugLink: https://bugs.launchpad.net/bugs/1911359 Fixes: 320100a5ffe5 ("x86/entry: Remove the TRACE_IRQS cruft") Signed-off-by: Andrea Righi Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/Ys/Ke7EWjcX+ZlXO@arighi-desktop Signed-off-by: Sasha Levin --- arch/x86/entry/Makefile | 3 ++- arch/x86/entry/thunk_32.S | 2 -- arch/x86/entry/thunk_64.S | 4 ---- arch/x86/um/Makefile | 3 ++- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile index eeadbd7d92cc..ca2fe186994b 100644 --- a/arch/x86/entry/Makefile +++ b/arch/x86/entry/Makefile @@ -11,12 +11,13 @@ CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) CFLAGS_common.o += -fno-stack-protector -obj-y := entry.o entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o +obj-y := entry.o entry_$(BITS).o syscall_$(BITS).o obj-y += common.o obj-y += vdso/ obj-y += vsyscall/ +obj-$(CONFIG_PREEMPTION) += thunk_$(BITS).o obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o diff --git a/arch/x86/entry/thunk_32.S b/arch/x86/entry/thunk_32.S index 7591bab060f7..ff6e7003da97 100644 --- a/arch/x86/entry/thunk_32.S +++ b/arch/x86/entry/thunk_32.S @@ -29,10 +29,8 @@ SYM_CODE_START_NOALIGN(\name) SYM_CODE_END(\name) .endm -#ifdef CONFIG_PREEMPTION THUNK preempt_schedule_thunk, preempt_schedule THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace EXPORT_SYMBOL(preempt_schedule_thunk) EXPORT_SYMBOL(preempt_schedule_notrace_thunk) -#endif diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index 505b488fcc65..f38b07d2768b 100644 --- a/arch/x86/entry/thunk_64.S +++ b/arch/x86/entry/thunk_64.S @@ -31,14 +31,11 @@ SYM_FUNC_END(\name) _ASM_NOKPROBE(\name) .endm -#ifdef CONFIG_PREEMPTION THUNK preempt_schedule_thunk, preempt_schedule THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace EXPORT_SYMBOL(preempt_schedule_thunk) EXPORT_SYMBOL(preempt_schedule_notrace_thunk) -#endif -#ifdef CONFIG_PREEMPTION SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore) popq %r11 popq %r10 @@ -53,4 +50,3 @@ SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore) RET _ASM_NOKPROBE(__thunk_restore) SYM_CODE_END(__thunk_restore) -#endif diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index ba5789c35809..a8cde4e8ab11 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile @@ -28,7 +28,8 @@ else obj-y += syscalls_64.o vdso/ -subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../entry/thunk_64.o +subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o +subarch-$(CONFIG_PREEMPTION) += ../entry/thunk_64.o endif -- 2.35.1