Skip to content

Commit 6eb18d4

Browse files
nipungupta87wildea01
authored andcommitted
iommu/arm-smmu: Set SMTNMB_TLBEN in ACR to enable caching of bypass entries
The SMTNMB_TLBEN in the Auxiliary Configuration Register (ACR) provides an option to enable the updation of TLB in case of bypass transactions due to no stream match in the stream match table. This reduces the latencies of the subsequent transactions with the same stream-id which bypasses the SMMU. This provides a significant performance benefit for certain networking workloads. With this change substantial performance improvement of ~9% is observed with DPDK l3fwd application (http://dpdk.org/doc/guides/sample_app_ug/l3_forward.html) on NXP's LS2088a platform. Reviewed-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent dfed5f0 commit 6eb18d4

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

drivers/iommu/arm-smmu.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ enum arm_smmu_s2cr_privcfg {
247247
#define ARM_MMU500_ACTLR_CPRE (1 << 1)
248248

249249
#define ARM_MMU500_ACR_CACHE_LOCK (1 << 26)
250+
#define ARM_MMU500_ACR_SMTNMB_TLBEN (1 << 8)
250251

251252
#define CB_PAR_F (1 << 0)
252253

@@ -1581,16 +1582,22 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu)
15811582
for (i = 0; i < smmu->num_mapping_groups; ++i)
15821583
arm_smmu_write_sme(smmu, i);
15831584

1584-
/*
1585-
* Before clearing ARM_MMU500_ACTLR_CPRE, need to
1586-
* clear CACHE_LOCK bit of ACR first. And, CACHE_LOCK
1587-
* bit is only present in MMU-500r2 onwards.
1588-
*/
1589-
reg = readl_relaxed(gr0_base + ARM_SMMU_GR0_ID7);
1590-
major = (reg >> ID7_MAJOR_SHIFT) & ID7_MAJOR_MASK;
1591-
if ((smmu->model == ARM_MMU500) && (major >= 2)) {
1585+
if (smmu->model == ARM_MMU500) {
1586+
/*
1587+
* Before clearing ARM_MMU500_ACTLR_CPRE, need to
1588+
* clear CACHE_LOCK bit of ACR first. And, CACHE_LOCK
1589+
* bit is only present in MMU-500r2 onwards.
1590+
*/
1591+
reg = readl_relaxed(gr0_base + ARM_SMMU_GR0_ID7);
1592+
major = (reg >> ID7_MAJOR_SHIFT) & ID7_MAJOR_MASK;
15921593
reg = readl_relaxed(gr0_base + ARM_SMMU_GR0_sACR);
1593-
reg &= ~ARM_MMU500_ACR_CACHE_LOCK;
1594+
if (major >= 2)
1595+
reg &= ~ARM_MMU500_ACR_CACHE_LOCK;
1596+
/*
1597+
* Allow unmatched Stream IDs to allocate bypass
1598+
* TLB entries for reduced latency.
1599+
*/
1600+
reg |= ARM_MMU500_ACR_SMTNMB_TLBEN;
15941601
writel_relaxed(reg, gr0_base + ARM_SMMU_GR0_sACR);
15951602
}
15961603

0 commit comments

Comments
 (0)