All of lore.kernel.org
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user: Fix definition of target_sigevent for 32-bit guests
Date: Fri, 7 Oct 2016 12:19:58 +0000	[thread overview]
Message-ID: <20161007121958.GB28620@kos.to> (raw)
In-Reply-To: <CAFEAcA-ZrnzBiZNB7URqrDjvoWmCSfaMEKVHR1ho3CPf80-UDw@mail.gmail.com>

On Tue, Oct 04, 2016 at 02:08:24PM +0100, Peter Maydell wrote:
> Ping ?

Applied, thanks.
 
> thanks
> -- PMM
> 
> On 2 September 2016 at 18:40, Peter Maydell <peter.maydell@linaro.org> wrote:
> > The sigevent structure includes a union with some fields which
> > are pointers. For the QEMU target_sigevent structure we must
> > represent these as abi_ulongs, not host function pointers.
> >
> > This error was causing the compiler to believe it should 8-align
> > the _sigev_un union on a 64-bit host, which meant that the
> > code in target_to_host_sigevent() was looking at the wrong
> > offset to find the _tid field, and timer_create() would
> > spuriously fail with EINVAL.
> >
> > This fixes the final loose end noted in LP:1042388.
> >
> > While we're editing the structure, switch the 'int32_t' fields
> > to 'abi_int'; this will only matter for guests with non-standard
> > integer alignment like m68k.
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
> >  linux-user/syscall_defs.h | 16 ++++++++++------
> >  1 file changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> > index dbf6a38..f4417ee 100644
> > --- a/linux-user/syscall_defs.h
> > +++ b/linux-user/syscall_defs.h
> > @@ -2618,15 +2618,19 @@ typedef int32_t target_timer_t;
> >
> >  struct target_sigevent {
> >      target_sigval_t sigev_value;
> > -    int32_t sigev_signo;
> > -    int32_t sigev_notify;
> > +    abi_int sigev_signo;
> > +    abi_int sigev_notify;
> >      union {
> > -        int32_t _pad[TARGET_SIGEV_PAD_SIZE];
> > -        int32_t _tid;
> > +        abi_int _pad[TARGET_SIGEV_PAD_SIZE];
> > +        abi_int _tid;
> >
> > +        /* The kernel (and thus QEMU) never looks at these;
> > +         * they're only used as part of the ABI between a
> > +         * userspace program and libc.
> > +         */
> >          struct {
> > -            void (*_function)(sigval_t);
> > -            void *_attribute;
> > +            abi_ulong _function;
> > +            abi_ulong _attribute;
> >          } _sigev_thread;
> >      } _sigev_un;
> >  };
> > --
> > 2.7.4
> 

      reply	other threads:[~2016-10-07 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 17:40 [Qemu-devel] [PATCH] linux-user: Fix definition of target_sigevent for 32-bit guests Peter Maydell
2016-10-04 13:08 ` Peter Maydell
2016-10-07 12:19   ` Riku Voipio [this message]

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=20161007121958.GB28620@kos.to \
    --to=riku.voipio@iki.fi \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.