From 9ecef3f4598c1aa187a0a5ea6fc5095983db0e70 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Mon, 10 Nov 2014 14:23:49 -0800 Subject: [PATCH] iommu/arm-smmu: enable unidentified stream faults on unmapped access Currently when an SMMU client accesses an unmapped address the SMMU does a bypass and propagates the request. This can make it difficult to debug problems when clients are accessing bogus addresses. Enable the sCR0 bit that causes the SMMU to raise an unidentified stream fault rather than falling back to bypass when no mapping is found. Change-Id: Ia0e40010c79b8a75954ae13ae60aca2d82ff76b6 Signed-off-by: Mitchel Humpherys --- drivers/iommu/arm-smmu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 09040be8d113..8e669f68f44b 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2158,8 +2158,11 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu) /* Disable TLB broadcasting. */ reg |= (sCR0_VMIDPNE | sCR0_PTM); - /* Enable client access, but bypass when no mapping is found */ - reg &= ~(sCR0_CLIENTPD | sCR0_USFCFG); + /* Enable client access */ + reg &= ~sCR0_CLIENTPD; + + /* Raise an unidentified stream fault on unmapped access */ + reg |= sCR0_USFCFG; /* Disable forced broadcasting */ reg &= ~sCR0_FB;