OSDN Git Service

iommu/arm-smmu: Make unmapped accesses more obvious
authorMitchel Humpherys <mitchelh@codeaurora.org>
Thu, 5 Nov 2015 19:50:29 +0000 (11:50 -0800)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:14:33 +0000 (11:14 -0700)
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 <mitchelh@codeaurora.org>
drivers/iommu/arm-smmu.c

index b989b02..f9da1c2 100644 (file)
@@ -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);