[PATCH v5 28/65] i386/tdx: Disable pmu for TD guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Current KVM doesn't support PMU for TD guest. It returns error if TD is
created with PMU bit being set in attributes.

Disable PMU for TD guest on QEMU side.

Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>
---
 target/i386/kvm/tdx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
index 262e86fd2c67..1c12cda002b8 100644
--- a/target/i386/kvm/tdx.c
+++ b/target/i386/kvm/tdx.c
@@ -496,6 +496,8 @@ int tdx_pre_create_vcpu(CPUState *cpu, Error **errp)
     g_autofree struct kvm_tdx_init_vm *init_vm = NULL;
     int r = 0;
 
+    object_property_set_bool(OBJECT(cpu), "pmu", false, &error_abort);
+
     QEMU_LOCK_GUARD(&tdx_guest->lock);
     if (tdx_guest->initialized) {
         return r;
-- 
2.34.1





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux