On Tue, Nov 28, 2023 at 06:00:13PM -0500, Pasha Tatashin wrote:
> On Tue, Nov 28, 2023 at 5:53 PM Robin Murphy wrote:
> >
> > On 2023-11-28 8:49 pm, Pasha Tatashin wrote:
> > > Convert iommu/fsl_pamu.c to use the new page allocation functions
> > > provided in iommu-pages.h.
> >
> > Again, this is
On Tue, Nov 28, 2023 at 08:49:31PM +, Pasha Tatashin wrote:
> Convert iommu/iommufd/* files to use the new page allocation functions
> provided in iommu-pages.h.
>
> Signed-off-by: Pasha Tatashin
> ---
> drivers/iommu/iommufd/iova_bitmap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 delet
On Tue, Nov 28, 2023 at 08:49:38PM +, Pasha Tatashin wrote:
> iommu allocations should be accounted in order to allow admins to
> monitor and limit the amount of iommu memory.
>
> Signed-off-by: Pasha Tatashin
> ---
> drivers/vfio/vfio_iommu_type1.c | 8 +---
> 1 file changed, 5 insertio
On Tue, Nov 28, 2023 at 04:25:03PM -0800, Yosry Ahmed wrote:
> > > Right, but as I mention above, if userspace starts depending on this
> > > equation, we won't be able to add any more classes of "secondary" page
> > > tables to SecPageTables. I'd like to avoid that if possible. We can do
> > > th
On Tue, Nov 28, 2023 at 04:30:27PM -0800, Yosry Ahmed wrote:
> On Tue, Nov 28, 2023 at 4:28 PM Jason Gunthorpe wrote:
> >
> > On Tue, Nov 28, 2023 at 04:25:03PM -0800, Yosry Ahmed wrote:
> >
> > > > > Right, but as I mention above, if userspace starts depe
On Wed, Nov 29, 2023 at 02:45:03PM -0500, Pasha Tatashin wrote:
> > same kind of big systems where IOMMU pagetables would be of any concern.
> > I believe some of the some of the "serious" NICs can easily run up
> > hundreds of megabytes if not gigabytes worth of queues, SKB pools, etc.
> > - woul
ches by the vfio/virtio coming
> driver.
>
> Signed-off-by: Yishai Hadas
> ---
> drivers/vfio/pci/vfio_pci_rdwr.c | 7 ---
> include/linux/vfio_pci_core.h| 1 +
> 2 files changed, 5 insertions(+), 3 deletions(-)
Reviewed-by: Jason Gunthorpe
Jason
> 2 files changed, 45 insertions(+), 24 deletions(-)
Reviewed-by: Jason Gunthorpe
Jason
_iommufd_physical_attach_ioas,
Missing detach_ioas
> +static bool virtiovf_bar0_exists(struct pci_dev *pdev)
> +{
> + struct resource *res = pdev->resource;
> +
> + return res->flags ? true : false;
?: isn't necessary cast to bool does this expression automatically
I didn't try to check the virtio parts of this, but the construction
of the variant driver looks OK, so
Reviewed-by: Jason Gunthorpe
Jason
On Thu, Mar 07, 2024 at 09:54:53AM +0800, Baolu Lu wrote:
> On 2024/3/7 0:01, Jason Gunthorpe wrote:
> > On Wed, Mar 06, 2024 at 11:15:50PM +0800, Zhangfei Gao wrote:
> > > Double checked, this does not send flags, 0 is OK,
> > > Only domain_alloc_user in iommufd_hwpt_
On Mon, Oct 28, 2024 at 10:13:48AM -0600, Alex Williamson wrote:
> On Sun, 27 Oct 2024 12:07:44 +0200
> Yishai Hadas wrote:
> >
> > - According to the Virtio specification, a device has only two states:
> > RUNNING and STOPPED. Consequently, certain VFIO transitions (e.g.,
> > RUNNING_P2P->ST
On Tue, Nov 05, 2024 at 03:47:46PM -0700, Alex Williamson wrote:
> I think the API to vfio core also suggests we shouldn't be modifying the
> ops pointer after the core device is allocated.
Yeah, that is a dangerous pattern we should avoid
Jason
On Tue, Nov 05, 2024 at 04:29:04PM -0700, Alex Williamson wrote:
> > @@ -1,7 +1,7 @@
> > # SPDX-License-Identifier: GPL-2.0-only
> > config VIRTIO_VFIO_PCI
> > tristate "VFIO support for VIRTIO NET PCI devices"
> > -depends on VIRTIO_PCI && VIRTIO_PCI_ADMIN_LEGACY
> > +de
ITY as virtio was the last
driver using it.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c| 6 --
drivers/iommu/virtio-iommu.c | 114 ---
2 files changed, 53 insertions(+), 67 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iomm
paging domain to return.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 20
include/linux/iommu.h | 4
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 870c3cdbd0f622..ee33d26dfcd40d 100644
e it as is. Wrap it's definition in CONFIG_FSL_PAMU to
discourage any new drivers from attempting to use it.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 2 ++
include/linux/iommu.h | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/io
qemu-system-x86_64: iommu map to non memory area 40
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
No driver implements SVA under domain_alloc() anymore, this is dead
code.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu-sva.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c
index 503c5d23c1ea27
.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/virtio-iommu.c | 86
1 file changed, 67 insertions(+), 19 deletions(-)
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index b85ce6310ddbda..c71a996760bddb 100644
--- a/drivers/iommu
On Tue, Feb 11, 2025 at 04:41:51PM -0800, Jacob Pan wrote:
> I see the same on arm64 with v9.0, assigned an ixgbe nic via VFIO.
Huh, I figured it worked on ARM..
There is no requirement that an iommu driver implement identity, this
is all an optimization. If it doesn't work in alot of cases can
On Wed, Feb 12, 2025 at 01:56:55PM +, Robin Murphy wrote:
> On 2025-02-07 2:46 pm, Jason Gunthorpe wrote:
> > virtio-iommu has a mode where the IDENTITY domain is actually a paging
> > domain with an identity mapping covering some of the system address
> > space manually
On Wed, Feb 12, 2025 at 02:16:54PM +, Robin Murphy wrote:
> On 2025-02-12 2:03 pm, Jason Gunthorpe wrote:
> > On Wed, Feb 12, 2025 at 01:56:55PM +, Robin Murphy wrote:
> > > On 2025-02-07 2:46 pm, Jason Gunthorpe wrote:
> > > > virtio-iommu has a mode where t
On Thu, Jan 30, 2025 at 03:21:37PM -0800, Shyam Saini wrote:
> Unfortunately, it is an HW issue.
Well, that's pretty bad to have built HW that can't DMA to low
addresses at all.. But OK.
> Are you okay with this passing custom MSI_IOVA via DTS approach ?
It isn't up to me, but I've understood
On Thu, Jan 16, 2025 at 03:23:04PM -0800, Shyam Saini wrote:
> Hi,
>
> Currently, the MSI_IOVA_BASE address is hard-coded to 0x8000,
> assuming that all platforms have this address available for MSI IOVA
> reservation. However, this is not always the case, as some platforms
> reserve this addr
On Tue, Jan 21, 2025 at 01:49:10PM -0800, Jacob Pan wrote:
> > On Thu, Jan 16, 2025 at 03:23:04PM -0800, Shyam Saini wrote:
> > > Hi,
> > >
> > > Currently, the MSI_IOVA_BASE address is hard-coded to 0x8000,
> > > assuming that all platforms have this address available for MSI IOVA
> > > rese
paging domain to return.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 20
include/linux/iommu.h | 4
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index c8033ca6637771..a61cceb706ed43 100644
-91eed9c8014a+53a37-iommu_virtio_domains_...@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
e it as is. Wrap it's definition in CONFIG_FSL_PAMU to
discourage any new drivers from attempting to use it.
Reviewed-by: Lu Baolu
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 2 ++
include/linux/iommu.h | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git
No driver implements SVA under domain_alloc() anymore, this is dead
code.
Reviewed-by: Lu Baolu
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu-sva.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c
On Thu, Apr 10, 2025 at 05:55:50AM +, Tian, Kevin wrote:
> > From: Jason Gunthorpe
> > Sent: Wednesday, April 9, 2025 12:36 AM
> >
> > +static struct iommu_domain *viommu_domain_alloc_identity(struct device
> > *dev)
> > +{
> > + struct viom
ITY as virtio was the last
driver using it.
Reviewed-by: Jean-Philippe Brucker
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c| 6 --
drivers/iommu/virtio-iommu.c | 121 +++
2 files changed, 53 insertions(+), 74 deletions(-)
diff --git a/driv
.
Reviewed-by: Jean-Philippe Brucker
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/virtio-iommu.c | 86
1 file changed, 67 insertions(+), 19 deletions(-)
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index b85ce6310ddbda
On Thu, Apr 10, 2025 at 05:57:44AM +, Tian, Kevin wrote:
> > From: Jason Gunthorpe
> > Sent: Wednesday, April 9, 2025 12:36 AM
> >
> > +#if IS_ENABLED(CONFIG_FSL_PAMU)
> > struct iommu_domain *(*domain_alloc)(unsigned
> > iommu_domain_type);
> >
On Thu, Apr 10, 2025 at 03:50:27PM -0700, Shyam Saini wrote:
>
> Hi,
>
> Currently, the MSI_IOVA_BASE address is hard-coded to 0x8000,
> assuming that all platforms have this address available for MSI IOVA
> reservation. However, this is not always the case, as some platforms
> reserve this a
On Wed, Apr 16, 2025 at 11:04:27AM -0700, Jacob Pan wrote:
> Per last discussion "SMMU driver have a list of potential addresses and
> select the first one that does not intersect with the non-working IOVA
> ranges.". If we don't know what the "non-working IOVA" is, how do we
> know it does not in
On Wed, Feb 12, 2025 at 09:47:23PM -0800, Jacob Pan wrote:
> Hi Jason,
>
> On Wed, 12 Feb 2025 19:30:53 -0400
> Jason Gunthorpe wrote:
>
> > On Wed, Feb 12, 2025 at 11:22:35AM -0800, Jacob Pan wrote:
> >
> > > Do you foresee the implementation can leverage y
On Tue, Feb 11, 2025 at 04:43:55PM -0800, Jacob Pan wrote:
> > +static int viommu_send_attach_req(struct viommu_dev *viommu, struct
> > device *dev,
> > + struct virtio_iommu_req_attach
> > *req) +{
> > + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
> > +
://patch.msgid.link/r/0-v1-91eed9c8014a+53a37-iommu_virtio_domains_...@nvidia.com
Cc: Eric Auger
Signed-off-by: Jason Gunthorpe
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
On Mon, Mar 03, 2025 at 03:21:43PM +, Jean-Philippe Brucker wrote:
> On Thu, Feb 27, 2025 at 08:20:01PM -0400, Jason Gunthorpe wrote:
> > virtio has the complication that it sometimes wants to return a paging
> > domain for IDENTITY which makes this conversion a little different
e it as is. Wrap it's definition in CONFIG_FSL_PAMU to
discourage any new drivers from attempting to use it.
Reviewed-by: Lu Baolu
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 2 ++
include/linux/iommu.h | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git
paging domain to return.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 20
include/linux/iommu.h | 4
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 870c3cdbd0f622..ee33d26dfcd40d 100644
ITY as virtio was the last
driver using it.
Reviewed-by: Jean-Philippe Brucker
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c| 6 --
drivers/iommu/virtio-iommu.c | 121 +++
2 files changed, 53 insertions(+), 74 deletions(-)
diff --git a/driv
No driver implements SVA under domain_alloc() anymore, this is dead
code.
Reviewed-by: Lu Baolu
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu-sva.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c
.
Reviewed-by: Jean-Philippe Brucker
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/virtio-iommu.c | 86
1 file changed, 67 insertions(+), 19 deletions(-)
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index b85ce6310ddbda
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_...@nvidia.com
Jason Gunthorpe (5):
iommu/virtio: Break out bypass
ITY as virtio was the last
driver using it.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c| 6 --
drivers/iommu/virtio-iommu.c | 114 ---
2 files changed, 53 insertions(+), 67 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iomm
paging domain to return.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c| 20
drivers/iommu/virtio-iommu.c | 11 ++-
include/linux/iommu.h| 4
3 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/drivers/iommu/iommu.c b
No driver implements SVA under domain_alloc() anymore, this is dead
code.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu-sva.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c
index 503c5d23c1ea27
.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/virtio-iommu.c | 86
1 file changed, 67 insertions(+), 19 deletions(-)
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index b85ce6310ddbda..55a2188197c621 100644
--- a/drivers/iommu
e it as is. Wrap it's definition in CONFIG_FSL_PAMU to
discourage any new drivers from attempting to use it.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 2 ++
include/linux/iommu.h | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/io
On Fri, Feb 28, 2025 at 09:59:53AM +0800, Baolu Lu wrote:
> This seems to be a paging domain with identity mappings for some
> specific ranges.
Sometimes it's the global static too
> So perhaps naming the callback as domain_alloc_paging_identity, or
> domain_alloc_paging_static?
s390 and dart
On Wed, Feb 12, 2025 at 11:22:35AM -0800, Jacob Pan wrote:
> Do you foresee the implementation can leverage your generic iommu_pt
> work? i.e. for building guest IO page tables. It will add a new flavor
> (page table based in addition to map/unmap) to
> viommu_domain_alloc_paging() i think.
Yes I
On Fri, Feb 21, 2025 at 11:42:06AM +, Jean-Philippe Brucker wrote:
> > There is no requirement that an iommu driver implement identity, this
> > is all an optimization. If it doesn't work in alot of cases can we
> > just remove it? It would simplfy a lot..
>
> No objection. Identity domains a
On Fri, Feb 21, 2025 at 11:35:27AM +, Jean-Philippe Brucker wrote:
> > +static int viommu_attach_identity_domain(struct iommu_domain *domain,
> > +struct device *dev)
> > +{
> > + int ret = 0;
> > + struct virtio_iommu_req_attach req;
> > + struct viomm
On Thu, Apr 03, 2025 at 12:34:58PM -0700, Shyam Saini wrote:
> Hi Jason,
>
> > On Thu, Jan 30, 2025 at 03:21:37PM -0800, Shyam Saini wrote:
> >
> > > Unfortunately, it is an HW issue.
> >
> > Well, that's pretty bad to have built HW that can't DMA to low
> > addresses at all.. But OK.
> >
> >
On Tue, May 20, 2025 at 03:42:24PM -0700, Shyam Saini wrote:
> Hi Jason,
>
> apologies for the delayed response.
>
> > On Wed, Apr 16, 2025 at 11:04:27AM -0700, Jacob Pan wrote:
> >
> > > Per last discussion "SMMU driver have a list of potential addresses and
> > > select the first one that does
On Tue, May 27, 2025 at 01:54:28PM -0700, Shyam Saini wrote:
> > The above is the only place that creates a IOMMU_RESV_SW_MSI so it is
> > definately called and used, right? If not where does your
> > IOMMU_RESV_SW_MSI come from?
>
> code tracing and printks in that code path suggests
> iommu_dma
On Thu, May 29, 2025 at 11:22:19AM -0700, Shyam Saini wrote:
> > All IOVA that the platform cannot DMA from should be reported in the
> > reserved_regions file as "reserved". You must make your platform
> > achieve this.
>
> so should it be for all the iommu groups?
>
> no_dma_mem
atible way.
Fixes: 5fcc26969a16 ("vfio: Add VFIO_DEVICE_BIND_IOMMUFD")
Signed-off-by: Jason Gunthorpe
---
drivers/vfio/device_cdev.c| 38 +--
.../vfio/pci/hisilicon/hisi_acc_vfio_pci.c| 1 +
drivers/vfio/pci/mlx5/main.c | 1 +
drivers/
On Thu, May 29, 2025 at 03:08:39PM -0700, Shyam Saini wrote:
> > How does your platform work at all? Isn't 0x0800 physical memory in
> > your address map?
>
> unfornately, this 0x0800 physical address is not in our address map
Is your issue PCI related, do you have a PCI switch without A
On Wed, May 28, 2025 at 03:42:55PM -0700, Jacob Pan wrote:
> > All IOVA that the platform cannot DMA from should be reported in the
> > reserved_regions file as "reserved". You must make your platform
> > achieve this.
> >
> Just to double confirm, the expected reserved region should be marked as
}
> 5fcc26969a164e Yi Liu 2023-07-18 123
> be2e70b96c3e54 Jason Gunthorpe 2025-07-14 124ret =
> vfio_df_check_token(device, &bind);
> be2e70b96c3e54 Jason Gunthorpe 2025-07-14 125if (ret)
> be2e70b96c3e54 Jason Gunthorpe 2025-07-14 @126
by: Shameer Kolothum
Reviewed-by: Yi Liu
Signed-off-by: Jason Gunthorpe
---
drivers/vfio/device_cdev.c| 38 +--
.../vfio/pci/hisilicon/hisi_acc_vfio_pci.c| 1 +
drivers/vfio/pci/mlx5/main.c | 1 +
drivers/vfio/pci/nvgrace-gpu/main.c
On Mon, Jul 14, 2025 at 09:12:52AM -0600, Alex Williamson wrote:
> On Mon, 14 Jul 2025 11:29:04 -0300
> Jason Gunthorpe wrote:
>
> > On Mon, Jul 14, 2025 at 09:12:30PM +0800, Yi Liu wrote:
> > > On 2025/7/10 23:30, Jason Gunthorpe wrote:
> > > >
here is co-ordination with
the owner of the PF.
Since we no longer have a device name, pass the token directly through
VFIO_DEVICE_BIND_IOMMUFD using an optional field indicated by
VFIO_DEVICE_BIND_TOKEN.
Fixes: 5fcc26969a16 ("vfio: Add VFIO_DEVICE_BIND_IOMMUFD")
Signed-off-by: Jason Gunthorp
On Fri, Jul 11, 2025 at 12:01:49PM +, Shameerali Kolothum Thodi wrote:
> > minsz = offsetofend(struct vfio_device_bind_iommufd, out_devid);
> >
> > - if (copy_from_user(&bind, arg, minsz))
> > - return -EFAULT;
> > + ret = get_user(user_size, &arg->argsz);
> > + if (ret)
>
On Thu, Jul 03, 2025 at 06:40:48AM +, Tian, Kevin wrote:
> > From: Jason Gunthorpe
> > Sent: Wednesday, June 25, 2025 2:35 AM
> >
> > This was missed during the initial implementation. The VFIO PCI encodes
> > the vf_token inside the device name when opening
On Tue, Jun 24, 2025 at 02:06:04PM -0600, Alex Williamson wrote:
> > This is used to control access to a VF unless there is co-ordination with
> > the owner of the PF.
> >
> > Since we no longer have a device name pass the token directly though
>
> s/name pass/name, pass/ s/though/through/
Got i
On Mon, Jul 14, 2025 at 09:12:30PM +0800, Yi Liu wrote:
> On 2025/7/10 23:30, Jason Gunthorpe wrote:
> > This was missed during the initial implementation. The VFIO PCI encodes
> > the vf_token inside the device name when opening the device from the group
> > FD, something li
69 matches
Mail list logo