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,
I'd like to withdraw this patch. After I posted it I talked to our x86 expert and he's convinced it's bogus.
We'll run without it for a while and see if we need to revisit this or not. But for now, please don't consider this change.
Warner
&MASK_sig(uc));
}
--
2.22.1