xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Quan Xu <quan.xu@intel.com>
To: jbeulich@suse.com, kevin.tian@intel.com
Cc: feng.wu@intel.com, eddie.dong@intel.com,
	george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	tim@xen.org, xen-devel@lists.xen.org, jun.nakajima@intel.com,
	Quan Xu <quan.xu@intel.com>,
	keir@xen.org
Subject: [PATCH v3 0/2] VT-d flush issue
Date: Sat, 12 Dec 2015 21:21:46 +0800	[thread overview]
Message-ID: <1449926508-72058-1-git-send-email-quan.xu@intel.com> (raw)

This patches are based on Kevin Tian's previous discussion 'Revisit VT-d asynchronous flush issue'.
Fix current timeout concern and also allow limited ATS support in a light way:

1. Reduce spin timeout to 1ms, which can be boot-time changed with 'iommu_qi_timeout_ms'.
   For example:
           multiboot /boot/xen.gz ats=1 iommu_qi_timeout_ms=100

2. Fix vt-d flush timeout issue.

    If IOTLB/Context/IETC flush is timeout, we should think all devices under this IOMMU cannot function correctly.
    So for each device under this IOMMU we'll mark it as unassignable and kill the domain owning the device.

    If Device-TLB flush is timeout, we'll mark the target ATS device as unassignable and kill the domain owning
    this device.

    If impacted domain is hardware domain, just throw out a warning. It's an open here whether we want to kill
    hardware domain (or directly panic hypervisor). Comments are welcomed.

    Device marked as unassignable will be disallowed to be further assigned to any domain.

--

 * DMAR_OPERATION_TIMEOUT should be also chopped down to a low number of milliseconds.
   As Kevin Tian mentioned in 'Revisit VT-d asynchronous flush issue', We also confirmed with hardware team
   that 1ms is large enough for IOMMU internal flush. So I can change DMAR_OPERATION_TIMEOUT from 1000 ms to 1 ms.

   IOMMU_WAIT_OP() is only for VT-d registers read/write, and there is also a panic. We need a further discussion
   whether or how to remove this panic in next patch set. 


 * Kevin Tian did basic functional review.

--Changes in v3:
   1. Once found you can break the for loop immediately since BDF is unique.

   2. Separate invalidate_timeout(struct iommu *iommu, int type, u16 did, u16 seg, u8 bus, u8 devfn)
      into invalidate_timeout(struct iommu *iommu) and device_tlb_invalidate_timeout(struct iommu *iommu,
      u16 did, u16 seg, u8 bus, u8 devfn).
      invalidate_timeout() is for iotlb/iec/context flush error.
      device_tlb_invalidate_timeout() is for Device-TLB flush error. 
      then ignore these INVALID_* parameters.

   3. Change macros(mark_pdev_unassignable/IS_PDEV_UNASSIGNABLE) into static inline functions.


Quan Xu (2):
  VT-d: Reduce spin timeout to 1ms, which can be boot-time changed.
  VT-d: Fix vt-d flush timeout issue.

 xen/drivers/passthrough/vtd/extern.h  |  5 ++
 xen/drivers/passthrough/vtd/iommu.c   |  6 +++
 xen/drivers/passthrough/vtd/qinval.c  | 89 +++++++++++++++++++++++++++++++++--
 xen/drivers/passthrough/vtd/x86/ats.c | 16 +++++++
 xen/include/xen/pci.h                 | 11 +++++
 5 files changed, 123 insertions(+), 4 deletions(-)

-- 
1.8.1.2

             reply	other threads:[~2015-12-12 13:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12 13:21 Quan Xu [this message]
2015-12-12 13:21 ` [PATCH v3 1/2] VT-d: Reduce spin timeout to 1ms, which can be boot-time changed Quan Xu
2015-12-14  9:14   ` Jan Beulich
2015-12-15  8:35     ` Xu, Quan
2015-12-15  9:18       ` Jan Beulich
2015-12-15 10:10         ` Xu, Quan
2015-12-12 13:21 ` [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue Quan Xu
2015-12-14  9:28   ` Jan Beulich
2015-12-15  8:15     ` Xu, Quan
2015-12-15  9:16       ` Jan Beulich
2015-12-15 10:24         ` Xu, Quan
2015-12-15 12:32           ` Jan Beulich
2015-12-15 13:01             ` Xu, Quan
2015-12-15 13:26               ` Jan Beulich
2015-12-15 10:58         ` Xu, Quan
2015-12-15 12:23         ` Xu, Quan
2015-12-15 12:29           ` Jan Beulich
2015-12-15 13:31             ` Xu, Quan
     [not found]               ` <5670271402000078000BFA35@prv-mh.provo.novell.com>
2015-12-15 14:49                 ` Xu, Quan
2015-12-16  3:51                 ` Xu, Quan
2015-12-16  8:08                   ` Jan Beulich
2015-12-17 11:43                     ` Xu, Quan
2015-12-17 12:10                       ` Jan Beulich
2015-12-17 12:55                         ` Xu, Quan
2015-12-19 14:01 ` [PATCH v3 0/2] VT-d flush issue Xu, Quan
  -- strict thread matches above, loose matches on Subject: below --
2015-12-20 13:57 Xu, Quan
2015-12-20 15:51 ` Andrew Cooper
2015-12-21 11:46 ` Jan Beulich
2015-12-21 12:28   ` Xu, Quan
2015-12-21 12:50     ` Jan Beulich
2015-12-21 13:08       ` Xu, Quan
2015-12-21 13:22         ` Jan Beulich
2015-12-21 13:35           ` Xu, Quan
2015-12-21 14:08           ` Xu, Quan
2015-12-21 14:16             ` Jan Beulich
2015-12-21 14:31               ` Xu, Quan
2015-12-21 14:52                 ` Jan Beulich
2015-12-21 15:15                   ` Xu, Quan
2015-12-22  7:40           ` Wu, Feng
2015-12-22  8:01             ` Jan Beulich
2015-12-22  8:10               ` Wu, Feng
2015-12-22  8:20                 ` Jan Beulich
2015-12-22  8:10               ` Xu, Quan
2015-12-22  8:27                 ` Jan Beulich
2015-12-22  8:43                   ` Xu, Quan
2015-12-22  9:08                     ` Jan Beulich
2015-12-22  9:18                       ` Xu, Quan
2015-12-22 10:26                       ` Xu, Quan
2015-12-23  6:21                         ` Tian, Kevin
2015-12-21 12:44   ` 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=1449926508-72058-1-git-send-email-quan.xu@intel.com \
    --to=quan.xu@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=eddie.dong@intel.com \
    --cc=feng.wu@intel.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=tim@xen.org \
    --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).