From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BC9EC43219 for ; Mon, 14 Nov 2022 17:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237919AbiKNRSt (ORCPT ); Mon, 14 Nov 2022 12:18:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237917AbiKNRSh (ORCPT ); Mon, 14 Nov 2022 12:18:37 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 490C0FF7 for ; Mon, 14 Nov 2022 09:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VHNRiFwLD0T8xlIzSdUGCUiQwRiGBIjAq2J/I0NP6Es=; b=iJAsxGebVqg5F0ryulGlz19f1x AscGkDKEeCi5Lpbr/e/pA/pFuFkGfpXqardUjV8/OMj6lNtSNfo/XIaGf55DZ2+8fZvY51SZBAV9J xXBuhJQzGvDFlwi7ddxEi70rWyM6gqCKCDMQR110Vth6gEF2/GvvpKxa4hDqBnMn78XBNRRcM3f1B HMJwMSz0LSw4b0ygAonLQ0DJgXn3CcF+o7dkN+fJgpBRaySku9EYpfQi3cfObcfwe748rMENkuNe0 SjfSbDQqRlR79JNOuFpXCCMUHxpNESxADEshDT7MZFBAnwcKVmhDELn5Urzay6Hev6PrVHYUwNH3+ fcsJbUtg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oud6N-00FaHg-OL; Mon, 14 Nov 2022 17:18:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D3EE93021D4; Mon, 14 Nov 2022 17:02:46 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BAF9D2B891F5A; Mon, 14 Nov 2022 17:02:46 +0100 (CET) Date: Mon, 14 Nov 2022 17:02:46 +0100 From: Peter Zijlstra To: "Jiri Slaby (SUSE)" Cc: linux-kernel@vger.kernel.org, Martin Liska , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, Jiri Slaby Subject: Re: [PATCH 14/46] x86/sev, lto: Mark cpuid_table_copy as __visible_on_lto Message-ID: References: <20221114114344.18650-1-jirislaby@kernel.org> <20221114114344.18650-15-jirislaby@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221114114344.18650-15-jirislaby@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 14, 2022 at 12:43:12PM +0100, Jiri Slaby (SUSE) wrote: > From: Martin Liska > > 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 cpuid_table_copy as __visible_on_lto. > > [js] use __visible_on_lto > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: "H. Peter Anvin" > Cc: x86@kernel.org > Signed-off-by: Martin Liska > Signed-off-by: Jiri Slaby > --- > arch/x86/kernel/sev-shared.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c > index 3a5b0c9c4fcc..554da8aabfc7 100644 > --- a/arch/x86/kernel/sev-shared.c > +++ b/arch/x86/kernel/sev-shared.c > @@ -64,7 +64,7 @@ struct snp_cpuid_table { > static u16 ghcb_version __ro_after_init; > > /* Copy of the SNP firmware's CPUID page. */ > -static struct snp_cpuid_table cpuid_table_copy __ro_after_init; > +__visible_on_lto struct snp_cpuid_table cpuid_table_copy __ro_after_init; Same again, address is taken (and passed into inline asm). Must not be eliminated.