[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3Jmpjwl0aJpwq/4@hirez.programming.kicks-ass.net>
Date: Mon, 14 Nov 2022 17:02:46 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
Cc: linux-kernel@...r.kernel.org, Martin Liska <mliska@...e.cz>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Jiri Slaby <jslaby@...e.cz>
Subject: Re: [PATCH 14/46] x86/sev, lto: Mark cpuid_table_copy as
__visible_on_lto
On Mon, Nov 14, 2022 at 12:43:12PM +0100, Jiri Slaby (SUSE) wrote:
> From: Martin Liska <mliska@...e.cz>
>
> 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 <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: x86@...nel.org
> Signed-off-by: Martin Liska <mliska@...e.cz>
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> ---
> 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.
Powered by blists - more mailing lists