diff options
author | Laurent Vivier <laurent@vivier.eu> | 2015-10-03 17:14:06 +0200 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:22 -0600 |
commit | 0d5f8b4d36b1765d627af28ade00d1b21af9585d (patch) | |
tree | 15efc1b9ccd76a3533b5344119b9a55cc6a8f241 | |
parent | 5a236147d0733a81bf3ca734ddb77c8dd49679d8 (diff) | |
download | hqemu-0d5f8b4d36b1765d627af28ade00d1b21af9585d.zip hqemu-0d5f8b4d36b1765d627af28ade00d1b21af9585d.tar.gz |
linux-user: correctly align target_epoll_event
According to comments in /usr/include/linux/eventpoll.h,
poll_event is packed only on x86_64.
And to be sure fields are correctly aligned in epoll_data,
use abi_XXX types for all of them.
Moreover, fd type is wrong: fd is int, not ulong.
This has been tested with a ppc guest on an x86_64 host:
without this patch, systemd crashes (core).
CC: Alexander Graf <agraf@suse.de>
CC: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r-- | linux-user/syscall_defs.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index f996acf..2fd4aff 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2514,20 +2514,23 @@ struct target_mq_attr { #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME) #ifdef CONFIG_EPOLL +#if defined(TARGET_X86_64) +#define TARGET_EPOLL_PACKED QEMU_PACKED +#else +#define TARGET_EPOLL_PACKED +#endif + typedef union target_epoll_data { abi_ulong ptr; - abi_ulong fd; - uint32_t u32; - uint64_t u64; + abi_int fd; + abi_uint u32; + abi_ullong u64; } target_epoll_data_t; struct target_epoll_event { - uint32_t events; -#if defined(TARGET_ARM) || defined(TARGET_MIPS) || defined(TARGET_MIPS64) - uint32_t __pad; -#endif + abi_uint events; target_epoll_data_t data; -} QEMU_PACKED; +} TARGET_EPOLL_PACKED; #endif struct target_rlimit64 { uint64_t rlim_cur; |