All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v12 0/6] VT-d Device-TLB flush issue
@ 2016-06-24  5:51 Xu, Quan
  2016-06-24  5:51 ` [PATCH v12 1/6] IOMMU: add a timeout parameter for device IOTLB invalidation Xu, Quan
                   ` (5 more replies)
  0 siblings, 6 replies; 35+ messages in thread
From: Xu, Quan @ 2016-06-24  5:51 UTC (permalink / raw)
  To: xen-devel; +Cc: dario.faggioli, Quan Xu

From: Quan Xu <quan.xu@intel.com>

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

1. add a timeout parameter for device IOTLB invalidation

    The parameter 'iommu_dev_iotlb_timeout' specifies the timeout
    of device IOTLB invalidation in milliseconds. By default, the
    timeout is 1000 milliseconds, which can be boot-time changed.

    We also confirmed with VT-d hardware team that 1 milliseconds
    is large enough for VT-d IOMMU internal invalidation.

    the existing panic() is eliminated and we bubble up the timeout
    of device IOTLB invalidation for further processing, as the
    PCI-e Address Translation Services (ATS) mandates a timeout of
    60 seconds for device IOTLB invalidation. Obviously we can't
    spin for 60 seconds or otherwise Xen hypervisor hangs.

2. 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. move the domain crash logic up to the generic IOMMU layer

4. 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).

---
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 (after v12 review, I try to send out
       brain storming).
---
Quan Xu (6):
  IOMMU: add a timeout parameter for device IOTLB invalidation
  vt-d: synchronize for Device-TLB flush one by one
  vt-d: convert conditionals of qi_ctrl->qinval_maddr into ASSERT()s
  IOMMU/x86: using a struct pci_dev* instead of SBDF
  IOMMU: move the domain crash logic up to the generic IOMMU layer
  vt-d: fix vt-d Device-TLB flush timeout issue

 docs/misc/xen-command-line.markdown         |   9 ++
 xen/drivers/passthrough/amd/iommu_cmd.c     |  11 +-
 xen/drivers/passthrough/amd/pci_amd_iommu.c |   2 +-
 xen/drivers/passthrough/ats.h               |   6 +-
 xen/drivers/passthrough/iommu.c             |  33 +++++-
 xen/drivers/passthrough/pci.c               |   6 +-
 xen/drivers/passthrough/vtd/extern.h        |   6 +-
 xen/drivers/passthrough/vtd/iommu.c         |  19 +++-
 xen/drivers/passthrough/vtd/qinval.c        | 168 +++++++++++++++++++---------
 xen/drivers/passthrough/vtd/x86/ats.c       |  23 ++--
 xen/drivers/passthrough/x86/ats.c           |  52 ++++++---
 xen/include/xen/iommu.h                     |   2 +
 xen/include/xen/pci.h                       |   1 +
 13 files changed, 238 insertions(+), 100 deletions(-)

-- 
1.9.1


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

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2016-06-29  1:59 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-24  5:51 [PATCH v12 0/6] VT-d Device-TLB flush issue Xu, Quan
2016-06-24  5:51 ` [PATCH v12 1/6] IOMMU: add a timeout parameter for device IOTLB invalidation Xu, Quan
2016-06-24 11:30   ` Tian, Kevin
2016-06-27  8:03   ` Jan Beulich
2016-06-27  8:19     ` Xu, Quan
2016-06-27  8:28       ` Jan Beulich
2016-06-27  8:34         ` Xu, Quan
2016-06-24  5:51 ` [PATCH v12 2/6] vt-d: synchronize for Device-TLB flush one by one Xu, Quan
2016-06-24 11:33   ` Tian, Kevin
2016-06-24  5:51 ` [PATCH v12 3/6] vt-d: convert conditionals of qi_ctrl->qinval_maddr into ASSERT()s Xu, Quan
2016-06-24 11:35   ` Tian, Kevin
2016-06-24  5:51 ` [PATCH v12 4/6] IOMMU/x86: using a struct pci_dev* instead of SBDF Xu, Quan
2016-06-24 11:46   ` Tian, Kevin
2016-06-26  8:57     ` Xu, Quan
2016-06-26 10:32     ` Xu, Quan
2016-06-29  1:59       ` Tian, Kevin
2016-06-27  8:17   ` Jan Beulich
2016-06-27  8:25     ` Jan Beulich
2016-06-27 11:11     ` Xu, Quan
2016-06-27 15:19       ` Jan Beulich
2016-06-28  1:31         ` Xu, Quan
2016-06-24  5:51 ` [PATCH v12 5/6] IOMMU: move the domain crash logic up to the generic IOMMU layer Xu, Quan
2016-06-24 11:48   ` Tian, Kevin
2016-06-26  8:58     ` Xu, Quan
2016-06-27  8:18       ` Jan Beulich
2016-06-24  5:51 ` [PATCH v12 6/6] vt-d: fix vt-d Device-TLB flush timeout issue Xu, Quan
2016-06-24 11:55   ` Tian, Kevin
2016-06-24 12:54     ` Jan Beulich
2016-06-26  9:18     ` Xu, Quan
2016-06-27  7:56       ` Jan Beulich
2016-06-27  8:24   ` Jan Beulich
2016-06-27 12:56     ` Xu, Quan
2016-06-27 15:21       ` Jan Beulich
2016-06-28  7:06         ` Xu, Quan
2016-06-28  7:24           ` Jan Beulich

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.