qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/1] Bsd user fix patches
@ 2022-02-01 21:58 Warner Losh
  2022-02-01 21:58 ` [PULL 1/1] bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026 Warner Losh
  2022-02-02 19:53 ` [PULL 0/1] Bsd user fix patches Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Warner Losh @ 2022-02-01 21:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, richard.henderson, alex.bennee, Warner Losh,
	Kyle Evans

The following changes since commit 3bbe296c1c7a6ddce7a294e006b8c4a53b385292:

  Merge remote-tracking branch 'remotes/hreitz-gitlab/tags/pull-block-2022-02-01' into staging (2022-02-01 16:32:54 +0000)

are available in the Git repository at:

  git@gitlab.com:bsdimp/qemu.git tags/bsd-user-fix-pull-request

for you to fetch changes up to eb9d35f686ed1279d57463d9e6f289988f594c19:

  bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026 (2022-02-01 14:43:20 -0700)

----------------------------------------------------------------
Pull request

Fix FreeBSD 12 and 13 builds.

----------------------------------------------------------------

Warner Losh (1):
  bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version >
    1400026

 bsd-user/signal-common.h | 5 +++++
 bsd-user/signal.c        | 5 +++++
 2 files changed, 10 insertions(+)

-- 
2.33.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PULL 1/1] bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026
  2022-02-01 21:58 [PULL 0/1] Bsd user fix patches Warner Losh
@ 2022-02-01 21:58 ` Warner Losh
  2022-02-02 19:53 ` [PULL 0/1] Bsd user fix patches Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Warner Losh @ 2022-02-01 21:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, richard.henderson, alex.bennee, Warner Losh,
	Kyle Evans

The capsicum signal stuff is new with FreeBSD 14, rev 1400026, so only
define QEMU_SI_CAPSICUM there. Only copy _capsicum when QEMU_SI_CAPSICUM
is defined. Default to no info being passed for signals we make no guess
about.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 bsd-user/signal-common.h | 5 +++++
 bsd-user/signal.c        | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/bsd-user/signal-common.h b/bsd-user/signal-common.h
index 7ff8e8f2e40..6f90345bb2a 100644
--- a/bsd-user/signal-common.h
+++ b/bsd-user/signal-common.h
@@ -59,12 +59,17 @@ void target_to_host_sigset(sigset_t *d, const target_sigset_t *s);
  * For FreeBSD, we have si_pid, si_uid, si_status, and si_addr always. Linux and
  * {Open,Net}BSD have a different approach (where their reason field is larger,
  * but whose siginfo has fewer fields always).
+ *
+ * QEMU_SI_CAPSICUM is currently only FreeBSD 14 current only, so only define
+ * it where _capsicum is available.
  */
 #define QEMU_SI_NOINFO   0      /* nothing other than si_signo valid */
 #define QEMU_SI_FAULT    1      /* _fault is valid in _reason */
 #define QEMU_SI_TIMER    2      /* _timer is valid in _reason */
 #define QEMU_SI_MESGQ    3      /* _mesgq is valid in _reason */
 #define QEMU_SI_POLL     4      /* _poll is valid in _reason */
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 1400026
 #define QEMU_SI_CAPSICUM 5      /* _capsicum is valid in _reason */
+#endif
 
 #endif
diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index ad22ba9d90d..0bc6d2edbd9 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -222,6 +222,7 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
          * We have to go based on the signal number now to figure out
          * what's valid.
          */
+        si_type = QEMU_SI_NOINFO;
         if (has_trapno(sig)) {
             tinfo->_reason._fault._trapno = info->_reason._fault._trapno;
             si_type = QEMU_SI_FAULT;
@@ -241,11 +242,13 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
          * capsicum is somewhere between weak and non-existant, but if we get
          * one, then we know what to save.
          */
+#ifdef QEMU_SI_CAPSICUM
         if (sig == TARGET_SIGTRAP) {
             tinfo->_reason._capsicum._syscall =
                 info->_reason._capsicum._syscall;
             si_type = QEMU_SI_CAPSICUM;
         }
+#endif
         break;
     }
     tinfo->si_code = deposit32(si_code, 24, 8, si_type);
@@ -295,10 +298,12 @@ static void tswap_siginfo(target_siginfo_t *tinfo, const target_siginfo_t *info)
         /* Note: Not generated on FreeBSD */
         __put_user(info->_reason._poll._band, &tinfo->_reason._poll._band);
         break;
+#ifdef QEMU_SI_CAPSICUM
     case QEMU_SI_CAPSICUM:
         __put_user(info->_reason._capsicum._syscall,
                    &tinfo->_reason._capsicum._syscall);
         break;
+#endif
     default:
         g_assert_not_reached();
     }
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL 0/1] Bsd user fix patches
  2022-02-01 21:58 [PULL 0/1] Bsd user fix patches Warner Losh
  2022-02-01 21:58 ` [PULL 1/1] bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026 Warner Losh
@ 2022-02-02 19:53 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2022-02-02 19:53 UTC (permalink / raw)
  To: Warner Losh; +Cc: richard.henderson, alex.bennee, qemu-devel, Kyle Evans

On Tue, 1 Feb 2022 at 21:59, Warner Losh <imp@bsdimp.com> wrote:
>
> The following changes since commit 3bbe296c1c7a6ddce7a294e006b8c4a53b385292:
>
>   Merge remote-tracking branch 'remotes/hreitz-gitlab/tags/pull-block-2022-02-01' into staging (2022-02-01 16:32:54 +0000)
>
> are available in the Git repository at:
>
>   git@gitlab.com:bsdimp/qemu.git tags/bsd-user-fix-pull-request
>
> for you to fetch changes up to eb9d35f686ed1279d57463d9e6f289988f594c19:
>
>   bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026 (2022-02-01 14:43:20 -0700)
>
> ----------------------------------------------------------------
> Pull request
>
> Fix FreeBSD 12 and 13 builds.
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-02 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01 21:58 [PULL 0/1] Bsd user fix patches Warner Losh
2022-02-01 21:58 ` [PULL 1/1] bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026 Warner Losh
2022-02-02 19:53 ` [PULL 0/1] Bsd user fix patches Peter Maydell

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).