qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

target/xtensa: linux-user: fix sysv IPC structures

- make target_ipc_perm fields match kernel definitions for xtensa;
- add target_semid64_ds with proper order of times and reserved fields
for little/big endian specific for xtensa;
- add missing reserved fields after time fields to the target_shmid_ds;
- fix types of shm_cpid, shm_lpid and shm_nattch fields of
target_shmid_ds to match kernel definitions for xtensa.

These changes fix guest ipcs output and fix glibc testsuite tests
sysvipc/test-sysvsem and sysvipc/test-sysvshm.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+30 -7
+30 -7
linux-user/xtensa/target_structs.h
··· 8 8 abi_uint cuid; /* Creator's user ID. */ 9 9 abi_uint cgid; /* Creator's group ID. */ 10 10 abi_uint mode; /* Read/write permission. */ 11 - abi_ushort __seq; /* Sequence number. */ 11 + abi_ulong __seq; /* Sequence number. */ 12 + abi_ulong __unused1; 13 + abi_ulong __unused2; 14 + }; 15 + 16 + struct target_semid64_ds { 17 + struct target_ipc_perm sem_perm; 18 + #ifdef TARGET_WORDS_BIGENDIAN 19 + abi_ulong __unused1; 20 + abi_ulong sem_otime; 21 + abi_ulong __unused2; 22 + abi_ulong sem_ctime; 23 + #else 24 + abi_ulong sem_otime; 25 + abi_ulong __unused1; 26 + abi_ulong sem_ctime; 27 + abi_ulong __unused2; 28 + #endif 29 + abi_ulong sem_nsems; 30 + abi_ulong __unused3; 31 + abi_ulong __unused4; 12 32 }; 33 + #define TARGET_SEMID64_DS 13 34 14 35 struct target_shmid_ds { 15 36 struct target_ipc_perm shm_perm; /* operation permission struct */ 16 - abi_int shm_segsz; /* size of segment in bytes */ 37 + abi_long shm_segsz; /* size of segment in bytes */ 17 38 abi_long shm_atime; /* time of last shmat() */ 39 + abi_ulong __unused1; 18 40 abi_long shm_dtime; /* time of last shmdt() */ 19 - abi_long shm_ctime; /* time of last change by shmctl() */ 20 - abi_ushort shm_cpid; /* pid of creator */ 21 - abi_ushort shm_lpid; /* pid of last shmop */ 22 - abi_ushort shm_nattch; /* number of current attaches */ 23 - abi_ushort shm_unused; /* compatibility */ 24 41 abi_ulong __unused2; 42 + abi_long shm_ctime; /* time of last change by shmctl() */ 25 43 abi_ulong __unused3; 44 + abi_uint shm_cpid; /* pid of creator */ 45 + abi_uint shm_lpid; /* pid of last shmop */ 46 + abi_ulong shm_nattch; /* number of current attaches */ 47 + abi_ulong __unused4; 48 + abi_ulong __unused5; 26 49 }; 27 50 28 51 #endif