]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/sev: Add Secure TSC support for SNP guests
authorNikunj A Dadhania <nikunj@amd.com>
Mon, 6 Jan 2025 12:46:25 +0000 (18:16 +0530)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 7 Jan 2025 19:27:23 +0000 (20:27 +0100)
commit85b60ca9ad2c94661acf86a0c11278246cc5ea86
treedf4612da8afdc84e9de54174f7385d689126a0db
parent1e0b23b5d2d18b2bd2c66d8214072d700a8c350d
x86/sev: Add Secure TSC support for SNP guests

Add support for Secure TSC in SNP-enabled guests. Secure TSC allows guests
to securely use RDTSC/RDTSCP instructions, ensuring that the parameters used
cannot be altered by the hypervisor once the guest is launched.

Secure TSC-enabled guests need to query TSC information from the AMD Security
Processor. This communication channel is encrypted between the AMD Security
Processor and the guest, with the hypervisor acting merely as a conduit to
deliver the guest messages to the AMD Security Processor. Each message is
protected with AEAD (AES-256 GCM).

  [ bp: Zap a stray newline over amd_cc_platform_has() while at it,
    simplify CC_ATTR_GUEST_SNP_SECURE_TSC check ]

Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250106124633.1418972-6-nikunj@amd.com
arch/x86/coco/core.c
arch/x86/coco/sev/core.c
arch/x86/include/asm/sev-common.h
arch/x86/include/asm/sev.h
arch/x86/include/asm/svm.h
arch/x86/mm/mem_encrypt.c
include/linux/cc_platform.h