lkml.org 
[lkml]   [2024]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v19 091/130] KVM: TDX: remove use of struct vcpu_vmx from posted_interrupt.c
    On Mon, Feb 26, 2024 at 12:26:33AM -0800, isaku.yamahata@intel.com wrote:
    >@@ -190,7 +211,8 @@ static bool vmx_needs_pi_wakeup(struct kvm_vcpu *vcpu)
    > * notification vector is switched to the one that calls
    > * back to the pi_wakeup_handler() function.
    > */
    >- return vmx_can_use_ipiv(vcpu) || vmx_can_use_vtd_pi(vcpu->kvm);
    >+ return (vmx_can_use_ipiv(vcpu) && !is_td_vcpu(vcpu)) ||
    >+ vmx_can_use_vtd_pi(vcpu->kvm);

    It is better to separate this functional change from the code refactoring.

    > }
    >
    > void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu)
    >@@ -200,7 +222,8 @@ void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu)
    > if (!vmx_needs_pi_wakeup(vcpu))
    > return;
    >
    >- if (kvm_vcpu_is_blocking(vcpu) && !vmx_interrupt_blocked(vcpu))
    >+ if (kvm_vcpu_is_blocking(vcpu) &&
    >+ (is_td_vcpu(vcpu) || !vmx_interrupt_blocked(vcpu)))

    Ditto.

    This looks incorrect to me. here we assume interrupt is always enabled for TD.
    But on TDVMCALL(HLT), the guest tells KVM if hlt is called with interrupt
    disabled. KVM can just check that interrupt status passed from the guest.

    > pi_enable_wakeup_handler(vcpu);
    >

    \
     
     \ /
      Last update: 2024-05-27 16:13    [W:5.777 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site