All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Chao Gao <chao.gao@intel.com>
Cc: yang.zhang.wz@gmail.com, "Xuquan (Quan Xu)" <xuquan8@huawei.com>,
	quan.xu0@gmail.com, Andrew Cooper <andrew.cooper3@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>,
	xen-devel@lists.xen.org, Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH v3] x86/apicv: Enhance posted-interrupt processing
Date: Thu, 02 Mar 2017 05:03:11 -0700	[thread overview]
Message-ID: <58B8180F020000780013F372@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20170302042806.GA12584@skl-2s3.sh.intel.com>

>>> On 02.03.17 at 05:28, <chao.gao@intel.com> wrote:
> On Thu, Mar 02, 2017 at 02:41:55AM -0700, Jan Beulich wrote:
>>>>> On 02.03.17 at 02:49, <chao.gao@intel.com> wrote:
>>
>>The patch title, btw, makes it looks like this isn't a bug fix, which is
>>contrary to the understanding I've gained so far.
> 
> Thanks to your patience and your changing so much description for me. Also 
> to the questions you asked. I agree to the comments i don't reply to.
> How about this:
> Fix a wrongly IPI suppression during posted interrupt delivery

fix wrong IPI suppression during posted interrupt delivery

>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -1842,13 +1842,59 @@ static void __vmx_deliver_posted_interrupt(struct vcpu *v)
>>>      bool_t running = v->is_running;
>>>  
>>>      vcpu_unblock(v);
>>> +    /*
>>> +     * The underlying 'IF' excludes two cases which we don't need further
>>
>>Who or what is 'IF'?
>>
> 
> I meaned the 'if sentence'.

I'm sorry, but this doesn't make it any more clear. DYM some if()
statement? But then why "underlying"? Was that meant to be
"following"?

>>> +     * operation to make sure the target vCPU (@v) will sync PIR to vIRR ASAP.
>>> +     * Specifically, the two cases are:
>>> +     * 1. The target vCPU is not running, meaning it is blocked or runnable.
>>> +     * Since we have unblocked the target vCPU above, the target vCPU will
>>> +     * sync PIR to vIRR when it is chosen to run.
>>> +     * 2. The target vCPU is the current vCPU and in_irq() is false. It means
>>> +     * the function is called in noninterrupt context.
>>
>>     * 2. The target vCPU is the current vCPU and we're in
>>     * non-interrupt context.
>>
>>> Since we don't call
>>> +     * the function in noninterrupt context after the last time a vCPU syncs
>>> +     * PIR to vIRR, excluding this case is also safe.
>>
>>It is not really clear to me what "the function" here refers to. Surely
>>the function the comment is in won't call itself, no matter what
>>context.
> 
> Yes, it is not clear. How about:
> The target vCPU is the current vCPU and we're in non-interrupt context.
> we can't be in the window between the call to vmx_intr_assist()

"we can't be" looks misleading. Perhaps "We're not being called from
the window ..."?

> and interrupts getting disabled since no existed code reachs here in
> non-interrupt context. Considering that, it is safe to just leave without
> further operation. 
> 
> Do you think this is correct? I have an assumption here to explain why
> (in_irq() || (v != current)) is reasonable. It is totally my guess.

As suggested earlier, feel free to simply refer to vcpu_kick() doing
the same.

Jan


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

  reply	other threads:[~2017-03-02 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  1:49 [PATCH v3] x86/apicv: Enhance posted-interrupt processing Chao Gao
2017-03-02  9:41 ` Jan Beulich
2017-03-02  4:28   ` Chao Gao
2017-03-02 12:03     ` Jan Beulich [this message]
2017-03-03  8:01     ` Tian, Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58B8180F020000780013F372@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chao.gao@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=quan.xu0@gmail.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xuquan8@huawei.com \
    --cc=yang.zhang.wz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.