and call iommu_attach_device_shared() which
will use dma owner framework to lock out other usages of the group and
refcount the domain attachment.
When the last device calls detatch the domain will be disconnected.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
Tested-by: Dmitry Osipenko
The iommu group changes notifer is not referenced in the tree. Remove it
to avoid dead code.
Suggested-by: Christoph Hellwig
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 23 -
drivers/iommu/iommu.c | 75 ---
2 files changed, 98
ff-by: Lu Baolu
---
drivers/vfio/vfio.c | 147
1 file changed, 147 deletions(-)
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 6426b29e73a2..539f5da9eb34 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -71,7 +71,6 @@ s
The only remaining reference is in GROUP_GET_STATUS, which could be called
at any time when group fd is valid. Here we just replace the
vfio_group_viable() by directly calling iommu core to get viability status.
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 18 ++
1 file c
_group_dev() returns, so simply delete the
unbound_list entirely.
Reviewed-by: Chaitanya Kulkarni
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 74 ++---
1 file changed, 2 insertions(+), 72 deletions(-)
diff --git a/d
Set DMA_OWNER_PRIVATE_DOMAIN_USER when an iommu group is set to a
container, and release DMA_OWNER_USER once the iommu group is unset
from a container.
Signed-off-by: Lu Baolu
---
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 +
drivers/vfio/pci/vfio_pci.c | 3 +++
drivers/vfio/platform
en multiple drivers
sharing the group claim the DMA_OWNER_PRIVATE_DOMAIN ownership. The first
call of iommu_attach_device_shared() attaches the domain to the group.
Other drivers could join it later. The domain will be detached from the
group after all drivers unjoin it.
Signed-off-by: Jason Gun
is viable to user assignment for
compatibility with VFIO_GROUP_FLAGS_VIABLE.
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 21 +++
drivers/iommu/iommu.c | 47 ++-
2 files changed, 63 insertions(+), 5 deletions(-)
diff --git a/include
controlled iommu_domain. Correspondingly, the default domain should
be reattached after the last DMA_OWNER_USER is released.
Signed-off-by: Lu Baolu
---
drivers/iommu/iommu.c | 35 ---
1 file changed, 32 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu
Suggested-by: Kevin Tian
Signed-off-by: Lu Baolu
---
drivers/pci/pcie/portdrv_pci.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 35eca6277a96..c48a8734f9c4 100644
--- a/drivers/pci/pcie/portdrv_p
the DMA ownership to vfio.
Signed-off-by: Lu Baolu
---
drivers/pci/pci-stub.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index e408099fea52..6324c68602b4 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -36,6 +36,9
evice
to userspace.
Suggested-by: Jason Gunthorpe
Link: https://lore.kernel.org/linux-iommu/20210922123931.gi327...@nvidia.com/
Link: https://lore.kernel.org/linux-iommu/20210928115751.gk964...@nvidia.com/
Signed-off-by: Lu Baolu
---
include/linux/device/driver.h | 2 ++
drivers/base
rated by multiple users simultaneously. Vice
versa, the owner type should be released after the user access permission
is withdrawn.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Kevin Tian
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 34
drivers/iommu/iomm
://github.com/LuBaolu/intel-iommu/commits/iommu-dma-ownership-v4
Merry Christmas to you all!
Best regards,
baolu
Jason Gunthorpe (2):
vfio: Delete the unbound_list
drm/tegra: Use the iommu dma_owner mechanism
Lu Baolu (11):
iommu: Add device dma ownership set/release interfaces
driver core
These macros has no reference in the tree anymore. Cleanup them.
Signed-off-by: Lu Baolu
---
include/linux/intel-svm.h | 6 --
1 file changed, 6 deletions(-)
diff --git a/include/linux/intel-svm.h b/include/linux/intel-svm.h
index 57cceecbe37f..1b73bab7eeff 100644
--- a/include/linux/intel
Hi Greg,
On 2021/12/13 8:50, Lu Baolu wrote:
On 12/10/21 9:23 AM, Lu Baolu wrote:
Hi Greg, Jason and Christoph,
On 12/9/21 9:20 AM, Lu Baolu wrote:
On 12/7/21 9:16 PM, Jason Gunthorpe wrote:
On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote:
On 12/6/21 11:06 PM, Jason Gunthorpe
On 12/10/21 9:23 AM, Lu Baolu wrote:
Hi Greg, Jason and Christoph,
On 12/9/21 9:20 AM, Lu Baolu wrote:
On 12/7/21 9:16 PM, Jason Gunthorpe wrote:
On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote:
On 12/6/21 11:06 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 06:36:27AM -0800
On 2021/12/10 7:21, Jacob Pan wrote:
On Thu, 9 Dec 2021 10:32:43 +0800, Lu Baolu
wrote:
On 12/9/21 3:16 AM, Jacob Pan wrote:
Hi Jason,
On Wed, 8 Dec 2021 09:22:55 -0400, Jason Gunthorpe
wrote:
On Tue, Dec 07, 2021 at 05:47:13AM -0800, Jacob Pan wrote:
Between DMA requests with and without
Hi Greg, Jason and Christoph,
On 12/9/21 9:20 AM, Lu Baolu wrote:
On 12/7/21 9:16 PM, Jason Gunthorpe wrote:
On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote:
On 12/6/21 11:06 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote:
I really hate
On 12/9/21 3:16 AM, Jacob Pan wrote:
Hi Jason,
On Wed, 8 Dec 2021 09:22:55 -0400, Jason Gunthorpe wrote:
On Tue, Dec 07, 2021 at 05:47:13AM -0800, Jacob Pan wrote:
Between DMA requests with and without PASID (legacy), DMA mapping APIs
are used indiscriminately on a device. Therefore, we shou
On 12/9/21 9:56 AM, Tian, Kevin wrote:
From: Jacob Pan
Sent: Thursday, December 9, 2021 2:50 AM
Can a device issue DMA requests with PASID even there's no system
IOMMU
or the system IOMMU is disabled?
Good point.
If IOMMU is not enabled, device cannot issue DMA requests with PASID. This
AP
On 12/7/21 9:16 PM, Jason Gunthorpe wrote:
On Tue, Dec 07, 2021 at 10:57:25AM +0800, Lu Baolu wrote:
On 12/6/21 11:06 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote:
I really hate the amount of boilerplate code that having this in each
bus type
Hi Eric,
On 12/7/21 6:22 PM, Eric Auger wrote:
On 12/6/21 11:48 AM, Joerg Roedel wrote:
On Wed, Oct 27, 2021 at 12:44:20PM +0200, Eric Auger wrote:
Signed-off-by: Jean-Philippe Brucker
Signed-off-by: Liu, Yi L
Signed-off-by: Ashok Raj
Signed-off-by: Jacob Pan
Signed-off-by: Eric Auger
This Si
Hi Jacob,
On 12/7/21 9:47 PM, Jacob Pan wrote:
DMA mapping API is the de facto standard for in-kernel DMA. It operates
on a per device/RID basis which is not PASID-aware.
Some modern devices such as Intel Data Streaming Accelerator, PASID is
required for certain work submissions. To allow such
On 12/6/21 11:06 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 06:36:27AM -0800, Christoph Hellwig wrote:
I really hate the amount of boilerplate code that having this in each
bus type causes.
+1
I liked the first version of this series better with the code near
really_probe().
Can we go
On 12/6/21 8:40 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 09:59:03AM +0800, Lu Baolu wrote:
@@ -941,48 +944,44 @@ int host1x_client_iommu_attach(struct host1x_client
*client)
* not the shared IOMMU domain, don't try to attach it to a different
* domain. This a
On 12/6/21 10:43 PM, Christoph Hellwig wrote:
The new helpers really could use a kerneldoc comment.
Also no need for the refcount_t with it's atomic operations for
attach_cnt either.
Yes. Agreed.
Best regards,
baolu
___
iommu mailing list
iommu@lis
On 12/6/21 10:42 PM, Christoph Hellwig wrote:
On Mon, Dec 06, 2021 at 09:58:46AM +0800, Lu Baolu wrote:
>From the perspective of who is initiating the device to do DMA, device
DMA could be divided into the following types:
DMA_OWNER_DMA_API: Device DMAs are initiated by a ker
On 12/6/21 11:01 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 02:35:55PM +0100, Joerg Roedel wrote:
On Mon, Dec 06, 2021 at 09:58:46AM +0800, Lu Baolu wrote:
>From the perspective of who is initiating the device to do DMA, device
DMA could be divided into the following ty
On 12/6/21 11:04 PM, Jason Gunthorpe wrote:
On Mon, Dec 06, 2021 at 06:47:45AM -0800, Christoph Hellwig wrote:
On Mon, Dec 06, 2021 at 10:45:35AM -0400, Jason Gunthorpe via iommu wrote:
IIRC the only thing this function does is touch ACPI and OF stuff?
Isn't that firmware?
AFAICT amba uses thi
On 11/28/21 10:50 AM, Lu Baolu wrote:
The original post and intent of this series is here.
https://lore.kernel.org/linux-iommu/2025020552.2378167-1-baolu...@linux.intel.com/
Change log:
v1: initial post
-
https://lore.kernel.org/linux-iommu/2025020552.2378167-1-baolu
and call iommu_attach_device_shared() which
will use dma owner framework to lock out other usages of the group and
refcount the domain attachment.
When the last device calls detatch the domain will be disconnected.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
Tested-by: Dmitry Osipenko
The iommu group changes notifer is not referenced in the tree. Remove it
to avoid dead code.
Suggested-by: Christoph Hellwig
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 23 -
drivers/iommu/iommu.c | 75 ---
2 files changed, 98
ff-by: Lu Baolu
---
drivers/vfio/vfio.c | 147
1 file changed, 147 deletions(-)
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 5c81346367b1..33d984ff3cc5 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -71,7 +71,6 @@ s
_group_dev() returns, so simply delete the
unbound_list entirely.
Reviewed-by: Chaitanya Kulkarni
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 74 ++---
1 file changed, 2 insertions(+), 72 deletions(-)
diff --git a/d
The only remaining reference is in GROUP_GET_STATUS, which could be called
at any time when group fd is valid. Here we just replace the
vfio_group_viable() by directly calling iommu core to get viability status.
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 18 ++
1 file c
Set DMA_OWNER_PRIVATE_DOMAIN_USER when an iommu group is set to a
container, and release DMA_OWNER_USER once the iommu group is unset
from a container.
Signed-off-by: Lu Baolu
---
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 +
drivers/vfio/pci/vfio_pci.c | 1 +
drivers/vfio/platform
en multiple drivers
sharing the group claim the DMA_OWNER_PRIVATE_DOMAIN ownership. The first
call of iommu_attach_device_shared() attaches the domain to the group.
Other drivers could join it later. The domain will be detached from the
group after all drivers unjoin it.
Signed-off-by: Jason Gun
is viable to user assignment for
compatibility with VFIO_GROUP_FLAGS_VIABLE.
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 21
drivers/iommu/iommu.c | 58 +++
2 files changed, 79 insertions(+)
diff --git a/include/linux/iommu.h b
controlled iommu_domain. Correspondingly, the default domain should
be reattached after the last DMA_OWNER_USER is released.
Signed-off-by: Lu Baolu
---
drivers/iommu/iommu.c | 42 +++---
1 file changed, 39 insertions(+), 3 deletions(-)
diff --git a/drivers
Suggested-by: Kevin Tian
Signed-off-by: Lu Baolu
---
drivers/pci/pcie/portdrv_pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 35eca6277a96..c66a83f2c987 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/driver
the DMA ownership to vfio.
Signed-off-by: Lu Baolu
---
drivers/pci/pci-stub.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index e408099fea52..14b9b9f2ad2b 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -36,6 +36,7
userspace.
Signed-off-by: Lu Baolu
---
include/linux/fsl/mc.h | 5 +
drivers/bus/fsl-mc/fsl-mc-bus.c | 26 --
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
index e026f6c48b49..3a26421ee3dc
device to userspace.
Signed-off-by: Lu Baolu
---
include/linux/pci.h | 5 +
drivers/pci/pci-driver.c | 21 +
2 files changed, 26 insertions(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 18a75c8e615c..1b29af0ab43b 100644
--- a/include/linux/pci.h
userspace.
Signed-off-by: Lu Baolu
---
include/linux/amba/bus.h | 1 +
drivers/amba/bus.c | 30 +-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index edfcf7a14dcd..745c5a60ddd8 100644
--- a
The platform_dma_configure() is shared between platform and amba bus
drivers. Rename the common helper to firmware_dma_configure() so that
both platform and amba bus drivers could customize their dma_configure
callbacks.
Signed-off-by: Lu Baolu
---
include/linux/platform_device.h | 2
to userspace.
Signed-off-by: Lu Baolu
---
include/linux/platform_device.h | 1 +
drivers/base/platform.c | 30 +-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 4381c34af7e0
://lore.kernel.org/linux-iommu/20210922123931.gi327...@nvidia.com/
Link: https://lore.kernel.org/linux-iommu/20210928115751.gk964...@nvidia.com/
Signed-off-by: Lu Baolu
---
include/linux/device/bus.h | 3 +++
drivers/base/dd.c | 7 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a
rated by multiple users simultaneously. Vice
versa, the owner type should be released after the user access permission
is withdrawn.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Kevin Tian
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 36 +
drivers/iommu/iomm
This is based on v5.16-rc3 and available on github:
https://github.com/LuBaolu/intel-iommu/commits/iommu-dma-ownership-v3
Best regards,
baolu
Jason Gunthorpe (2):
vfio: Delete the unbound_list
drm/tegra: Use the iommu dma_owner mechanism
Lu Baolu (16):
iommu: Add device dma ownership set/release
On 11/28/21 4:02 PM, Greg Kroah-Hartman wrote:
On Sun, Nov 28, 2021 at 10:50:36AM +0800, Lu Baolu wrote:
The bus_type structure defines dma_configure() callback for bus drivers
to configure DMA on the devices. This adds the paired dma_unconfigure()
callback and calls it during driver unbinding
Hi Greg,
On 11/28/21 4:10 PM, Greg Kroah-Hartman wrote:
On Sun, Nov 28, 2021 at 10:50:34AM +0800, Lu Baolu wrote:
The original post and intent of this series is here.
https://lore.kernel.org/linux-iommu/2025020552.2378167-1-baolu...@linux.intel.com/
Please put the intent in the message
and call iommu_attach_device_shared() which
will use dma owner framework to lock out other usages of the group and
refcount the domain attachment.
When the last device calls detatch the domain will be disconnected.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
---
drivers/gpu/drm/tegra
The iommu group changes notifer is not referenced in the tree. Remove it
to avoid dead code.
Suggested-by: Christoph Hellwig
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 23 -
drivers/iommu/iommu.c | 75 ---
2 files changed, 98
ff-by: Lu Baolu
---
drivers/vfio/vfio.c | 147
1 file changed, 147 deletions(-)
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 5c81346367b1..33d984ff3cc5 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -71,7 +71,6 @@ s
_group_dev() returns, so simply delete the
unbound_list entirely.
Reviewed-by: Chaitanya Kulkarni
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 74 ++---
1 file changed, 2 insertions(+), 72 deletions(-)
diff --git a/d
The only remaining reference is in GROUP_GET_STATUS, which could be called
at any time when group fd is valid. Here we just replace the
vfio_group_viable() by directly calling iommu core to get viability status.
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 18 ++
1 file c
Set DMA_OWNER_PRIVATE_DOMAIN_USER when an iommu group is set to a
container, and release DMA_OWNER_USER once the iommu group is unset
from a container.
Signed-off-by: Lu Baolu
---
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 +
drivers/vfio/pci/vfio_pci.c | 1 +
drivers/vfio/platform
en multiple drivers
sharing the group claim the DMA_OWNER_PRIVATE_DOMAIN ownership. The first
call of iommu_attach_device_shared() attaches the domain to the group.
Other drivers could join it later. The domain will be detached from the
group after all drivers unjoin it.
Signed-off-by: Jason Gun
is viable to user assignment for
compatibility with VFIO_GROUP_FLAGS_VIABLE.
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 21
drivers/iommu/iommu.c | 58 +++
2 files changed, 79 insertions(+)
diff --git a/include/linux/iommu.h b
controlled iommu_domain. Correspondingly, the default domain should
be reattached after the last DMA_OWNER_USER is released.
Signed-off-by: Lu Baolu
---
drivers/iommu/iommu.c | 42 +++---
1 file changed, 39 insertions(+), 3 deletions(-)
diff --git a/drivers
Suggested-by: Kevin Tian
Signed-off-by: Lu Baolu
---
drivers/pci/pcie/portdrv_pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 35eca6277a96..c66a83f2c987 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/driver
the DMA ownership to vfio.
Signed-off-by: Lu Baolu
---
drivers/pci/pci-stub.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c
index e408099fea52..14b9b9f2ad2b 100644
--- a/drivers/pci/pci-stub.c
+++ b/drivers/pci/pci-stub.c
@@ -36,6 +36,7
userspace.
Signed-off-by: Lu Baolu
---
include/linux/fsl/mc.h | 5 +
drivers/bus/fsl-mc/fsl-mc-bus.c | 26 --
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h
index e026f6c48b49..3a26421ee3dc
userspace.
Signed-off-by: Lu Baolu
---
include/linux/amba/bus.h | 1 +
drivers/amba/bus.c | 30 +-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index edfcf7a14dcd..745c5a60ddd8 100644
--- a
to userspace.
Signed-off-by: Lu Baolu
---
include/linux/platform_device.h | 1 +
drivers/base/platform.c | 30 +-
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 7c96f169d274
device to userspace.
Signed-off-by: Lu Baolu
---
include/linux/pci.h | 5 +
drivers/pci/pci-driver.c | 21 +
2 files changed, 26 insertions(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 18a75c8e615c..1b29af0ab43b 100644
--- a/include/linux/pci.h
://lore.kernel.org/linux-iommu/20210922123931.gi327...@nvidia.com/
Link: https://lore.kernel.org/linux-iommu/20210928115751.gk964...@nvidia.com/
Signed-off-by: Lu Baolu
---
include/linux/device/bus.h | 3 +++
drivers/base/dd.c | 7 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git
rated by multiple users simultaneously. Vice
versa, the owner type should be released after the user access permission
is withdrawn.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Kevin Tian
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 36 +
drivers/iommu/iomm
-iommu/commits/iommu-dma-ownership-v2
Best regards,
baolu
Jason Gunthorpe (2):
vfio: Delete the unbound_list
drm/tegra: Use the iommu dma_owner mechanism
Lu Baolu (15):
iommu: Add device dma ownership set/release interfaces
driver core: Add dma_unconfigure callback in bus_type
PCI: Add
On 11/27/21 5:57 AM, Joerg Roedel wrote:
On Fri, Nov 26, 2021 at 09:55:54PM +0800, Lu Baolu wrote:
Update this series with a fix for an issue reported by Intel 0-day
robot. Sorry for the inconvenience.
Replaced those with the previous fixes, thanks. Please just send a fix
on-top next time
tps://lore.kernel.org/all/20211002124012.18186-1-ajaygargn...@gmail.com/
Link:
https://lore.kernel.org/r/163659074748.1617923.12716161410774184024.stgit@omen
Signed-off-by: Lu Baolu
---
drivers/iommu/intel/iommu.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/driv
Hi Joerg,
Update this series with a fix for an issue reported by Intel 0-day
robot. Sorry for the inconvenience.
Best regards,
baolu
change log:
v1:
https://lore.kernel.org/all/20211122032458.2549761-1-baolu...@linux.intel.com/
v2: For the patch titled "iommu/vt-d: Fix unmap_pages support",
quot;)
Signed-off-by: Christophe JAILLET
Link:
https://lore.kernel.org/r/40cc077ca5f543614eab2a10e84d29dd190273f6.1636217517.git.christophe.jail...@wanadoo.fr
Signed-off-by: Lu Baolu
---
drivers/iommu/intel/cap_audit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a
On 2021/11/22 11:24, Lu Baolu wrote:
From: Alex Williamson
When supporting only the .map and .unmap callbacks of iommu_ops,
the IOMMU driver can make assumptions about the size and alignment
used for mappings based on the driver provided pgsize_bitmap. VT-d
previously used essentially
On 2021/11/23 18:55, Joerg Roedel wrote:
From: Joerg Roedel
The macro is unused after commit 00ecd5401349a so it can be removed.
Reported-by: Linus Torvalds
Fixes: 00ecd5401349a ("iommu/vt-d: Clean up unused PASID updating functions")
Reviewed-by: Lu Baolu
Best regards,
baol
tps://lore.kernel.org/all/20211002124012.18186-1-ajaygargn...@gmail.com/
Link:
https://lore.kernel.org/r/163659074748.1617923.12716161410774184024.stgit@omen
Signed-off-by: Lu Baolu
---
drivers/iommu/intel/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iomm
quot;)
Signed-off-by: Christophe JAILLET
Link:
https://lore.kernel.org/r/40cc077ca5f543614eab2a10e84d29dd190273f6.1636217517.git.christophe.jail...@wanadoo.fr
Signed-off-by: Lu Baolu
---
drivers/iommu/intel/cap_audit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a
Please consider them for the iommu/fix branch.
Best regards,
Lu Baolu
Alex Williamson (1):
iommu/vt-d: Fix unmap_pages support
Christophe JAILLET (1):
iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock()
drivers/iommu/intel/cap_audit.c | 5 +++--
drivers/iommu/intel/iommu.c | 2
Hi Joerg,
On 11/19/21 11:06 PM, Jörg Rödel wrote:
On Fri, Nov 19, 2021 at 07:14:10PM +0800, Lu Baolu wrote:
The singleton group requirement for iommu_attach/detach_device() was
added by below commit:
commit 426a273834eae65abcfc7132a21a85b3151e0bce
Author: Joerg Roedel
Date: Thu May 28 18
On 2021/11/19 13:44, Tian, Kevin wrote:
From: Jason Gunthorpe
Sent: Thursday, November 18, 2021 9:33 PM
In concept a singleton group is different from a
multi-devices group which has only one device bound to driver...
Really? Why? I don't see it that way..
A singleton group is just a multi-
Hi Jerry,
On 11/19/21 3:48 AM, Jerry Snitselaar wrote:
On Fri, 2021-11-12 at 10:59 +0800, Lu Baolu wrote:
Hi Alex,
On 11/11/21 8:32 AM, Alex Williamson wrote:
When supporting only the .map and .unmap callbacks of iommu_ops,
the IOMMU driver can make assumptions about the size and alignment
On 11/17/21 9:35 PM, Jason Gunthorpe wrote:
On Wed, Nov 17, 2021 at 01:22:19PM +0800, Lu Baolu wrote:
Hi Jason,
On 11/16/21 9:46 PM, Jason Gunthorpe wrote:
On Tue, Nov 16, 2021 at 09:57:30AM +0800, Lu Baolu wrote:
Hi Christoph,
On 11/15/21 9:14 PM, Christoph Hellwig wrote:
On Mon, Nov 15
Hi Jason,
On 11/16/21 9:46 PM, Jason Gunthorpe wrote:
On Tue, Nov 16, 2021 at 09:57:30AM +0800, Lu Baolu wrote:
Hi Christoph,
On 11/15/21 9:14 PM, Christoph Hellwig wrote:
On Mon, Nov 15, 2021 at 10:05:42AM +0800, Lu Baolu wrote:
+enum iommu_dma_owner {
+ DMA_OWNER_NONE
Hi Christoph,
On 2021/11/15 21:27, Christoph Hellwig wrote:
On Mon, Nov 15, 2021 at 10:05:47AM +0800, Lu Baolu wrote:
The vfio needs to set DMA_OWNER_USER for the entire group when attaching
The vfio subsystem? driver?
"vfio subsystem"
it to a vfio container. So expose grou
On 2021/11/15 21:22, Christoph Hellwig wrote:
On Mon, Nov 15, 2021 at 10:05:46AM +0800, Lu Baolu wrote:
+ /*
+* The UNMANAGED domain should be detached before all
USER
+* owners have been released
Hi Bjorn,
On 2021/11/16 4:44, Bjorn Helgaas wrote:
On Mon, Nov 15, 2021 at 10:05:45AM +0800, Lu Baolu wrote:
IOMMU grouping on PCI necessitates that if we lack isolation on a bridge
then all of the downstream devices will be part of the same IOMMU group
as the bridge.
I think this means
Hi Bjorn,
On 11/16/21 6:17 AM, Bjorn Helgaas wrote:
On Mon, Nov 15, 2021 at 10:05:44AM +0800, Lu Baolu wrote:
pci_stub allows the admin to block driver binding on a device and make
it permanently shared with userspace. Since pci_stub does not do DMA,
it is safe. However the admin must
Hi Christoph,
On 11/15/21 9:14 PM, Christoph Hellwig wrote:
On Mon, Nov 15, 2021 at 10:05:42AM +0800, Lu Baolu wrote:
+enum iommu_dma_owner {
+ DMA_OWNER_NONE,
+ DMA_OWNER_KERNEL,
+ DMA_OWNER_USER,
+};
+
+ enum iommu_dma_owner dma_owner;
+ refcount_t owner_cnt
Hi Bjorn,
On 11/16/21 4:38 AM, Bjorn Helgaas wrote:
On Mon, Nov 15, 2021 at 10:05:42AM +0800, Lu Baolu wrote:
From the perspective of who is initiating the device to do DMA, device
DMA could be divided into the following types:
DMA_OWNER_KERNEL: kernel device driver intiates the DMA
The iommu group changes notifer is not referenced in the tree. Remove it
to avoid dead code.
Suggested-by: Christoph Hellwig
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 23 -
drivers/iommu/iommu.c | 75 ---
2 files changed, 98
ff-by: Lu Baolu
---
drivers/vfio/vfio.c | 147
1 file changed, 147 deletions(-)
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 8c317d1a0f3c..c74e10044af4 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -71,7 +71,6 @@ s
_group_dev() returns, so simply delete the
unbound_list entirely.
Reviewed-by: Chaitanya Kulkarni
Signed-off-by: Jason Gunthorpe
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 74 ++---
1 file changed, 2 insertions(+), 72 deletions(-)
diff --git a/d
The only remaining reference is in GROUP_GET_STATUS, which could be
called at any time when group fd is valid. Here we just replace the
vfio_group_viable() by directly calling iommu core to get viability
status.
Signed-off-by: Lu Baolu
---
drivers/vfio/vfio.c | 18 ++
1 file c
Set DMA_OWNER_USER when an iommu group is set to a container, and
release DMA_OWNER_USER once the iommu group is unset from a container.
Signed-off-by: Lu Baolu
---
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 1 +
drivers/vfio/pci/vfio_pci.c | 3 +++
drivers/vfio/platform/vfio_amba.c
assignment, for
compatibility with VFIO_GROUP_FLAGS_VIABLE.
Signed-off-by: Lu Baolu
---
include/linux/iommu.h | 21
drivers/iommu/iommu.c | 57 +++
2 files changed, 78 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux
. Vice versa, the default domain should be re-attached to
the group after the last DMA_OWNER_USER is released.
Signed-off-by: Lu Baolu
---
drivers/iommu/iommu.c | 36 +---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers
Suggested-by: Jason Gunthorpe
Suggested-by: Kevin Tian
Signed-off-by: Lu Baolu
---
drivers/pci/pcie/portdrv_pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 35eca6277a96..1285862a9aa8 100644
--- a/drivers/pci/pcie
pci_stub allows the admin to block driver binding on a device and make
it permanently shared with userspace. Since pci_stub does not do DMA,
it is safe. However the admin must understand that using pci_stub allows
userspace to attack whatever device it was bound to.
Signed-off-by: Lu Baolu
evice
to userspace.
Suggested-by: Jason Gunthorpe
Link: https://lore.kernel.org/linux-iommu/20210922123931.gi327...@nvidia.com/
Link: https://lore.kernel.org/linux-iommu/20210928115751.gk964...@nvidia.com/
Signed-off-by: Lu Baolu
---
include/linux/device/driver.h | 7 ++-
drivers/base
601 - 700 of 2572 matches
Mail list logo