Skip to content

KVM: SVM: Enable Secure TSC for SEV-SNP

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v11 Latest8 patches 13 repliesIn review

Changes in v11 from the cover letter

- Shuffle code around so that snp_is_secure_tsc_enabled() doesn't need to be exposed outside of sev.c.
- Explicitly modify the intercept for MSR_AMD64_GUEST_TSC_FREQ (paranoia is cheap in this case).
- Trim the changelog for the GHCB version enforcement patch.
- Continue on with snp_launch_start() if default_tsc_khz is '0'. AFAICT, continuing on doesn't put the host at (any moer) risk. [Kai]

Patches in v11 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8KVM: SEV: Drop GHCB_VERSION_DEFAULT and open code itarch/x86/kvm/svm/sev.c+8 -90 replies
2/8KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guestsarch/x86/kvm/svm/sev.c+6 -20 replies
3/8x86/cpufeatures: Add SNP Secure TSCarch/x86/include/asm/cpufeatures.h+1 -00 replies
4/8KVM: SVM: Move SEV-ES VMSA allocation to a dedicated sev_vcpu_create() helperarch/x86/kvm/svm/sev.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+29 -181 reply
5/8KVM: SEV: Move init of SNP guest state into sev_init_vmcb()arch/x86/kvm/svm/sev.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+13 -161 reply
6/8KVM: SEV: Set RESET GHCB MSR value during sev_es_init_vmcb()arch/x86/kvm/svm/sev.c+11 -131 reply
7/8KVM: SEV: Fold sev_es_vcpu_reset() into sev_vcpu_create()arch/x86/kvm/svm/sev.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+2 -91 reply
8/8KVM: SVM: Enable Secure TSC for SNP guestsarch/x86/include/asm/svm.h arch/x86/kvm/svm/sev.c+27 -03 replies

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchBorislav Petkov (AMD)Tom LendackyVaishali ThakkarKai HuangNikunj A Dadhania
1/8
2/8
3/8A-b R-b T-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v11 thread

Cover letter [PATCH v11 0/8] KVM: SVM: Enable Secure TSC for SEV-SNP

This is a combination of Nikunk's series to enable secure TSC support and to fix the GHCB version issues, along with some code refactorings to move SEV+ setup code into sev.c (we've managed to grow something like 4 flows that all do more or less the same thing).

Note, I haven't tested SNP functionality in any way.

v11:
- Shuffle code around so that snp_is_secure_tsc_enabled() doesn't need to be exposed outside of sev.c.
- Explicitly modify the intercept for MSR_AMD64_GUEST_TSC_FREQ (paranoia is cheap in this case).
- Trim the changelog for the GHCB version enforcement patch.
- Continue on with snp_launch_start() if default_tsc_khz is '0'. AFAICT, continuing on doesn't put the host at (any moer) risk. [Kai]

v10: https://lore.kernel.org/all/[email protected]

v3 (GHCB): https://lore.kernel.org/all/[email protected]

Nikunj A Dadhania (4):
KVM: SEV: Drop GHCB_VERSION_DEFAULT and open code it
KVM: SEV: Enforce minimum GHCB version requirement for SEV-SNP guests x86/cpufeatures: Add SNP Secure TSC
KVM: SVM: Enable Secure TSC for SNP guests

Sean Christopherson (4):
KVM: SVM: Move SEV-ES VMSA allocation to a dedicated sev_vcpu_create()
helper
KVM: SEV: Move init of SNP guest state into sev_init_vmcb()
KVM: SEV: Set RESET GHCB MSR value during sev_es_init_vmcb()
KVM: SEV: Fold sev_es_vcpu_reset() into sev_vcpu_create()

 arch/x86/include/asm/cpufeatures.h |   1 +
 arch/x86/include/asm/svm.h         |   1 +
 arch/x86/kvm/svm/sev.c             | 108 ++++++++++++++++++++---------
 arch/x86/kvm/svm/svm.c             |  37 +++-------
 arch/x86/kvm/svm/svm.h             |   7 +-
 5 files changed, 92 insertions(+), 62 deletions(-)

base-commit: c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9

Signature · 1 line
2.51.0.rc1.167.g924127e9c0-goog