Fix networking for s390x-user
cover Fix networking for s390x-user
Pavel Zbitskiy (3):
linux-user: fixed s390x clone() argument order
linux-user: fixed getsockopt() optlen
linux-user: fixed recvfrom() addrlen
linux-user/s390x/syscall.h | 2 +- linux-user/syscall.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
PATCH 1/3 linux-user: fixed s390x clone() argument order
From: Pavel Zbitskiy <[email protected]>
It was broken by 4ce6243dc6216e35b5b691078ffa856463bfa8db, where TARGET_CLONE_BACKWARDS was specified instead of TARGET_CLONE_BACKWARDS2.
--- linux-user/s390x/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/s390x/syscall.h +1 -1
@@ -22,4 +22,4 @@ struct target_pt_regs {#define UNAME_MACHINE "s390x" -#define TARGET_CLONE_BACKWARDS +#define TARGET_CLONE_BACKWARDS2
Signature · 1 line
1.7.10.4
Re: [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order
Quoted 16 lines · On 11 January 2014 09:34, <[email protected]> wrote:
From: Pavel Zbitskiy <[email protected]>
It was broken by
4ce6243dc6216e35b5b691078ffa856463bfa8db, whereTARGET_CLONE_BACKWARDSwas specified instead ofTARGET_CLONE_BACKWARDS2.Signed-off-by Pavel Zbitskiy <[email protected]>--- linux-user/s390x/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)linux-user/s390x/syscall.h +0
-0
linux-user/s390x/syscall.h struct target_pt_regs { · line 25
Quoted 5 lines
linux-user/s390x/syscall.h +1
-1@@ -22,4 +22,4 @@ struct target_pt_regs {#define UNAME_MACHINE "s390x" -#define TARGET_CLONE_BACKWARDS +#define TARGET_CLONE_BACKWARDS2
Yep, kernel config agrees:
http://lxr.free-electrons.com/source/arch/s390/Kconfig#L99
thanks
-- PMM
PATCH 2/3 linux-user: fixed getsockopt() optlen
In reply to [email protected]From: Pavel Zbitskiy <[email protected]>
optlen parameter of getsockopt() of type socklen_t* was read into variable of type socklen_t, that caused zeroing out of upper 4 bytes when running s390x on top of x86_64. This patch changes optlen type to abi_ulong.
--- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
@@ -2389,7 +2389,7 @@ static abi_long do_socketcall(int num, abi_ulong vptr)abi_ulong level;abi_ulong optname;abi_ulong optval; -socklen_t optlen; +abi_ulong optlen;if (get_user_ual (sockfd, vptr) || get_user_ual(level, vptr + n)
Signature · 1 line
1.7.10.4
Re: [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen
Quoted 6 lines · On 11 January 2014 09:34, <[email protected]> wrote:
From: Pavel Zbitskiy <[email protected]>
optlen parameter of
getsockopt()of type socklen_t* was read into variable of typesocklen_t, that caused zeroing out of upper 4 bytes when running s390x on top ofx86_64. This patch changes optlen type toabi_ulong.
This patch and patch 3 are correct fixes, but shouldn't we be more generally using abi_ulong for every argument we read from the guest in do_socketcall() ?
It might be nicer to fix this by having a lookup table of SOCKOP_* to number-of-arguments, and then hoist the get_user_ual() calls outside the switch() statement to fill in an 'abi_ulong args[]' array. Then the individual calls in the switch would just look like
do_socket(args[0], args[1], args[2]);
thanks
-- PMM
Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/3] linux-user: fixed getsockopt() optlen
Quoted 11 lines · Peter Maydell
Quoted 6 lines · On 11 January 2014 09:34, <[email protected]> wrote:
From: Pavel Zbitskiy <[email protected]>
optlen parameter of
getsockopt()of type socklen_t* was read into variable of typesocklen_t, that caused zeroing out of upper 4 bytes when running s390x on top ofx86_64. This patch changes optlen type toabi_ulong.This patch and patch 3 are correct fixes, but shouldn't we be more generally using
abi_ulongfor every argument we read from the guest indo_socketcall()?
I think the current fix is worth to apply anyway, regareless of further possible rework.
Thanks,
/mjt
PATCH 3/3 linux-user: fixed recvfrom() addrlen
In reply to [email protected]From: Pavel Zbitskiy <[email protected]>
addrlen parameter of recvfrom() of type socklen_t* was read into variable of type socklen_t, that caused zeroing out of upper 4 bytes when running s390x on top of x86_64. This patch changes addrlen type to abi_ulong.
--- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
@@ -2325,7 +2325,7 @@ static abi_long do_socketcall(int num, abi_ulong vptr)size_t len;abi_ulong flags;abi_ulong addr; -socklen_t addrlen; +abi_ulong addrlen;if (get_user_ual (sockfd, vptr) || get_user_ual(msg, vptr + n)
Signature · 1 line
1.7.10.4
Michael Tokarev
AppliedQuoted 4 lines · 11.01.2014 13:34, [email protected] wrote:
Pavel Zbitskiy (3):
linux-user: fixed s390xclone()argument order
linux-user: fixedgetsockopt()optlen
linux-user: fixedrecvfrom()addrlen
Thanks, applied all 3 to the trivial-patches queue.
/mjt