]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/tdx: Set APIC bus rate to match with what TDX module enforces
authorXiaoyao Li <xiaoyao.li@intel.com>
Thu, 8 May 2025 14:59:20 +0000 (10:59 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 28 May 2025 17:01:41 +0000 (19:01 +0200)
commitd529a2ac5ef4620173439942f78ec668f9165fc1
treec887c0fb2a802431af171c4adb981e882df06483
parentd05a0858cf876f79b57a622716fbad07f5b2ea08
i386/tdx: Set APIC bus rate to match with what TDX module enforces

TDX advertises core crystal clock with cpuid[0x15] as 25MHz for TD
guests and it's unchangeable from VMM. As a result, TDX guest reads
the APIC timer at the same frequency, 25MHz.

While KVM's default emulated frequency for APIC bus is 1GHz, set the
APIC bus rate to match with TDX explicitly to ensure KVM provide correct
emulated APIC timer for TD guest.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250508150002.689633-15-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/kvm/tdx.c
target/i386/kvm/tdx.h