All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xuquan (Quan Xu)" <xuquan8@huawei.com>
To: Jan Beulich <JBeulich@suse.com>, KevinTian <kevin.tian@intel.com>,
	Chao Gao <chao.gao@intel.com>
Cc: "yang.zhang.wz@gmail.com" <yang.zhang.wz@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"quan.xu0@gmail.com" <quan.xu0@gmail.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/apicv: enhance posted-interrupt processing
Date: Thu, 23 Feb 2017 11:55:15 +0000	[thread overview]
Message-ID: <E0A769A898ADB6449596C41F51EF62C6AE8236@SZXEMI506-MBX.china.huawei.com> (raw)
In-Reply-To: <58AECF09020000780013D29A@prv-mh.provo.novell.com>

On February 23, 2017 7:01 PM, Jan Beulich wrote:
>>>> On 23.02.17 at 11:53, <xuquan8@huawei.com> wrote:
>> On February 23, 2017 5:59 PM, Jan Beulich wrote:
>>>>>> On 23.02.17 at 10:28, <xuquan8@huawei.com> wrote:
>>>> On February 18, 2017 12:33 AM, Jan Beulich wrote:
>>>>>>>> On 17.02.17 at 09:49, <chao.gao@intel.com> wrote:
>>>>>>>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())
>>>>>>>+ )
>>>>
>>>> Jan,
>>>>     could you help me present the definition of ' smp_processor_id()'
>and '
>>>> current' in __vmx_deliver_posted_interrupt() ? thanks..
>>>
>>>I'm afraid I don't understand the request.
>>
>> IOW,
>>  which vcpu does the 'current' refer to?
>>  which cpu does the ' smp_processor_id()' refer to?
>
>current: currently running vCPU

in a SMP machine, are there more than one currently running vCPU?
I think so, the condition "if ( running && (in_irq() || (v != current)) )", in __vmx_deliver_posted_interrupt() looks strange -- when vCPU is running, why to check ' v != current '..


>smp_processor_id(): processor ID of the CPU we're running on
>
I think if vcpu is running, ' cpu != smp_processor_id() ' should be true.


I think we could simplify __vmx_deliver_posted_interrupt():

   1. set VCPU_KICK_SOFTIRQ bit of v->processor.
   2. IF vcpu is running:
         - send_IPI
     ELSE
         - vcpu_kick


Thank you for your patience..
Quan



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

  reply	other threads:[~2017-02-23 11:55 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
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) [this message]
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=E0A769A898ADB6449596C41F51EF62C6AE8236@SZXEMI506-MBX.china.huawei.com \
    --to=xuquan8@huawei.com \
    --cc=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=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.