public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] Enable Secure TSC for SEV-SNP
@ 2024-08-29  5:37 Nikunj A Dadhania
  2024-08-29  5:37 ` [RFC PATCH 1/5] x86/cpufeatures: Add SNP Secure TSC Nikunj A Dadhania
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Nikunj A Dadhania @ 2024-08-29  5:37 UTC (permalink / raw)
  To: seanjc, pbonzini, kvm
  Cc: thomas.lendacky, santosh.shukla, bp, ketanch, nikunj

TSC value calculations for the guest are controlled by the hypervisor. A
malicious hypervisor can prevent guest from moving forward. The Secure TSC
feature for SEV-SNP allows guests to securely use the RDTSC and RDTSCP
instructions. This ensures the guest gets a consistent view of time and
prevents a malicious hypervisor from making it appear that time rolls
backwards, advancing at an unusually fast rate, or employing similar tricks.
For more details, please refer to "Secure Nested Paging (SEV-SNP)" section,
subsection "Secure TSC" of APM Volume 2

This patchset is also available at:

  https://github.com/AMDESE/linux-kvm/tree/sectsc-host-latest

and is based on v6.11-rc5

Testing SecureTSC
-----------------
 
SecureTSC Guest patches:
https://github.com/AMDESE/linux-kvm/tree/sectsc-guest-latest
 
QEMU changes:
https://github.com/nikunjad/qemu/tree/snp-securetsc-latest
 
QEMU commandline SEV-SNP with SecureTSC:
 
  qemu-system-x86_64 -cpu EPYC-Milan-v2 -smp 4 \
     -object memory-backend-memfd,id=ram1,size=1G,share=true,prealloc=false,reserve=false \
     -object sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1,secure-tsc=on \
     -machine q35,confidential-guest-support=sev0,memory-backend=ram1 \
     ...

Ketan Chaturvedi (2):
  KVM: SVM: Set TSC frequency for SecureTSC-enabled guests
  KVM: SVM: Add Secure TSC support for SNP Guest

Nikunj A Dadhania (3):
  x86/cpufeatures: Add SNP Secure TSC
  KVM: SVM: Add GUEST_TSC_FREQ MSR
  KVM: SVM: Prevent writes to TSC MSR when Secure TSC is enabled

 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/include/asm/msr-index.h   |  1 +
 arch/x86/include/asm/svm.h         |  1 +
 arch/x86/include/uapi/asm/kvm.h    |  3 ++-
 arch/x86/kvm/svm/sev.c             | 15 +++++++++++++++
 arch/x86/kvm/svm/svm.c             | 12 ++++++++++++
 arch/x86/kvm/svm/svm.h             | 14 +++++++++++++-
 include/linux/psp-sev.h            |  2 ++
 8 files changed, 47 insertions(+), 2 deletions(-)


base-commit: 5be63fc19fcaa4c236b307420483578a56986a37
-- 
2.34.1


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

end of thread, other threads:[~2024-11-22  0:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29  5:37 [RFC PATCH 0/5] Enable Secure TSC for SEV-SNP Nikunj A Dadhania
2024-08-29  5:37 ` [RFC PATCH 1/5] x86/cpufeatures: Add SNP Secure TSC Nikunj A Dadhania
2024-08-29 13:22   ` Borislav Petkov
2024-09-02  4:16     ` Nikunj A. Dadhania
2024-09-02 16:42       ` Borislav Petkov
2024-09-03  5:43         ` Nikunj A. Dadhania
2024-09-03  7:16           ` Borislav Petkov
2024-08-29  5:37 ` [RFC PATCH 2/5] KVM: SVM: Set TSC frequency for SecureTSC-enabled guests Nikunj A Dadhania
2024-08-29  5:37 ` [RFC PATCH 3/5] KVM: SVM: Add GUEST_TSC_FREQ MSR Nikunj A Dadhania
2024-08-29  5:37 ` [RFC PATCH 4/5] KVM: SVM: Prevent writes to TSC MSR when Secure TSC is enabled Nikunj A Dadhania
2024-08-29  5:37 ` [RFC PATCH 5/5] KVM: SVM: Add Secure TSC support for SNP Guest Nikunj A Dadhania
2024-11-22  0:41 ` [RFC PATCH 0/5] Enable Secure TSC for SEV-SNP Isaku Yamahata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox