alistair23-linux/drivers/iommu
Tomasz Nowicki 3677a649a7 iommu/arm-smmu: Fix for ThunderX erratum #27704
The goal of erratum #27704 workaround was to make sure that ASIDs and VMIDs
are unique across all SMMU instances on affected Cavium systems.

Currently, the workaround code partitions ASIDs and VMIDs by increasing
global cavium_smmu_context_count which in turn becomes the base ASID and VMID
value for the given SMMU instance upon the context bank initialization.

For systems with multiple SMMU instances this approach implies the risk
of crossing 8-bit ASID, like for 1-socket CN88xx capable of 4 SMMUv2,
128 context banks each:
SMMU_0 (0-127 ASID RANGE)
SMMU_1 (127-255 ASID RANGE)
SMMU_2 (256-383 ASID RANGE) <--- crossing 8-bit ASID
SMMU_3 (384-511 ASID RANGE) <--- crossing 8-bit ASID

Since now we use 8-bit ASID (SMMU_CBn_TCR2.AS = 0) we effectively misconfigure
ASID[15:8] bits of SMMU_CBn_TTBRm register for SMMU_2/3. Moreover, we still
assume non-zero ASID[15:8] bits upon context invalidation. In the end,
except SMMU_0/1 devices all other devices under other SMMUs will fail on guest
power off/on. Since we try to invalidate TLB with 16-bit ASID but we actually
have 8-bit zero padded 16-bit entry.

This patch adds 16-bit ASID support for stage-1 AArch64 contexts so that
we use ASIDs consistently for all SMMU instances.

Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Tirumalesh Chalamarla  <Tirumalesh.Chalamarla@cavium.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2017-01-26 18:16:58 +00:00
..
amd_iommu.c iommu/amd: Fix the left value check of cmd buffer 2017-01-04 15:22:22 +01:00
amd_iommu_init.c More ACPI updates for v4.10-rc1 2016-12-22 10:19:32 -08:00
amd_iommu_proto.h Merge branch 'x86/amd-avic' into x86/amd 2016-09-05 12:43:16 +02:00
amd_iommu_types.h KVM updates for v4.9-rc1 2016-10-06 10:49:01 -07:00
amd_iommu_v2.c iommu/amd: Missing error code in amd_iommu_init_device() 2016-11-29 17:39:44 +01:00
arm-smmu-v3.c iommu/arm-smmu-v3: limit use of 2-level stream tables 2017-01-26 18:16:57 +00:00
arm-smmu.c iommu/arm-smmu: Fix for ThunderX erratum #27704 2017-01-26 18:16:58 +00:00
dma-iommu.c iommu/dma: Implement dma_{map,unmap}_resource() 2016-11-14 16:58:36 +01:00
dmar.c ACPI / DMAR: Avoid passing NULL to acpi_put_table() 2017-01-05 15:10:52 +01:00
exynos-iommu.c iommu: Drop the of_iommu_{set/get}_ops() interface 2017-01-26 18:16:57 +00:00
fsl_pamu.c
fsl_pamu.h
fsl_pamu_domain.c
fsl_pamu_domain.h
intel-iommu.c iommu/vt-d: Fix pasid table size encoding 2017-01-04 15:18:57 +01:00
intel-svm.c iommu/vt-d: Fix PASID table allocation 2016-11-19 09:42:35 -08:00
intel_irq_remapping.c
io-pgtable-arm-v7s.c iommu/io-pgtable-arm: Use for_each_set_bit to simplify the code 2016-11-29 15:57:40 +00:00
io-pgtable-arm.c iommu/io-pgtable-arm: Use const and __initconst for iommu_gather_ops structures 2016-11-29 15:57:41 +00:00
io-pgtable.c iommu/io-pgtable: Fix a brace coding style issue. 2016-04-05 15:34:29 +02:00
io-pgtable.h iommu/io-pgtable: Add MTK 4GB mode in Short-descriptor 2016-04-05 15:39:37 +02:00
iommu-sysfs.c
iommu-traces.c
iommu.c Merge branches 'arm/mediatek', 'arm/smmu', 'x86/amd', 's390', 'core' and 'arm/exynos' into next 2016-12-06 17:32:16 +01:00
iova.c iommu/iova: Extend cached node lookup condition 2016-11-15 12:39:52 +01:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Fix wrong error handle of ipmmu_add_device 2016-09-05 12:53:58 +02:00
irq_remapping.c x86/cpufeature: Replace cpu_has_apic with boot_cpu_has() usage 2016-04-13 11:37:41 +02:00
irq_remapping.h
Kconfig iommu/arm-smmu: Support non-PCI devices with SMMUv3 2016-09-16 09:34:17 +01:00
Makefile Merge branches 'x86/amd', 'x86/vt-d', 'arm/exynos', 'arm/mediatek', 'arm/msm', 'arm/rockchip', 'arm/smmu' and 'core' into next 2016-07-26 16:02:37 +02:00
msm_iommu.c iommu: Drop the of_iommu_{set/get}_ops() interface 2017-01-26 18:16:57 +00:00
msm_iommu.h iommu/msm: Add DT adaptation 2016-06-21 13:56:00 +02:00
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu: Drop the of_iommu_{set/get}_ops() interface 2017-01-26 18:16:57 +00:00
mtk_iommu.h iommu/mediatek: Convert DT component matching to component_match_add_release() 2016-11-10 12:25:16 +01:00
mtk_iommu_v1.c Merge branches 'arm/mediatek', 'arm/smmu', 'x86/amd', 's390', 'core' and 'arm/exynos' into next 2016-12-06 17:32:16 +01:00
of_iommu.c iommu: Drop the of_iommu_{set/get}_ops() interface 2017-01-26 18:16:57 +00:00
omap-iommu-debug.c iommu/omap: Align code with open parenthesis 2016-04-05 17:53:20 +02:00
omap-iommu.c iommu/omap: Use WARN_ON for page table alignment check 2016-04-05 17:53:20 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: Prepare to support generic DMA mapping 2016-06-27 14:50:08 +02:00
s390-iommu.c iommu/s390: Drop duplicate header pci.h 2016-11-29 17:37:58 +01:00
tegra-gart.c
tegra-smmu.c