All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Xuquan (Quan Xu)" <xuquan8@huawei.com>
Cc: "yang.zhang.wz@gmail.com" <yang.zhang.wz@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Chao Gao <chao.gao@intel.com>
Subject: Re: [xen-unstable test] 104131: regressions - FAIL
Date: Wed, 08 Feb 2017 01:52:01 -0700	[thread overview]
Message-ID: <589AEA41020000780013798C@prv-mh.provo.novell.com> (raw)
In-Reply-To: <E0A769A898ADB6449596C41F51EF62C6AE5466@SZXEMI506-MBX.china.huawei.com>

>>> On 08.02.17 at 09:27, <xuquan8@huawei.com> wrote:
> Assumed vCPU is in guest_mode..
> When apicv is enabled, hypervisor calls vmx_deliver_posted_intr(), then 
> __vmx_deliver_posted_interrupt() to deliver interrupt, but no vmexit (also no 
> vcpu_kick() )..
> In __vmx_deliver_posted_interrupt(), it is __conditional__ to deliver posted 
> interrupt. if posted interrupt is not delivered, the posted interrupt is 
> pending until next VM entry -- by PIR to vIRR.. 
> 
> one condition is :
> In __vmx_deliver_posted_interrupt(),  ' if ( 
> !test_and_set_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))' ..
> 
> Specifically, we did verify it by RES interrupt, which is used for 
> smp_reschedule_interrupt..
> We even cost more time to deliver RES interrupt than no-apicv in average..
> 
> If RES interrupt (no. 1) is delivered by posted way (the vcpu is still 
> guest_mode).. when tries to deliver next-coming RES interrupt (no. 2) by 
> posted way,
> The next-coming RES interrupt (no. 2) is not delivered, as we set the 
> VCPU_KICK_SOFTIRQ bit when we deliver RES interrupt (no. 1)..
> 
> Then the next-coming RES interrupt (no. 2) is pending until next VM entry -- by 
> PIR to vIRR..
> 
> 
> We can fix it as below(I don't think this is a best one, it is better to set 
> the VCPU_KICK_SOFTIRQ bit, but not test it):
> 
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -1846,7 +1846,7 @@ static void __vmx_deliver_posted_interrupt(struct vcpu *v)
>      {
>          unsigned int cpu = v->processor;
> 
> -        if ( !test_and_set_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))
> +        if ( !test_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))
>               && (cpu != smp_processor_id()) )
>              send_IPI_mask(cpumask_of(cpu), posted_intr_vector);
>      }

While I don't think I fully understand your description, the line you
change here has always been puzzling me: If we were to raise a
softirq here, we ought to call cpu_raise_softirq() instead of partly
open coding what it does. So I think not marking that softirq
pending (but doing this incompletely) is a valid change in any case.
But I'll have to defer to Kevin in the hopes that he fully
understands what you explain above as well as him knowing why
this was a test-and-set here in the first place.

Jan


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

  reply	other threads:[~2017-02-08  8:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  6:46 [xen-unstable test] 104131: regressions - FAIL osstest service owner
2017-01-12  9:14 ` Andrew Cooper
2017-01-12 12:07   ` Xuquan (Quan Xu)
2017-01-12  9:04     ` Chao Gao
2017-01-12 12:15     ` Andrew Cooper
2017-01-12 12:25       ` Jan Beulich
2017-01-16  5:25         ` Tian, Kevin
2017-01-16  6:27           ` Xuquan (Quan Xu)
2017-01-16  0:06             ` Chao Gao
2017-01-16 11:00           ` Jan Beulich
2017-01-18  4:57             ` Tian, Kevin
2017-01-18  9:38               ` Jan Beulich
2017-01-18 10:23                 ` Tian, Kevin
2017-01-20 11:48                   ` Jan Beulich
2017-01-22  4:35                     ` Tian, Kevin
2017-01-23 10:33                       ` Jan Beulich
2017-01-20  8:47                 ` Xuquan (Quan Xu)
2017-01-20  8:56                   ` Jan Beulich
2017-01-20  9:08           ` Xuquan (Quan Xu)
2017-01-23 10:56           ` Xuquan (Quan Xu)
2017-02-08  6:51             ` Tian, Kevin
2017-02-08  8:27               ` Xuquan (Quan Xu)
2017-02-08  8:52                 ` Jan Beulich [this message]
2017-02-08 10:15                   ` Xuquan (Quan Xu)
2017-02-08  8:22                     ` Chao Gao
2017-02-09  8:51                       ` Xuquan (Quan Xu)
2017-02-09  3:41                         ` Chao Gao
2017-02-13  8:21                   ` Tian, Kevin
2017-02-20 12:04                     ` Xuquan (Quan Xu)
2017-02-21  3:17                       ` Tian, Kevin
2017-02-13  8:23                   ` Tian, Kevin
2017-02-14  1:22                     ` Xuquan (Quan Xu)

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=589AEA41020000780013798C@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chao.gao@intel.com \
    --cc=kevin.tian@intel.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.