Re: [PATCH 2/7] KVM: TDX: Implement TDX vcpu enter/exit path

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

 






On 11/22/2024 1:23 PM, Xiaoyao Li wrote:
[...]
+
+fastpath_t tdx_vcpu_run(struct kvm_vcpu *vcpu, bool force_immediate_exit)
+{
+    struct vcpu_tdx *tdx = to_tdx(vcpu);
+
+    /* TDX exit handle takes care of this error case. */
+    if (unlikely(tdx->state != VCPU_TD_STATE_INITIALIZED)) {
+        /* Set to avoid collision with EXIT_REASON_EXCEPTION_NMI. */

It seems the check fits better in tdx_vcpu_pre_run().

Indeed, it's cleaner to move the check to vcpu_pre_run.
Then no need to set the value to vp_enter_ret, and the comments are not
needed.


And without the patch of how TDX handles Exit (i.e., how deal with vp_enter_ret), it's hard to review this comment.

+        tdx->vp_enter_ret = TDX_SW_ERROR;
+        return EXIT_FASTPATH_NONE;
+    }
+
+    trace_kvm_entry(vcpu, force_immediate_exit);
+
+    tdx_vcpu_enter_exit(vcpu);
+
+    vcpu->arch.regs_avail &= ~VMX_REGS_LAZY_LOAD_SET;
+    trace_kvm_exit(vcpu, KVM_ISA_VMX);
+
+    return EXIT_FASTPATH_NONE;
+}
+
[...]




[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