[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] tcg: Additional Trap type for FreeBSD
From: |
imp |
Subject: |
[PATCH 2/4] tcg: Additional Trap type for FreeBSD |
Date: |
Fri, 18 Dec 2020 13:52:48 -0700 |
From: Sean Bruno <sbruno@freebsd.org>
FreeBSD can generate a trap 0xc as well as 0xe when writing to a
read-only page.
Signed-off-by: Juergen Lock <nox@FreeBSD.org>
[imp rewored commit message for clarity]
Signed-off-by: Warner Losh <imp@FreeBSD.org>
---
accel/tcg/user-exec.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index 4ebe25461a..1f5befa9f9 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -343,7 +343,13 @@ int cpu_signal_handler(int host_signum, void *pinfo,
pc = PC_sig(uc);
return handle_cpu_signal(pc, info,
- TRAP_sig(uc) == 0xe ? (ERROR_sig(uc) >> 1) & 1 :
0,
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+ (TRAP_sig(uc) == 0xe ||
+ TRAP_sig(uc) == 0xc) ?
+#else
+ TRAP_sig(uc) == 0xe ?
+#endif
+ (ERROR_sig(uc) >> 1) & 1 : 0,
&MASK_sig(uc));
}
--
2.22.1