Fix broken SNP support with KVM module built-in
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest3 patches 3 repliesIn review
- v33 patches 11 repliesSuperseded
- v24 patches 7 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 4 patches | 10 replies | Superseded |
Changes in v4 from the cover letter
- Add warning if SNP support has been checked on IOMMUs and host SNP support has been enabled but late IOMMU initialization fails subsequently.
- Add reviewed-by's.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | crypto: ccp: Add external API interface for PSP module initializationdrivers/ include/ | +23 | 0 replies | |
| 2/3 | KVM: SVM: Ensure PSP module is initialized if KVM module is built-inarch/ | +10 | 0 replies | |
| 3/3 | x86/sev: Fix broken SNP support with KVM module built-inarch/ arch/ drivers/ | +39 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Tom Lendacky | Joerg Roedel |
|---|---|---|
| 1/3 | R-b | |
| 2/3 | R-b | |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/3] Fix broken SNP support with KVM module built-in
From: Ashish Kalra <[email protected]>
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 currently 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.
This patch-set adds support to call snp_rmptable_init() early and directly from iommu_snp_enable() (after checking and enabling IOMMU SNP support) which enables SNP host support before KVM initialization with kvm_amd module built-in.
Additionally the patch-set adds support to initialize PSP SEV driver during KVM module probe time.
This patch-set has been tested with the following cases/scenarios:
1). kvm_amd module and PSP driver built-in.
2). kvm_amd module built-in with intremap=off kernel command line. 3). kvm_amd module built-in with iommu=off kernel command line. 4). kvm_amd and PSP driver built as modules.
5). kvm_amd built as module with iommu=off kernel command line. 6). kvm_amd module as built-in and PSP driver as module. 7). kvm_amd build as a module and PSP driver as built-in.
v4:
- Add warning if SNP support has been checked on IOMMUs and host SNP support has been enabled but late IOMMU initialization fails subsequently.
- Add reviewed-by's.
v3:
- Ensure that dropping the device_initcall() happens in the same patch that wires up the IOMMU code to invoke snp_rmptable_init() which then makes sure that snp_rmptable_init() is still getting called and also merge patches 3 & 4.
- Fix commit logs.
v2:
- Drop calling iommu_snp_enable() early before enabling IOMMUs as IOMMU subsystem gets initialized via subsys_initcall() and hence snp_rmptable_init() cannot be invoked via subsys_initcall().
- Instead add support to call snp_rmptable_init() early and directly via iommu_snp_enable().
- Fix commit logs.
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 is initialized if KVM module is built-in
arch/x86/include/asm/sev.h | 2 ++ arch/x86/kvm/svm/sev.c | 10 ++++++++++ arch/x86/virt/svm/sev.c | 23 +++++++---------------- drivers/crypto/ccp/sp-dev.c | 14 ++++++++++++++ drivers/iommu/amd/init.c | 34 ++++++++++++++++++++++++++++++---- include/linux/psp-sev.h | 9 +++++++++ 6 files changed, 72 insertions(+), 20 deletions(-)
Signature · 1 line
2.34.1