]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/cpufeatures: Add SNP Secure TSC
authorNikunj A Dadhania <nikunj@amd.com>
Tue, 19 Aug 2025 23:48:28 +0000 (16:48 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 21 Aug 2025 15:44:49 +0000 (08:44 -0700)
The Secure TSC feature for SEV-SNP allows guests to securely use the RDTSC
and RDTSCP instructions, ensuring that the parameters used cannot be
altered by the hypervisor once the guest is launched. For more details,
refer to the AMD64 APM Vol 2, Section "Secure TSC".

Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Vaishali Thakkar <vaishali.thakkar@suse.com>
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Link: https://lore.kernel.org/r/20250819234833.3080255-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/cpufeatures.h

index 06fc0479a23f01e5a65526fc185713294013f793..f53d4943ea63dcb64d9b1c434fd790c773d66318 100644 (file)
 #define X86_FEATURE_VM_PAGE_FLUSH      (19*32+ 2) /* VM Page Flush MSR is supported */
 #define X86_FEATURE_SEV_ES             (19*32+ 3) /* "sev_es" Secure Encrypted Virtualization - Encrypted State */
 #define X86_FEATURE_SEV_SNP            (19*32+ 4) /* "sev_snp" Secure Encrypted Virtualization - Secure Nested Paging */
+#define X86_FEATURE_SNP_SECURE_TSC     (19*32+ 8) /* SEV-SNP Secure TSC */
 #define X86_FEATURE_V_TSC_AUX          (19*32+ 9) /* Virtual TSC_AUX */
 #define X86_FEATURE_SME_COHERENT       (19*32+10) /* hardware-enforced cache coherency */
 #define X86_FEATURE_DEBUG_SWAP         (19*32+14) /* "debug_swap" SEV-ES full debug state swap support */