[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 09/44] target/i386: kvm: don't synchronize guest tsc for T
From: |
isaku . yamahata |
Subject: |
[RFC PATCH v2 09/44] target/i386: kvm: don't synchronize guest tsc for TD guest |
Date: |
Wed, 7 Jul 2021 17:54:39 -0700 |
From: Isaku Yamahata <isaku.yamahata@intel.com>
Make kvm_synchronize_all_tsc() nop for TD-guest.
TDX module specification, 9.11.1 TSC Virtualization
"Virtual TSC values are consistent among all the TD;s VCPUs at the
level suppored by the CPU".
There is no need for qemu to synchronize tsc and VMM can't access
to guest TSC. Actually do_kvm_synchronize_tsc() hits assert due to
failure to write to guest tsc.
> qemu/target/i386/kvm.c:235: kvm_get_tsc: Assertion `ret == 1' failed.
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
target/i386/kvm/kvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index c29cb420a1..ecb1714920 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -254,7 +254,7 @@ void kvm_synchronize_all_tsc(void)
{
CPUState *cpu;
- if (kvm_enabled()) {
+ if (kvm_enabled() && vm_type != KVM_X86_TDX_VM) {
CPU_FOREACH(cpu) {
run_on_cpu(cpu, do_kvm_synchronize_tsc, RUN_ON_CPU_NULL);
}
--
2.25.1
- Re: [RFC PATCH v2 02/44] kvm: Switch KVM_CAP_READONLY_MEM to a per-VM ioctl(), (continued)
- [RFC PATCH v2 29/44] target/i386: Add machine option to disable PIC/8259, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 30/44] qom: implement property helper for sha384, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 31/44] target/i386/tdx: Allows mrconfigid/mrowner/mrownerconfig for TDX_INIT_VM, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 03/44] i386/kvm: Move architectural CPUID leaf generation to separarte helper, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 01/44] target/i386: Expose x86_cpu_get_supported_feature_word() for TDX, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 13/44] i386/tdx: Frame in tdx_get_supported_cpuid with KVM_TDX_CAPABILITIES, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 33/44] qmp: add query-tdx-capabilities query-tdx command, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 10/44] hw/i386: Initialize TDX via KVM ioctl() when kvm_type is TDX, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 09/44] target/i386: kvm: don't synchronize guest tsc for TD guest,
isaku . yamahata <=
- [RFC PATCH v2 32/44] tdx: add kvm_tdx_enabled() accessor for later use, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 12/44] target/i386/tdx: Finalize the TD's measurement when machine is done, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 35/44] ioapic: add property to disable level interrupt, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 38/44] hw/i386: plug eoi_intercept_unsupported to ioapic, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 04/44] vl: Introduce machine_init_done_late notifier, isaku . yamahata, 2021/07/07
- [RFC PATCH v2 08/44] i386/kvm: Skip KVM_X86_SETUP_MCE for TDX guests, isaku . yamahata, 2021/07/07