Message ID | 20221114114344.18650-13-jirislaby@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2097699wru; Mon, 14 Nov 2022 03:47:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6j8RFJX8QuDAIu6O6d3bPqNZ8F/cKTnPxCbw0cadkUcANXOuLd4KDYdm2i91+FVWiNTnLA X-Received: by 2002:a17:906:33da:b0:78d:b046:aaae with SMTP id w26-20020a17090633da00b0078db046aaaemr9593687eja.218.1668426475237; Mon, 14 Nov 2022 03:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668426475; cv=none; d=google.com; s=arc-20160816; b=q4k+Xdj6mT85b2THe15ofIJGptr17surphKg58KV7IiNCUx3S1JzSlXzmNui2jOSSL vW7lf5sF7vriWJBrifrHSxe6JR4cF4oF90hxwA1jbfHw99DKe5L6NtGv8zHrVJpCuIkr +XEMjhv7OJRJY6w6rv9ILAaLeK/TbTNHorEEzhufpaZA4vAILjzWS73rrPb2cVJ67p7/ LOCb/rOmCb0QOCLvdu1epRxfxCT4Jir5jk2Mt4j3vKL5wT+aSohfEKZWF4jVX0vxh+X4 OHdIJ0IDBJwn5l4xGyq2eQZ9thKdNQBqsLc5BjmRfAVl/mC4ZrWty4maSDrSzwYdP33E 4L3g== 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=z5oJZBSWwgnPbQhTtEvZJ4+nelyi+5iof19yfzgCYhc=; b=vmVheKemFilE8luAXy2L2KZCKMI5AlwA2Gu3yewqoHpz4HkJ172z0sgod1gPvbShyL RJReNO2YGkQjx45uV7o33vIUt2vJvXmYi2Kb1onew6Za8WPKi93I51qKThjjVFynMG/6 hCWufcQH6lC6FWbCIgih4whBg6HQcj6ELUBb4Yp/uZsNW4iB+z2uNIxKYywTUsjlv5uI h0ITpmuYFVLCPc4SvRsShtzFHFKoQqomXG4hUuu5JsTfZO2S3lV6WJ1O8trAgCsztTFv fCTABKWE3aRENcUEbfXqk1PPoE8YGtXXJnFBOSKasJhGypx1uPjA/XF0GFHHwKAtrjeG nIiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iMdFCUcw; 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 jw12-20020a17090776ac00b007ad79c4f58fsi7033173ejc.120.2022.11.14.03.47.31; Mon, 14 Nov 2022 03:47:55 -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=iMdFCUcw; 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 S236658AbiKNLpI (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 06:45:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236660AbiKNLoe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 06:44:34 -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 CDDBA20BC5 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 03:44:25 -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 905B0B80E6C for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 11:44:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 988CDC433C1; Mon, 14 Nov 2022 11:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426263; bh=owzR+yZF1fBmG413bQU+FKodqiSnrZRm615nsyA2Qd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iMdFCUcwcAU0BxJEunp20sguBCmcihaBHzTN2R0laCZjfHpV3wYTLqN8Vo2RZE7iE haT1PNIPMmf++W29BCMx6YNaaDQS8iK2T4P5eJJzru7mrUTlNkwpLyOvP/sVh3ZW7g jVUQmQuZqHtZAIEj4JTTWT7Fml+LW8NRfvsbzTjt4+Ejv/GYDgIi4+nyNlni1tgPdH qhdKHJQ1coiRZPhNytWT8z/3lra+iaMThcXGG5fwaGe7WwfIYSj0GxQSZungNuRLsC 8kdFYo1ocB+NsfrwYgJw3vwGvgr9pTj/vGO7sjkMOOniPt6Bd8ZEa++WhKOr3ySQUf Q0rqE88PdqL1w== From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> To: linux-kernel@vger.kernel.org Cc: Andi Kleen <ak@linux.intel.com>, Juergen Gross <jgross@suse.com>, Alexey Makhalov <amakhalov@vmware.com>, VMware PV-Drivers Reviewers <pv-drivers@vmware.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org, Martin Liska <mliska@suse.cz>, Jiri Slaby <jslaby@suse.cz> Subject: [PATCH 12/46] x86/paravirt, lto: Mark native_steal_clock() as __visible_on_lto Date: Mon, 14 Nov 2022 12:43:10 +0100 Message-Id: <20221114114344.18650-13-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 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749471959933885345?= X-GMAIL-MSGID: =?utf-8?q?1749471959933885345?= |
Series |
gcc-LTO support for the kernel
|
|
Commit Message
Jiri Slaby
Nov. 14, 2022, 11:43 a.m. UTC
From: Andi Kleen <ak@linux.intel.com> 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 native_steal_clock() as __visible_on_lto. [js] use __visible_on_lto Cc: Juergen Gross <jgross@suse.com> Cc: "Srivatsa S. Bhat Cc: Alexey Makhalov <amakhalov@vmware.com> Cc: VMware PV-Drivers Reviewers <pv-drivers@vmware.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Martin Liska <mliska@suse.cz> Signed-off-by: Jiri Slaby <jslaby@suse.cz> --- arch/x86/kernel/paravirt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Nov 14, 2022 at 12:43:10PM +0100, Jiri Slaby (SUSE) wrote: > From: Andi Kleen <ak@linux.intel.com> > > 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. > @@ -120,7 +120,7 @@ unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr, > struct static_key paravirt_steal_enabled; > struct static_key paravirt_steal_rq_enabled; > > -static u64 native_steal_clock(int cpu) > +__visible_on_lto u64 native_steal_clock(int cpu) More hate; same reason, DEFINE_STATIC_CALL() takes the function address and stuffs it in a variable, WTF is GCC-LTO eliminating it?
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 7ca2d46c08cc..27a537cd4b0e 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -120,7 +120,7 @@ unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr, struct static_key paravirt_steal_enabled; struct static_key paravirt_steal_rq_enabled; -static u64 native_steal_clock(int cpu) +__visible_on_lto u64 native_steal_clock(int cpu) { return 0; }