> @e -875,6 +876,13 @@ static int tdx_check_features(X86ConfidentialGuest *cg, > CPUState *cs) > return -1;
Here you has already used "return -1", so... > } > > + if (cpu->phys_bits != host_cpu_phys_bits()) { > + error_report("TDX requires guest CPU physical bits (%u) " > + "to match host CPU physical bits (%u)", > + cpu->phys_bits, host_cpu_phys_bits()); > + exit(1); ...what about "return -1"? kvm_init_vcpu() missed a "goto err", but it is not a big deal: diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 9862d8ff1d38..05034f622f20 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -595,6 +595,7 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) error_setg_errno(errp, -ret, "kvm_init_vcpu: kvm_arch_init_vcpu failed (%lu)", kvm_arch_vcpu_id(cpu)); + goto err; } cpu->kvm_vcpu_stats_fd = kvm_vcpu_ioctl(cpu, KVM_GET_STATS_FD, NULL); --- Overall, LGTM, Reviewed-by: Zhao Liu <zhao1....@intel.com> > + } > + > return 0; > } > > -- > 2.34.1 > >