iommu/arm: Add Renesas IPMMU-VMSA support
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Thu, 26 Sep 2019 11:20:34 +0000 (14:20 +0300)
committerJulien Grall <julien.grall@arm.com>
Thu, 26 Sep 2019 14:52:01 +0000 (15:52 +0100)
commit32350c5bbdf4d5ff1fe613ff7348fee587ddcc89
tree00f5e44823649f597a03450090fa88c3bd3e59ee
parent3e27f7d4cf434fd2cee6ecb5aeebf117e1e9572c
iommu/arm: Add Renesas IPMMU-VMSA support

The IPMMU-VMSA is VMSA-compatible I/O Memory Management Unit (IOMMU)
which provides address translation and access protection functionalities
to processing units and interconnect networks.

Please note, current driver is supposed to work only with newest
R-Car Gen3 SoCs revisions which IPMMU hardware supports stage 2 translation
table format and is able to use CPU's P2M table as is if one is
3-level page table (up to 40 bit IPA).

The major differences compare to the Linux driver are:

1. Stage 1/Stage 2 translation. Linux driver supports Stage 1
translation only (with Stage 1 translation table format). It manages
page table by itself. But Xen driver supports Stage 2 translation
(with Stage 2 translation table format) to be able to share the P2M
with the CPU. Stage 1 translation is always bypassed in Xen driver.

So, Xen driver is supposed to be used with newest R-Car Gen3 SoC revisions
only (H3 ES3.0, M3-W+, etc.) which IPMMU H/W supports stage 2 translation
table format.

2. AArch64 support. Linux driver uses VMSAv8-32 mode, while Xen driver
enables Armv8 VMSAv8-64 mode to cover up to 40 bit input address.

3. Context bank (sets of page table) usage. In Xen, each context bank is
mapped to one Xen domain. So, all devices being pass throughed to the
same Xen domain share the same context bank.

4. IPMMU device tracking. In Xen, all IOMMU devices are managed
by single driver instance. So, driver uses global list to keep track
of registered IPMMU devices.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
[for the IPMMU H/W bits]
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[julien: Remove unneeded "default n"]
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/platforms/Kconfig
xen/drivers/passthrough/Kconfig
xen/drivers/passthrough/arm/Makefile
xen/drivers/passthrough/arm/ipmmu-vmsa.c [new file with mode: 0644]