summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mentz <danielmentz@google.com>2023-12-04 17:16:52 -0800
committerDaniel Mentz <danielmentz@google.com>2023-12-08 00:45:23 +0000
commit172c524fd887df226d203a567d22e4c99eb05df2 (patch)
tree231c9a10fde11efad4cbe8e7cb9a6fdd1c45c8fb
parent1f64d841d1419a8adc7a499187cae0d698f78cb4 (diff)
downloadgs-172c524fd887df226d203a567d22e4c99eb05df2.tar.gz
iommu/samsung: Option to dump full fault information
Add device tree property sysmmu,always-dump-full-fault-info. If set, we always dump the full fault information including relevant page table entries as well as full TLB contents even if the client device's fault handler returns -EAGAIN. Bug: 314860267 Change-Id: I337fb714e7e7a5bd94adff346e4b527107ceeb0e Signed-off-by: Daniel Mentz <danielmentz@google.com>
-rw-r--r--drivers/iommu/samsung-iommu-fault-v9.c8
-rw-r--r--drivers/iommu/samsung-iommu-v9.c4
-rw-r--r--drivers/iommu/samsung-iommu-v9.h1
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/iommu/samsung-iommu-fault-v9.c b/drivers/iommu/samsung-iommu-fault-v9.c
index d8cd30343..24bbaa802 100644
--- a/drivers/iommu/samsung-iommu-fault-v9.c
+++ b/drivers/iommu/samsung-iommu-fault-v9.c
@@ -826,8 +826,12 @@ irqreturn_t samsung_sysmmu_irq_thread(int irq, void *dev_id)
goto out;
}
} else {
- if (!drvdata->hide_page_fault)
- sysmmu_show_fault_info_simple(drvdata, itype, addr, vmid);
+ if (!drvdata->hide_page_fault) {
+ if (drvdata->always_dump_full_fault_info)
+ sysmmu_show_fault_information(drvdata, itype, addr, vmid);
+ else
+ sysmmu_show_fault_info_simple(drvdata, itype, addr, vmid);
+ }
sysmmu_clear_interrupt(drvdata, false, &vmid);
}
pm_runtime_put(drvdata->dev);
diff --git a/drivers/iommu/samsung-iommu-v9.c b/drivers/iommu/samsung-iommu-v9.c
index b5df702d3..c1dc6d8cb 100644
--- a/drivers/iommu/samsung-iommu-v9.c
+++ b/drivers/iommu/samsung-iommu-v9.c
@@ -1526,6 +1526,10 @@ static int sysmmu_parse_dt(struct device *sysmmu, struct sysmmu_drvdata *data)
}
data->hide_page_fault = of_property_read_bool(sysmmu->of_node, "sysmmu,hide-page-fault");
+ data->always_dump_full_fault_info = of_property_read_bool(sysmmu->of_node,
+ "sysmmu,always-dump-full-fault-info");
+ if (data->hide_page_fault && data->always_dump_full_fault_info)
+ dev_warn(sysmmu, "Device tree option sysmmu,always-dump-full-fault-info ineffective if sysmmu,hide-page-fault is set\n");
/* use async fault mode */
data->async_fault_mode = of_property_read_bool(sysmmu->of_node, "sysmmu,async-fault");
data->leave_enabled_on_suspend = of_property_read_bool(sysmmu->of_node,
diff --git a/drivers/iommu/samsung-iommu-v9.h b/drivers/iommu/samsung-iommu-v9.h
index 2a9d7f995..34edb096b 100644
--- a/drivers/iommu/samsung-iommu-v9.h
+++ b/drivers/iommu/samsung-iommu-v9.h
@@ -176,6 +176,7 @@ struct sysmmu_drvdata {
unsigned int secure_base;
bool async_fault_mode;
bool hide_page_fault;
+ bool always_dump_full_fault_info;
bool leave_enabled_on_suspend;
bool ap_read_implies_write;
bool ap_permissive;