From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsU8I-0000t8-7k for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:20:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsU8C-0003o6-VQ for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:20:09 -0400 Received: from jessie.kos.to ([212.47.231.226]:49962 helo=pilvi.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsU8C-0003mB-P4 for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:20:04 -0400 Date: Fri, 7 Oct 2016 12:19:58 +0000 From: Riku Voipio Message-ID: <20161007121958.GB28620@kos.to> References: <1472838001-1673-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] linux-user: Fix definition of target_sigevent for 32-bit guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Patch Tracking 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 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 > > --- > > 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 >