[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 21/30] bsd-user/signal.c: force_sig
|
From: |
Kyle Evans |
|
Subject: |
Re: [PATCH 21/30] bsd-user/signal.c: force_sig |
|
Date: |
Thu, 13 Jan 2022 17:04:16 -0600 |
On Thu, Jan 13, 2022 at 2:53 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Thu, 13 Jan 2022 at 20:29, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Sun, 9 Jan 2022 at 16:44, Warner Losh <imp@bsdimp.com> wrote:
> > >
> > > Force delivering a signal and generating a core file.
>
> > > +/* Abort execution with signal. */
> > > +void QEMU_NORETURN force_sig(int target_sig)
> >
> > In linux-user we call this dump_core_and_abort(), which is
> > a name that better describes what it's actually doing.
> >
> > (Today's linux-user's force_sig() does what the Linux kernel's
> > function of that name does -- it's a wrapper around
> > queue_signal() which delivers a signal to the guest with
> > .si_code = SI_KERNEL , si_pid = si_uid = 0.
> > Whether you want one of those or not depends on what BSD
> > kernels do in that kind of "we have to kill this process"
> > situation.)
>
> It looks like the FreeBSD kernel uses sigexit() as its equivalent
> function to Linux's force_sig(), incidentally. Not sure if
> you/we would prefer the bsd-user code to follow the naming that
> FreeBSD's kernel uses or the naming linux-user takes from
> the Linux kernel.
>
My $.02: let's go with linux-inherited linux-user names and drop in a
comment with the FreeBSD name, if they're functionally similar enough
(in general, not just for this specific case). My gut feeling is that
it'll be more useful in the long run if we can more quickly identify
parallels between the two, so changes affecting linux-user that may
benefit bsd-user are more easily identified and exchanged (and
vice-versa).
Thanks,
Kyle Evans
- Re: [PATCH 12/30] bsd-user/host/i386/host-signal.h: Implement host_signal_*, (continued)
[PATCH 17/30] bsd-user/signal.c: Implement rewind_if_in_safe_syscall, Warner Losh, 2022/01/09
[PATCH 23/30] bsd-user/signal.c: sigset manipulation routines., Warner Losh, 2022/01/09
[PATCH 15/30] bsd-user: Add trace events for bsd-usr, Warner Losh, 2022/01/09