From: Wei Liu <wei.liu@kernel.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
linux-hyperv@vger.kernel.org, mikelley@microsoft.com,
tiala@microsoft.com, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
thomas.lendacky@amd.com, linux-kernel@vger.kernel.org,
x86@kernel.org
Subject: Re: [PATCH] x86/hyperv: Fix undefined reference to isolation_type_en_snp without CONFIG_HYPERV
Date: Wed, 23 Aug 2023 05:42:32 +0000 [thread overview]
Message-ID: <ZOWcSKlonRpbNloN@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20230823032008.18186-1-decui@microsoft.com>
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@amd.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@microsoft.com>
Applied. Thanks.
prev parent reply other threads:[~2023-08-23 5:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 3:20 [PATCH] x86/hyperv: Fix undefined reference to isolation_type_en_snp without CONFIG_HYPERV Dexuan Cui
2023-08-23 5:42 ` Wei Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZOWcSKlonRpbNloN@liuwe-devbox-debian-v2 \
--to=wei.liu@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tiala@microsoft.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).