[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZOWcSKlonRpbNloN@liuwe-devbox-debian-v2>
Date: Wed, 23 Aug 2023 05:42:32 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Dexuan Cui <decui@...rosoft.com>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
linux-hyperv@...r.kernel.org, mikelley@...rosoft.com,
tiala@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
thomas.lendacky@....com, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH] x86/hyperv: Fix undefined reference to
isolation_type_en_snp without CONFIG_HYPERV
On Tue, Aug 22, 2023 at 08:20:08PM -0700, Dexuan Cui wrote:
> When CONFIG_HYPERV is not set, arch/x86/hyperv/ivm.c is not built (see
> arch/x86/Kbuild), so 'isolation_type_en_snp' in the ivm.c is not defined,
> and this failure happens:
>
> ld: arch/x86/kernel/cpu/mshyperv.o: in function `ms_hyperv_init_platform':
> arch/x86/kernel/cpu/mshyperv.c:417: undefined reference to `isolation_type_en_snp'
>
> Fix the failure by testing hv_get_isolation_type() and
> ms_hyperv.paravisor_present for a fully enlightened SNP VM: when
> CONFIG_HYPERV is not set, hv_get_isolation_type() is defined as a
> static inline function that always returns HV_ISOLATION_TYPE_NONE
> (see include/asm-generic/mshyperv.h), so the compiler won't generate any
> code for the ms_hyperv.paravisor_present and static_branch_enable().
>
> Reported-by: Tom Lendacky <thomas.lendacky@....com>
> Closes: https://lore.kernel.org/lkml/b4979997-23b9-0c43-574e-e4a3506500ff@amd.com/
> Fixes: d6e2d6524437 ("x86/hyperv: Add sev-snp enlightened guest static key")
> Signed-off-by: Dexuan Cui <decui@...rosoft.com>
Applied. Thanks.
Powered by blists - more mailing lists