xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v5 5/7] VT-d: Refactor iommu_ops .map_page() and unmap_page()
@ 2016-02-25  6:56 Xu, Quan
  2016-02-25  8:59 ` Jan Beulich
  0 siblings, 1 reply; 17+ messages in thread
From: Xu, Quan @ 2016-02-25  6:56 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Tian, Kevin, Wu, Feng, george.dunlap@eu.citrix.com,
	andrew.cooper3@citrix.com, tim@xen.org, xen-devel@lists.xen.org


> On February 17, 2016 10:23pm, <JBeulich@suse.com> wrote:
> >>> On 05.02.16 at 11:18, <quan.xu@intel.com> wrote:
> > to pass down a flag indicating whether the lock is being held, and
> > check the way up the call trees.
> 
> Same comments as on the previous patch; most of the changes outside of
> xen/drivers/passthrough/ seem to be avoidable here.
> 

(VT-d RMRR / P2M EPT)

Jan,
   When I fix the VT-d RMRR related code 
     1. $... iommu_map_page()/iommu_unmap_page() --p2m->set_entry()--p2m_set_entry()--set_identity_p2m_entry() / clear_identity_p2m_entry()-- rmrr_identity_mapping()--... ,
     2. $... iommu_pte_flush() --p2m->set_entry()--p2m_set_entry()--set_identity_p2m_entry() / clear_identity_p2m_entry()-- rmrr_identity_mapping()--... ,

 I found that the pcidevs_lock is being held for p2m_set_entry(). It is a corner case which is _not_ fix in previous patch set. As similar, I think I need to add p2m_set_entry_locked() to pass down a flag indicating
 whether the pcidevs_lock is being held. Right?

BTW, just a quick question, what's the difference between p2m-ept.c and p2m-pt.c ? Thanks.


Quan

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH v5 0/7]  VT-d Device-TLB flush issue
@ 2016-02-05 10:18 Quan Xu
  2016-02-05 10:18 ` [PATCH v5 5/7] VT-d: Refactor iommu_ops .map_page() and unmap_page() Quan Xu
  0 siblings, 1 reply; 17+ messages in thread
From: Quan Xu @ 2016-02-05 10:18 UTC (permalink / raw)
  To: jbeulich, kevin.tian
  Cc: feng.wu, george.dunlap, andrew.cooper3, tim, xen-devel, Quan Xu

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

1. Check VT-d Device-TLB flush error.
   This patch checks all kinds of error and all the way up the call trees of VT-d Device-TLB flush.

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

3. Pass down a flag indicating whether the lock is being held.
 
4. Fix vt-d Device-TLB flush timeout issue.
   If Device-TLB flush is timeout, we'll hide the target ATS device and crash the domain owning this ATS device.
   If impacted domain is hardware domain, just throw out a warning.
   The hidden device 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.

 * The coming patch set will fix IOTLB/Context/IETC flush timeout.

-Changes in v5:
  * Split the 'check VT-d Device-TLB flush error' into MMU part and IOMMU part. (P1-P2)
  * Add a new standalone entry for new command 'vtd_qi_timeout' in docs/misc/xen-command-line.markdown.(P3)
  * Change the option name from 'iommu_qi_timeout_ms' to 'vtd_qi_timeout'.(P3)
  * Pass down a flag indicating whether the lock is being held.(P4-P6)
  * Fix multiple return points when this can be trivially avoided.(P7)
  * Enhance the print out message. (P7)
  * Enhance the comment.(P7)
  * Consult the bitmap along with the domain ID array.(P7)



Quan Xu (7):
  VT-d: Check VT-d Device-TLB flush error(IOMMU part).
  VT-d: Check VT-d Device-TLB flush error(MMU part).
  VT-d: Reduce spin timeout to 1ms, which can be boot-time changed.
  VT-d: Refactor iommu_ops .iotlb_flush() and iotlb_flush_all()
  VT-d: Refactor iommu_ops .map_page() and unmap_page()
  VT-d: Refactor iommu_flush .iotlb()
  VT-d: Fix vt-d Device-TLB flush timeout issue.

 docs/misc/xen-command-line.markdown           |   7 ++
 xen/arch/arm/p2m.c                            |   2 +-
 xen/arch/x86/acpi/power.c                     |   6 +-
 xen/arch/x86/crash.c                          |   3 +-
 xen/arch/x86/domain_build.c                   |   5 +-
 xen/arch/x86/mm.c                             |  15 ++-
 xen/arch/x86/mm/p2m-ept.c                     |  15 ++-
 xen/arch/x86/mm/p2m-pt.c                      |  14 ++-
 xen/arch/x86/mm/p2m.c                         |  24 ++--
 xen/arch/x86/x86_64/mm.c                      |   5 +-
 xen/common/domain.c                           |   2 +-
 xen/common/grant_table.c                      |  16 ++-
 xen/common/memory.c                           |   5 +-
 xen/drivers/passthrough/amd/iommu_init.c      |   4 +-
 xen/drivers/passthrough/amd/iommu_map.c       |   7 +-
 xen/drivers/passthrough/amd/pci_amd_iommu.c   |   7 +-
 xen/drivers/passthrough/arm/smmu.c            |  15 ++-
 xen/drivers/passthrough/iommu.c               |  47 ++++---
 xen/drivers/passthrough/pci.c                 |   2 +-
 xen/drivers/passthrough/vtd/extern.h          |  12 +-
 xen/drivers/passthrough/vtd/iommu.c           | 173 +++++++++++++++++---------
 xen/drivers/passthrough/vtd/iommu.h           |   3 +-
 xen/drivers/passthrough/vtd/qinval.c          |  93 +++++++++++++-
 xen/drivers/passthrough/vtd/quirks.c          |  26 ++--
 xen/drivers/passthrough/vtd/x86/ats.c         |  14 ++-
 xen/drivers/passthrough/vtd/x86/vtd.c         |  18 ++-
 xen/drivers/passthrough/x86/iommu.c           |   9 +-
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |   8 +-
 xen/include/asm-x86/iommu.h                   |   3 +-
 xen/include/asm-x86/p2m.h                     |   6 +-
 xen/include/xen/iommu.h                       |  37 +++---
 31 files changed, 429 insertions(+), 174 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2016-02-26 12:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-25  6:56 [PATCH v5 5/7] VT-d: Refactor iommu_ops .map_page() and unmap_page() Xu, Quan
2016-02-25  8:59 ` Jan Beulich
2016-02-25 12:14   ` Xu, Quan
2016-02-25 12:23     ` Jan Beulich
2016-02-25 13:12       ` Dario Faggioli
2016-02-26  1:55       ` Xu, Quan
2016-02-26  7:37       ` Xu, Quan
2016-02-26  8:14         ` Jan Beulich
2016-02-26  8:21           ` Jan Beulich
2016-02-26  9:24           ` Xu, Quan
2016-02-26 10:11             ` Jan Beulich
2016-02-26 11:48               ` Xu, Quan
2016-02-26 12:33                 ` Jan Beulich
2016-02-26 10:08           ` Xu, Quan
2016-02-26 10:13             ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2016-02-05 10:18 [PATCH v5 0/7] VT-d Device-TLB flush issue Quan Xu
2016-02-05 10:18 ` [PATCH v5 5/7] VT-d: Refactor iommu_ops .map_page() and unmap_page() Quan Xu
2016-02-17 14:23   ` Jan Beulich

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