Re: [PATCH 01/11] RISC-V: drivers/iommu: Add RISC-V IOMMU - Ziommu support.

From: Tomasz Jeznach
Date: Thu Jul 20 2023 - 13:30:35 EST


On Thu, Jul 20, 2023 at 5:31 AM Baolu Lu <baolu.lu@xxxxxxxxxxxxxxx> wrote:
>
> On 2023/7/20 3:33, Tomasz Jeznach wrote:
> > +static void riscv_iommu_iotlb_sync_map(struct iommu_domain *iommu_domain,
> > + unsigned long iova, size_t size)
> > +{
> > + unsigned long end = iova + size - 1;
> > + /*
> > + * Given we don't know the page size used by this range, we assume the
> > + * smallest page size to ensure all possible entries are flushed from
> > + * the IOATC.
> > + */
> > + size_t pgsize = PAGE_SIZE;
> > + riscv_iommu_flush_iotlb_range(iommu_domain, &iova, &end, &pgsize);
> > +}
>
> Does RISC-V IOMMU require to invalidate the TLB cache after new mappings
> are created?
>

No. Only on unmapping / permission change.
Thanks for pointing this out.

> Best regards,
> baolu

regards,
- Tomasz