aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/hyperv/ivm.c
diff options
context:
space:
mode:
authorDexuan Cui <[email protected]>2023-08-22 20:20:08 -0700
committerWei Liu <[email protected]>2023-08-23 05:42:20 +0000
commit86e619c922e616d8780833562a14a5bda329f0c3 (patch)
treecdeb298f6509cc5db82238c5d0ef624180d686a3 /arch/x86/hyperv/ivm.c
parentf0a3d1de89876f4ca54fccb4103b504d50a8347f (diff)
x86/hyperv: Fix undefined reference to isolation_type_en_snp without CONFIG_HYPERV
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 <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Fixes: d6e2d6524437 ("x86/hyperv: Add sev-snp enlightened guest static key") Signed-off-by: Dexuan Cui <[email protected]> Signed-off-by: Wei Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/x86/hyperv/ivm.c')
0 files changed, 0 insertions, 0 deletions