Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5804393rwb; Mon, 14 Nov 2022 09:39:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf4XDOQQKh7ZBYJ3ywL9NUMUxxOjAEGipw/VvAI7oxUe6P6iGcJmx6jWjCpCYP5K1/LBJWCR X-Received: by 2002:a50:ec12:0:b0:461:d5af:e9ea with SMTP id g18-20020a50ec12000000b00461d5afe9eamr11535592edr.403.1668447551593; Mon, 14 Nov 2022 09:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668447551; cv=none; d=google.com; s=arc-20160816; b=MSQLspQu+Yx29Fc26BwD6CHKnlYZvYrE1Pm8wt3JOj0brZEcxjm6CaI4MORvrgjs/6 J8ikO7eDBIaw5UIaZ77vKAFlYCmZLCUMK77+eCLtuX6EvyTxB8ggjh6a480ApQ1jVKhy V+yeugnyLAurK/jHt7oPuO3xieLGd/NvQiPtM1I5W8cBSsHpNH9BNt7VXnzVzriuWyQu p3SBifH02is0N35QVOiAJm69YbYa9M6i6bfZ6aHXt0RDBHK1vyazLaTBRzOZs5vvGotR MSOFrM5SMjJuBvFwaA82UJ9fxOejbJbWAKo1p6GEAJn6se9QyzVt/tUV9OOMopRTRDNb 3Fow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VHNRiFwLD0T8xlIzSdUGCUiQwRiGBIjAq2J/I0NP6Es=; b=rNglqMVq7GSnIi+yX9NMw/wTppQTNE4pZJI94jrLUDzqtA9mRHumviaRkLfHHvOtHS le9Ue/B0M/gkeCUD+UQAC5MErqZjAd4b/QLn+yYVOhkmv13hA4jocDZc+Ken4E7odnvR TjSCrcpOMSwSaV1qdWKw3hBGbfvtB9G32GKYW9uC3oSQKqhjowYGKARhUzc8xC38AiEE uL6HhMgVEiKw1Xm4MWHNCv0XzGBUHyxveLNdVlFEDmAlHeb1qOhEOqzrw8YWG4PXHEdJ Wcvs0o3bClxVEpyQdcRGUuHNli2SIGQOE7iQBeTXx7H6VxVkLLVrwXT1N8Gqqo37AocK LozQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iJAsxGeb; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs16-20020a1709072d1000b007add882fe58si10355817ejc.796.2022.11.14.09.38.49; Mon, 14 Nov 2022 09:39:11 -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=@infradead.org header.s=casper.20170209 header.b=iJAsxGeb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237892AbiKNRSs (ORCPT + 89 others); Mon, 14 Nov 2022 12:18:48 -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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 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.