Re: [PATCH v4 4/8] iommu/vt-d: Use pci_is_display()

2025-06-23 Thread Baolu Lu
On 6/24/25 02:47, Mario Limonciello wrote: From: Mario Limonciello The inline pci_is_display() helper does the same thing. Use it. Reviewed-by: Daniel Dadap Reviewed-by: Simona Vetter Suggested-by: Bjorn Helgaas Signed-off-by: Mario Limonciello Reviewed-by: Lu Baolu

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-06-09 Thread Baolu Lu
On 6/10/25 12:20, Alexey Kardashevskiy wrote: On 31/5/25 02:23, Xu Yilun wrote: On Fri, May 30, 2025 at 12:29:30PM +1000, Alexey Kardashevskiy wrote: On 30/5/25 00:41, Xu Yilun wrote: FLR to a bound device is absolutely fine, just break the CC state. Sometimes it is exactly what host need

Re: [RFC PATCH 08/12] vfio/pci: Create host unaccessible dma-buf for private device

2025-01-19 Thread Baolu Lu
On 1/17/25 21:25, Jason Gunthorpe wrote: If my recollection is correct, the arm smmu-v3 needs it to obtain the vmid to setup the userspace event queue: Right now it will use a VMID unrelated to KVM. BTM support on ARM will require syncing the VMID with KVM. AMD and Intel may require the KVM for

Re: [RFC PATCH 08/12] vfio/pci: Create host unaccessible dma-buf for private device

2025-01-16 Thread Baolu Lu
On 1/15/25 21:01, Jason Gunthorpe wrote: On Wed, Jan 15, 2025 at 11:57:05PM +1100, Alexey Kardashevskiy wrote: On 15/1/25 00:35, Jason Gunthorpe wrote: On Tue, Jun 18, 2024 at 07:28:43AM +0800, Xu Yilun wrote: is needed so the secure world can prepare anything it needs prior to starting the V

Re: [PATCH next] drm/tegra: Fix NULL vs IS_ERR() check in probe()

2024-09-13 Thread Baolu Lu
On 9/13/24 10:34 PM, Dan Carpenter wrote: The iommu_paging_domain_alloc() function doesn't return NULL pointers, it returns error pointers. Update the check to match. Fixes: 45c690aea8ee ("drm/tegra: Use iommu_paging_domain_alloc()") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tegra/drm

Re: [PATCH 3/3] drm/tegra: Remove call to iommu_domain_alloc()

2024-09-01 Thread Baolu Lu
On 2024/8/28 23:27, Thierry Reding wrote: On Mon, Aug 12, 2024 at 03:10:34PM GMT, Lu Baolu wrote: Commit <17de3f5fdd35> ("iommu: Retire bus ops") removes iommu ops from the bus structure. The iommu subsystem no longer relies on bus for operations. So iommu_domain_alloc() interface is no longer r

Re: [PATCH v3 00/21] iommu: Refactoring domain allocation interface

2024-07-08 Thread Baolu Lu
On 7/9/24 12:34 AM, Jason Gunthorpe wrote: On Thu, Jul 04, 2024 at 03:18:56PM +0100, Will Deacon wrote: On Mon, 10 Jun 2024 16:55:34 +0800, Lu Baolu wrote: The IOMMU subsystem has undergone some changes, including the removal of iommu_ops from the bus structure. Consequently, the existing domai

Re: [PATCH v3 00/21] iommu: Refactoring domain allocation interface

2024-07-04 Thread Baolu Lu
On 2024/7/4 22:18, Will Deacon wrote: On Mon, 10 Jun 2024 16:55:34 +0800, Lu Baolu wrote: The IOMMU subsystem has undergone some changes, including the removal of iommu_ops from the bus structure. Consequently, the existing domain allocation interface, which relies on a bus type argument, is no

Re: [PATCH v3 15/21] iommu/vt-d: Add helper to allocate paging domain

2024-06-28 Thread Baolu Lu
On 2024/6/28 13:42, Yi Liu wrote: On 2024/6/10 16:55, Lu Baolu wrote: The domain_alloc_user operation is currently implemented by allocating a paging domain using iommu_domain_alloc(). This is because it needs to fully initialize the domain before return. Add a helper to do this to avoid using

Re: [PATCH v3 15/21] iommu/vt-d: Add helper to allocate paging domain

2024-06-19 Thread Baolu Lu
On 6/19/24 11:12 PM, Jason Gunthorpe wrote: On Mon, Jun 10, 2024 at 04:55:49PM +0800, Lu Baolu wrote: The domain_alloc_user operation is currently implemented by allocating a paging domain using iommu_domain_alloc(). This is because it needs to fully initialize the domain before return. Add a he

Re: [PATCH v2 01/22] iommu: Add iommu_user_domain_alloc() interface

2024-06-05 Thread Baolu Lu
On 6/5/24 2:23 PM, Yi Liu wrote: On 2024/6/5 10:00, Baolu Lu wrote: On 6/4/24 4:03 PM, Yi Liu wrote: On 2024/6/4 09:51, Lu Baolu wrote: Commit <909f4abd1097> ("iommu: Add new iommu op to create domains owned by userspace") added a dedicated iommu op to allocate a user domai

Re: [PATCH v2 02/22] iommufd: Use iommu_user_domain_alloc()

2024-06-04 Thread Baolu Lu
On 6/5/24 12:51 AM, Jason Gunthorpe wrote: On Tue, Jun 04, 2024 at 09:51:14AM +0800, Lu Baolu wrote: Replace iommu_domain_alloc() with iommu_user_domain_alloc(). Signed-off-by: Lu Baolu --- drivers/iommu/iommufd/hw_pagetable.c | 20 +--- 1 file changed, 5 insertions(+), 15 d

Re: [PATCH v2 01/22] iommu: Add iommu_user_domain_alloc() interface

2024-06-04 Thread Baolu Lu
On 6/4/24 4:03 PM, Yi Liu wrote: On 2024/6/4 09:51, Lu Baolu wrote: Commit <909f4abd1097> ("iommu: Add new iommu op to create domains owned by userspace") added a dedicated iommu op to allocate a user domain. While IOMMUFD has already made use of this callback, other frameworks like vfio/type1 a

Re: [PATCH 00/20] iommu: Refactoring domain allocation interface

2024-06-03 Thread Baolu Lu
On 6/3/24 9:35 PM, Jason Gunthorpe wrote: On Wed, May 29, 2024 at 08:02:12PM +0800, Baolu Lu wrote: drivers/infiniband/hw/usnic/usnic_uiom.c:   pd->domain = domain = iommu_domain_alloc(dev->bus); This series leave those cases unchanged and keep iommu_domain_alloc() for their usage. B

Re: [PATCH 00/20] iommu: Refactoring domain allocation interface

2024-05-30 Thread Baolu Lu
On 5/31/24 11:16 AM, Yi Liu wrote: On 2024/5/29 20:02, Baolu Lu wrote: On 2024/5/29 17:03, Yi Liu wrote: On 2024/5/29 13:32, Lu Baolu wrote: The IOMMU subsystem has undergone some changes, including the removal of iommu_ops from the bus structure. Consequently, the existing domain allocation

Re: [PATCH 00/20] iommu: Refactoring domain allocation interface

2024-05-30 Thread Baolu Lu
On 5/31/24 1:59 AM, Robin Murphy wrote: On 29/05/2024 6:32 am, Lu Baolu wrote: The IOMMU subsystem has undergone some changes, including the removal of iommu_ops from the bus structure. Consequently, the existing domain allocation interface, which relies on a bus type argument, is no longer rele

Re: [PATCH 06/20] drm/msm: Use iommu_paging_domain_alloc()

2024-05-30 Thread Baolu Lu
On 5/30/24 3:58 PM, Dmitry Baryshkov wrote: On Thu, 30 May 2024 at 04:59, Baolu Lu wrote: On 5/29/24 4:21 PM, Dmitry Baryshkov wrote: On Wed, May 29, 2024 at 01:32:36PM +0800, Lu Baolu wrote: The domain allocated in msm_iommu_new() is for the @dev. Replace iommu_domain_alloc() with

Re: [PATCH 05/20] iommu: Add iommu_paging_domain_alloc() interface

2024-05-29 Thread Baolu Lu
On 5/30/24 9:59 AM, Baolu Lu wrote: On 5/29/24 5:04 PM, Yi Liu wrote: On 2024/5/29 13:32, Lu Baolu wrote: Commit <17de3f5fdd35> ("iommu: Retire bus ops") removes iommu ops from bus. The iommu subsystem no longer relies on bus for operations. So the bus parameter in iommu_doma

Re: [PATCH 05/20] iommu: Add iommu_paging_domain_alloc() interface

2024-05-29 Thread Baolu Lu
On 5/29/24 5:04 PM, Yi Liu wrote: On 2024/5/29 13:32, Lu Baolu wrote: Commit <17de3f5fdd35> ("iommu: Retire bus ops") removes iommu ops from bus. The iommu subsystem no longer relies on bus for operations. So the bus parameter in iommu_domain_alloc() is no longer relevant. Add a new interface n

Re: [PATCH 06/20] drm/msm: Use iommu_paging_domain_alloc()

2024-05-29 Thread Baolu Lu
On 5/29/24 4:21 PM, Dmitry Baryshkov wrote: On Wed, May 29, 2024 at 01:32:36PM +0800, Lu Baolu wrote: The domain allocated in msm_iommu_new() is for the @dev. Replace iommu_domain_alloc() with iommu_paging_domain_alloc() to make it explicit. Update msm_iommu_new() to always return ERR_PTR in fa

Re: [PATCH 00/20] iommu: Refactoring domain allocation interface

2024-05-29 Thread Baolu Lu
On 2024/5/29 17:03, Yi Liu wrote: On 2024/5/29 13:32, Lu Baolu wrote: The IOMMU subsystem has undergone some changes, including the removal of iommu_ops from the bus structure. Consequently, the existing domain allocation interface, which relies on a bus type argument, is no longer relevant:   

Re: [PATCH 04/10] iommu: Mark dev_iommu_get() with lockdep

2023-11-28 Thread Baolu Lu
On 2023/11/29 8:48, Jason Gunthorpe wrote: Allocation of dev->iommu must be done under the iommu_probe_device_lock. Mark this with lockdep to discourage future mistakes. Reviewed-by: Jerry Snitselaar Tested-by: Hector Martin Signed-off-by: Jason Gunthorpe --- drivers/iommu/iommu.c | 2 ++ 1 f

Re: [PATCH 07/10] acpi: Do not return struct iommu_ops from acpi_iommu_configure_id()

2023-11-28 Thread Baolu Lu
On 2023/11/29 8:48, Jason Gunthorpe wrote: Nothing needs this pointer. Return a normal error code with the usual IOMMU semantic that ENODEV means 'there is no IOMMU driver'. Acked-by: Rafael J. Wysocki Reviewed-by: Jerry Snitselaar Tested-by: Hector Martin Signed-off-by: Jason Gunthorpe --- dr

Re: [PATCH 02/10] iommmu/of: Do not return struct iommu_ops from of_iommu_configure()

2023-11-28 Thread Baolu Lu
On 2023/11/29 8:47, Jason Gunthorpe wrote: Nothing needs this pointer. Return a normal error code with the usual IOMMU semantic that ENODEV means 'there is no IOMMU driver'. Reviewed-by: Jerry Snitselaar Acked-by: Rob Herring Tested-by: Hector Martin Signed-off-by: Jason Gunthorpe --- drivers/

Re: [PATCH v2 08/10] iommu/intel: Use GFP_KERNEL in sleepable contexts

2023-01-19 Thread Baolu Lu
On 2023/1/19 2:00, Jason Gunthorpe wrote: These contexts are sleepable, so use the proper annotation. The GFP_ATOMIC was added mechanically in the prior patches. Signed-off-by: Jason Gunthorpe Reviewed-by: Lu Baolu Best regards, baolu

Re: [PATCH v2 07/10] iommu/intel: Support the gfp argument to the map_pages op

2023-01-19 Thread Baolu Lu
On 2023/1/19 19:57, Baolu Lu wrote: On 2023/1/19 2:00, Jason Gunthorpe wrote: Flow it down to alloc_pgtable_page() via pfn_to_dma_pte() and __domain_mapping(). Signed-off-by: Jason Gunthorpe Irrelevant to this patch, GFP_ATOMIC could be changed to GFP_KERNEL in some places. I will follow up

Re: [PATCH v2 07/10] iommu/intel: Support the gfp argument to the map_pages op

2023-01-19 Thread Baolu Lu
On 2023/1/19 2:00, Jason Gunthorpe wrote: Flow it down to alloc_pgtable_page() via pfn_to_dma_pte() and __domain_mapping(). Signed-off-by: Jason Gunthorpe Irrelevant to this patch, GFP_ATOMIC could be changed to GFP_KERNEL in some places. I will follow up further to clean it up. For this patc

Re: [PATCH v2 06/10] iommu/intel: Add a gfp parameter to alloc_pgtable_page()

2023-01-19 Thread Baolu Lu
On 2023/1/19 2:00, Jason Gunthorpe wrote: This is eventually called by iommufd through intel_iommu_map_pages() and it should not be forced to atomic. Push the GFP_ATOMIC to all callers. Signed-off-by: Jason Gunthorpe Reviewed-by: Lu Baolu Best regards, baolu

Re: [PATCH 7/8] iommu/intel: Support the gfp argument to the map_pages op

2023-01-17 Thread Baolu Lu
On 2023/1/17 11:38, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Saturday, January 7, 2023 12:43 AM @@ -2368,7 +2372,7 @@ static int iommu_domain_identity_map(struct dmar_domain *domain, return __domain_mapping(domain, first_vpfn, first_vpfn, last_vpfn