linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix broken SNP support with KVM module built-in
@ 2025-01-22  0:59 Ashish Kalra
  2025-01-22  1:00 ` [PATCH 1/4] iommu/amd: Check SNP support before enabling IOMMU Ashish Kalra
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Ashish Kalra @ 2025-01-22  0:59 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, x86, hpa,
	thomas.lendacky, john.allen, herbert, davem, joro,
	suravee.suthikulpanit, will, robin.murphy
  Cc: michael.roth, dionnaglaze, vasant.hegde, kvm, linux-kernel,
	linux-crypto, linux-coco, iommu

From: Ashish Kalra <ashish.kalra@amd.com>

This patch-set fixes the current SNP host enabling code and effectively SNP
which is broken with respect to the KVM module being built-in.

Essentially SNP host enabling code should be invoked before KVM
initialization, which is currently not the case when KVM is built-in.

SNP host support is enabled in snp_rmptable_init() which is invoked as a
device_initcall(). Here device_initcall() is used as snp_rmptable_init()
expects AMD IOMMU SNP support to be enabled prior to it and the AMD
IOMMU driver enables SNP support after PCI bus enumeration.

The first pre-patch in this patch-set is the AMD IOMMU driver patch
which moves SNP enable check before enabling IOMMUs. With this patch
applied, the final patch in this patch-set calls snp_rmptable_init()
early with subsys_initcall() which then enables SNP host support before
KVM initialization with kvm_amd module built-in. The other two pre-patches
in the patch-set ensure that the dependent PSP SEV driver is initialized
before KVM module if KVM module is built-in.

Fixes: c3b86e61b756 ("x86/cpufeatures: Enable/unmask SEV-SNP CPU feature")

Ashish Kalra (1):
  x86/sev: Fix broken SNP support with KVM module built-in

Sean Christopherson (2):
  crypto: ccp: Add external API interface for PSP module initialization
  KVM: SVM: Ensure PSP module initialized before built-in KVM module

Vasant Hegde (1):
  iommu/amd: Check SNP support before enabling IOMMU

 arch/x86/kvm/svm/sev.c      | 10 ++++++++++
 arch/x86/virt/svm/sev.c     |  2 +-
 drivers/crypto/ccp/sp-dev.c | 12 ++++++++++++
 drivers/crypto/ccp/sp-dev.h |  1 +
 drivers/iommu/amd/init.c    |  3 ++-
 include/linux/psp-sev.h     | 11 +++++++++++
 6 files changed, 37 insertions(+), 2 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-01-29  9:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-22  0:59 [PATCH 0/4] Fix broken SNP support with KVM module built-in Ashish Kalra
2025-01-22  1:00 ` [PATCH 1/4] iommu/amd: Check SNP support before enabling IOMMU Ashish Kalra
2025-01-22 15:22   ` Tom Lendacky
2025-01-22 17:07     ` Vasant Hegde
2025-01-24 21:46       ` Kalra, Ashish
2025-01-25  0:39         ` Sean Christopherson
2025-01-27 20:43           ` Kalra, Ashish
2025-01-27 21:12             ` Sean Christopherson
2025-01-29  9:24               ` Vasant Hegde
2025-01-22  1:00 ` [PATCH 2/4] crypto: ccp: Add external API interface for PSP module initialization Ashish Kalra
2025-01-22 15:53   ` Tom Lendacky
2025-01-22  1:00 ` [PATCH 3/4] KVM: SVM: Ensure PSP module initialized before built-in KVM module Ashish Kalra
2025-01-22 15:58   ` Tom Lendacky
2025-01-22  1:00 ` [PATCH 4/4] x86/sev: Fix broken SNP support with KVM module built-in Ashish Kalra
2025-01-22 16:07   ` Tom Lendacky

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).