qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: imp@freebsd.org
To: qemu-devel@nongnu.org
Cc: Juergen Lock <nox@FreeBSD.org>, Sean Bruno <sbruno@freebsd.org>,
	Warner Losh <imp@FreeBSD.org>
Subject: [PATCH 2/4] tcg: Additional Trap type for FreeBSD
Date: Fri, 18 Dec 2020 13:52:48 -0700	[thread overview]
Message-ID: <20201218205250.86382-3-imp@freebsd.org> (raw)
In-Reply-To: <20201218205250.86382-1-imp@freebsd.org>

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



  parent reply	other threads:[~2020-12-19 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 20:52 [PATCH 0/4] A few preliminary bsd-user patches imp
2020-12-18 20:52 ` [PATCH 1/4] bsd-user: regenerate FreeBSD's system call numbers imp
2020-12-18 20:52 ` imp [this message]
2020-12-19 23:22   ` [PATCH 2/4] tcg: Additional Trap type for FreeBSD Warner Losh
2020-12-18 20:52 ` [PATCH 3/4] bsd-user: move strace OS/arch dependent code to host/arch dirs imp
2020-12-18 20:52 ` [PATCH 4/4] bsd-user: Update strace.list for FreeBSD's latest syscalls imp
2020-12-19 23:21 ` [PATCH 0/4] A few preliminary bsd-user patches Warner Losh
  -- strict thread matches above, loose matches on Subject: below --
2020-12-18 20:54 imp
2020-12-18 20:54 ` [PATCH 2/4] tcg: Additional Trap type for FreeBSD imp
2020-12-18 23:12   ` Warner Losh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201218205250.86382-3-imp@freebsd.org \
    --to=imp@freebsd.org \
    --cc=nox@FreeBSD.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sbruno@freebsd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).