x86/tsc: Init the TSC for Secure TSC guests
authorNikunj A Dadhania <nikunj@amd.com>
Mon, 6 Jan 2025 12:46:30 +0000 (18:16 +0530)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 8 Jan 2025 20:26:19 +0000 (21:26 +0100)
commit73bbf3b0fbba9aa27fef07a1fbd837661a863f03
tree5aed0ee86cb776b621cf53b4c98239f2997a1080
parent0a2a98f691f2c57db5bb321e68787cb1de29c7dd
x86/tsc: Init the TSC for Secure TSC guests

Use the GUEST_TSC_FREQ MSR to discover the TSC frequency instead of
relying on kvm-clock based frequency calibration.  Override both CPU and
TSC frequency calibration callbacks with securetsc_get_tsc_khz(). Since
the difference between CPU base and TSC frequency does not apply in this
case, the same callback is being used.

  [ bp: Carve out from
    https://lore.kernel.org/r/20250106124633.1418972-11-nikunj@amd.com ]

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-11-nikunj@amd.com
arch/x86/coco/sev/core.c
arch/x86/include/asm/sev.h
arch/x86/kernel/tsc.c