Re: [PATCH v12 3/7] soc: ti: Add IOMMU-like PVU driver

From: Nishanth Menon
Date: Tue Jul 29 2025 - 12:37:38 EST


On 18:11-20250729, Jan Kiszka wrote:
> On 29.07.25 14:22, Nishanth Menon wrote:
> > On 10:36-20250728, huaqian.li@xxxxxxxxxxx wrote:
> >> From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
> >>
> >> The TI Peripheral Virtualization Unit (PVU) permits to define a limited
> >> set of mappings for DMA requests on the system memory. Unlike with an
> >> IOMMU, there is no fallback to a memory-backed page table, only a fixed
> >> set of register-backed TLBs. Emulating an IOMMU behavior appears to be
> >> the more fragile the more fragmentation of pending requests occur.
> >>
> >> Therefore, this driver does not expose the PVU as an IOMMU. It rather
> >> introduces a simple, static interface to devices that are under
> >> restricted-dma-pool constraints. They can register their pools with the
> >> PVUs, enabling only those pools to work for DMA. As also MSI is issued
> >> as DMA, the PVU already register the related translator region of the
> >> AM654 as valid DMA target.
> >>
> >> This driver is the essential building block for limiting DMA from
> >> untrusted devices to clearly defined memory regions in the absence of a
> >> real IOMMU (SMMU).
> >>
> >> Co-developed-by: Diogo Ivo <diogo.ivo@xxxxxxxxxxx>
> >> Signed-off-by: Diogo Ivo <diogo.ivo@xxxxxxxxxxx>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
> >> Signed-off-by: Li Hua Qian <huaqian.li@xxxxxxxxxxx>
> >> ---
> >> drivers/soc/ti/Kconfig | 4 +
> >> drivers/soc/ti/Makefile | 1 +
> >> drivers/soc/ti/ti-pvu.c | 500 ++++++++++++++++++++++++++++++++++++++++
> >> include/linux/ti-pvu.h | 32 +++
> >> 4 files changed, 537 insertions(+)
> >> create mode 100644 drivers/soc/ti/ti-pvu.c
> >> create mode 100644 include/linux/ti-pvu.h
> >>
> >> diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
> >> index 1a93001c9e36..af7173ad84de 100644
> >> --- a/drivers/soc/ti/Kconfig
> >> +++ b/drivers/soc/ti/Kconfig
> >> @@ -82,6 +82,10 @@ config TI_PRUSS
> >> processors on various TI SoCs. It's safe to say N here if you're
> >> not interested in the PRU or if you are unsure.
> >>
> >> +config TI_PVU
> >> + bool "TI Peripheral Virtualization Unit driver"
> >
> > tristate please? Prefer to make this as a module.
> >
> >
>
> PCI_KEYSTONE is bool and needs this (if enabled). So this won't be a
> module in practice.
>

Something of the form of
https://lore.kernel.org/all/20250307103128.3287497-1-s-vadapalli@xxxxxx/
will need to be done then.

--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource