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@xxxxxxxxxxxxx> > > Cc: Steven Price <steven.price@xxxxxxx> > > Cc: Liviu Dudau <liviu.dudau@xxxxxxx> > > Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx > > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> > > --- > > 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