From patchwork Mon Nov 14 11:43:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 19740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2097717wru; Mon, 14 Nov 2022 03:47:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf49Xjzlt/kMj+rhcihfl/qvUj7An3UnQoThm3jMg1EUyQ724PBZI99I7sPIpEXR3P53Z5u1 X-Received: by 2002:a17:906:fb96:b0:7ad:dcf7:c4f with SMTP id lr22-20020a170906fb9600b007addcf70c4fmr9931234ejb.631.1668426478298; Mon, 14 Nov 2022 03:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668426478; cv=none; d=google.com; s=arc-20160816; b=YVfelUhSaFXYnmnwOFlN4MTzP6BTSEvkIClPA/BFNurjFNL4nevRORiRLKH0MiaUW8 roGKDr4HYWhSJ/PwtSmCXrXM9rx9VxtKEzbykKDQGSs1eqwElers1LaMWp64npBf60HL WP0ttisEgQvSdlKDflJCmaIbK1E7NJVPyKiwRblgl7NDS7KYSm2pK+mQbt/CK75FgebX GtOHX8UBs3kyu/rJHgx++kvsCCHRI46ecCtEa3/5AW7hOppZpQULAtG8Y+muGHwiZFfL aHsHrEgFaFED14sWH5KOOVpggXWMfhbd7bRsRw3wp4DsnGgtvm/c8eroLG8XuvqksZXG WLbg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k3ZUR2h+mEKL3OZPzUexk63/NgLNzDz87sk4U1h1dpk=; b=RPHz9FR6+vnMZclLzZN78jUvqQLPXhUPX2Re2IfgkQR3Er/GSg0itHgU6pev3F2tQc EcyCpdYbmeEreM8+dbS7ND4VtdQty/itoCFFw1Wlqhw0uctFQFHW0950P0q5xPhmQNFE ru9+gPTx+snZvfBKbZ7xhJEh91y+7j4Nle04yp2nwzTfolRbH2tcm2qVJ6w0DNoSW7sF MfWPDHhngHC60z9Q8/hiEAvBtChvAzgmZuKX0RVDo0HI0Zr8jw6qrNznpGNTz4/NpCmP l4gS4FQXjRLQfDGv6MsndUy6k1C+g1zV5PvXgqiv7Af15aKxAx8pISy8ta4ZXdwor1wt HhDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FPYVlpz3; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht8-20020a170907608800b0078dd7383ed8si8523962ejc.414.2022.11.14.03.47.34; Mon, 14 Nov 2022 03:47:58 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=FPYVlpz3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236664AbiKNLpO (ORCPT + 99 others); Mon, 14 Nov 2022 06:45:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236517AbiKNLoj (ORCPT ); Mon, 14 Nov 2022 06:44:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B053B1D655 for ; Mon, 14 Nov 2022 03:44:28 -0800 (PST) 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 34A71B80E6C for ; Mon, 14 Nov 2022 11:44:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE33AC433D6; Mon, 14 Nov 2022 11:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426265; bh=mZy59RfMp+d1UJJbf+o4C0WWNhptP9zLv0Zp8nxmYqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FPYVlpz368y2BvR4VAyLp0saq8tF6P5Cp+4m0jbJhjQgB9H7x7DfN3vURZR+wYkC/ GBWAYSbKB6NYboPLqd1Rnnwtv6/IoJ4+ARtKrns+0fztif2QW7WsCr5Iw1NFJjmKup y8grnvSS2m/5cppYeNVgrNJETBDHGJSdNjFhE4s0j/dLKVfjdkkTgo7Tqi+pEQfsyf 5In4dDX+Pf1RaDEjZMXsT5w/J3HQBXMZfEWDzorQ8r2uDq8J84W6ev0qhlT9a3whu+ nW1oGTYQdFMtRHOhzEVCWZbJtpOLOTved+3Xr9wXJXB0xL7BBCqPCGFkmylbq6s2f/ D6ZFfLFn8tJyw== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, Martin Liska , Jiri Slaby Subject: [PATCH 13/46] x86/preempt, lto: Mark preempt_schedule_*thunk() as __visible Date: Mon, 14 Nov 2022 12:43:11 +0100 Message-Id: <20221114114344.18650-14-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749471962695515019?= X-GMAIL-MSGID: =?utf-8?q?1749471962695515019?= From: Andi Kleen Symbols referenced from assembler (either directly or e.f. from DEFINE_STATIC_KEY()) need to be global and visible in gcc LTO because they could end up in a different object file than the assembler. This can lead to linker errors without this patch. So mark preempt_schedule_thunk() and preempt_schedule_notrace_thunk() as __visible. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: x86@kernel.org Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- arch/x86/include/asm/preempt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h index 5f6daea1ee24..c76ec881b23c 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h @@ -106,13 +106,13 @@ static __always_inline bool should_resched(int preempt_offset) #ifdef CONFIG_PREEMPTION extern asmlinkage void preempt_schedule(void); -extern asmlinkage void preempt_schedule_thunk(void); +extern __visible asmlinkage void preempt_schedule_thunk(void); #define preempt_schedule_dynamic_enabled preempt_schedule_thunk #define preempt_schedule_dynamic_disabled NULL extern asmlinkage void preempt_schedule_notrace(void); -extern asmlinkage void preempt_schedule_notrace_thunk(void); +extern __visible asmlinkage void preempt_schedule_notrace_thunk(void); #define preempt_schedule_notrace_dynamic_enabled preempt_schedule_notrace_thunk #define preempt_schedule_notrace_dynamic_disabled NULL