mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] sev-snp: parse MP tables for VMware hypervisor
@ 2025-03-13 17:31 Ajay Kaher
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ajay Kaher @ 2025-03-13 17:31 UTC (permalink / raw)
  To: bp, thomas.lendacky
  Cc: ajay.kaher, alexey.makhalov, bcm-kernel-feedback-list, bo.gan,
	dave.hansen, florian.fainelli, hpa, kevinloughlin, linux-kernel,
	mingo, tglx, vamsi-krishna.brahmajosyula, vasavi.sirnapalli,
	virtualization, x86, ye.li

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] sev-snp: parse MP tables for VMware hypervisor
  2025-03-13 17:31 [PATCH v2] sev-snp: parse MP tables for VMware hypervisor Ajay Kaher
@ 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
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2025-03-13 17:52 UTC (permalink / raw)
  To: Ajay Kaher
  Cc: thomas.lendacky, alexey.makhalov, bcm-kernel-feedback-list,
	bo.gan, dave.hansen, florian.fainelli, hpa, kevinloughlin,
	linux-kernel, mingo, tglx, vamsi-krishna.brahmajosyula,
	vasavi.sirnapalli, virtualization, x86, ye.li

On Thu, Mar 13, 2025 at 05:31:11PM +0000, Ajay Kaher wrote:
> For VMware hypervisor, SEV-SNP enabled VM's could boot without UEFI.

VMs

mingo, pls fix up while applying.

> 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(+)

Acked-by: Borislav Petkov (AMD) <bp@alien8.de>

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: x86/urgent] x86/vmware: Parse MP tables for SEV-SNP enabled guests under VMware hypervisors
  2025-03-13 17:31 [PATCH v2] sev-snp: parse MP tables for VMware hypervisor Ajay Kaher
  2025-03-13 17:52 ` Borislav Petkov
@ 2025-03-13 18:10 ` tip-bot2 for Ajay Kaher
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Ajay Kaher @ 2025-03-13 18:10 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Ye Li, Ajay Kaher, Ingo Molnar, Kevin Loughlin,
	Borislav Petkov (AMD),
	x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     a2ab25529bbcea51b5e01dded79f45aeb94f644a
Gitweb:        https://git.kernel.org/tip/a2ab25529bbcea51b5e01dded79f45aeb94f644a
Author:        Ajay Kaher <ajay.kaher@broadcom.com>
AuthorDate:    Thu, 13 Mar 2025 17:31:11 
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Thu, 13 Mar 2025 19:01:09 +01:00

x86/vmware: Parse MP tables for SEV-SNP enabled guests under VMware hypervisors

Under VMware hypervisors, SEV-SNP enabled VMs are fundamentally able to boot
without UEFI, but this regressed a year ago due to:

  0f4a1e80989a ("x86/sev: Skip ROM range scans and validation for SEV-SNP guests")

In this case, mpparse_find_mptable() has to be called to parse MP
tables which contains the necessary boot information.

[ mingo: Updated the changelog. ]

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>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Ye Li <ye.li@broadcom.com>
Reviewed-by: Kevin Loughlin <kevinloughlin@google.com>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250313173111.10918-1-ajay.kaher@broadcom.com
---
 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 00189cd..cb3f900 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-13 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-13 17:31 [PATCH v2] sev-snp: parse MP tables for VMware hypervisor Ajay Kaher
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

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®