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

Re: [Xen-devel] [PATCH v9 15/17] vmx: VT-d posted-interrupt core logic handling



On Tue, 2015-11-03 at 09:07 +0000, Wu, Feng wrote:
> BTW, In the previous discussion, we will do the PI state adjustment
> in vmx_do_resume, however, seems this is not a good place to do this,
> since this function gets called only if the scheduling occurs, no
> matter it switches to another vCPU or continue runs the current vCPU.
> If no scheduling happens during "VM->Xen->VM", vmx-do_resume() will
> not get called. 
>
Mmm... When I first read this, it seemed to me to be a good thing, and
a reason for actually putting your logic in there (that would avoid
paying the price of going through it during every VMENTRY, which you
were yourself hesitant about)!

So, maybe I'm missing/misremembering something. Just to be sure, can
you tell me...

> So I put the PI state adjustment code in vmx_vmenter_helper(), if you
> have any other good suggestions, please let me know, thanks a lot!
> 
... what is the reason(s) why you need to do the update even if no
scheduling happened?

Looking at the code again, I think one reason may be to cope with when
vcpu_block() is called, but then local_events_need_delivery() returns
true, as shown here below:

void vcpu_block(void)
{
    struct vcpu *v = current;

    set_bit(_VPF_blocked, &v->pause_flags);

    arch_vcpu_block(v);                             // nv <--- pi_wakeup_vector

    /* Check for events /after/ blocking: avoids wakeup waiting race. */
    if ( local_events_need_delivery() )             // <=== TRUE
        clear_bit(_VPF_blocked, &v->pause_flags);
                                                    // we want nv == 
posted_intr_vector,
                                                       so we need 
vmx_pi_state_change()
                                                       to run, even if we're 
not scheduling
}

Is this the case?

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.