diff options
author | Isaku Yamahata <isaku.yamahata@intel.com> | 2025-05-08 10:59:45 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-28 19:35:54 +0200 |
commit | 0ed55865b49b703af93e160d48935812a7114e07 (patch) | |
tree | b73da0bec7de601bd7df6a8617f8a66467ade08e | |
parent | bb45580d842530d78b58179eaf80b6331b15324e (diff) | |
download | qemu-0ed55865b49b703af93e160d48935812a7114e07.zip qemu-0ed55865b49b703af93e160d48935812a7114e07.tar.gz qemu-0ed55865b49b703af93e160d48935812a7114e07.tar.bz2 |
i386/tdx: Don't synchronize guest tsc for TDs
TSC of TDs is not accessible and KVM doesn't allow access of
MSR_IA32_TSC for TDs. To avoid the assert() in kvm_get_tsc, make
kvm_synchronize_all_tsc() noop for TDs,
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Reviewed-by: Connor Kuehl <ckuehl@redhat.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250508150002.689633-40-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | target/i386/kvm/kvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index ee33797..4fc37cc 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -328,7 +328,7 @@ void kvm_synchronize_all_tsc(void) { CPUState *cpu; - if (kvm_enabled()) { + if (kvm_enabled() && !is_tdx_vm()) { CPU_FOREACH(cpu) { run_on_cpu(cpu, do_kvm_synchronize_tsc, RUN_ON_CPU_NULL); } |