All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Fix networking for s390x-user
@ 2014-01-11  9:34 pavel.zbitskiy
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order pavel.zbitskiy
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: pavel.zbitskiy @ 2014-01-11  9:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

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(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order
  2014-01-11  9:34 [Qemu-devel] [PATCH 0/3] Fix networking for s390x-user pavel.zbitskiy
@ 2014-01-11  9:34 ` pavel.zbitskiy
  2014-01-12 18:56   ` Peter Maydell
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen pavel.zbitskiy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: pavel.zbitskiy @ 2014-01-11  9:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Pavel Zbitskiy

From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>

It was broken by 4ce6243dc6216e35b5b691078ffa856463bfa8db,
where TARGET_CLONE_BACKWARDS was specified instead of
TARGET_CLONE_BACKWARDS2.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
---
 linux-user/s390x/syscall.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/s390x/syscall.h b/linux-user/s390x/syscall.h
index ea8c304..e5ce30b 100644
--- a/linux-user/s390x/syscall.h
+++ b/linux-user/s390x/syscall.h
@@ -22,4 +22,4 @@ struct target_pt_regs {
 
 #define UNAME_MACHINE "s390x"
 
-#define TARGET_CLONE_BACKWARDS
+#define TARGET_CLONE_BACKWARDS2
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen
  2014-01-11  9:34 [Qemu-devel] [PATCH 0/3] Fix networking for s390x-user pavel.zbitskiy
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order pavel.zbitskiy
@ 2014-01-11  9:34 ` pavel.zbitskiy
  2014-01-12 19:07   ` Peter Maydell
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 3/3] linux-user: fixed recvfrom() addrlen pavel.zbitskiy
  2014-01-15 19:38 ` [Qemu-devel] [Qemu-trivial] [PATCH 0/3] Fix networking for s390x-user Michael Tokarev
  3 siblings, 1 reply; 8+ messages in thread
From: pavel.zbitskiy @ 2014-01-11  9:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Pavel Zbitskiy

From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>

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.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
---
 linux-user/syscall.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4a14a43..c2cd2b4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 3/3] linux-user: fixed recvfrom() addrlen
  2014-01-11  9:34 [Qemu-devel] [PATCH 0/3] Fix networking for s390x-user pavel.zbitskiy
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order pavel.zbitskiy
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen pavel.zbitskiy
@ 2014-01-11  9:34 ` pavel.zbitskiy
  2014-01-15 19:38 ` [Qemu-devel] [Qemu-trivial] [PATCH 0/3] Fix networking for s390x-user Michael Tokarev
  3 siblings, 0 replies; 8+ messages in thread
From: pavel.zbitskiy @ 2014-01-11  9:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Pavel Zbitskiy

From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>

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.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
---
 linux-user/syscall.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c2cd2b4..43f54ca 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order pavel.zbitskiy
@ 2014-01-12 18:56   ` Peter Maydell
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2014-01-12 18:56 UTC (permalink / raw)
  To: pavel.zbitskiy; +Cc: QEMU Trivial, QEMU Developers

On 11 January 2014 09:34,  <pavel.zbitskiy@gmail.com> wrote:
> From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
>
> It was broken by 4ce6243dc6216e35b5b691078ffa856463bfa8db,
> where TARGET_CLONE_BACKWARDS was specified instead of
> TARGET_CLONE_BACKWARDS2.
>
> Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
> ---
>  linux-user/s390x/syscall.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/s390x/syscall.h b/linux-user/s390x/syscall.h
> index ea8c304..e5ce30b 100644
> --- a/linux-user/s390x/syscall.h
> +++ b/linux-user/s390x/syscall.h
> @@ -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

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen pavel.zbitskiy
@ 2014-01-12 19:07   ` Peter Maydell
  2014-01-15 19:37     ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2014-01-12 19:07 UTC (permalink / raw)
  To: pavel.zbitskiy; +Cc: QEMU Trivial, QEMU Developers

On 11 January 2014 09:34,  <pavel.zbitskiy@gmail.com> wrote:
> From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
>
> 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.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/3] linux-user: fixed getsockopt() optlen
  2014-01-12 19:07   ` Peter Maydell
@ 2014-01-15 19:37     ` Michael Tokarev
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Tokarev @ 2014-01-15 19:37 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Trivial, pavel.zbitskiy, QEMU Developers

12.01.2014 23:07, Peter Maydell wrote:
> On 11 January 2014 09:34,  <pavel.zbitskiy@gmail.com> wrote:
>> From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
>>
>> 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.
> 
> 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() ?

I think the current fix is worth to apply anyway, regareless of
further possible rework.

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH 0/3] Fix networking for s390x-user
  2014-01-11  9:34 [Qemu-devel] [PATCH 0/3] Fix networking for s390x-user pavel.zbitskiy
                   ` (2 preceding siblings ...)
  2014-01-11  9:34 ` [Qemu-devel] [PATCH 3/3] linux-user: fixed recvfrom() addrlen pavel.zbitskiy
@ 2014-01-15 19:38 ` Michael Tokarev
  3 siblings, 0 replies; 8+ messages in thread
From: Michael Tokarev @ 2014-01-15 19:38 UTC (permalink / raw)
  To: pavel.zbitskiy; +Cc: qemu-trivial, qemu-devel

11.01.2014 13:34, pavel.zbitskiy@gmail.com wrote:
> Pavel Zbitskiy (3):
>   linux-user: fixed s390x clone() argument order
>   linux-user: fixed getsockopt() optlen
>   linux-user: fixed recvfrom() addrlen

Thanks, applied all 3 to the trivial-patches queue.

/mjt

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-15 19:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-11  9:34 [Qemu-devel] [PATCH 0/3] Fix networking for s390x-user pavel.zbitskiy
2014-01-11  9:34 ` [Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order pavel.zbitskiy
2014-01-12 18:56   ` Peter Maydell
2014-01-11  9:34 ` [Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen pavel.zbitskiy
2014-01-12 19:07   ` Peter Maydell
2014-01-15 19:37     ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-01-11  9:34 ` [Qemu-devel] [PATCH 3/3] linux-user: fixed recvfrom() addrlen pavel.zbitskiy
2014-01-15 19:38 ` [Qemu-devel] [Qemu-trivial] [PATCH 0/3] Fix networking for s390x-user Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.