summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorEdmond Chung <edmondchung@google.com>2020-08-03 18:12:47 -0700
committerGe Bian <bian@google.com>2020-12-15 14:33:55 -0800
commit0ef2b7548944dd804552d009d51fc59b495f3436 (patch)
tree25b4bc2195aae5e5cb37850581fce689fcc0e819 /platform
parent559d3a3018b5904b5a32e2c83824c73eea2702e8 (diff)
downloadlwis-0ef2b7548944dd804552d009d51fc59b495f3436.tar.gz
Event: Push event to userspace for SysMMU page faults
Userspace will be notified when there is a SysMMU page fault, such that this will enable us to handle these types of errors more gracefully in the userspace. Bug: 162036180 Signed-off-by: Edmond Chung <edmondchung@google.com> Change-Id: Iaf3538b7ed08b6833a969ba9de4daa59311f7842
Diffstat (limited to 'platform')
-rw-r--r--platform/gs101/lwis_platform_gs101.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/gs101/lwis_platform_gs101.c b/platform/gs101/lwis_platform_gs101.c
index 3314b9c..b17da6b 100644
--- a/platform/gs101/lwis_platform_gs101.c
+++ b/platform/gs101/lwis_platform_gs101.c
@@ -61,6 +61,7 @@ int lwis_platform_probe(struct lwis_device *lwis_dev)
static int __attribute__((unused)) lwis_iommu_fault_handler(struct iommu_fault *fault, void *param)
{
struct lwis_device *lwis_dev = (struct lwis_device *)param;
+ struct lwis_mem_page_fault_event_payload event_payload;
pr_err("############ LWIS IOMMU PAGE FAULT ############\n");
pr_err("\n");
@@ -75,6 +76,11 @@ static int __attribute__((unused)) lwis_iommu_fault_handler(struct iommu_fault *
pr_err("\n");
pr_err("###############################################\n");
+ event_payload.fault_address = fault->event.addr;
+ event_payload.fault_flags = fault->event.flags;
+ lwis_device_error_event_emit(lwis_dev, LWIS_ERROR_EVENT_ID_MEMORY_PAGE_FAULT,
+ &event_payload, sizeof(event_payload));
+
#ifdef ENABLE_PAGE_FAULT_PANIC
return NOTIFY_BAD;
#else