xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* IOMMU, vtd and iotlb flush rework (v3)
@ 2011-11-07 18:25 Jean Guyader
  2011-11-07 18:25 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
  0 siblings, 1 reply; 23+ messages in thread
From: Jean Guyader @ 2011-11-07 18:25 UTC (permalink / raw)
  To: xen-devel; +Cc: allen.m.kay, tim

In one of my previous email I detailed a bug I was seeing when passing
through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim
we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

Changes between v2 and v3:
        - Check for the presence iotlb_flush_all callback before calling it.

Changes between v1 and v2:
       - Move size in struct xen_add_to_physmap in padding between .domid and .space.
       - Store iommu_dont_flush per cpu
       - Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.

Jean Guyader (6):
      vtd: Refactor iotlb flush code
      iommu: Introduce iommu_flush and iommu_flush_all.
      add_to_physmap: Move the code for XENMEM_add_to_physmap.
      mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range
      hvmloader: Change memory relocation loop when overlap with PCI hole.
      Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush

 tools/firmware/hvmloader/pci.c      |   20 +++-
 xen/arch/x86/mm.c                   |  203 +++++++++++++++++++++--------------
 xen/drivers/passthrough/iommu.c     |   25 +++++
 xen/drivers/passthrough/vtd/iommu.c |  100 ++++++++++--------
 xen/include/public/memory.h         |    4 +
 xen/include/xen/iommu.h             |    7 ++
 6 files changed, 230 insertions(+), 129 deletions(-)

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v8)
@ 2011-11-16 19:25 Jean Guyader
  2011-11-16 19:25 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
  0 siblings, 1 reply; 23+ messages in thread
From: Jean Guyader @ 2011-11-16 19:25 UTC (permalink / raw)
  To: xen-devel; +Cc: tim, allen.m.kay, keir, Jean Guyader, JBeulich

[-- Attachment #1: Type: text/plain, Size: 2807 bytes --]


In one of my previous email I detailed a bug I was seeing when passing
through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim
we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

Changes between v7 and v8:
        - Rebase on new add_to_physmap from Andres Lagar-Cavilla
        - Only do copy_to_guest on the new XENMAPSPACE (XENMAPSPACE_gmfn_range).
        - Convert the xatp argument to a pointer in xenmem_add_to_physmap.
        - Modify xenmem_add_to_physmap so it doesn't touchs the input (xatp is const now).

Changes between v6 and v7:
       - xenmem_add_to_physmap_once can't take a pointer on xatp because
         it modifies .idx and .gpfn.
       - Cancel hypercall continuation in the compat layer if the copy_to_guest
         failed.

Changes between v5 and v6:
      - Rework the patch queue to make it more readable.
      - Modify xatp in place in xenmem_add_to_physmap
      - Only check for preemption if we are not at the last iteration
      - Copy xatp guest handler back to the guest only in case of continuation
      - Add continuation only when dealing with the new xenmem space
        (XENMAPSPACE_gmfn_range).

Changes between v4 and v5:
      - Fix hypercall continuation for add_to_physmap in compat mode.

Changes between v3 and v4:
      - Move the loop for gmfn_range from arch_memory_op to xenmem_add_to_physmap.
      - Add a comment to comment to explain the purpose of iommu_dont_flush_iotlb.

Changes between v2 and v3:
      - Check for the presence iotlb_flush_all callback before calling it.

Changes between v1 and v2:
      - Move size in struct xen_add_to_physmap in padding between .domid and .space.
      - Store iommu_dont_flush per cpu
      - Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.

Jean Guyader (6):
  vtd: Refactor iotlb flush code
  iommu: Introduce iommu_flush and iommu_flush_all.
  add_to_physmap: Move the code for XENMEM_add_to_physmap
  mm: New XENMEM space, XENMAPSPACE_gmfn_range
  hvmloader: Change memory relocation loop when overlap with PCI hole
  Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary
    iotlb flush

 tools/firmware/hvmloader/pci.c      |   20 +++-
 xen/arch/x86/mm.c                   |  212 +++++++++++++++++++++++------------
 xen/arch/x86/x86_64/compat/mm.c     |   18 +++
 xen/drivers/passthrough/iommu.c     |   25 ++++
 xen/drivers/passthrough/vtd/iommu.c |  100 ++++++++++-------
 xen/include/public/memory.h         |    4 +
 xen/include/xen/iommu.h             |   17 +++
 7 files changed, 277 insertions(+), 119 deletions(-)


[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v7)
@ 2011-11-13 17:40 Jean Guyader
  2011-11-13 17:40 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
  0 siblings, 1 reply; 23+ messages in thread
From: Jean Guyader @ 2011-11-13 17:40 UTC (permalink / raw)
  To: xen-devel; +Cc: tim, allen.m.kay, keir, Jean Guyader, JBeulich

[-- Attachment #1: Type: text/plain, Size: 2480 bytes --]

In one of my previous email I detailed a bug I was seeing when passing
through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim
we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

Changes between v6 and v7:
        - xenmem_add_to_physmap_once can't take a pointer on xatp because
          it modifies .idx and .gpfn.
        - Cancel hypercall continuation in the compat layer if the copy_to_guest
          failed.

Changes between v5 and v6:
       - Rework the patch queue to make it more readable.
       - Modify xatp in place in xenmem_add_to_physmap
       - Only check for preemption if we are not at the last iteration
       - Copy xatp guest handler back to the guest only in case of continuation
       - Add continuation only when dealing with the new xenmem space
         (XENMAPSPACE_gmfn_range).

Changes between v4 and v5:
       - Fix hypercall continuation for add_to_physmap in compat mode.

Changes between v3 and v4:
       - Move the loop for gmfn_range from arch_memory_op to xenmem_add_to_physmap.
       - Add a comment to comment to explain the purpose of iommu_dont_flush_iotlb.

Changes between v2 and v3:
       - Check for the presence iotlb_flush_all callback before calling it.

Changes between v1 and v2:
       - Move size in struct xen_add_to_physmap in padding between .domid and .space.
       - Store iommu_dont_flush per cpu
       - Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.

Jean Guyader (6):
  vtd: Refactor iotlb flush code
  iommu: Introduce iommu_flush and iommu_flush_all.
  add_to_physmap: Move the code for XENMEM_add_to_physmap
  mm: New XENMEM space, XENMAPSPACE_gmfn_range
  hvmloader: Change memory relocation loop when overlap with PCI hole
  Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary
    iotlb flush

 tools/firmware/hvmloader/pci.c      |   20 ++-
 xen/arch/x86/mm.c                   |  231 ++++++++++++++++++++++-------------
 xen/arch/x86/x86_64/compat/mm.c     |   14 ++
 xen/drivers/passthrough/iommu.c     |   25 ++++
 xen/drivers/passthrough/vtd/iommu.c |  100 +++++++++-------
 xen/include/public/memory.h         |    4 +
 xen/include/xen/iommu.h             |   17 +++
 7 files changed, 279 insertions(+), 132 deletions(-)


[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v5)
@ 2011-11-10  8:43 Jean Guyader
  2011-11-10  8:43 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
  0 siblings, 1 reply; 23+ messages in thread
From: Jean Guyader @ 2011-11-10  8:43 UTC (permalink / raw)
  To: xen-devel; +Cc: tim, allen.m.kay, keir, Jean Guyader, JBeulich

[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]

In one of my previous email I detailed a bug I was seeing when passing
through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim
we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

changes between v4 and v5:
        - Fix hypercall continuation for add_to_physmap in compat mode.

Changes between v3 and v4:
       - Move the loop for gmfn_range from arch_memory_op to xenmem_add_to_physmap.
       - Add a comment to comment to explain the purpose of iommu_dont_flush_iotlb.

Changes between v2 and v3:
      - Check for the presence iotlb_flush_all callback before calling it.

Changes between v1 and v2:
     - Move size in struct xen_add_to_physmap in padding between .domid and .space.
     - Store iommu_dont_flush per cpu
     - Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.

Jean Guyader (6):
  vtd: Refactor iotlb flush code
  iommu: Introduce iommu_flush and iommu_flush_all.
  add_to_physmap: Move the code for XENMEM_add_to_physmap.
  mm: New XENMEM space, XENMAPSPACE_gmfn_range
  hvmloader: Change memory relocation loop when overlap with PCI hole.
  Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary
    iotlb flush

 tools/firmware/hvmloader/pci.c      |   20 +++++--
 xen/arch/x86/mm.c                   |   82 ++++++++++++++++++++++------
 xen/arch/x86/x86_64/compat/mm.c     |   10 ++++
 xen/drivers/passthrough/iommu.c     |   25 +++++++++
 xen/drivers/passthrough/vtd/iommu.c |  100 ++++++++++++++++++++---------------
 xen/include/public/memory.h         |    4 ++
 xen/include/xen/iommu.h             |   17 ++++++
 7 files changed, 192 insertions(+), 66 deletions(-)


[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v4)
@ 2011-11-08 20:04 Jean Guyader
  2011-11-08 20:04 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
  0 siblings, 1 reply; 23+ messages in thread
From: Jean Guyader @ 2011-11-08 20:04 UTC (permalink / raw)
  To: xen-devel; +Cc: allen.m.kay, tim

In one of my previous email I detailed a bug I was seeing when passing
through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim
we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

Changes between v3 and v4:
        - Move the loop for gmfn_range from arch_memory_op to xenmem_add_to_physmap.
        - Add a comment to comment to explain the purpose of iommu_dont_flush_iotlb.

Changes between v2 and v3:
       - Check for the presence iotlb_flush_all callback before calling it.

Changes between v1 and v2:
      - Move size in struct xen_add_to_physmap in padding between .domid and .space.
      - Store iommu_dont_flush per cpu
      - Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.


 tools/firmware/hvmloader/pci.c      |   20 +++++--
 xen/arch/x86/mm.c                   |   82 ++++++++++++++++++++++------
 xen/arch/x86/x86_64/compat/mm.c     |    4 ++
 xen/drivers/passthrough/iommu.c     |   25 +++++++++
 xen/drivers/passthrough/vtd/iommu.c |  100 ++++++++++++++++++++---------------
 xen/include/public/memory.h         |    4 ++
 xen/include/xen/iommu.h             |   17 ++++++
 7 files changed, 186 insertions(+), 66 deletions(-)

Jean Guyader (6):
      vtd: Refactor iotlb flush code
      iommu: Introduce iommu_flush and iommu_flush_all.
      add_to_physmap: Move the code for XENMEM_add_to_physmap.
      mm: New XENMEM space, XENMAPSPACE_gmfn_range
      hvmloader: Change memory relocation loop when overlap with PCI hole.
      Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush

^ permalink raw reply	[flat|nested] 23+ messages in thread
* IOMMU, vtd and iotlb flush rework (v2)
@ 2011-11-07 15:16 Jean Guyader
  2011-11-07 15:16 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
  0 siblings, 1 reply; 23+ messages in thread
From: Jean Guyader @ 2011-11-07 15:16 UTC (permalink / raw)
  To: xen-devel; +Cc: tim, allen.m.kay

In one of my previous email I detailed a bug I was seeing when passing
through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim
we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

Changes between v1 and v2:
        - Move size in struct xen_add_to_physmap in padding between .domid and .space.
        - Store iommu_dont_flush per cpu
        - Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.

Jean Guyader (6):
      vtd: Refactor iotlb flush code
      iommu: Introduce iommu_flush and iommu_flush_all.
      add_to_physmap: Move the code for XENMEM_add_to_physmap.
      mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range
      hvmloader: Change memory relocation loop when overlap with PCI hole.
      Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush
 
 tools/firmware/hvmloader/pci.c      |   20 +++-
 xen/arch/x86/mm.c                   |  203 +++++++++++++++++++++--------------
 xen/drivers/passthrough/iommu.c     |   25 +++++
 xen/drivers/passthrough/vtd/iommu.c |  100 ++++++++++--------
 xen/include/public/memory.h         |    5 +-
 xen/include/xen/iommu.h             |    7 ++
 6 files changed, 230 insertions(+), 130 deletions(-)

Jean

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

end of thread, other threads:[~2011-11-16 19:25 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 18:25 IOMMU, vtd and iotlb flush rework (v3) Jean Guyader
2011-11-07 18:25 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-07 18:25   ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-07 18:25     ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-07 18:25       ` [PATCH 4/6] mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range Jean Guyader
2011-11-07 18:25         ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-07 18:25           ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader
2011-11-08 13:45             ` Tim Deegan
2011-11-08  9:20         ` [PATCH 4/6] mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range Jan Beulich
2011-11-08 13:32           ` Tim Deegan
2011-11-08 13:39             ` Tim Deegan
2011-11-08 13:24       ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Tim Deegan
2011-11-08  3:10   ` [PATCH 1/6] vtd: Refactor iotlb flush code Kay, Allen M
2011-11-08  7:42     ` Jean Guyader
2011-11-09  2:41       ` Kay, Allen M
2011-11-09 22:15         ` Jean Guyader
2011-11-09 23:25           ` Kay, Allen M
2011-11-09  2:50       ` Kay, Allen M
  -- strict thread matches above, loose matches on Subject: below --
2011-11-16 19:25 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v8) Jean Guyader
2011-11-16 19:25 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-16 19:25   ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-16 19:25     ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-16 19:25       ` [PATCH 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range Jean Guyader
2011-11-16 19:25         ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-16 19:25           ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader
2011-11-13 17:40 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v7) Jean Guyader
2011-11-13 17:40 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-13 17:40   ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-13 17:40     ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-13 17:40       ` [PATCH 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range Jean Guyader
2011-11-13 17:40         ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-13 17:40           ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader
2011-11-10  8:43 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v5) Jean Guyader
2011-11-10  8:43 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-10  8:44   ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-10  8:44     ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-10  8:44       ` [PATCH 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range Jean Guyader
2011-11-10  8:44         ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-10  8:44           ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader
2011-11-08 20:04 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v4) Jean Guyader
2011-11-08 20:04 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-08 20:04   ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-08 20:04     ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-08 20:04       ` [PATCH 4/6] mm: New XENMEM space, XENMAPSPACE_gmfn_range Jean Guyader
2011-11-08 20:04         ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-08 20:04           ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader
2011-11-07 15:16 IOMMU, vtd and iotlb flush rework (v2) Jean Guyader
2011-11-07 15:16 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-07 15:16   ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-07 15:16     ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-07 15:16       ` [PATCH 4/6] mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range Jean Guyader
2011-11-07 15:16         ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-07 15:16           ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader

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