* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
[not found] <0-v1-8c5f369ec2e5+75-arm_no_split_jgg@nvidia.com>
@ 2024-10-24 13:05 ` Will Deacon
2024-10-24 13:44 ` Jason Gunthorpe
2024-11-01 11:58 ` Will Deacon
2024-11-01 13:40 ` Jason Gunthorpe
2 siblings, 1 reply; 9+ messages in thread
From: Will Deacon @ 2024-10-24 13:05 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy,
Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
Hi Jason,
On Fri, Oct 18, 2024 at 02:19:26PM -0300, Jason Gunthorpe wrote:
> Of the page table implementations (AMD v1/2, VT-D SS, ARM32, DART)
> arm_lpae is unique in how it handles partial unmap of large IOPTEs.
>
> All other drivers will unmap the large IOPTE and return it's length. For
> example if a 2M IOPTE is present and the first 4K is requested to be
> unmapped then unmap will remove the whole 2M and report 2M as the result.
>
> arm_lpae instead replaces the IOPTE with a table of smaller IOPTEs, unmaps
> the 4K and returns 4k. This is actually an illegal/non-hitless operation
> on at least SMMUv3 because of the BBM level 0 rules.
>
> Long ago VFIO could trigger a path like this, today I know of no user of
> this functionality.
>
> Given it doesn't work fully correctly on SMMUv3 and would create
> portability problems if any user depends on it, remove the unique support
> in arm_lpae and align with the expected iommu interface.
>
> Outside the iommu users, this will potentially effect io_pgtable users of
> ARM_32_LPAE_S1, ARM_32_LPAE_S2, ARM_64_LPAE_S1, ARM_64_LPAE_S2, and
> ARM_MALI_LPAE formats.
>
> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/iommu/io-pgtable-arm.c | 72 +++-------------------------------
> 1 file changed, 6 insertions(+), 66 deletions(-)
I'd love to drop this, but I'm sure it was needed when I added it :/
My recollection is hazy, but I seem to remember VFIO using the largest
page sizes in the IOMMU 'pgsize_bitmap' for map() requests but then
using the smallest page size for unmap() requests, so you'd end up
cracking block mappings when tearing down a VM with assigne devices.
Is this what you're referring to when you say?
> Long ago VFIO could trigger a path like this, today I know of no user of
> this functionality.
If so, please can you provide a reference to the patch that moved VFIO
off that problematic behaviour?
Thanks!
Will
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
2024-10-24 13:05 ` [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior Will Deacon
@ 2024-10-24 13:44 ` Jason Gunthorpe
2024-11-01 11:54 ` Will Deacon
0 siblings, 1 reply; 9+ messages in thread
From: Jason Gunthorpe @ 2024-10-24 13:44 UTC (permalink / raw)
To: Will Deacon
Cc: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy,
Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
On Thu, Oct 24, 2024 at 02:05:53PM +0100, Will Deacon wrote:
> My recollection is hazy, but I seem to remember VFIO using the largest
> page sizes in the IOMMU 'pgsize_bitmap' for map() requests but then
> using the smallest page size for unmap() requests, so you'd end up
> cracking block mappings when tearing down a VM with assigne devices.
>
> Is this what you're referring to when you say?
Sounds like it, but I'm really hazy on the long ago history here.
> > Long ago VFIO could trigger a path like this, today I know of no user of
> > this functionality.
>
> If so, please can you provide a reference to the patch that moved VFIO
> off that problematic behaviour?
Looking more deeply, I'm not really sure VFIO ever required this.
vfio commit 166fd7d94afd ("vfio: hugepage support for
vfio_iommu_type1") is the thing that added the huge page support, and
it called map like:
+ ret = iommu_map(iommu->domain, iova,
+ (phys_addr_t)pfn << PAGE_SHIFT,
+ npage << PAGE_SHIFT, prot);
But then the unmap path still looked like:
+ unmapped = iommu_unmap(iommu->domain, iova, PAGE_SIZE);
+ unlocked += vfio_unpin_pages(phys >> PAGE_SHIFT,
+ unmapped >> PAGE_SHIFT,
+ dma->prot, false);
So at that time it was relying on the "unmap smaller gives the larger
size" trick that we see Intel and AMD implementing today. No
requirement for split, but the ARM split code could be triggered.
Next came the introduction of VFIO_TYPE1v2_IOMMU which eliminated the
ability for userspace to request splitting a mapping. Userspace can
only unmap what userspace maps. commit 1ef3e2bc0422
("vfio/iommu_type1: Multi-IOMMU domain support")
To do this, our DMA tracking needs to change. We currently try to
coalesce user mappings into as few tracking entries as possible. The
problem then becomes that we lose granularity of user mappings. We've
never guaranteed that a user is able to unmap at a finer granularity
than the original mapping, but we must honor the granularity of the
original mapping. This coalescing code is therefore removed, allowing
only unmaps covering complete maps. The change in accounting is
fairly small here, a typical QEMU VM will start out with roughly a
dozen entries, so it's arguable if this coalescing was ever needed.
That blocked any requirement for splitting driven by the uAPI. Noting
uAPI based splitting never worked right and AFAICT AMD didn't
implement split at the time.
Finally, commit 6fe1010d6d9c ("vfio/type1: DMA unmap chunking")
changed the unmap loop to this:
- unmapped = iommu_unmap(domain->domain, iova, PAGE_SIZE);
+ /*
+ * To optimize for fewer iommu_unmap() calls, each of which
+ * may require hardware cache flushing, try to find the
+ * largest contiguous physical memory chunk to unmap.
+ */
+ for (len = PAGE_SIZE;
+ !domain->fgsp && iova + len < end; len += PAGE_SIZE) {
+ next = iommu_iova_to_phys(domain->domain, iova + len);
+ if (next != phys + len)
+ break;
+ }
+
+ unmapped = iommu_unmap(domain->domain, iova, len);
fgsp=true is only possible on AMD, and this loop effectively
guarantees that the iommu driver will never see a partial huge page
unmap as the size is discovered via iommu_iova_to_phys() before
calling unmap.
At that point only the AMD driver will ever see a page size that is
smaller than what is in the radix tree.
Jason
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
2024-10-24 13:44 ` Jason Gunthorpe
@ 2024-11-01 11:54 ` Will Deacon
0 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2024-11-01 11:54 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy,
Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
Hi Jason,
On Thu, Oct 24, 2024 at 10:44:11AM -0300, Jason Gunthorpe wrote:
> On Thu, Oct 24, 2024 at 02:05:53PM +0100, Will Deacon wrote:
>
> > My recollection is hazy, but I seem to remember VFIO using the largest
> > page sizes in the IOMMU 'pgsize_bitmap' for map() requests but then
> > using the smallest page size for unmap() requests, so you'd end up
> > cracking block mappings when tearing down a VM with assigne devices.
> >
> > Is this what you're referring to when you say?
>
> Sounds like it, but I'm really hazy on the long ago history here.
>
> > > Long ago VFIO could trigger a path like this, today I know of no user of
> > > this functionality.
> >
> > If so, please can you provide a reference to the patch that moved VFIO
> > off that problematic behaviour?
>
> Looking more deeply, I'm not really sure VFIO ever required this.
>
> vfio commit 166fd7d94afd ("vfio: hugepage support for
> vfio_iommu_type1") is the thing that added the huge page support, and
> it called map like:
>
> + ret = iommu_map(iommu->domain, iova,
> + (phys_addr_t)pfn << PAGE_SHIFT,
> + npage << PAGE_SHIFT, prot);
>
> But then the unmap path still looked like:
>
> + unmapped = iommu_unmap(iommu->domain, iova, PAGE_SIZE);
> + unlocked += vfio_unpin_pages(phys >> PAGE_SHIFT,
> + unmapped >> PAGE_SHIFT,
> + dma->prot, false);
>
> So at that time it was relying on the "unmap smaller gives the larger
> size" trick that we see Intel and AMD implementing today. No
> requirement for split, but the ARM split code could be triggered.
Urgh, I'm not sure I was ever fully aware of that "trick". That's really
horrible!
> Next came the introduction of VFIO_TYPE1v2_IOMMU which eliminated the
> ability for userspace to request splitting a mapping. Userspace can
> only unmap what userspace maps. commit 1ef3e2bc0422
> ("vfio/iommu_type1: Multi-IOMMU domain support")
>
> To do this, our DMA tracking needs to change. We currently try to
> coalesce user mappings into as few tracking entries as possible. The
> problem then becomes that we lose granularity of user mappings. We've
> never guaranteed that a user is able to unmap at a finer granularity
> than the original mapping, but we must honor the granularity of the
> original mapping. This coalescing code is therefore removed, allowing
> only unmaps covering complete maps. The change in accounting is
> fairly small here, a typical QEMU VM will start out with roughly a
> dozen entries, so it's arguable if this coalescing was ever needed.
>
> That blocked any requirement for splitting driven by the uAPI. Noting
> uAPI based splitting never worked right and AFAICT AMD didn't
> implement split at the time.
>
> Finally, commit 6fe1010d6d9c ("vfio/type1: DMA unmap chunking")
> changed the unmap loop to this:
>
> - unmapped = iommu_unmap(domain->domain, iova, PAGE_SIZE);
> + /*
> + * To optimize for fewer iommu_unmap() calls, each of which
> + * may require hardware cache flushing, try to find the
> + * largest contiguous physical memory chunk to unmap.
> + */
> + for (len = PAGE_SIZE;
> + !domain->fgsp && iova + len < end; len += PAGE_SIZE) {
> + next = iommu_iova_to_phys(domain->domain, iova + len);
> + if (next != phys + len)
> + break;
> + }
> +
> + unmapped = iommu_unmap(domain->domain, iova, len);
>
> fgsp=true is only possible on AMD, and this loop effectively
> guarantees that the iommu driver will never see a partial huge page
> unmap as the size is discovered via iommu_iova_to_phys() before
> calling unmap.
Talking to Robin, he reminded me of:
7c6d90e2bb1a ("iommu/io-pgtable-arm: Fix iova_to_phys for block entries")
which looks like it fixes a bug which would've defeated the VFIO chunking
in your snippet above.
But we're all good now, so I'm in favour of dropping this. Let's just
cram some of this history into the commit message so we know why we're
happy to do so.
Lemme go look at the actual diff now...
Cheers,
Will
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
[not found] <0-v1-8c5f369ec2e5+75-arm_no_split_jgg@nvidia.com>
2024-10-24 13:05 ` [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior Will Deacon
@ 2024-11-01 11:58 ` Will Deacon
2024-11-01 15:37 ` Jason Gunthorpe
2024-11-01 13:40 ` Jason Gunthorpe
2 siblings, 1 reply; 9+ messages in thread
From: Will Deacon @ 2024-11-01 11:58 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy,
Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
On Fri, Oct 18, 2024 at 02:19:26PM -0300, Jason Gunthorpe wrote:
> Of the page table implementations (AMD v1/2, VT-D SS, ARM32, DART)
> arm_lpae is unique in how it handles partial unmap of large IOPTEs.
>
> All other drivers will unmap the large IOPTE and return it's length. For
> example if a 2M IOPTE is present and the first 4K is requested to be
> unmapped then unmap will remove the whole 2M and report 2M as the result.
>
> arm_lpae instead replaces the IOPTE with a table of smaller IOPTEs, unmaps
> the 4K and returns 4k. This is actually an illegal/non-hitless operation
> on at least SMMUv3 because of the BBM level 0 rules.
>
> Long ago VFIO could trigger a path like this, today I know of no user of
> this functionality.
>
> Given it doesn't work fully correctly on SMMUv3 and would create
> portability problems if any user depends on it, remove the unique support
> in arm_lpae and align with the expected iommu interface.
>
> Outside the iommu users, this will potentially effect io_pgtable users of
> ARM_32_LPAE_S1, ARM_32_LPAE_S2, ARM_64_LPAE_S1, ARM_64_LPAE_S2, and
> ARM_MALI_LPAE formats.
>
> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/iommu/io-pgtable-arm.c | 72 +++-------------------------------
> 1 file changed, 6 insertions(+), 66 deletions(-)
>
> I don't know anything in the iommu space that needs this, and this is the only
> page table implementation in iommu that does it.
I think the v7s code does it as well, so please can you apply the same
treatment to arm_v7s_split_blk_unmap()?
> @@ -678,12 +618,12 @@ static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
>
> return i * size;
> } else if (iopte_leaf(pte, lvl, iop->fmt)) {
> - /*
> - * Insert a table at the next level to map the old region,
> - * minus the part we want to unmap
> - */
> - return arm_lpae_split_blk_unmap(data, gather, iova, size, pte,
> - lvl + 1, ptep, pgcount);
> + /* Unmap the entire large IOPTE and return its size */
> + size = ARM_LPAE_BLOCK_SIZE(lvl, data);
If I understand your other message correctly, we shouldn't actually get
into this situation any more, right? In which case, can we WARN_ONCE()
and return 0 instead? Over-unmapping is filthy!
Will
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
2024-11-01 11:58 ` Will Deacon
@ 2024-11-01 15:37 ` Jason Gunthorpe
0 siblings, 0 replies; 9+ messages in thread
From: Jason Gunthorpe @ 2024-11-01 15:37 UTC (permalink / raw)
To: Will Deacon
Cc: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy,
Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
On Fri, Nov 01, 2024 at 11:58:29AM +0000, Will Deacon wrote:
> On Fri, Oct 18, 2024 at 02:19:26PM -0300, Jason Gunthorpe wrote:
> > Of the page table implementations (AMD v1/2, VT-D SS, ARM32, DART)
> > arm_lpae is unique in how it handles partial unmap of large IOPTEs.
> >
> > All other drivers will unmap the large IOPTE and return it's length. For
> > example if a 2M IOPTE is present and the first 4K is requested to be
> > unmapped then unmap will remove the whole 2M and report 2M as the result.
> >
> > arm_lpae instead replaces the IOPTE with a table of smaller IOPTEs, unmaps
> > the 4K and returns 4k. This is actually an illegal/non-hitless operation
> > on at least SMMUv3 because of the BBM level 0 rules.
> >
> > Long ago VFIO could trigger a path like this, today I know of no user of
> > this functionality.
> >
> > Given it doesn't work fully correctly on SMMUv3 and would create
> > portability problems if any user depends on it, remove the unique support
> > in arm_lpae and align with the expected iommu interface.
> >
> > Outside the iommu users, this will potentially effect io_pgtable users of
> > ARM_32_LPAE_S1, ARM_32_LPAE_S2, ARM_64_LPAE_S1, ARM_64_LPAE_S2, and
> > ARM_MALI_LPAE formats.
> >
> > Cc: Boris Brezillon <boris.brezillon@collabora.com>
> > Cc: Steven Price <steven.price@arm.com>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> > ---
> > drivers/iommu/io-pgtable-arm.c | 72 +++-------------------------------
> > 1 file changed, 6 insertions(+), 66 deletions(-)
> >
> > I don't know anything in the iommu space that needs this, and this is the only
> > page table implementation in iommu that does it.
>
> I think the v7s code does it as well, so please can you apply the same
> treatment to arm_v7s_split_blk_unmap()?
I have that patch written, I'm not as confident in it as it is much
more complex, but it passes my simple tests.
However, if we make it fail and WARN_ON that should simplify it alot.
> > @@ -678,12 +618,12 @@ static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
> >
> > return i * size;
> > } else if (iopte_leaf(pte, lvl, iop->fmt)) {
> > - /*
> > - * Insert a table at the next level to map the old region,
> > - * minus the part we want to unmap
> > - */
> > - return arm_lpae_split_blk_unmap(data, gather, iova, size, pte,
> > - lvl + 1, ptep, pgcount);
> > + /* Unmap the entire large IOPTE and return its size */
> > + size = ARM_LPAE_BLOCK_SIZE(lvl, data);
>
> If I understand your other message correctly, we shouldn't actually get
> into this situation any more, right? In which case, can we WARN_ONCE()
> and return 0 instead? Over-unmapping is filthy!
VFIO won't do it (except on AMD), I have not tried to figure out if
something else might depend on it over-unmapping.
So, OK, let's try the WARN_ON and it is very easy to put the above
hunk back as a fixup if someone hits it.
Jason
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
[not found] <0-v1-8c5f369ec2e5+75-arm_no_split_jgg@nvidia.com>
2024-10-24 13:05 ` [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior Will Deacon
2024-11-01 11:58 ` Will Deacon
@ 2024-11-01 13:40 ` Jason Gunthorpe
2024-11-04 11:32 ` Will Deacon
2 siblings, 1 reply; 9+ messages in thread
From: Jason Gunthorpe @ 2024-11-01 13:40 UTC (permalink / raw)
To: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy, Will Deacon
Cc: Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
On Fri, Oct 18, 2024 at 02:19:26PM -0300, Jason Gunthorpe wrote:
> Of the page table implementations (AMD v1/2, VT-D SS, ARM32, DART)
> arm_lpae is unique in how it handles partial unmap of large IOPTEs.
>
> All other drivers will unmap the large IOPTE and return it's length. For
> example if a 2M IOPTE is present and the first 4K is requested to be
> unmapped then unmap will remove the whole 2M and report 2M as the result.
>
> arm_lpae instead replaces the IOPTE with a table of smaller IOPTEs, unmaps
> the 4K and returns 4k. This is actually an illegal/non-hitless operation
> on at least SMMUv3 because of the BBM level 0 rules.
>
> Long ago VFIO could trigger a path like this, today I know of no user of
> this functionality.
>
> Given it doesn't work fully correctly on SMMUv3 and would create
> portability problems if any user depends on it, remove the unique support
> in arm_lpae and align with the expected iommu interface.
>
> Outside the iommu users, this will potentially effect io_pgtable users of
> ARM_32_LPAE_S1, ARM_32_LPAE_S2, ARM_64_LPAE_S1, ARM_64_LPAE_S2, and
> ARM_MALI_LPAE formats.
>
> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Liviu Dudau <liviu.dudau@arm.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/iommu/io-pgtable-arm.c | 72 +++-------------------------------
> 1 file changed, 6 insertions(+), 66 deletions(-)
Updated commit message - Will let me know if you want me to resend
with this, or any changes:
iommu/io-pgtable-arm: Remove split on unmap behavior
A minority of page table implementations (arm_lpae, armv7) are unique in
how they handle partial unmap of large IOPTEs.
Other implementations will unmap the large IOPTE and return it's
length. For example if a 2M IOPTE is present and the first 4K is requested
to be unmapped then unmap will remove the whole 2M and report 2M as the
result.
arm_lpae instead replaces the IOPTE with a table of smaller IOPTEs, unmaps
the 4K and returns 4k. This is actually an illegal/non-hitless operation
on at least SMMUv3 because of the BBM level 0 rules.
Will says this was done to support VFIO, but upon deeper analysis this was
never strictly necessary:
https://lore.kernel.org/all/20241024134411.GA6956@nvidia.com/
In summary, historical VFIO supported the AMD behavior of unmapping the
whole large IOPTE and returning the size, even if asked to unmap a
portion. The driver would see this as a request to split a large IOPTE.
Modern VFIO always unmaps entire large IOPTEs (except on AMD) and drivers
don't see an IOPTE split.
Given it doesn't work fully correctly on SMMUv3 and relying on ARM unique
behavior would create portability problems across IOMMU drivers, retire
this functionality.
Outside the iommu users, this will potentially effect io_pgtable users of
ARM_32_LPAE_S1, ARM_32_LPAE_S2, ARM_64_LPAE_S1, ARM_64_LPAE_S2, and
ARM_MALI_LPAE formats.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
2024-11-01 13:40 ` Jason Gunthorpe
@ 2024-11-04 11:32 ` Will Deacon
2025-07-05 20:12 ` Daniel Mentz
0 siblings, 1 reply; 9+ messages in thread
From: Will Deacon @ 2024-11-04 11:32 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: iommu, Joerg Roedel, linux-arm-kernel, Robin Murphy,
Boris Brezillon, dri-devel, Liviu Dudau, patches, Steven Price
On Fri, Nov 01, 2024 at 10:40:05AM -0300, Jason Gunthorpe wrote:
> On Fri, Oct 18, 2024 at 02:19:26PM -0300, Jason Gunthorpe wrote:
> > Of the page table implementations (AMD v1/2, VT-D SS, ARM32, DART)
> > arm_lpae is unique in how it handles partial unmap of large IOPTEs.
> >
> > All other drivers will unmap the large IOPTE and return it's length. For
> > example if a 2M IOPTE is present and the first 4K is requested to be
> > unmapped then unmap will remove the whole 2M and report 2M as the result.
> >
> > arm_lpae instead replaces the IOPTE with a table of smaller IOPTEs, unmaps
> > the 4K and returns 4k. This is actually an illegal/non-hitless operation
> > on at least SMMUv3 because of the BBM level 0 rules.
> >
> > Long ago VFIO could trigger a path like this, today I know of no user of
> > this functionality.
> >
> > Given it doesn't work fully correctly on SMMUv3 and would create
> > portability problems if any user depends on it, remove the unique support
> > in arm_lpae and align with the expected iommu interface.
> >
> > Outside the iommu users, this will potentially effect io_pgtable users of
> > ARM_32_LPAE_S1, ARM_32_LPAE_S2, ARM_64_LPAE_S1, ARM_64_LPAE_S2, and
> > ARM_MALI_LPAE formats.
> >
> > Cc: Boris Brezillon <boris.brezillon@collabora.com>
> > Cc: Steven Price <steven.price@arm.com>
> > Cc: Liviu Dudau <liviu.dudau@arm.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> > ---
> > drivers/iommu/io-pgtable-arm.c | 72 +++-------------------------------
> > 1 file changed, 6 insertions(+), 66 deletions(-)
>
> Updated commit message - Will let me know if you want me to resend
> with this, or any changes:
Thanks! Please send a new version with this text, the WARN we discussed
in the other part of the thread and also attacking the v7s code.
Cheers,
Will
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
2024-11-04 11:32 ` Will Deacon
@ 2025-07-05 20:12 ` Daniel Mentz
2025-07-07 16:05 ` Liviu Dudau
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Mentz @ 2025-07-05 20:12 UTC (permalink / raw)
To: Will Deacon
Cc: Jason Gunthorpe, iommu, Joerg Roedel, linux-arm-kernel,
Robin Murphy, Boris Brezillon, dri-devel, Liviu Dudau, patches,
Steven Price
With the removal of arm_lpae_split_blk_unmap, I believe the following
macros are now unused. Is there any interest in removing those as
well? If so, I can draft a patch.
#define ARM_LPAE_PTE_ATTR_LO_MASK (((arm_lpae_iopte)0x3ff) << 2)
/* Ignore the contiguous bit for block splitting */
#define ARM_LPAE_PTE_ATTR_HI_MASK (ARM_LPAE_PTE_XN | ARM_LPAE_PTE_DBM)
#define ARM_LPAE_PTE_ATTR_MASK (ARM_LPAE_PTE_ATTR_LO_MASK | \
ARM_LPAE_PTE_ATTR_HI_MASK)
#define iopte_prot(pte) ((pte) & ARM_LPAE_PTE_ATTR_MASK)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] iommu/io-pgtable-arm: Remove split on unmap behavior
2025-07-05 20:12 ` Daniel Mentz
@ 2025-07-07 16:05 ` Liviu Dudau
0 siblings, 0 replies; 9+ messages in thread
From: Liviu Dudau @ 2025-07-07 16:05 UTC (permalink / raw)
To: Daniel Mentz
Cc: Will Deacon, Jason Gunthorpe, iommu, Joerg Roedel,
linux-arm-kernel, Robin Murphy, Boris Brezillon, dri-devel,
patches, Steven Price
On Sat, Jul 05, 2025 at 01:12:09PM -0700, Daniel Mentz wrote:
> With the removal of arm_lpae_split_blk_unmap, I believe the following
> macros are now unused. Is there any interest in removing those as
> well? If so, I can draft a patch.
>
> #define ARM_LPAE_PTE_ATTR_LO_MASK (((arm_lpae_iopte)0x3ff) << 2)
> /* Ignore the contiguous bit for block splitting */
> #define ARM_LPAE_PTE_ATTR_HI_MASK (ARM_LPAE_PTE_XN | ARM_LPAE_PTE_DBM)
> #define ARM_LPAE_PTE_ATTR_MASK (ARM_LPAE_PTE_ATTR_LO_MASK | \
> ARM_LPAE_PTE_ATTR_HI_MASK)
> #define iopte_prot(pte) ((pte) & ARM_LPAE_PTE_ATTR_MASK)
Yes, I think these can be removed as I cannot find any users.
Thanks for offering to clean it up!
Best regards,
Liviu
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 9+ messages in thread