All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches
@ 2019-03-07 10:06 Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 1/9] linux-user: fix recvmsg emulation Laurent Vivier
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio

The following changes since commit 32694e98b8d7a246345448a8f707d2e11d6c65e2:

  Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2019-03-06 18:52:19 +0000)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/linux-user-for-4.0-pull-request

for you to fetch changes up to 61b463fbf6cbf21fcd9abb5af765a19b88dbc1ba:

  linux-user: add new netlink types (2019-03-07 11:02:33 +0100)

----------------------------------------------------------------
- Update netlink types to linux v5.0
- fix accept4/getpeername/getsockname/recvfrom/recvmsg/read
- add/fix ELF_PLATFORM ofr aarch64 and arm
- fix "may be used uninitialized" warnings
- Fix breakpoint support in Nios
- Nicer strace output of chroot() syscall

----------------------------------------------------------------

Andreas Schwab (3):
  linux-user: fix recvmsg emulation
  linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom
    syscalls
  linux-user: don't short-circuit read with zero length

Helge Deller (1):
  linux-user: Nicer strace output of chroot() syscall

Laurent Vivier (1):
  linux-user: add new netlink types

Marc-André Lureau (1):
  linux-user: fix "may be used uninitialized" warnings

Richard Henderson (2):
  linux-user: Add ELF_PLATFORM for arm
  linux-user: Fix ELF_PLATFORM for aarch64_be-linux-user

Sandra Loosemore (1):
  Fix breakpoint support in Nios II user-mode emulation.

 linux-user/elfload.c        | 37 +++++++++++++++++++++++++-
 linux-user/fd-trans.c       |  9 +++++++
 linux-user/nios2/cpu_loop.c |  6 +++++
 linux-user/strace.c         | 12 +++++++++
 linux-user/strace.list      |  2 +-
 linux-user/syscall.c        | 53 +++++++++++++++++++++++--------------
 6 files changed, 97 insertions(+), 22 deletions(-)

-- 
2.20.1

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

* [Qemu-devel] [PULL 1/9] linux-user: fix recvmsg emulation
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 2/9] linux-user: Add ELF_PLATFORM for arm Laurent Vivier
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Riku Voipio, Andreas Schwab, Philippe Mathieu-Daudé

From: Andreas Schwab <schwab@suse.de>

Set msg_flags in the returned struct msghdr.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <mvmimxprmn8.fsf@suse.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5bbb72f3d5fc..f380048cbd8b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2759,6 +2759,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
             }
             if (!is_error(ret)) {
                 msgp->msg_namelen = tswap32(msg.msg_namelen);
+                msgp->msg_flags = tswap32(msg.msg_flags);
                 if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
                     ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
                                     msg.msg_name, msg.msg_namelen);
-- 
2.20.1

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

* [Qemu-devel] [PULL 2/9] linux-user: Add ELF_PLATFORM for arm
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 1/9] linux-user: fix recvmsg emulation Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 3/9] linux-user: Fix ELF_PLATFORM for aarch64_be-linux-user Laurent Vivier
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Richard Henderson

From: Richard Henderson <richard.henderson@linaro.org>

The 32-bit kernel has strings for v4, v5, v6, v7, v7m.
The 64-bit kernel, in compat mode, has strings for v8.

Fixes: https://bugs.launchpad.net/bugs/1813034
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190212074840.13542-2-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/elfload.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 6e8762b40dea..940a97a2f2e9 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -500,6 +500,37 @@ static uint32_t get_elf_hwcap2(void)
 #undef GET_FEATURE
 #undef GET_FEATURE_ID
 
+#define ELF_PLATFORM get_elf_platform()
+
+static const char *get_elf_platform(void)
+{
+    CPUARMState *env = thread_cpu->env_ptr;
+
+#ifdef TARGET_WORDS_BIGENDIAN
+# define END  "b"
+#else
+# define END  "l"
+#endif
+
+    if (arm_feature(env, ARM_FEATURE_V8)) {
+        return "v8" END;
+    } else if (arm_feature(env, ARM_FEATURE_V7)) {
+        if (arm_feature(env, ARM_FEATURE_M)) {
+            return "v7m" END;
+        } else {
+            return "v7" END;
+        }
+    } else if (arm_feature(env, ARM_FEATURE_V6)) {
+        return "v6" END;
+    } else if (arm_feature(env, ARM_FEATURE_V5)) {
+        return "v5" END;
+    } else {
+        return "v4" END;
+    }
+
+#undef END
+}
+
 #else
 /* 64 bit ARM definitions */
 #define ELF_START_MMAP 0x80000000
-- 
2.20.1

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

* [Qemu-devel] [PULL 3/9] linux-user: Fix ELF_PLATFORM for aarch64_be-linux-user
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 1/9] linux-user: fix recvmsg emulation Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 2/9] linux-user: Add ELF_PLATFORM for arm Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 4/9] linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom syscalls Laurent Vivier
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Richard Henderson

From: Richard Henderson <richard.henderson@linaro.org>

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190212074840.13542-3-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/elfload.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 940a97a2f2e9..c1a26021f8d7 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -537,7 +537,11 @@ static const char *get_elf_platform(void)
 
 #define ELF_ARCH        EM_AARCH64
 #define ELF_CLASS       ELFCLASS64
-#define ELF_PLATFORM    "aarch64"
+#ifdef TARGET_WORDS_BIGENDIAN
+# define ELF_PLATFORM    "aarch64_be"
+#else
+# define ELF_PLATFORM    "aarch64"
+#endif
 
 static inline void init_thread(struct target_pt_regs *regs,
                                struct image_info *infop)
-- 
2.20.1

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

* [Qemu-devel] [PULL 4/9] linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom syscalls
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (2 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 3/9] linux-user: Fix ELF_PLATFORM for aarch64_be-linux-user Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 5/9] Fix breakpoint support in Nios II user-mode emulation Laurent Vivier
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Andreas Schwab

From: Andreas Schwab <schwab@suse.de>

System calls that return a socket address do so by writing the (possibly
truncated) address into the provided buffer space, but setting the
addrlen parameter to the actual size of the address.  To determine how
much to copy back to the target memory the emulation needs to remember
the incoming value of the addrlen parameter, so that it doesn't write
past the buffer limits.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <mvmimxmppcj.fsf_-_@suse.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 41 +++++++++++++++++++++++++----------------
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f380048cbd8b..5f72209debc9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2847,7 +2847,7 @@ static abi_long do_sendrecvmmsg(int fd, abi_ulong target_msgvec,
 static abi_long do_accept4(int fd, abi_ulong target_addr,
                            abi_ulong target_addrlen_addr, int flags)
 {
-    socklen_t addrlen;
+    socklen_t addrlen, ret_addrlen;
     void *addr;
     abi_long ret;
     int host_flags;
@@ -2871,11 +2871,13 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
 
     addr = alloca(addrlen);
 
-    ret = get_errno(safe_accept4(fd, addr, &addrlen, host_flags));
+    ret_addrlen = addrlen;
+    ret = get_errno(safe_accept4(fd, addr, &ret_addrlen, host_flags));
     if (!is_error(ret)) {
-        host_to_target_sockaddr(target_addr, addr, addrlen);
-        if (put_user_u32(addrlen, target_addrlen_addr))
+        host_to_target_sockaddr(target_addr, addr, MIN(addrlen, ret_addrlen));
+        if (put_user_u32(ret_addrlen, target_addrlen_addr)) {
             ret = -TARGET_EFAULT;
+        }
     }
     return ret;
 }
@@ -2884,7 +2886,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
 static abi_long do_getpeername(int fd, abi_ulong target_addr,
                                abi_ulong target_addrlen_addr)
 {
-    socklen_t addrlen;
+    socklen_t addrlen, ret_addrlen;
     void *addr;
     abi_long ret;
 
@@ -2900,11 +2902,13 @@ static abi_long do_getpeername(int fd, abi_ulong target_addr,
 
     addr = alloca(addrlen);
 
-    ret = get_errno(getpeername(fd, addr, &addrlen));
+    ret_addrlen = addrlen;
+    ret = get_errno(getpeername(fd, addr, &ret_addrlen));
     if (!is_error(ret)) {
-        host_to_target_sockaddr(target_addr, addr, addrlen);
-        if (put_user_u32(addrlen, target_addrlen_addr))
+        host_to_target_sockaddr(target_addr, addr, MIN(addrlen, ret_addrlen));
+        if (put_user_u32(ret_addrlen, target_addrlen_addr)) {
             ret = -TARGET_EFAULT;
+        }
     }
     return ret;
 }
@@ -2913,7 +2917,7 @@ static abi_long do_getpeername(int fd, abi_ulong target_addr,
 static abi_long do_getsockname(int fd, abi_ulong target_addr,
                                abi_ulong target_addrlen_addr)
 {
-    socklen_t addrlen;
+    socklen_t addrlen, ret_addrlen;
     void *addr;
     abi_long ret;
 
@@ -2929,11 +2933,13 @@ static abi_long do_getsockname(int fd, abi_ulong target_addr,
 
     addr = alloca(addrlen);
 
-    ret = get_errno(getsockname(fd, addr, &addrlen));
+    ret_addrlen = addrlen;
+    ret = get_errno(getsockname(fd, addr, &ret_addrlen));
     if (!is_error(ret)) {
-        host_to_target_sockaddr(target_addr, addr, addrlen);
-        if (put_user_u32(addrlen, target_addrlen_addr))
+        host_to_target_sockaddr(target_addr, addr, MIN(addrlen, ret_addrlen));
+        if (put_user_u32(ret_addrlen, target_addrlen_addr)) {
             ret = -TARGET_EFAULT;
+        }
     }
     return ret;
 }
@@ -3005,7 +3011,7 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
                             abi_ulong target_addr,
                             abi_ulong target_addrlen)
 {
-    socklen_t addrlen;
+    socklen_t addrlen, ret_addrlen;
     void *addr;
     void *host_msg;
     abi_long ret;
@@ -3023,10 +3029,12 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
             goto fail;
         }
         addr = alloca(addrlen);
+        ret_addrlen = addrlen;
         ret = get_errno(safe_recvfrom(fd, host_msg, len, flags,
-                                      addr, &addrlen));
+                                      addr, &ret_addrlen));
     } else {
         addr = NULL; /* To keep compiler quiet.  */
+        addrlen = 0; /* To keep compiler quiet.  */
         ret = get_errno(safe_recvfrom(fd, host_msg, len, flags, NULL, 0));
     }
     if (!is_error(ret)) {
@@ -3039,8 +3047,9 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
             }
         }
         if (target_addr) {
-            host_to_target_sockaddr(target_addr, addr, addrlen);
-            if (put_user_u32(addrlen, target_addrlen)) {
+            host_to_target_sockaddr(target_addr, addr,
+                                    MIN(addrlen, ret_addrlen));
+            if (put_user_u32(ret_addrlen, target_addrlen)) {
                 ret = -TARGET_EFAULT;
                 goto fail;
             }
-- 
2.20.1

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

* [Qemu-devel] [PULL 5/9] Fix breakpoint support in Nios II user-mode emulation.
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (3 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 4/9] linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom syscalls Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 6/9] linux-user: don't short-circuit read with zero length Laurent Vivier
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Sandra Loosemore, Peter Maydell

From: Sandra Loosemore <sandra@codesourcery.com>

Nios II user-mode emulation was missing handling for EXCP_DEBUG,
making the gdb stub essentially useless.  This patch adds the missing
piece.  The new code was copied from the existing EXCP_TRAP handling
and is also similar to what other targets (e.g., arm) do with EXCP_DEBUG.

Signed-off-by: Sandra Loosemore <sandra@codesourcery.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <1550076626-7202-1-git-send-email-sandra@codesourcery.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/nios2/cpu_loop.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c
index b96b1aa1195a..5aa1eca740de 100644
--- a/linux-user/nios2/cpu_loop.c
+++ b/linux-user/nios2/cpu_loop.c
@@ -73,6 +73,12 @@ void cpu_loop(CPUNios2State *env)
                 queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
                 break;
             }
+        case EXCP_DEBUG:
+            info.si_signo = TARGET_SIGTRAP;
+            info.si_errno = 0;
+            info.si_code = TARGET_TRAP_BRKPT;
+            queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
+            break;
         case 0xaa:
             switch (env->regs[R_PC]) {
             /*case 0x1000:*/  /* TODO:__kuser_helper_version */
-- 
2.20.1

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

* [Qemu-devel] [PULL 6/9] linux-user: don't short-circuit read with zero length
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (4 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 5/9] Fix breakpoint support in Nios II user-mode emulation Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 7/9] linux-user: fix "may be used uninitialized" warnings Laurent Vivier
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Andreas Schwab

From: Andreas Schwab <schwab@suse.de>

A zero-length read still needs to do the usual checks, thus it may return
errors like EBADF.  This makes the read syscall emulation consistent with
the pread64 syscall emulation.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <mvm5zsxz2we.fsf@suse.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5f72209debc9..9f7eb7d7a896 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7009,8 +7009,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         _exit(arg1);
         return 0; /* avoid warning */
     case TARGET_NR_read:
-        if (arg3 == 0) {
-            return 0;
+        if (arg2 == 0 && arg3 == 0) {
+            return get_errno(safe_read(arg1, 0, 0));
         } else {
             if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0)))
                 return -TARGET_EFAULT;
-- 
2.20.1

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

* [Qemu-devel] [PULL 7/9] linux-user: fix "may be used uninitialized" warnings
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (5 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 6/9] linux-user: don't short-circuit read with zero length Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 8/9] linux-user: Nicer strace output of chroot() syscall Laurent Vivier
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Fixes:

/home/elmarco/src/qemu/linux-user/syscall.c: In function ‘do_ioctl_rt’:
/home/elmarco/src/qemu/linux-user/syscall.c:4773:9: error: ‘host_rt_dev_ptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (*host_rt_dev_ptr != 0) {
         ^~~~~~~~~~~~~~~~
/home/elmarco/src/qemu/linux-user/syscall.c:4774:9: error: ‘target_rt_dev_ptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         unlock_user((void *)*host_rt_dev_ptr,
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     *target_rt_dev_ptr, 0);
                     ~~~~~~~~~~~~~~~~~~~~~~

Based on previous discussion from patch "linux-users/syscall: make
do_ioctl_rt safer" by Alex Bennée.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190305151500.25038-1-marcandre.lureau@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9f7eb7d7a896..208fd1813d6a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4733,8 +4733,8 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp,
     const int *dst_offsets, *src_offsets;
     int target_size;
     void *argptr;
-    abi_ulong *target_rt_dev_ptr;
-    unsigned long *host_rt_dev_ptr;
+    abi_ulong *target_rt_dev_ptr = NULL;
+    unsigned long *host_rt_dev_ptr = NULL;
     abi_long ret;
     int i;
 
@@ -4780,6 +4780,9 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp,
     unlock_user(argptr, arg, 0);
 
     ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
+
+    assert(host_rt_dev_ptr != NULL);
+    assert(target_rt_dev_ptr != NULL);
     if (*host_rt_dev_ptr != 0) {
         unlock_user((void *)*host_rt_dev_ptr,
                     *target_rt_dev_ptr, 0);
-- 
2.20.1

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

* [Qemu-devel] [PULL 8/9] linux-user: Nicer strace output of chroot() syscall
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (6 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 7/9] linux-user: fix "may be used uninitialized" warnings Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-07 10:06 ` [Qemu-devel] [PULL 9/9] linux-user: add new netlink types Laurent Vivier
  2019-03-08 11:04 ` [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Helge Deller

From: Helge Deller <deller@gmx.de>

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Message-Id: <20190227191115.GA20163@ls3530.dellerweb.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/strace.c    | 12 ++++++++++++
 linux-user/strace.list |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 7318392e571c..6f72a74c0918 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1235,6 +1235,18 @@ print_chdir(const struct syscallname *name,
 }
 #endif
 
+#ifdef TARGET_NR_chroot
+static void
+print_chroot(const struct syscallname *name,
+    abi_long arg0, abi_long arg1, abi_long arg2,
+    abi_long arg3, abi_long arg4, abi_long arg5)
+{
+    print_syscall_prologue(name);
+    print_string(arg0, 1);
+    print_syscall_epilogue(name);
+}
+#endif
+
 #ifdef TARGET_NR_chmod
 static void
 print_chmod(const struct syscallname *name,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index ff8bb19f5fac..db21ce41779f 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -77,7 +77,7 @@
 { TARGET_NR_chown32, "chown32" , NULL, NULL, NULL },
 #endif
 #ifdef TARGET_NR_chroot
-{ TARGET_NR_chroot, "chroot" , NULL, NULL, NULL },
+{ TARGET_NR_chroot, "chroot" , NULL, print_chroot, NULL },
 #endif
 #ifdef TARGET_NR_clock_adjtime
 { TARGET_NR_clock_adjtime, "clock_adjtime" , NULL, print_clock_adjtime, NULL },
-- 
2.20.1

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

* [Qemu-devel] [PULL 9/9] linux-user: add new netlink types
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (7 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 8/9] linux-user: Nicer strace output of chroot() syscall Laurent Vivier
@ 2019-03-07 10:06 ` Laurent Vivier
  2019-03-08 11:04 ` [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Laurent Vivier @ 2019-03-07 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Riku Voipio, Philippe Mathieu-Daudé

Add QEMU_IFLA_BR_VLAN_STATS_PER_PORT (from linux v4.20),
    QEMU_IFLA_BR_MULTI_BOOLOPT (from linux v5.0).

The first new entry fixes the following error:

  Unknown QEMU_IFLA_BR type 45

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190306200925.17605-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/fd-trans.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index 30425c9df6bc..612819c1b1ec 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -75,6 +75,8 @@ enum {
     QEMU_IFLA_BR_MCAST_STATS_ENABLED,
     QEMU_IFLA_BR_MCAST_IGMP_VERSION,
     QEMU_IFLA_BR_MCAST_MLD_VERSION,
+    QEMU_IFLA_BR_VLAN_STATS_PER_PORT,
+    QEMU_IFLA_BR_MULTI_BOOLOPT,
     QEMU___IFLA_BR_MAX,
 };
 
@@ -438,6 +440,7 @@ static abi_long host_to_target_data_bridge_nlattr(struct nlattr *nlattr,
     case QEMU_IFLA_BR_MCAST_STATS_ENABLED:
     case QEMU_IFLA_BR_MCAST_IGMP_VERSION:
     case QEMU_IFLA_BR_MCAST_MLD_VERSION:
+    case QEMU_IFLA_BR_VLAN_STATS_PER_PORT:
         break;
     /* uint16_t */
     case QEMU_IFLA_BR_PRIORITY:
@@ -543,6 +546,12 @@ static abi_long host_to_target_slave_data_bridge_nlattr(struct nlattr *nlattr,
     case QEMU_IFLA_BRPORT_ROOT_ID:
     case QEMU_IFLA_BRPORT_BRIDGE_ID:
         break;
+    /* br_boolopt_multi { uint32_t, uint32_t } */
+    case QEMU_IFLA_BR_MULTI_BOOLOPT:
+        u32 = NLA_DATA(nlattr);
+        u32[0] = tswap32(u32[0]); /* optval */
+        u32[1] = tswap32(u32[1]); /* optmask */
+        break;
     default:
         gemu_log("Unknown QEMU_IFLA_BRPORT type %d\n", nlattr->nla_type);
         break;
-- 
2.20.1

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

* Re: [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches
  2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
                   ` (8 preceding siblings ...)
  2019-03-07 10:06 ` [Qemu-devel] [PULL 9/9] linux-user: add new netlink types Laurent Vivier
@ 2019-03-08 11:04 ` Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2019-03-08 11:04 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: QEMU Developers, Riku Voipio

On Thu, 7 Mar 2019 at 10:09, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit 32694e98b8d7a246345448a8f707d2e11d6c65e2:
>
>   Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2019-03-06 18:52:19 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/linux-user-for-4.0-pull-request
>
> for you to fetch changes up to 61b463fbf6cbf21fcd9abb5af765a19b88dbc1ba:
>
>   linux-user: add new netlink types (2019-03-07 11:02:33 +0100)
>
> ----------------------------------------------------------------
> - Update netlink types to linux v5.0
> - fix accept4/getpeername/getsockname/recvfrom/recvmsg/read
> - add/fix ELF_PLATFORM ofr aarch64 and arm
> - fix "may be used uninitialized" warnings
> - Fix breakpoint support in Nios
> - Nicer strace output of chroot() syscall
>

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM

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

end of thread, other threads:[~2019-03-08 11:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 10:06 [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 1/9] linux-user: fix recvmsg emulation Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 2/9] linux-user: Add ELF_PLATFORM for arm Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 3/9] linux-user: Fix ELF_PLATFORM for aarch64_be-linux-user Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 4/9] linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom syscalls Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 5/9] Fix breakpoint support in Nios II user-mode emulation Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 6/9] linux-user: don't short-circuit read with zero length Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 7/9] linux-user: fix "may be used uninitialized" warnings Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 8/9] linux-user: Nicer strace output of chroot() syscall Laurent Vivier
2019-03-07 10:06 ` [Qemu-devel] [PULL 9/9] linux-user: add new netlink types Laurent Vivier
2019-03-08 11:04 ` [Qemu-devel] [PULL 0/9] Linux user for 4.0 patches Peter Maydell

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.