qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] linux-user: Add support for tracking the ta


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 2/5] linux-user: Add support for tracking the target signal mask
Date: Fri, 14 Jun 2019 14:14:15 +0100

On Wed, 22 May 2019 at 19:57, Aleksandar Markovic
<address@hidden> wrote:
>
> From: Miloš Stojanović <address@hidden>
>
> If TRACK_TARGET_SIGMASK is defined, add fields in the TaskState structure
> which will hold the target signal and suspend mask and add support for
> initialization and forking. No functional changes are being introduced in
> this commit. The TRACK_TARGET_SIGMASK will be defined in a later commit
> where the target signal masks will be needed in order to implement
> multiplexing of real-time target signals which are out of the host range.
>
> Currently, QEMU has a copy of the host signal and suspend masks and that
> is usually enough, since most of the time the signal mask of the target
> architecture is either the same length or narrower. If however the signal
> mask is wider, then part of it won't be tracked.
>
> This commit enables adding support for separately tracking the target
> signal masks in the following commits.
>
> Signed-off-by: Miloš Stojanović <address@hidden>
> Signed-off-by: Aleksandar Markovic <address@hidden>

> ---
>  linux-user/qemu.h    | 5 +++++
>  linux-user/signal.c  | 3 +++
>  linux-user/syscall.c | 3 +++
>  3 files changed, 11 insertions(+)
>
> diff --git a/linux-user/qemu.h b/linux-user/qemu.h
> index ef400cb..9f70996 100644
> --- a/linux-user/qemu.h
> +++ b/linux-user/qemu.h
> @@ -141,6 +141,11 @@ typedef struct TaskState {
>       * currently in the middle of such a syscall
>       */
>      sigset_t sigsuspend_mask;
> +#ifdef TRACK_TARGET_SIGMASK
> +    /* Track the target signal and suspend masks. */
> +    target_sigset_t target_signal_mask;
> +    target_sigset_t target_sigsuspend_mask;
> +#endif

These basically do the same thing as the existing sigsuspend_mask
and signal_mask fields. Rather than having two struct fields
that do very similar things, my guess is that we'll end up
with cleaner code if we just always store these masks as
target_sigset_t, and refactor the code that currently treats
them as being host sigset_t to treat them as target_sigset_t.
After all, the signal_mask field is supposed to be "the signal
mask as requested by the guest program", so target_sigset_t
is the more natural way to represent it.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]