From 3a25b40a4e0aff69443e446e4293c7b63828c331 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Thu, 5 Nov 2015 11:50:29 -0800 Subject: iommu/arm-smmu: Make unmapped accesses more obvious The fault handler currently spits out a ton of information that can make clients' eyes glaze over, and understandably so. One of the most important pieces of information we obtain from the fault handler is whether the faulting address is actually mapped (which we check with a software table walk), but that information is currently not obvious (you have to know that "soft iova-to-phys=0" means that the software table walk failed). Fix this by adding a more obvious error message when we detect an unmapped access. Change-Id: Ib95a916baf3e73934642676de4852a550ae0f54b Signed-off-by: Mitchel Humpherys --- drivers/iommu/arm-smmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index b989b025e0a5..f9da1c283b45 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1256,6 +1256,10 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev) (fsr & 0x80000000) ? "MULTI " : ""); dev_err(smmu->dev, "soft iova-to-phys=%pa\n", &phys_soft); + if (!phys_soft) + dev_err(smmu->dev, + "SOFTWARE TABLE WALK FAILED! Looks like %s accessed an unmapped address!\n", + dev_name(smmu->dev)); dev_err(smmu->dev, "hard iova-to-phys (ATOS)=%pa\n", &phys_atos); dev_err(smmu->dev, "SID=0x%x\n", frsynra & 0xffff); -- cgit v1.2.3