From: Chao Gao <chao.gao@intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v11 1/6] passthrough: don't migrate pirq when it is delivered through VT-d PI
Date: Fri, 31 Mar 2017 07:10:39 +0800 [thread overview]
Message-ID: <20170330231039.GB13934@skl-2s3.sh.intel.com> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D190C878FE@SHSMSX101.ccr.corp.intel.com>
On Fri, Mar 31, 2017 at 01:28:02PM +0800, Tian, Kevin wrote:
>> From: Chao Gao
>> Sent: Wednesday, March 29, 2017 1:12 PM
>>
>> When a vCPU migrated to another pCPU, pt irqs binded to this vCPU also
>> needed migration. When VT-d PI is enabled, interrupt vector will be recorded
>> to a main memory resident data-structure and a notification whose
>> destination is decided by NDST is generated. NDST is properly adjusted
>> during vCPU migration so pirq directly injected to guest needn't be migrated.
>>
>> This patch adds a indicator, @posted, to show whether the pt irq is delivered
>> through VT-d PI.
>>
>> Signed-off-by: Chao Gao <chao.gao@intel.com>
>>
>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index
>> 0282986..2d8de16 100644
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -438,6 +438,9 @@ static int hvm_migrate_pirq(struct domain *d, struct
>> hvm_pirq_dpci *pirq_dpci,
>> struct vcpu *v = arg;
>>
>> if ( (pirq_dpci->flags & HVM_IRQ_DPCI_MACH_MSI) &&
>> + (pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI) &&
>> + /* Needn't migrate pirq if this pirq is delivered to guest directly.*/
>> + (!pirq_dpci->gmsi.posted) &&
>> (pirq_dpci->gmsi.dest_vcpu_id == v->vcpu_id) )
>
>simply looking at above change it's more than what you intend to change.
>Previously even w/o GUEST_MSI flag will fall into that path, but now
>you limit it to only GUEST_MSI and irq remapping (i.e. changed the
>behavior for both posted case and w/o GUEST_MSI case). I haven't looked
>whether MACH_MASI always set with GUEST_MSI, but my gut-feeling
>looks not correct here.
Yes. It's a problem. I think the original code may be wrong for it acquires
gmsi.dest_vcpu_id without checking 'flags' of pirq_dpci. Do we need to migrate
pirq when its type is GUEST_PCI?
Thanks
Chao
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-03-30 23:10 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 5:11 [PATCH v11 0/6] VMX: Properly handle pi descriptor and per-cpu blocking list Chao Gao
2017-03-29 5:11 ` [PATCH v11 1/6] passthrough: don't migrate pirq when it is delivered through VT-d PI Chao Gao
2017-03-31 5:28 ` Tian, Kevin
2017-03-30 23:10 ` Chao Gao [this message]
2017-03-31 10:27 ` Jan Beulich
2017-03-31 9:31 ` Jan Beulich
2017-03-31 2:42 ` Chao Gao
2017-03-31 10:06 ` Jan Beulich
2017-03-31 3:27 ` Chao Gao
2017-03-31 10:38 ` Jan Beulich
2017-04-05 0:20 ` Chao Gao
2017-04-05 8:03 ` Jan Beulich
2017-03-29 5:11 ` [PATCH v11 2/6] VT-d: Introduce new fields in msi_desc to track binding with guest interrupt Chao Gao
2017-03-31 5:46 ` Tian, Kevin
2017-03-30 23:01 ` Chao Gao
2017-03-31 8:11 ` Jan Beulich
2017-03-31 1:13 ` Chao Gao
2017-03-31 9:48 ` Jan Beulich
2017-03-29 5:11 ` [PATCH v11 3/6] VT-d: Some cleanups Chao Gao
2017-03-29 5:11 ` [PATCH v11 4/6] VMX: Fixup PI descriptor when cpu is offline Chao Gao
2017-03-29 5:11 ` [PATCH v11 5/6] VT-d: introduce update_irte to update irte safely Chao Gao
2017-03-31 6:03 ` Tian, Kevin
2017-03-31 10:01 ` Jan Beulich
2017-04-04 19:12 ` Chao Gao
2017-04-05 7:40 ` Jan Beulich
2017-03-29 5:11 ` [PATCH v11 6/6] passthrough/io: Fall back to remapping interrupt when we can't use VT-d PI Chao Gao
2017-03-31 5:13 ` [PATCH v11 0/6] VMX: Properly handle pi descriptor and per-cpu blocking list 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=20170330231039.GB13934@skl-2s3.sh.intel.com \
--to=chao.gao@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xen.org \
/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).