Skip to content

Commit

Permalink
xen/arm: smmuv3: Add support for SMMUv3 driver
Browse files Browse the repository at this point in the history
Add support for ARM architected SMMUv3 implementation. It is based on
the Linux SMMUv3 driver.

Driver is currently supported as Tech Preview.

Major differences with regard to Linux driver are as follows:
2. Only Stage-2 translation is supported as compared to the Linux driver
   that supports both Stage-1 and Stage-2 translations.
3. Use P2M  page table instead of creating one as SMMUv3 has the
   capability to share the page tables with the CPU.
4. Tasklets are used in place of threaded IRQ's in Linux for event queue
   and priority queue IRQ handling.
5. Latest version of the Linux SMMUv3 code implements the commands queue
   access functions based on atomic operations implemented in Linux.
   Atomic functions used by the commands queue access functions are not
   implemented in XEN therefore we decided to port the earlier version
   of the code. Atomic operations are introduced to fix the bottleneck
   of the SMMU command queue insertion operation. A new algorithm for
   inserting commands into the queue is introduced, which is lock-free
   on the fast-path.
   Consequence of reverting the patch is that the command queue
   insertion will be slow for large systems as spinlock will be used to
   serializes accesses from all CPUs to the single queue supported by
   the hardware. Once the proper atomic operations will be available in
   XEN the driver can be updated.
6. Spin lock is used in place of mutex when attaching a device to the
   SMMU, as there is no blocking locks implementation available in XEN.
   This might introduce latency in XEN. Need to investigate before
   driver is out for tech preview.
7. PCI ATS functionality is not supported, as there is no support
   available in XEN to test the functionality. Code is not tested and
   compiled. Code is guarded by the flag CONFIG_PCI_ATS.
8. MSI interrupts are not supported as there is no support available in
   XEN to request MSI interrupts. Code is not tested and compiled. Code
   is guarded by the flag CONFIG_MSI.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
  • Loading branch information
rahul-sin authored and Julien Grall committed Jan 23, 2021
1 parent be7f047 commit 452ddbe
Show file tree
Hide file tree
Showing 5 changed files with 842 additions and 129 deletions.
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ F: xen/include/asm-arm/
F: xen/include/public/arch-arm/
F: xen/include/public/arch-arm.h

ARM SMMUv3
M: Bertrand Marquis <bertrand.marquis@arm.com>
M: Rahul Singh <rahul.singh@arm.com>
S: Supported
F: xen/drivers/passthrough/arm/smmu-v3.c

Change Log
M: Paul Durrant <paul@xen.org>
R: Community Manager <community.manager@xenproject.org>
Expand Down
1 change: 1 addition & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ For the Cortex A57 r0p0 - r1p1, see Errata 832075.
Status, Intel VT-d: Supported
Status, ARM SMMUv1: Supported, not security supported
Status, ARM SMMUv2: Supported, not security supported
Status, ARM SMMUv3: Tech Preview
Status, Renesas IPMMU-VMSA: Supported, not security supported

### ARM/GICv3 ITS
Expand Down
11 changes: 11 additions & 0 deletions xen/drivers/passthrough/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ config ARM_SMMU
Say Y here if your SoC includes an IOMMU device implementing the
ARM SMMU architecture.

config ARM_SMMU_V3
bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support" if EXPERT
depends on ARM_64
---help---
Support for implementations of the ARM System MMU architecture
version 3. Driver is in experimental stage and should not be used in
production.

Say Y here if your system includes an IOMMU device implementing
the ARM SMMUv3 architecture.

config IPMMU_VMSA
bool "Renesas IPMMU-VMSA found in R-Car Gen3 SoCs"
depends on ARM_64
Expand Down
1 change: 1 addition & 0 deletions xen/drivers/passthrough/arm/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
obj-y += iommu.o iommu_helpers.o iommu_fwspec.o
obj-$(CONFIG_ARM_SMMU) += smmu.o
obj-$(CONFIG_IPMMU_VMSA) += ipmmu-vmsa.o
obj-$(CONFIG_ARM_SMMU_V3) += smmu-v3.o

0 comments on commit 452ddbe

Please sign in to comment.