virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Convert virtio-iommu to domain_alloc_paging()
@ 2025-04-08 16:35 Jason Gunthorpe
  2025-04-08 16:35 ` [PATCH v4 1/5] iommu/virtio: Break out bypass identity support into a global static Jason Gunthorpe
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Jason Gunthorpe @ 2025-04-08 16:35 UTC (permalink / raw)
  To: iommu, Joerg Roedel, Robin Murphy, virtualization, Will Deacon
  Cc: Lu Baolu, Eric Auger, Jean-Philippe Brucker, patches

virtio-iommu and fsl_pamu are the only two drivers left that still
rely on ops.domain_alloc()

Update virtio-iommu to have a global static identity domain, implement
domain_alloc_paging(), and finalize its domain during allocation instead
of on first attach.

As virtio-iommu was the last real iommu driver using domain_alloc() update
the core code to isolate the remains to fsl_pamu.

I tested this using qemu x86 7.0.0 and 9.2.0 with a mlx5 VFIO PCI
device. The kernel behaves the same after this series.

However, there seem to be some unrelated qemu bugs. 7.0.0 does not have
working VIRTIO_IOMMU_F_BYPASS_CONFIG and neither qemu works with an
IDENTITY domain using !VIRTIO_IOMMU_F_BYPASS_CONFIG. It prints:

 qemu-system-x86_64: iommu has granularity incompatible with target AS
 qemu-system-x86_64: iommu map to non memory area 80000000
 qemu-system-x86_64: iommu map to non memory area c0000000
 qemu-system-x86_64: iommu map to non memory area e0000000
 qemu-system-x86_64: iommu map to non memory area f0000000
 qemu-system-x86_64: iommu map to non memory area f8000000
 qemu-system-x86_64: iommu map to non memory area fc000000
 qemu-system-x86_64: iommu map to non memory area fe000000
 qemu-system-x86_64: iommu map to non memory area fe800000
 qemu-system-x86_64: iommu map to non memory area 0
 qemu-system-x86_64: iommu map to non memory area fef00000
 qemu-system-x86_64: iommu map to non memory area ff000000
 qemu-system-x86_64: iommu has granularity incompatible with target AS
 qemu-system-x86_64: iommu map to non memory area 200000000
 qemu-system-x86_64: iommu map to non memory area 400000000
 qemu-system-x86_64: iommu map to non memory area 800000000
 qemu-system-x86_64: iommu map to non memory area 1000000000
 qemu-system-x86_64: iommu map to non memory area 2000000000
 qemu-system-x86_64: iommu map to non memory area 4000000000

v4:
 - Rebase on v6.15-rc1
v3: https://patch.msgid.link/r/0-v3-e005a650174b+53def-iommu_virtio_domains_jgg@nvidia.com
 - Fix rebasing error
 - Fix incorrect const remove that was from another series
v2: https://patch.msgid.link/r/0-v2-a3b72fd4b99a+1b6-iommu_virtio_domains_jgg@nvidia.com
 - Remove the viommu_ops.identity_domain = NULL in the last patch and
   re-constify the ops
 - Fix incorrect tracking in the identity domain attach
 - Christmas tree variable order and some other formatting
v1: https://patch.msgid.link/r/0-v1-91eed9c8014a+53a37-iommu_virtio_domains_jgg@nvidia.com

Jason Gunthorpe (5):
  iommu/virtio: Break out bypass identity support into a global static
  iommu: Add domain_alloc_identity()
  iommu/virtio: Move to domain_alloc_paging()
  iommu: Do not call domain_alloc() in iommu_sva_domain_alloc()
  iommu: Hide ops.domain_alloc behind CONFIG_FSL_PAMU

 drivers/iommu/iommu-sva.c    |  15 ++-
 drivers/iommu/iommu.c        |  16 +--
 drivers/iommu/virtio-iommu.c | 193 ++++++++++++++++++++---------------
 include/linux/iommu.h        |  10 +-
 4 files changed, 134 insertions(+), 100 deletions(-)


base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
-- 
2.43.0


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

end of thread, other threads:[~2025-04-10 12:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 16:35 [PATCH v4 0/5] Convert virtio-iommu to domain_alloc_paging() Jason Gunthorpe
2025-04-08 16:35 ` [PATCH v4 1/5] iommu/virtio: Break out bypass identity support into a global static Jason Gunthorpe
2025-04-10  5:46   ` Tian, Kevin
2025-04-08 16:35 ` [PATCH v4 2/5] iommu: Add domain_alloc_identity() Jason Gunthorpe
2025-04-10  5:48   ` Tian, Kevin
2025-04-08 16:35 ` [PATCH v4 3/5] iommu/virtio: Move to domain_alloc_paging() Jason Gunthorpe
2025-04-10  5:55   ` Tian, Kevin
2025-04-10 12:10     ` Jason Gunthorpe
2025-04-08 16:35 ` [PATCH v4 4/5] iommu: Do not call domain_alloc() in iommu_sva_domain_alloc() Jason Gunthorpe
2025-04-10  5:56   ` Tian, Kevin
2025-04-08 16:35 ` [PATCH v4 5/5] iommu: Hide ops.domain_alloc behind CONFIG_FSL_PAMU Jason Gunthorpe
2025-04-10  5:57   ` Tian, Kevin
2025-04-10 12:08     ` Jason Gunthorpe

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