xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chao Gao <chao.gao@intel.com>
To: "Xuquan (Quan Xu)" <xuquan8@huawei.com>
Cc: "yang.zhang.wz@gmail.com" <yang.zhang.wz@gmail.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"quan.xu0@gmail.com" <quan.xu0@gmail.com>,
	Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH] x86/apicv: enhance posted-interrupt processing
Date: Fri, 17 Feb 2017 16:49:04 +0800	[thread overview]
Message-ID: <20170217084904.GA43546@skl-2s3.sh.intel.com> (raw)
In-Reply-To: <E0A769A898ADB6449596C41F51EF62C6AE6E44@SZXEMI506-MBX.china.huawei.com>

On Fri, Feb 17, 2017 at 09:37:45AM +0000, Xuquan (Quan Xu) wrote:
>From a589074281cc22a30ed75a5bccba60e83d2312a6 Mon Sep 17 00:00:00 2001
>From: Quan Xu <xuquan8@huawei.com>
>Date: Sat, 18 Feb 2017 09:27:37 +0800
>Subject: [PATCH] x86/apicv: enhance posted-interrupt processing
>
>If guest is already in non-root mode, an posted interrupt will
>be directly delivered to guest (leaving softirq being set w/o
>actually incurring a VM-Exit - breaking desired softirq behavior).
>Then further posted interrupts will skip the IPI, stay in PIR and
>not noted until another VM-Exit happens.
>
>Remove the softirq set. Actually since it's an optimization for
>less IPIs, check softirq_pending(cpu) directly instead of sticking
>to one bit only.
>
>Signed-off-by: Quan Xu <xuquan8@huawei.com>
>---
> xen/arch/x86/hvm/vmx/vmx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
>index 61925cf..3887c32 100644
>--- a/xen/arch/x86/hvm/vmx/vmx.c
>+++ b/xen/arch/x86/hvm/vmx/vmx.c
>@@ -1846,8 +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))
>-             && (cpu != smp_processor_id()) )
>+        if ( !softirq_pending(cpu) && (cpu != smp_processor_id()) )
HI, Quan.
Is there a situation that we need set VCPU_KICK_SOFTIRQ. For example,
after vmx_intr_assist(), a interrupt happened and its handler called this
function to deliver interrupt to current vcpu. In that case, the interrupt
would not be injected to guest before this VM-entry for we don't generate a
softirq and don't send a self-IPI to current vcpu.

Thanks,
Chao
>             send_IPI_mask(cpumask_of(cpu), posted_intr_vector);
>     }
> }
>--
>1.8.3.1



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

  reply	other threads:[~2017-02-17  8:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  9:37 [PATCH] x86/apicv: enhance posted-interrupt processing Xuquan (Quan Xu)
2017-02-17  8:49 ` Chao Gao [this message]
2017-02-17 16:32   ` Jan Beulich
2017-02-20 11:25     ` Xuquan (Quan Xu)
2017-02-20  8:24       ` Chao Gao
2017-02-21  2:49         ` Xuquan (Quan Xu)
2017-02-21  3:07           ` Tian, Kevin
2017-02-21  4:11             ` Xuquan (Quan Xu)
2017-02-20 21:54               ` Chao Gao
2017-02-21  6:19                 ` Xuquan (Quan Xu)
2017-02-21  9:08                   ` Jan Beulich
2017-02-21  9:44               ` Tian, Kevin
2017-02-23  9:28     ` Xuquan (Quan Xu)
2017-02-23  9:59       ` Jan Beulich
2017-02-23 10:53         ` Xuquan (Quan Xu)
2017-02-23 11:01           ` Jan Beulich
2017-02-23 11:55             ` Xuquan (Quan Xu)
2017-02-23  8:37               ` Chao Gao
2017-02-27  8:00                 ` Xuquan (Quan Xu)
2017-02-23 12:26               ` Jan Beulich
2017-02-24  8:02                 ` Xuquan (Quan Xu)
2017-02-24  8:20                   ` Jan Beulich

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=20170217084904.GA43546@skl-2s3.sh.intel.com \
    --to=chao.gao@intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).