From: Quan Xu <quan.xu@intel.com>
To: xen-devel@lists.xen.org
Cc: kevin.tian@intel.com, feng.wu@intel.com, jbeulich@suse.com,
dario.faggioli@citrix.com, Quan Xu <quan.xu@intel.com>
Subject: [PATCH v9 0/3] VT-d Device-TLB flush issue
Date: Fri, 1 Apr 2016 22:47:36 +0800 [thread overview]
Message-ID: <1459522059-102365-1-git-send-email-quan.xu@intel.com> (raw)
This patches fix current timeout concern and also allow limited ATS support:
1. Add a command line parameter for Queued Invalidation
The command line parameter 'vtd_qi_timeout' specifies the
timeout of the VT-d Queued Invalidation in milliseconds. By
default, the timeout is 1ms, which can be boot-time changed.
Add a __must_check annotation. The followup patch titled
'VT-d IOTLB/Context/IEC flush issue' addresses the __mustcheck.
That is the other callers of this routine (two or three
levels up) ignore the return code. This patch does not
address this but the other does.
2. wrap a _sync version for all VT-d flush interfaces
The dev_invalidate_iotlb() scans ats_devices list to flush ATS devices,
and the invalidate_sync() is put after dev_invalidate_iotlb() to
synchronize with hardware for flush status. If we assign multiple
ATS devices to a domain, the flush status is about all these multiple
ATS devices. Once flush timeout expires, we couldn't find out which
one is the buggy ATS device.
Then, The invalidate_sync() variant (We need to pass down the device's
SBDF to hide the ATS device) is put within dev_invalidate_iotlb() to
synchronize for the flush status one by one. If flush timeout expires,
we could find out the buggy ATS device and hide it. However, for other
VT-d flush interfaces, the invalidate_sync() is still put after at present.
This is inconsistent.
So we wrap a _sync version for all VT-d flush interfaces. It simplifies
caller logic and makes code more readable as well.
3. Fix vt-d Device-TLB flush timeout issue
If Device-TLB flush timed out, we would hide the target ATS
device and crash the domain owning this ATS device. If impacted
domain is hardware domain, just throw out a warning (done in
queue_invalidate_wait).
By hiding the device, we make sure it can't be assigned to
any domain any longer (see device_assigned).
**NOTE**
This patch set should base on one prereq patch sets:
a). Check VT-d Device-TLB flush error.
----
Not covered in this series:
a) Eliminate the panic() in IOMMU_WAIT_OP, used only in VT-d register read/write.
Further discussion is required on whether and how to improve it.
b) Handle IOTLB/Context/IEC flush timeout.
--Changes in v9:
#patch 1
* Enhance the commit message and docs/misc/xen-command-line.markdown.
#patch 2
* Enhance the commit message.
* Add function declaration at the head of file, and then we don't need pure code movement.
#patch 3
* Enhance the commit message.
* 'ASSERT ( pdev->domain )' to 'ASSERT(pdev->domain)'
Quan Xu (3):
VT-d: add a command line parameter for Queued Invalidation
VT-d: wrap a _sync version for all VT-d flush interfaces
VT-d: Fix vt-d Device-TLB flush timeout issue
docs/misc/xen-command-line.markdown | 18 +++++
xen/drivers/passthrough/pci.c | 6 +-
xen/drivers/passthrough/vtd/extern.h | 3 +
xen/drivers/passthrough/vtd/qinval.c | 131 ++++++++++++++++++++++++++++------
xen/drivers/passthrough/vtd/x86/ats.c | 15 ++--
xen/include/xen/pci.h | 1 +
6 files changed, 141 insertions(+), 33 deletions(-)
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2016-04-01 14:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 14:47 Quan Xu [this message]
2016-04-01 14:47 ` [PATCH v9 1/3] VT-d: add a command line parameter for Queued Invalidation Quan Xu
2016-04-05 9:09 ` Jan Beulich
2016-04-07 1:49 ` Xu, Quan
2016-04-07 1:51 ` Tian, Kevin
2016-04-01 14:47 ` [PATCH v9 2/3] VT-d: wrap a _sync version for all VT-d flush interfaces Quan Xu
2016-04-05 9:35 ` Jan Beulich
2016-04-07 7:44 ` Xu, Quan
2016-04-07 15:28 ` Jan Beulich
2016-04-08 2:20 ` Xu, Quan
2016-04-11 7:25 ` Tian, Kevin
2016-04-11 9:07 ` Xu, Quan
2016-04-11 6:52 ` Tian, Kevin
2016-04-11 8:01 ` Xu, Quan
2016-04-01 14:47 ` [PATCH v9 3/3] VT-d: Fix vt-d Device-TLB flush timeout issue Quan Xu
2016-04-05 9:47 ` Jan Beulich
2016-04-10 14:28 ` Xu, Quan
2016-04-11 16:17 ` 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=1459522059-102365-1-git-send-email-quan.xu@intel.com \
--to=quan.xu@intel.com \
--cc=dario.faggioli@citrix.com \
--cc=feng.wu@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).