From: Chao Gao <chao.gao@intel.com>
To: xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>,
Jan Beulich <jbeulich@suse.com>, Chao Gao <chao.gao@intel.com>
Subject: [PATCH v10 6/6] passthrough/io: Fall back to remapping interrupt when we can't use VT-d PI
Date: Wed, 15 Mar 2017 13:11:22 +0800 [thread overview]
Message-ID: <1489554682-6126-7-git-send-email-chao.gao@intel.com> (raw)
In-Reply-To: <1489554682-6126-1-git-send-email-chao.gao@intel.com>
The current logic of using VT-d pi is when guest configurates the pirq's
destination vcpu to a single vcpu, the according IRTE is updated to
posted format. If the destination of the pirq is multiple vcpus, we just use
interrupt remapping. Obviously, we should fall back to remapping interrupt
when guest wrongly configurate destination of pirq or makes it have
multi-destination vcpus.
Signed-off-by: Chao Gao <chao.gao@intel.com>
---
v10:
- Newly added
xen/drivers/passthrough/io.c | 9 +--------
xen/drivers/passthrough/vtd/intremap.c | 2 +-
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 37d9af6..be06b10 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -457,14 +457,7 @@ int pt_irq_create_bind(
/* Use interrupt posting if it is supported. */
if ( iommu_intpost )
- {
- if ( vcpu )
- pi_update_irte(vcpu, info, pirq_dpci->gmsi.gvec);
- else
- dprintk(XENLOG_G_INFO,
- "%pv: deliver interrupt in remapping mode,gvec:%02x\n",
- vcpu, pirq_dpci->gmsi.gvec);
- }
+ pi_update_irte(vcpu, info, pirq_dpci->gmsi.gvec);
break;
}
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 342b45f..331c7d5 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -946,7 +946,7 @@ int pi_update_irte(const struct vcpu *v, const struct pirq *pirq,
{
struct irq_desc *desc;
struct msi_desc *msi_desc;
- const struct pi_desc *pi_desc = &v->arch.hvm_vmx.pi_desc;
+ const struct pi_desc *pi_desc = v ? &v->arch.hvm_vmx.pi_desc : NULL;
int rc;
desc = pirq_spin_lock_irq_desc(pirq, NULL);
--
1.8.3.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-03-15 5:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 5:11 [PATCH v10 0/6] VMX: Properly handle pi descriptor and per-cpu blocking list Chao Gao
2017-03-15 5:11 ` [PATCH v10 1/6] VT-d: Introduce new fields in msi_desc to track binding with guest interrupt Chao Gao
2017-03-15 16:41 ` Jan Beulich
2017-03-15 21:21 ` Chao Gao
2017-03-16 10:24 ` Jan Beulich
2017-03-22 5:59 ` Tian, Kevin
2017-03-22 0:18 ` Chao Gao
2017-03-22 8:32 ` Tian, Kevin
2017-03-15 5:11 ` [PATCH v10 2/6] VT-d: Some cleanups Chao Gao
2017-03-15 5:11 ` [PATCH v10 3/6] VMX: Fixup PI descriptor when cpu is offline Chao Gao
2017-03-15 5:11 ` [PATCH v10 4/6] VT-d: introduce update_irte to update irte safely Chao Gao
2017-03-15 16:48 ` Jan Beulich
2017-03-15 22:39 ` Chao Gao
2017-03-16 10:29 ` Jan Beulich
2017-03-17 1:52 ` Chao Gao
2017-03-17 9:08 ` Jan Beulich
2017-03-22 6:26 ` Tian, Kevin
2017-03-24 8:44 ` Tian, Kevin
2017-03-15 5:11 ` [PATCH v10 5/6] passthrough/io: don't migrate pirq when it is delivered through VT-d PI Chao Gao
2017-03-17 10:43 ` Jan Beulich
2017-03-20 1:59 ` Chao Gao
2017-03-20 9:18 ` Jan Beulich
2017-03-20 2:38 ` Chao Gao
2017-03-20 10:26 ` Jan Beulich
2017-03-20 5:22 ` Chao Gao
2017-03-20 12:50 ` Jan Beulich
2017-03-20 6:11 ` Chao Gao
2017-03-15 5:11 ` Chao Gao [this message]
2017-03-17 10:48 ` [PATCH v10 6/6] passthrough/io: Fall back to remapping interrupt when we can't use " Jan Beulich
2017-03-22 6:34 ` 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=1489554682-6126-7-git-send-email-chao.gao@intel.com \
--to=chao.gao@intel.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).