Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-10-08 Thread Baolu Lu
On 2024/9/30 15:19, Tian, Kevin wrote: From: Baolu Lu Sent: Friday, September 13, 2024 10:17 AM On 9/13/24 9:35 AM, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: +static void intel_iommu_remove_dev_pasid(struct device *dev, ioasid_t pasid, + struct iommu_domain

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-13 Thread Baolu Lu
On 9/13/24 8:21 PM, Yi Liu wrote: On 2024/9/13 09:42, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4325,24 +4363,18 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain,   ret = intel_pasid_setup_second_level(iommu, dmar_domain

Re: [PATCH v4 01/10] iommu: Introduce a replace API for device pasid

2024-09-12 Thread Baolu Lu
On 9/12/24 9:12 PM, Yi Liu wrote: Provide a high-level API to allow replacements of one domain with another for specific pasid of a device. This is similar to iommu_group_replace_domain() and it is expected to be used only by IOMMUFD. Co-developed-by: Lu Baolu Signed-off-by: Lu Baolu Signed-of

Re: [PATCH 3/3] iommu: Add a wrapper for remove_dev_pasid

2024-09-12 Thread Baolu Lu
On 9/12/24 9:06 PM, Yi Liu wrote: The iommu drivers are on the way to drop the remove_dev_pasid op by extending the blocked_domain to support PASID. However, this cannot be done in one shot. So far, the Intel iommu and the ARM SMMUv3 driver have supported it, while the AMD iommu driver has not ye

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-12 Thread Baolu Lu
On 9/13/24 9:35 AM, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: set_dev_pasid op is going to support domain replacement and keep the old hardware config if it fails. Make the Intel iommu driver be prepared for it. Signed-off-by: Yi Liu ---   drivers/iommu/intel/iommu.c | 98

Re: [PATCH v2 2/6] iommu/vt-d: Move intel_drain_pasid_prq() into intel_pasid_tear_down_entry()

2024-09-12 Thread Baolu Lu
On 9/12/24 9:04 PM, Yi Liu wrote: diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index b51fc268dc84..ceb9c5274a39 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -236,8 +236,13 @@ devtlb_invalidation_with_pasid(struct intel_iommu *iommu,

Re: [PATCH v2 4/6] iommu/vt-d: Add set_dev_pasid callback for nested domain

2024-09-12 Thread Baolu Lu
On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4299,7 +4304,12 @@ domain_prepare_dev_pasid(struct iommu_domain *domain, unsigned long flags; int ret; - ret = prepare_domain_attach_device(domain, dev); + /* Nested type domain should prepare its parent domain */ + if (domain_

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-12 Thread Baolu Lu
On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4325,24 +4363,18 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain, ret = intel_pasid_setup_second_level(iommu, dmar_domain, dev, pasid); if (ret) -

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-12 Thread Baolu Lu
On 9/12/24 9:04 PM, Yi Liu wrote: set_dev_pasid op is going to support domain replacement and keep the old hardware config if it fails. Make the Intel iommu driver be prepared for it. Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 98 - 1 file cha

Re: [PATCH v2 2/6] iommu/vt-d: Move intel_drain_pasid_prq() into intel_pasid_tear_down_entry()

2024-09-12 Thread Baolu Lu
On 2024/9/12 21:04, Yi Liu wrote: Draining PRQ is mostly conjuncted with pasid teardown, and with more callers coming, move it into it in the intel_pasid_tear_down_entry(). But there is scenario that only teardown pasid entry but no PRQ drain, so passing a flag to mark it. Is it a reasonable

Re: [PATCH v3 1/7] iommu: Introduce a replace API for device pasid

2024-09-05 Thread Baolu Lu
On 9/6/24 12:21 PM, Yi Liu wrote: On 2024/8/16 21:02, Jason Gunthorpe wrote: On Fri, Aug 16, 2024 at 05:43:18PM +0800, Yi Liu wrote: On 2024/7/18 16:27, Tian, Kevin wrote: From: Liu, Yi L Sent: Friday, June 28, 2024 5:06 PM @@ -3289,7 +3290,20 @@ static int __iommu_set_group_pasid(struct iom

Re: [PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-08-31 Thread Baolu Lu
On 2024/8/28 0:59, Nicolin Chen wrote: +int iommufd_viommu_alloc_ioctl(struct iommufd_ucmd *ucmd) +{ + struct iommu_viommu_alloc *cmd = ucmd->cmd; + struct iommufd_hwpt_paging *hwpt_paging; + struct iommufd_viommu *viommu; + struct iommufd_device *idev; + int rc; + +

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-12 Thread Baolu Lu
On 2024/3/12 11:07, Yi Liu wrote: On 2024/3/11 17:26, Tian, Kevin wrote: From: Liu, Yi L Sent: Sunday, March 10, 2024 9:06 PM On 2024/1/16 01:19, Jason Gunthorpe wrote: On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote: +int iommu_replace_device_pasid(struct iommu_domain *domain, + 

Re: [PATCH rc 7/8] iommu/vt-d: Wrap the dirty tracking loop to be a helper

2024-02-08 Thread Baolu Lu
On 2024/2/8 16:23, Yi Liu wrote: --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4730,23 +4730,35 @@ static void *intel_iommu_hw_info(struct device *dev, u32 *length, u32 *type) return vtd; } +static int +device_set_dirty_tracking(struct list_head *devices,

Re: [PATCH] iommu/vt-d: Set SSADE when attaching to a parent with dirty tracking

2024-02-08 Thread Baolu Lu
On 2024/2/8 17:14, Yi Liu wrote: Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the pasid entry when attaching a device to a nested domain if its parent has already enabled dirty tracking. Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested translation") Signed

Re: [PATCH rc 3/8] iommu/vt-d: Add missing iotlb flush for parent domain

2024-02-08 Thread Baolu Lu
On 2024/2/8 16:38, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, February 8, 2024 4:23 PM +/* + * Flush the relevant caches in nested translation if the domain + * also serves as a parent + */ +static void parent_domain_flush(struct dmar_domain *domain, + unsig

Re: [PATCH 8/8] iommu/vt-d: Add set_dev_pasid callback for nested domain

2024-01-17 Thread Baolu Lu
On 2024/1/16 1:22, Jason Gunthorpe wrote: On Sun, Nov 26, 2023 at 10:34:28PM -0800, Yi Liu wrote: +static int intel_nested_set_dev_pasid(struct iommu_domain *domain, + struct device *dev, ioasid_t pasid) +{ + struct device_domain_info *info = dev_iommu_

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2024-01-14 Thread Baolu Lu
On 1/15/24 1:18 AM, Joel Granados wrote: On Sun, Jan 14, 2024 at 09:13:19PM +0800, Baolu Lu wrote: On 2024/1/13 5:56, Joel Granados wrote: On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: Hi folks, This series implements the functionality of delivering IO page faults to user space

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2024-01-14 Thread Baolu Lu
On 2024/1/13 5:56, Joel Granados wrote: On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: Hi folks, This series implements the functionality of delivering IO page faults to user space through the IOMMUFD framework for nested translation. Nested translation is a hardware feature that sup

Re: [PATCH v10 10/10] iommu/vt-d: Add iotlb flush for nested domain

2024-01-02 Thread Baolu Lu
On 2024/1/3 9:33, Yi Liu wrote: On 2024/1/3 02:44, Jason Gunthorpe wrote: On Tue, Jan 02, 2024 at 06:38:34AM -0800, Yi Liu wrote: +static void intel_nested_flush_cache(struct dmar_domain *domain, u64 addr, + unsigned long npages, bool ih, u32 *error) +{ +    struct iommu_d

Re: [PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-31 Thread Baolu Lu
On 12/28/23 2:17 PM, Tian, Kevin wrote: raw_spin_lock_irqsave(&qi->q_lock, flags); /* @@ -1430,7 +1439,7 @@ int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc, * a deadlock where the interrupt context can wait indefinitely * for fr

Re: [PATCH 8/8] iommu/vt-d: Add set_dev_pasid callback for nested domain

2023-12-14 Thread Baolu Lu
On 2023/12/14 10:55, Yang, Weijiang wrote: On 11/27/2023 2:34 PM, Yi Liu wrote: From: Lu Baolu This allows the upper layers to set a nested type domain to a PASID of a device if the PASID feature is supported by the IOMMU hardware. The set_dev_pasid callback for non-nest domain has already be

Re: [PATCH v2 3/6] iommufd: Initializing and releasing IO page fault data

2023-12-12 Thread Baolu Lu
On 12/12/23 10:12 PM, Jason Gunthorpe wrote: On Tue, Dec 12, 2023 at 02:10:08PM +0100, Joel Granados wrote: diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index 645ab5d290fe..0a8e03d5e7c5 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/devic

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-08 Thread Baolu Lu
On 2023/12/1 23:24, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:28AM +0800, Lu Baolu wrote: +static ssize_t hwpt_fault_fops_write(struct file *filep, +const char __user *buf, +size_t count, loff_t *ppos) +{ +

Re: [PATCH v2 2/6] iommufd: Add iommu page fault uapi data

2023-12-07 Thread Baolu Lu
On 12/1/23 11:14 PM, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:26AM +0800, Lu Baolu wrote: + * @IOMMU_HWPT_ALLOC_IOPF_CAPABLE: User is capable of handling IO page faults. This does not seem like the best name? Probably like this given my remark in the cover letter: --- a/includ

Re: [PATCH v2 1/6] iommu: Add iommu page fault cookie helpers

2023-12-07 Thread Baolu Lu
On 12/1/23 10:38 PM, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:25AM +0800, Lu Baolu wrote: +void *iopf_pasid_cookie_get(struct device *dev, ioasid_t pasid) +{ + struct iommu_fault_param *iopf_param = iopf_get_dev_fault_param(dev); + void *curr; + + if (!iopf_param)

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-12-07 Thread Baolu Lu
On 12/1/23 10:24 PM, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: Hi folks, This series implements the functionality of delivering IO page faults to user space through the IOMMUFD framework for nested translation. Nested translation is a hardware feature that

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Baolu Lu
On 12/8/23 1:17 AM, Jason Gunthorpe wrote: On Thu, Dec 07, 2023 at 05:34:10PM +0100, Joel Granados wrote: @@ -58,6 +255,8 @@ static void hw_pagetable_fault_free(struct hw_pgtable_fault *fault) WARN_ON(!list_empty(&fault->deliver)); WARN_ON(!list_empty(&fault->response)); + fp

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-12-07 Thread Baolu Lu
On 12/4/23 11:07 PM, Joel Granados wrote: On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: Hi folks, This series implements the functionality of delivering IO page faults to user space through the IOMMUFD framework for nested translation. Nested Does this mean the IOPF_CAPABLE HWPT ne

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-11-29 Thread Baolu Lu
On 2023/11/29 17:08, Shameerali Kolothum Thodi wrote: -Original Message- From: Lu Baolu [mailto:baolu...@linux.intel.com] Sent: 26 October 2023 03:49 To: Jason Gunthorpe ; Kevin Tian ; Joerg Roedel ; Will Deacon ; Robin Murphy ; Jean-Philippe Brucker ; Nicolin Chen ; Yi Liu ; Jacob Pan

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-11-21 Thread Baolu Lu
On 11/21/23 8:17 PM, Jason Gunthorpe wrote: On Tue, Nov 21, 2023 at 02:54:15AM +, Tian, Kevin wrote: From: Jason Gunthorpe Sent: Tuesday, November 21, 2023 7:05 AM On Mon, Nov 20, 2023 at 08:26:31AM +, Tian, Kevin wrote: From: Liu, Yi L Sent: Friday, November 17, 2023 9:18 PM This a

Re: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-11-20 Thread Baolu Lu
On 11/17/23 9:07 PM, Yi Liu wrote: In nested translation, the stage-1 page table is user-managed but cached by the IOMMU hardware, so an update on present page table entries in the stage-1 page table should be followed with a cache invalidation. Add an IOMMU_HWPT_INVALIDATE ioctl to support such

Re: [PATCH] iommu/vt-d: Enhance capability check for nested parent domain allocation

2023-10-24 Thread Baolu Lu
On 10/24/23 11:00 PM, Yi Liu wrote: This adds the scalable mode check before allocating the nested parent domain as checking nested capability is not enough. User may turn off scalable mode which also means no nested support even if the hardware supports it. Fixes: c97d1b20d383 ("iommu/vt-d: Add

Re: [PATCH v6 8/8] iommu/vt-d: Disallow read-only mappings to nest parent domain

2023-10-23 Thread Baolu Lu
On 2023/10/23 19:15, Liu, Yi L wrote: I would also prefer to introduce is_nested_parent_domain to the user domain allocation patch (patch 7/8). This field should be checked when allocating a nested user domain. A ctually, no need. This should be a common check, so iommufd core already has the ch

Re: [PATCH v6 2/3] iommu/vt-d: Make iotlb flush helpers to be extern

2023-10-20 Thread Baolu Lu
On 10/20/23 5:37 PM, Yi Liu wrote: This makes the helpers visible to nested.c. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 10 +- drivers/iommu/intel/iommu.h | 6 ++ 2 files changed, 11 insertions(+), 5 deletions(-) Reviewed-by: Lu Baolu

Re: [PATCH v6 8/8] iommu/vt-d: Disallow read-only mappings to nest parent domain

2023-10-20 Thread Baolu Lu
On 10/20/23 5:32 PM, Yi Liu wrote: From: Lu Baolu When remapping hardware is configured by system software in scalable mode as Nested (PGTT=011b) and with PWSNP field Set in the PASID-table-entry, it may Set Accessed bit and Dirty bit (and Extended Access bit if enabled) in first-stage page-tab

Re: [PATCH v6 7/8] iommu/vt-d: Add nested domain allocation

2023-10-20 Thread Baolu Lu
On 10/20/23 5:32 PM, Yi Liu wrote: From: Lu Baolu This adds the support for IOMMU_HWPT_DATA_VTD_S1 type. Signed-off-by: Lu Baolu Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 39 ++--- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git

Re: [PATCH v6 5/8] iommu/vt-d: Make domain attach helpers to be extern

2023-10-20 Thread Baolu Lu
On 2023/10/20 17:32, Yi Liu wrote: This makes the helpers visible to nested.c. Suggested-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 15 ++- drivers/iommu/intel/iommu.h | 7 +++ 2 files changed, 13 insertions(+), 9 deletion

Re: [PATCH v6 3/8] iommu/vt-d: Add helper for nested domain allocation

2023-10-20 Thread Baolu Lu
On 2023/10/20 17:32, Yi Liu wrote: From: Lu Baolu This adds helper for accepting user parameters and allocate a nested domain. Reviewed-by: Kevin Tian Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Signed-off-by: Yi Liu --- drivers/iommu/intel/Makefile | 2 +- drivers/iommu/intel/iom

Re: [PATCH v4 08/17] iommufd: Always setup MSI and anforce cc on kernel-managed domains

2023-10-17 Thread Baolu Lu
On 10/17/23 4:52 PM, Tian, Kevin wrote: another problem is that intel_iommu_enforce_cache_coherency() doesn't update existing entries. It only sets a domain flag to affect future mappings. so it means the 2nd idev is also broken. This is such a gap, intel driver should not permit that. yes. @Ba

Re: [PATCH v5 04/11] iommu/vt-d: Add helper to setup pasid nested translation

2023-10-13 Thread Baolu Lu
On 2023/10/13 20:40, Yi Liu wrote: +    return -EINVAL; +    } + +    if ((s1_cfg->flags & IOMMU_VTD_S1_SRE) && !ecap_srs(iommu- ecap)) { +    pr_err_ratelimited("No supervisor request support on %s\n", +   iommu->name); +    return -EINVAL; +    } + +    if ((s1_c

Re: [PATCH v2 6/6] iommu/vt-d: Add domain_alloc_user op

2023-10-10 Thread Baolu Lu
On 10/11/23 12:43 AM, Jason Gunthorpe wrote: On Thu, Sep 28, 2023 at 12:15:28AM -0700, Yi Liu wrote: This adds the domain_alloc_user op implementation. It supports allocating domains to be used as parent under nested translation. Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 28

Re: [PATCH v2 6/6] iommu/vt-d: Add domain_alloc_user op

2023-09-28 Thread Baolu Lu
On 9/28/23 3:15 PM, Yi Liu wrote: This adds the domain_alloc_user op implementation. It supports allocating domains to be used as parent under nested translation. Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 28 1 file changed, 28 insertions(+) Review

Re: [PATCH v2 4/6] iommufd/hw_pagetable: Support allocating nested parent domain

2023-09-28 Thread Baolu Lu
On 9/28/23 3:15 PM, Yi Liu wrote: This extends IOMMU_HWPT_ALLOC to allocate domains used as parent (stage-2) in nested translation. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/hw_pagetable.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Lu Baolu Best regards,

Re: [PATCH v2 3/6] iommufd/hw_pagetable: Accepts user flags for domain allocation

2023-09-28 Thread Baolu Lu
On 9/28/23 3:15 PM, Yi Liu wrote: This extends iommufd_hw_pagetable_alloc() to accepts user flags. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 2 +- drivers/iommu/iommufd/hw_pagetable.c| 9 ++--- drivers/iommu/iommufd/iommufd_private.h

Re: [RFC 8/8] iommu/vt-d: Add set_dev_pasid callback for nested domain

2023-09-27 Thread Baolu Lu
On 2023/9/27 15:52, Tian, Kevin wrote: From: Liu, Yi L Sent: Tuesday, September 26, 2023 5:27 PM From: Lu Baolu This allows the upper layers to set a nested type domain to a PASID of a device if the PASID feature is supported by the IOMMU hardware. Signed-off-by: Lu Baolu Signed-off-by: Yi Liu

Re: [RFC 3/8] iommufd: Support attach/replace hwpt per pasid

2023-09-26 Thread Baolu Lu
On 9/26/23 5:26 PM, Yi Liu wrote: From: Kevin Tian This introduces three APIs for device drivers to manage pasid attach/ replace/detach. int iommufd_device_pasid_attach(struct iommufd_device *idev, u32 pasid, u32 *pt_id); int iommufd_device_pasid_re

Re: [RFC 2/8] iommufd: replace attach_fn with a structure

2023-09-26 Thread Baolu Lu
On 9/26/23 5:26 PM, Yi Liu wrote: Most of the core logic before conducting the actual device attach/ replace operation can be shared with pasid attach/replace. Create a new structure so more information (e.g. pasid) can be later added along with the attach_fn. Signed-off-by: Kevin Tian Signed-of

Re: [RFC 1/8] iommu: Introduce a replace API for device pasid

2023-09-26 Thread Baolu Lu
On 9/26/23 5:26 PM, Yi Liu wrote: From: Lu Baolu Provide a high-level API to allow replacements of one domain with another for specific pasid of a device. This is similar to iommu_group_replace_domain() and it is also expected to be used only by IOMMUFD. Signed-off-by: Lu Baolu Signed-off-by:

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-09-25 Thread Baolu Lu
On 2023/9/25 14:22, Yi Liu wrote: On 2023/9/21 20:10, Baolu Lu wrote: On 2023/9/21 15:51, Yi Liu wrote: +/** + * iommu_copy_user_data - Copy iommu driver specific user space data + * @dst_data: Pointer to an iommu driver specific user data that is defined in + *    include/uapi/linux

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-09-21 Thread Baolu Lu
On 2023/9/21 15:51, Yi Liu wrote: +/** + * iommu_copy_user_data - Copy iommu driver specific user space data + * @dst_data: Pointer to an iommu driver specific user data that is defined in + *include/uapi/linux/iommufd.h + * @src_data: Pointer to a struct iommu_user_data for user spac

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-09-21 Thread Baolu Lu
On 2023/9/21 15:51, Yi Liu wrote: diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h index 4a7c5c8fdbb4..3c8660fe9bb1 100644 --- a/include/uapi/linux/iommufd.h +++ b/include/uapi/linux/iommufd.h @@ -357,6 +357,14 @@ enum iommufd_hwpt_alloc_flags { IOMMU_HWPT_ALLOC_NE

Re: [PATCH v5 07/11] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-09-21 Thread Baolu Lu
On 2023/9/21 15:54, Yi Liu wrote: This adds the data structure for flushing iotlb for the nested domain allocated with IOMMU_HWPT_TYPE_VTD_S1 type. This only supports invalidating IOTLB, but no for device-TLB as device-TLB invalidation will be covered automatically in the IOTLB invalidation if t

Re: [PATCH 6/6] iommu/vt-d: Add domain_alloc_user op

2023-09-20 Thread Baolu Lu
On 9/20/23 9:10 PM, Liu, Yi L wrote: + + domain = iommu_domain_alloc(dev->bus); No need to bounce between core and driver. Just, intel_iommu_domain_alloc(IOMMU_DOMAIN_UNMANAGED); and fully initialize it before return. If you are going to do that then intel_iommu_domain_alloc() s

Re: [PATCH 6/6] iommu/vt-d: Add domain_alloc_user op

2023-09-19 Thread Baolu Lu
On 9/19/23 5:25 PM, Yi Liu wrote: This adds the domain_alloc_user op implementation. It supports allocating domains to be used as parent under nested translation. Documentation/process/submitting-patches.rst: Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[Thi

Re: [PATCH 4/6] iommufd/hw_pagetable: Support allocating nested parent domain

2023-09-19 Thread Baolu Lu
On 9/19/23 5:25 PM, Yi Liu wrote: This extends IOMMU_HWPT_ALLOC to allocate domains used as parent (stage-2) in nested translation. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/hw_pagetable.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/hw_