From 6a3fc5a68ac19292eb3226ea182dbc044c21f3c7 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Thu, 25 Aug 2022 20:00:53 -0600
Subject: [PATCH] Send SIGSEGV on aarch64 exception

---
 src/arch/aarch64/interrupt/exception.rs | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/arch/aarch64/interrupt/exception.rs b/src/arch/aarch64/interrupt/exception.rs
index 589df521..cffceb5e 100644
--- a/src/arch/aarch64/interrupt/exception.rs
+++ b/src/arch/aarch64/interrupt/exception.rs
@@ -32,24 +32,12 @@ exception_stack!(synchronous_exception_at_el0, |stack| {
             println!("FATAL: Not an SVC induced synchronous exception");
             stack.dump();
             stack_trace();
-
-            println!("CPU {}, PID {:?}", cpu_id(), context::context_id());
-
-            // This could deadlock, but at this point we are going to halt anyways
-            {
-                let contexts = context::contexts();
-                if let Some(context_lock) = contexts.current() {
-                    let context = context_lock.read();
-                    println!("NAME: {}", *context.name.read());
-                }
-            }
-
-            // Halt
-            loop {}
+            crate::ksignal(SIGSEGV);
+            stack.scratch.x0
+        } else {
+            let scratch = &stack.scratch;
+            syscall::syscall(scratch.x8, scratch.x0, scratch.x1, scratch.x2, scratch.x3, scratch.x4, stack)
         }
-
-        let scratch = &stack.scratch;
-        syscall::syscall(scratch.x8, scratch.x0, scratch.x1, scratch.x2, scratch.x3, scratch.x4, stack)
     });
 });
 
-- 
GitLab