diff mbox series

[v4,40/48] linux-user/signal: Handle BUS_ADRALN in host_signal_handler

Message ID 20211013024607.731881-41-richard.henderson@linaro.org
State Superseded
Headers show
Series [v4,01/48] hw/core: Add TCGCPUOps.record_sigbus | expand

Commit Message

Richard Henderson Oct. 13, 2021, 2:45 a.m. UTC
Handle BUS_ADRALN via cpu_loop_exit_sigbus, but allow other SIGBUS
si_codes to continue into the host-to-guest signal coversion code.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/signal.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.25.1
diff mbox series

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index df2c8678d0..81c45bfce9 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -860,6 +860,9 @@  static void host_signal_handler(int host_sig, siginfo_t *info, void *puc)
             cpu_loop_exit_sigsegv(cpu, guest_addr, access_type, maperr, pc);
         } else {
             sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL);
+            if (info->si_code == BUS_ADRALN) {
+                cpu_loop_exit_sigbus(cpu, guest_addr, access_type, pc);
+            }
         }
 
         sync_sig = true;