From: Ajay Kaher <ajay.kaher@broadcom.com>
To: bp@alien8.de, thomas.lendacky@amd.com
Cc: ajay.kaher@broadcom.com, alexey.makhalov@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, bo.gan@broadcom.com,
dave.hansen@linux.intel.com, florian.fainelli@broadcom.com,
hpa@zytor.com, kevinloughlin@google.com,
linux-kernel@vger.kernel.org, mingo@redhat.com,
tglx@linutronix.de, vamsi-krishna.brahmajosyula@broadcom.com,
vasavi.sirnapalli@broadcom.com, virtualization@lists.linux.dev,
x86@kernel.org, ye.li@broadcom.com
Subject: [PATCH v2] sev-snp: parse MP tables for VMware hypervisor
Date: Thu, 13 Mar 2025 17:31:11 +0000 [thread overview]
Message-ID: <20250313173111.10918-1-ajay.kaher@broadcom.com> (raw)
For VMware hypervisor, SEV-SNP enabled VM's could boot without UEFI.
In this case, mpparse_find_mptable() has to be called to parse MP
tables which contains boot information.
Fixes: 0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests")
Co-developed-by: Ye Li <ye.li@broadcom.com>
Signed-off-by: Ye Li <ye.li@broadcom.com>
Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com>
Tested-by: Ye Li <ye.li@broadcom.com>
Reviewed-by: Kevin Loughlin <kevinloughlin@google.com>
---
Changes since v1:
https://lore.kernel.org/lkml/20241219114400.858980-1-ajay.kaher@broadcom.com/
- use cc_platform_has(CC_ATTR_GUEST_SEV_SNP) instead of
(sev_status & MSR_AMD64_SEV_SNP_ENABLED)
- remove unwanted header files
---
arch/x86/kernel/cpu/vmware.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 00189cdeb..cb3f900c4 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -26,6 +26,7 @@
#include <linux/export.h>
#include <linux/clocksource.h>
#include <linux/cpu.h>
+#include <linux/efi.h>
#include <linux/reboot.h>
#include <linux/static_call.h>
#include <asm/div64.h>
@@ -429,6 +430,9 @@ static void __init vmware_platform_setup(void)
pr_warn("Failed to get TSC freq from the hypervisor\n");
}
+ if (cc_platform_has(CC_ATTR_GUEST_SEV_SNP) && !efi_enabled(EFI_BOOT))
+ x86_init.mpparse.find_mptable = mpparse_find_mptable;
+
vmware_paravirt_ops_setup();
#ifdef CONFIG_X86_IO_APIC
--
2.39.4
next reply other threads:[~2025-03-13 17:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 17:31 Ajay Kaher [this message]
2025-03-13 17:52 ` Borislav Petkov
2025-03-13 18:10 ` [tip: x86/urgent] x86/vmware: Parse MP tables for SEV-SNP enabled guests under VMware hypervisors tip-bot2 for Ajay Kaher
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=20250313173111.10918-1-ajay.kaher@broadcom.com \
--to=ajay.kaher@broadcom.com \
--cc=alexey.makhalov@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bo.gan@broadcom.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=florian.fainelli@broadcom.com \
--cc=hpa@zytor.com \
--cc=kevinloughlin@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=vamsi-krishna.brahmajosyula@broadcom.com \
--cc=vasavi.sirnapalli@broadcom.com \
--cc=virtualization@lists.linux.dev \
--cc=x86@kernel.org \
--cc=ye.li@broadcom.com \
/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
all inboxes | Powered by JetHome®