[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MT
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values |
Date: |
Thu, 12 Oct 2017 18:49:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Le 12/10/2017 à 17:30, Peter Maydell a écrit :
> The TARGET_MTIOCTOP/TARGET_MTIOCGET/TARGET_MTIOCPOS values
> were being defined in terms of host struct types, but
> these structures are such that their size might differ
> on different hosts. Switch to using a target struct
> definition instead.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> linux-user/syscall_defs.h | 31 ++++++++++++++++++++++++++++---
> 1 file changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index f7cc9f9..16d56fa 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -2706,9 +2706,34 @@ struct target_f_owner_ex {
> #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1)
> #define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2)
>
> -#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct mtop)
> -#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget)
> -#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos)
> +struct target_mtop {
> + abi_short mt_op;
> + abi_int mt_count;
> +};
> +
> +#if defined(TARGET_SPARC) || defined(TARGET_MIPS)
> +typedef abi_long target_kernel_daddr_t;
> +#else
> +typedef abi_int target_kernel_daddr_t;
> +#endif
Perhaps you can add these ones into include/exec/user/abitypes.h ?
> +struct target_mtget {
> + abi_long mt_type;
> + abi_long mt_resid;
> + abi_long mt_dsreg;
> + abi_long mt_gstat;
> + abi_long mt_erreg;
> + target_kernel_daddr_t mt_fileno;
> + target_kernel_daddr_t mt_blkno;
> +};
I think you need to update STRUCT(mtget, ...) in
linux-user/syscall_types.h to reflect the size difference for MIPS and
SPARC.
Thanks,
Laurent
- [Qemu-devel] [PATCH 0/2] fix incorrect target ioctl numbers, Peter Maydell, 2017/10/12
- [Qemu-devel] [PATCH 1/2] linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers, Peter Maydell, 2017/10/12
- [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Peter Maydell, 2017/10/12
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values,
Laurent Vivier <=
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Peter Maydell, 2017/10/12
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Laurent Vivier, 2017/10/12
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Riku Voipio, 2017/10/16
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Laurent Vivier, 2017/10/16
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Peter Maydell, 2017/10/16
- Re: [Qemu-devel] [PATCH 2/2] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, Laurent Vivier, 2017/10/16