All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quan Xu <quan.xu@intel.com>
To: xen-devel@lists.xen.org
Cc: Quan Xu <quan.xu@intel.com>,
	kevin.tian@intel.com, feng.wu@intel.com,
	dario.faggioli@citrix.com, jbeulich@suse.com
Subject: [PATCH v10 0/3] VT-d Device-TLB flush issue
Date: Fri, 22 Apr 2016 18:54:10 +0800	[thread overview]
Message-ID: <1461322453-29216-1-git-send-email-quan.xu@intel.com> (raw)

This patches fix current timeout concern and also allow limited ATS support:

1. Add a timeout parameter for Queued Invalidation

 The 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. Synchronize for Device-TLB flush one by one

 Today we do Device-TLB flush synchronization after issuing flush
 requests for all ATS devices belonging to a VM. Doing so however
 imposes a limitation, i.e. that we can not figure out which flush
 request is blocked in the flush queue list, based on VT-d spec.

 To prepare correct Device-TLB flush timeout handling in next patch,
 we change the behavior to synchronize for every Device-TLB flush
 request. So the Device-TLB flush interface is changed a little bit,
 by checking timeout within the function instead of outside of function.

 Accordingly we also do a similar change for flush interfaces of
 IOTLB/IEC/Context, i.e. moving synchronization into the function.
 Since there is no user of a non-synced interface, we just rename
 existing ones with _sync suffix.

3. Fix vt-d Device-TLB flush timeout issue

 If Device-TLB flush timed out, we hide the target ATS device
 immediately and crash the domain owning this ATS device. If
 impacted domain is hardware domain, just throw out a warning.

 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 v10:
#patch1
   * Enhance commit message.
   * Enhance description in docs/misc/xen-command-line.markdown


#patch2
   * Enhance commit message.
   * Fix indentation issue.
   * Add __must_check anotation.
   * Remove redundant comment.
   * leave the existing logic as - best effort invalidation even when an error has occurred.

#patch3
   * Remove stray blanks.
   * Remove pointless local variable.
   * Add comment.
   * Add printk().

Quan Xu (3):
  vt-d: add a timeout parameter for Queued Invalidation
  vt-d: synchronize for Device-TLB flush one by one
  vt-d: fix vt-d Device-TLB flush timeout issue

 docs/misc/xen-command-line.markdown   |  10 +++
 xen/drivers/passthrough/pci.c         |   6 +-
 xen/drivers/passthrough/vtd/extern.h  |   6 +-
 xen/drivers/passthrough/vtd/qinval.c  | 141 ++++++++++++++++++++++++++--------
 xen/drivers/passthrough/vtd/x86/ats.c |  11 +--
 xen/include/xen/pci.h                 |   1 +
 6 files changed, 134 insertions(+), 41 deletions(-)

-- 
1.9.1


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

             reply	other threads:[~2016-04-22 10:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 10:54 Quan Xu [this message]
2016-04-22 10:54 ` [PATCH v10 1/3] vt-d: add a timeout parameter for Queued Invalidation Quan Xu
2016-05-13 15:27   ` Jan Beulich
2016-05-16 15:25     ` Xu, Quan
2016-05-17  3:19       ` Tian, Kevin
2016-05-17  7:47         ` Jan Beulich
2016-05-18 12:53           ` Xu, Quan
2016-05-18 15:05             ` Jan Beulich
2016-05-19  0:32               ` Tian, Kevin
2016-05-19  1:35                 ` Xu, Quan
2016-05-19  6:13                   ` Jan Beulich
2016-05-19 11:26                     ` Xu, Quan
2016-05-19 11:35                       ` Jan Beulich
2016-05-19 15:14                         ` Xu, Quan
2016-04-22 10:54 ` [PATCH v10 2/3] vt-d: synchronize for Device-TLB flush one by one Quan Xu
2016-05-17 12:36   ` Jan Beulich
2016-05-18  8:53     ` Xu, Quan
2016-05-18  9:29       ` Jan Beulich
2016-05-18 12:02         ` Xu, Quan
2016-04-22 10:54 ` [PATCH v10 3/3] vt-d: fix vt-d Device-TLB flush timeout issue Quan Xu
2016-05-17 14:00   ` Jan Beulich
2016-05-18 13:11     ` Xu, Quan
2016-05-20  7:15     ` Xu, Quan
2016-05-20  9:58       ` Jan Beulich
2016-05-23 14:00         ` Xu, Quan

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=1461322453-29216-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 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.