i386/tdx: Disable pmu for TD guest

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@intel.com>
This commit is contained in:
Xiaoyao Li
2024-01-26 02:10:32 -05:00
parent 4dc0aabacb
commit d2dd1f08ed

View File

@@ -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;