All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches
@ 2019-05-23 14:43 Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc Laurent Vivier
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Aurelien Jarno, Riku Voipio, Laurent Vivier,
	Aleksandar Markovic

The following changes since commit a4f667b6714916683408b983cfe0a615a725775f:

  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190521-3' into staging (2019-05-21 16:30:13 +0100)

are available in the Git repository at:

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

for you to fetch changes up to 069a1504ee1e2943964d0357d798e11b66afd351:

  linux-user: Pass through nanosecond timestamp components for stat syscalls (2019-05-22 20:50:55 +0200)

----------------------------------------------------------------
Add /proc/hardware and /proc/cpuinfo,
update SIOCXXX ioctls,
update IPV6 options,
fix shmat emulation,
add nanoseconds in stat,
init field fp_abi on mips

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

Aleksandar Markovic (2):
  linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa
  linux-user: Add support for SIOCSPGRP ioctl for all targets

Chen-Yu Tsai (1):
  linux-user: Pass through nanosecond timestamp components for stat
    syscalls

Daniel Santos (1):
  linux-user: Sanitize interp_info and, for mips only, init field fp_abi

Laurent Vivier (2):
  linux-user: add pseudo /proc/cpuinfo for sparc
  linux-user: add pseudo /proc/hardware for m68k

Neng Chen (2):
  linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets
  linux-user: Add support for setsockopt() options
    IPV6_<ADD|DROP>_MEMBERSHIP

Richard Henderson (2):
  linux-user: Fix shmat emulation by honoring host SHMLBA
  linux-user: Align mmap_find_vma to host page size

 linux-user/elfload.c      | 22 ++++++++----
 linux-user/ioctls.h       |  3 ++
 linux-user/mmap.c         | 72 +++++++++++++++++++++------------------
 linux-user/qemu.h         |  2 +-
 linux-user/syscall.c      | 72 +++++++++++++++++++++++++++++++++++++--
 linux-user/syscall_defs.h | 57 ++++++++++++++++++++-----------
 6 files changed, 166 insertions(+), 62 deletions(-)

-- 
2.20.1



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

* [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k Laurent Vivier
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Richard Henderson,
	Laurent Vivier, Aleksandar Markovic, Aurelien Jarno

SPARC libc6 debian package wants to check the cpu level to be
installed or not:

  WARNING: This machine has a SPARC V8 or earlier class processor.
  Debian lenny and later does not support such old hardware
  any longer.

To avoid this, it only needs to know if the machine type is sun4u or sun4v,
for that it reads the information from /proc/cpuinfo.

Fixes: 9a93c152fcdb4ab2cd85094487b33578fd693915
       ("linux-user: fix UNAME_MACHINE for sparc/sparc64")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190517133149.19593-2-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efa3ec283706..68484a83e69e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6786,12 +6786,15 @@ static int is_proc_myself(const char *filename, const char *entry)
     return 0;
 }
 
-#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \
+    defined(TARGET_SPARC)
 static int is_proc(const char *filename, const char *entry)
 {
     return strcmp(filename, entry) == 0;
 }
+#endif
 
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
 static int open_net_route(void *cpu_env, int fd)
 {
     FILE *fp;
@@ -6836,6 +6839,14 @@ static int open_net_route(void *cpu_env, int fd)
 }
 #endif
 
+#if defined(TARGET_SPARC)
+static int open_cpuinfo(void *cpu_env, int fd)
+{
+    dprintf(fd, "type\t\t: sun4u\n");
+    return 0;
+}
+#endif
+
 static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags, mode_t mode)
 {
     struct fake_open {
@@ -6851,6 +6862,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
         { "cmdline", open_self_cmdline, is_proc_myself },
 #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
         { "/proc/net/route", open_net_route, is_proc },
+#endif
+#if defined(TARGET_SPARC)
+        { "/proc/cpuinfo", open_cpuinfo, is_proc },
 #endif
         { NULL, NULL, NULL }
     };
-- 
2.20.1



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

* [Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 03/10] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa Laurent Vivier
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Richard Henderson,
	Laurent Vivier, Aleksandar Markovic, Aurelien Jarno

Debian console-setup uses /proc/hardware to guess the keyboard layout.
If the file /proc/hardware cannot be opened, the installation fails.

This patch adds a pseudo /proc/hardware file to report the model of
the machine. Instead of reporting a known and fake model, it
reports "qemu-m68k", which is true, and avoids to set the configuration
for an Amiga/Apple/Atari and let the user to chose the good one.

Bug: https://github.com/vivier/qemu-m68k/issues/34
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190517133149.19593-3-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 68484a83e69e..e5545cbafac7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6787,7 +6787,7 @@ static int is_proc_myself(const char *filename, const char *entry)
 }
 
 #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \
-    defined(TARGET_SPARC)
+    defined(TARGET_SPARC) || defined(TARGET_M68K)
 static int is_proc(const char *filename, const char *entry)
 {
     return strcmp(filename, entry) == 0;
@@ -6847,6 +6847,14 @@ static int open_cpuinfo(void *cpu_env, int fd)
 }
 #endif
 
+#if defined(TARGET_M68K)
+static int open_hardware(void *cpu_env, int fd)
+{
+    dprintf(fd, "Model:\t\tqemu-m68k\n");
+    return 0;
+}
+#endif
+
 static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags, mode_t mode)
 {
     struct fake_open {
@@ -6865,6 +6873,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
 #endif
 #if defined(TARGET_SPARC)
         { "/proc/cpuinfo", open_cpuinfo, is_proc },
+#endif
+#if defined(TARGET_M68K)
+        { "/proc/hardware", open_hardware, is_proc },
 #endif
         { NULL, NULL, NULL }
     };
-- 
2.20.1



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

* [Qemu-devel] [PULL 03/10] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets Laurent Vivier
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Laurent Vivier, Max Filippov,
	Aleksandar Markovic, Aurelien Jarno

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Fix support for the SIOCATMARK and SIOCGPGRP ioctls for xtensa by
correcting corresponding macro definition.

Values for TARGET_SIOCATMARK and TARGET_SIOCGPGRP are determined by
Linux kernel. Following relevant lines (obtained by grep) are from
the kernel source tree:

arch/ia64/include/uapi/asm/sockios.h:#define SIOCATMARK    0x8905
arch/mips/include/uapi/asm/sockios.h:#define SIOCATMARK    _IOR('s', 7, int)
arch/parisc/include/uapi/asm/sockios.h:#define SIOCATMARK  0x8905
arch/sh/include/uapi/asm/sockios.h:#define SIOCATMARK      _IOR('s', 7, int)
arch/xtensa/include/uapi/asm/sockios.h:#define SIOCATMARK  _IOR('s', 7, int)
arch/alpha/include/uapi/asm/sockios.h:#define SIOCATMARK   _IOR('s', 7, int)
arch/sparc/include/uapi/asm/sockios.h:#define SIOCATMARK   0x8905
include/uapi/asm-generic/sockios.h:#define SIOCATMARK	   0x8905

arch/ia64/include/uapi/asm/sockios.h:#define SIOCGPGRP     0x8904
arch/mips/include/uapi/asm/sockios.h:#define SIOCGPGRP     _IOR('s', 9, pid_t)
arch/parisc/include/uapi/asm/sockios.h:#define SIOCGPGRP   0x8904
arch/sh/include/uapi/asm/sockios.h:#define SIOCGPGRP       _IOR('s', 9, pid_t)
arch/xtensa/include/uapi/asm/sockios.h:#define SIOCGPGRP   _IOR('s', 9, pid_t)
arch/alpha/include/uapi/asm/sockios.h:#define SIOCGPGRP    _IOR('s', 9, pid_t)
arch/sparc/include/uapi/asm/sockios.h:#define SIOCGPGRP    0x8904
include/uapi/asm-generic/sockios.h:#define SIOCGPGRP       0x8904

It is visible from above that xtensa should have the same definitions
as alpha, mips and sh4 already do. This patch brings QEMU to the accurate
state wrt these two ioctls.

Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1558282527-22183-2-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall_defs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 1f5b2d18dbea..5b530e04b8fd 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -737,7 +737,8 @@ struct target_pollfd {
 #define TARGET_KDSETLED        0x4B32	/* set led state [lights, not flags] */
 #define TARGET_KDSIGACCEPT     0x4B4E
 
-#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4)
+#if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) ||    \
+       defined(TARGET_XTENSA)
 #define TARGET_SIOCATMARK      TARGET_IOR('s', 7, int)
 #define TARGET_SIOCGPGRP       TARGET_IOR('s', 9, pid_t)
 #else
-- 
2.20.1



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

* [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (2 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 03/10] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 05/10] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls " Laurent Vivier
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Laurent Vivier, Max Filippov,
	Aleksandar Markovic, Aurelien Jarno

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Add support for setting the process (or process group) to receive SIGIO
or SIGURG signals when I/O becomes possible or urgent data is available,
using SIOCSPGRP ioctl.

The ioctl numeric values for SIOCSPGRP are platform-dependent and are
determined by following files in Linux kernel source tree:

arch/ia64/include/uapi/asm/sockios.h:#define SIOCSPGRP    0x8902
arch/mips/include/uapi/asm/sockios.h:#define SIOCSPGRP    _IOW('s', 8, pid_t)
arch/parisc/include/uapi/asm/sockios.h:#define SIOCSPGRP  0x8902
arch/sh/include/uapi/asm/sockios.h:#define SIOCSPGRP      _IOW('s', 8, pid_t)
arch/xtensa/include/uapi/asm/sockios.h:#define SIOCSPGRP  _IOW('s', 8, pid_t)
arch/alpha/include/uapi/asm/sockios.h:#define SIOCSPGRP   _IOW('s', 8, pid_t)
arch/sparc/include/uapi/asm/sockios.h:#define SIOCSPGRP   0x8902
include/uapi/asm-generic/sockios.h:#define SIOCSPGRP      0x8902

Hence the different definition for alpha, mips, sh4, and xtensa.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1558282527-22183-3-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/ioctls.h       | 1 +
 linux-user/syscall_defs.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 37501f575cdd..99ed9d982568 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -218,6 +218,7 @@
   IOCTL(SIOCSRARP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_arpreq)))
   IOCTL(SIOCGRARP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_arpreq)))
   IOCTL(SIOCGIWNAME, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_char_ifreq)))
+  IOCTL(SIOCSPGRP, IOC_W, MK_PTR(TYPE_INT)) /* pid_t */
   IOCTL(SIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) /* pid_t */
   IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
   IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 5b530e04b8fd..9470a5ce965b 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -740,11 +740,14 @@ struct target_pollfd {
 #if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_SH4) ||    \
        defined(TARGET_XTENSA)
 #define TARGET_SIOCATMARK      TARGET_IOR('s', 7, int)
+#define TARGET_SIOCSPGRP       TARGET_IOW('s', 8, pid_t)
 #define TARGET_SIOCGPGRP       TARGET_IOR('s', 9, pid_t)
 #else
 #define TARGET_SIOCATMARK      0x8905
+#define TARGET_SIOCSPGRP       0x8902
 #define TARGET_SIOCGPGRP       0x8904
 #endif
+
 #define TARGET_SIOCGSTAMP      0x8906          /* Get stamp (timeval) */
 #define TARGET_SIOCGSTAMPNS    0x8907          /* Get stamp (timespec) */
 
-- 
2.20.1



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

* [Qemu-devel] [PULL 05/10] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (3 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 06/10] linux-user: Sanitize interp_info and, for mips only, init field fp_abi Laurent Vivier
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Laurent Vivier,
	Aleksandar Markovic, Neng Chen, Aurelien Jarno

From: Neng Chen <nchen@wavecomp.com>

Add support for getting and setting extended private flags of a
network device via SIOCSIFPFLAGS and SIOCGIFPFLAGS ioctls.

The ioctl numeric values are platform-independent and determined by
the file include/uapi/linux/sockios.h in Linux kernel source code:

  #define SIOCSIFPFLAGS 0x8934
  #define SIOCGIFPFLAGS	0x8935

These ioctls get (or set) the field ifr_flags of type short in the
structure ifreq. Such functionality is achieved in QEMU by using
MK_STRUCT() and MK_PTR() macros with an appropriate argument, as
it was done for existing similar cases.

Signed-off-by: Neng Chen <nchen@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1554839486-3527-1-git-send-email-aleksandar.markovic@rt-rk.com>
Message-Id: <1558282527-22183-4-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/ioctls.h       | 2 ++
 linux-user/syscall_defs.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 99ed9d982568..5e84dc7c3a77 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -206,6 +206,8 @@
   IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
   IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
   IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
+  IOCTL(SIOCSIFPFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
+  IOCTL(SIOCGIFPFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
   IOCTL(SIOCSIFLINK, 0, TYPE_NULL)
   IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf,
                 MK_PTR(MK_STRUCT(STRUCT_ifconf)))
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 9470a5ce965b..cb40620114f8 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -782,6 +782,8 @@ struct target_pollfd {
 #define TARGET_SIOCADDMULTI    0x8931          /* Multicast address lists      */
 #define TARGET_SIOCDELMULTI    0x8932
 #define TARGET_SIOCGIFINDEX    0x8933
+#define TARGET_SIOCSIFPFLAGS   0x8934          /* set extended flags          */
+#define TARGET_SIOCGIFPFLAGS   0x8935          /* get extended flags          */
 
 /* Bridging control calls */
 #define TARGET_SIOCGIFBR       0x8940          /* Bridging support             */
-- 
2.20.1



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

* [Qemu-devel] [PULL 06/10] linux-user: Sanitize interp_info and, for mips only, init field fp_abi
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (4 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 05/10] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls " Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 07/10] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP Laurent Vivier
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Laurent Vivier, Daniel Santos,
	Aleksandar Markovic, Philippe Mathieu-Daudé,
	Aurelien Jarno

From: Daniel Santos <daniel.santos@pobox.com>

Sanitize interp_info structure in load_elf_binary() and, for MIPS only,
init its field fp_abi to MIPS_ABI_FP_UNKNOWN. This fixes appearances of
"Unexpected FPU mode" message in some MIPS use cases. Currently, this
bug is a complete stopper for some MIPS binaries.

In load_elf_binary(), struct image_info interp_info is used without
being properly initialized. One result is that when the ELF's program
header doesn't contain an entry for the ABI flags, then the value of
the struct image_info's fp_abi field is set to whatever happened to
be in stack memory at the time.

Backporting to 4.0 and, if possible, to 3.1 is recommended.

Fixes: https://bugs.launchpad.net/qemu/+bug/1825002

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1558282527-22183-6-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/elfload.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index ef42e02d8233..02832adfbc0c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2706,6 +2706,11 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
     char *elf_interpreter = NULL;
     char *scratch;
 
+    memset(&interp_info, 0, sizeof(interp_info));
+#ifdef TARGET_MIPS
+    interp_info.fp_abi = MIPS_ABI_FP_UNKNOWN;
+#endif
+
     info->start_mmap = (abi_ulong)ELF_START_MMAP;
 
     load_elf_image(bprm->filename, bprm->fd, info,
-- 
2.20.1



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

* [Qemu-devel] [PULL 07/10] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (5 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 06/10] linux-user: Sanitize interp_info and, for mips only, init field fp_abi Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 08/10] linux-user: Fix shmat emulation by honoring host SHMLBA Laurent Vivier
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Laurent Vivier,
	Aleksandar Markovic, Neng Chen, Aurelien Jarno

From: Neng Chen <nchen@wavecomp.com>

Add support for options IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMPEMBERSHIP
of the syscall setsockopt(). These options control membership in
multicast groups. Their argument is a pointer to a struct ipv6_mreq,
which is in turn defined in IP v6 header netinet/in.h as:

 struct ipv6_mreq {
     /* IPv6 multicast address of group */
     struct  in6_addr  ipv6mr_multiaddr;
     /* local IPv6 address of interface */
     int     ipv6mr_interface;
 };

...whereas its definition in kernel's include/uapi/linux/in6.h is:

 #if __UAPI_DEF_IPV6_MREQ
 struct ipv6_mreq {
     /* IPv6 multicast address of group */
         struct  in6_addr ipv6mr_multiaddr;
     /* local IPv6 address of interface */
     int     ipv6mr_ifindex;
 };
 #endif

The first field of ipv6_mreq has the same name ("ipv6mr_multiaddr")
and type ("in6_addr") in both cases. Moreover, the in6_addr structure
consists of fields that are always big-endian (on host of any endian),
therefore the ipv6_mreq's field ipv6mr_multiaddr doesn't need any
endian conversion.

The second field of ipv6_mreq may, however, depending on the build
environment, have different names. This is the reason why the line
"#if __UAPI_DEF_IPV6_MREQ" is used in this patch - to establish the
right choice for the field name. Also, endian conversion is needed
for this field, since it is of type "int".

Signed-off-by: Neng Chen <nchen@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1558282527-22183-5-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e5545cbafac7..a0c2bf7db43c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1911,6 +1911,29 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
                                        &pki, sizeof(pki)));
             break;
         }
+        case IPV6_ADD_MEMBERSHIP:
+        case IPV6_DROP_MEMBERSHIP:
+        {
+            struct ipv6_mreq ipv6mreq;
+
+            if (optlen < sizeof(ipv6mreq)) {
+                return -TARGET_EINVAL;
+            }
+
+            if (copy_from_user(&ipv6mreq, optval_addr, sizeof(ipv6mreq))) {
+                return -TARGET_EFAULT;
+            }
+
+#if __UAPI_DEF_IPV6_MREQ
+            ipv6mreq.ipv6mr_ifindex = tswap32(ipv6mreq.ipv6mr_ifindex);
+#else
+            ipv6mreq.ipv6mr_interface = tswap32(ipv6mreq.ipv6mr_interface);
+#endif /* __UAPI_DEF_IVP6_MREQ */
+
+            ret = get_errno(setsockopt(sockfd, level, optname,
+                                       &ipv6mreq, sizeof(ipv6mreq)));
+            break;
+        }
         default:
             goto unimplemented;
         }
-- 
2.20.1



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

* [Qemu-devel] [PULL 08/10] linux-user: Fix shmat emulation by honoring host SHMLBA
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (6 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 07/10] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 09/10] linux-user: Align mmap_find_vma to host page size Laurent Vivier
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Richard Henderson,
	Laurent Vivier, Aleksandar Markovic, Aurelien Jarno

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

For those hosts with SHMLBA > getpagesize, we don't automatically
select a guest address that is compatible with the host.  We can
achieve this by boosting the alignment of guest_base and by adding
an extra alignment argument to mmap_find_vma.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190519201953.20161-13-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/elfload.c | 17 ++++++-----
 linux-user/mmap.c    | 70 +++++++++++++++++++++++---------------------
 linux-user/qemu.h    |  2 +-
 linux-user/syscall.c |  3 +-
 4 files changed, 50 insertions(+), 42 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 02832adfbc0c..a23aa4493e72 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -3,6 +3,7 @@
 #include <sys/param.h>
 
 #include <sys/resource.h>
+#include <sys/shm.h>
 
 #include "qemu.h"
 #include "disas/disas.h"
@@ -2012,6 +2013,8 @@ unsigned long init_guest_space(unsigned long host_start,
                                unsigned long guest_start,
                                bool fixed)
 {
+    /* In order to use host shmat, we must be able to honor SHMLBA.  */
+    unsigned long align = MAX(SHMLBA, qemu_host_page_size);
     unsigned long current_start, aligned_start;
     int flags;
 
@@ -2029,7 +2032,7 @@ unsigned long init_guest_space(unsigned long host_start,
     }
 
     /* Setup the initial flags and start address.  */
-    current_start = host_start & qemu_host_page_mask;
+    current_start = host_start & -align;
     flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
     if (fixed) {
         flags |= MAP_FIXED;
@@ -2065,8 +2068,8 @@ unsigned long init_guest_space(unsigned long host_start,
             return (unsigned long)-1;
         }
         munmap((void *)real_start, host_full_size);
-        if (real_start & ~qemu_host_page_mask) {
-            /* The same thing again, but with an extra qemu_host_page_size
+        if (real_start & (align - 1)) {
+            /* The same thing again, but with extra
              * so that we can shift around alignment.
              */
             unsigned long real_size = host_full_size + qemu_host_page_size;
@@ -2079,7 +2082,7 @@ unsigned long init_guest_space(unsigned long host_start,
                 return (unsigned long)-1;
             }
             munmap((void *)real_start, real_size);
-            real_start = HOST_PAGE_ALIGN(real_start);
+            real_start = ROUND_UP(real_start, align);
         }
         current_start = real_start;
     }
@@ -2106,7 +2109,7 @@ unsigned long init_guest_space(unsigned long host_start,
         }
 
         /* Ensure the address is properly aligned.  */
-        if (real_start & ~qemu_host_page_mask) {
+        if (real_start & (align - 1)) {
             /* Ideally, we adjust like
              *
              *    pages: [  ][  ][  ][  ][  ]
@@ -2134,7 +2137,7 @@ unsigned long init_guest_space(unsigned long host_start,
             if (real_start == (unsigned long)-1) {
                 return (unsigned long)-1;
             }
-            aligned_start = HOST_PAGE_ALIGN(real_start);
+            aligned_start = ROUND_UP(real_start, align);
         } else {
             aligned_start = real_start;
         }
@@ -2171,7 +2174,7 @@ unsigned long init_guest_space(unsigned long host_start,
          * because of trouble with ARM commpage setup.
          */
         munmap((void *)real_start, real_size);
-        current_start += qemu_host_page_size;
+        current_start += align;
         if (host_start == current_start) {
             /* Theoretically possible if host doesn't have any suitably
              * aligned areas.  Normally the first mmap will fail.
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index e0249efe4fed..10796b37ac7b 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -202,49 +202,52 @@ unsigned long last_brk;
 
 /* Subroutine of mmap_find_vma, used when we have pre-allocated a chunk
    of guest address space.  */
-static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
+static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size,
+                                        abi_ulong align)
 {
-    abi_ulong addr;
-    abi_ulong end_addr;
+    abi_ulong addr, end_addr, incr = qemu_host_page_size;
     int prot;
-    int looped = 0;
+    bool looped = false;
 
     if (size > reserved_va) {
         return (abi_ulong)-1;
     }
 
-    size = HOST_PAGE_ALIGN(size);
+    /* Note that start and size have already been aligned by mmap_find_vma. */
+
     end_addr = start + size;
-    if (end_addr > reserved_va) {
-        end_addr = reserved_va;
+    if (start > reserved_va - size) {
+        /* Start at the top of the address space.  */
+        end_addr = ((reserved_va - size) & -align) + size;
+        looped = true;
     }
-    addr = end_addr - qemu_host_page_size;
 
+    /* Search downward from END_ADDR, checking to see if a page is in use.  */
+    addr = end_addr;
     while (1) {
+        addr -= incr;
         if (addr > end_addr) {
             if (looped) {
+                /* Failure.  The entire address space has been searched.  */
                 return (abi_ulong)-1;
             }
-            end_addr = reserved_va;
-            addr = end_addr - qemu_host_page_size;
-            looped = 1;
-            continue;
-        }
-        prot = page_get_flags(addr);
-        if (prot) {
-            end_addr = addr;
-        }
-        if (addr && addr + size == end_addr) {
-            break;
+            /* Re-start at the top of the address space.  */
+            addr = end_addr = ((reserved_va - size) & -align) + size;
+            looped = true;
+        } else {
+            prot = page_get_flags(addr);
+            if (prot) {
+                /* Page in use.  Restart below this page.  */
+                addr = end_addr = ((addr - size) & -align) + size;
+            } else if (addr && addr + size == end_addr) {
+                /* Success!  All pages between ADDR and END_ADDR are free.  */
+                if (start == mmap_next_start) {
+                    mmap_next_start = addr;
+                }
+                return addr;
+            }
         }
-        addr -= qemu_host_page_size;
     }
-
-    if (start == mmap_next_start) {
-        mmap_next_start = addr;
-    }
-
-    return addr;
 }
 
 /*
@@ -253,7 +256,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
  * It must be called with mmap_lock() held.
  * Return -1 if error.
  */
-abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
+abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size, abi_ulong align)
 {
     void *ptr, *prev;
     abi_ulong addr;
@@ -265,11 +268,12 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
     } else {
         start &= qemu_host_page_mask;
     }
+    start = ROUND_UP(start, align);
 
     size = HOST_PAGE_ALIGN(size);
 
     if (reserved_va) {
-        return mmap_find_vma_reserved(start, size);
+        return mmap_find_vma_reserved(start, size, align);
     }
 
     addr = start;
@@ -299,7 +303,7 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
         if (h2g_valid(ptr + size - 1)) {
             addr = h2g(ptr);
 
-            if ((addr & ~TARGET_PAGE_MASK) == 0) {
+            if ((addr & (align - 1)) == 0) {
                 /* Success.  */
                 if (start == mmap_next_start && addr >= TASK_UNMAPPED_BASE) {
                     mmap_next_start = addr + size;
@@ -313,12 +317,12 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
                 /* Assume the result that the kernel gave us is the
                    first with enough free space, so start again at the
                    next higher target page.  */
-                addr = TARGET_PAGE_ALIGN(addr);
+                addr = ROUND_UP(addr, align);
                 break;
             case 1:
                 /* Sometimes the kernel decides to perform the allocation
                    at the top end of memory instead.  */
-                addr &= TARGET_PAGE_MASK;
+                addr &= -align;
                 break;
             case 2:
                 /* Start over at low memory.  */
@@ -416,7 +420,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
     if (!(flags & MAP_FIXED)) {
         host_len = len + offset - host_offset;
         host_len = HOST_PAGE_ALIGN(host_len);
-        start = mmap_find_vma(real_start, host_len);
+        start = mmap_find_vma(real_start, host_len, TARGET_PAGE_SIZE);
         if (start == (abi_ulong)-1) {
             errno = ENOMEM;
             goto fail;
@@ -710,7 +714,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
     } else if (flags & MREMAP_MAYMOVE) {
         abi_ulong mmap_start;
 
-        mmap_start = mmap_find_vma(0, new_size);
+        mmap_start = mmap_find_vma(0, new_size, TARGET_PAGE_SIZE);
 
         if (mmap_start == -1) {
             errno = ENOMEM;
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index ef400cb78ac6..82d33d7e93d5 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -443,7 +443,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
                        abi_ulong new_addr);
 extern unsigned long last_brk;
 extern abi_ulong mmap_next_start;
-abi_ulong mmap_find_vma(abi_ulong, abi_ulong);
+abi_ulong mmap_find_vma(abi_ulong, abi_ulong, abi_ulong);
 void mmap_fork_start(void);
 void mmap_fork_end(int child);
 
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a0c2bf7db43c..e43255c29e56 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3935,7 +3935,8 @@ static inline abi_ulong do_shmat(CPUArchState *cpu_env,
     else {
         abi_ulong mmap_start;
 
-        mmap_start = mmap_find_vma(0, shm_info.shm_segsz);
+        /* In order to use the host shmat, we need to honor host SHMLBA.  */
+        mmap_start = mmap_find_vma(0, shm_info.shm_segsz, MAX(SHMLBA, shmlba));
 
         if (mmap_start == -1) {
             errno = ENOMEM;
-- 
2.20.1



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

* [Qemu-devel] [PULL 09/10] linux-user: Align mmap_find_vma to host page size
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (7 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 08/10] linux-user: Fix shmat emulation by honoring host SHMLBA Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 14:43 ` [Qemu-devel] [PULL 10/10] linux-user: Pass through nanosecond timestamp components for stat syscalls Laurent Vivier
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Richard Henderson,
	Laurent Vivier, Aleksandar Markovic, Aurelien Jarno

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

This can avoid stack allocation failures for i386 guest
on ppc64 (64k page) host.

Suggested-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190519201953.20161-14-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/mmap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 10796b37ac7b..af41339d576b 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -262,6 +262,8 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size, abi_ulong align)
     abi_ulong addr;
     int wrapped, repeat;
 
+    align = MAX(align, qemu_host_page_size);
+
     /* If 'start' == 0, then a default start address is used. */
     if (start == 0) {
         start = mmap_next_start;
-- 
2.20.1



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

* [Qemu-devel] [PULL 10/10] linux-user: Pass through nanosecond timestamp components for stat syscalls
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (8 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 09/10] linux-user: Align mmap_find_vma to host page size Laurent Vivier
@ 2019-05-23 14:43 ` Laurent Vivier
  2019-05-23 16:36 ` [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches no-reply
  2019-05-24 11:07 ` Peter Maydell
  11 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-23 14:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Riku Voipio, Laurent Vivier, Chen-Yu Tsai,
	Aleksandar Markovic, Aurelien Jarno

From: Chen-Yu Tsai <wens@csie.org>

Since Linux 2.6 the stat syscalls have mostly supported nanosecond
components for each of the file-related timestamps.

QEMU user mode emulation currently does not pass through the nanosecond
portion of the timestamp, even when the host system fills in the value.
This results in a mismatch when run on subsecond resolution filesystems
such as ext4 or XFS.

An example of this leading to inconsistency is cross-debootstraping a
full desktop root filesystem of Debian Buster. Recent versions of
fontconfig store the full timestamp (instead of just the second portion)
of the directory in its per-directory cache file, and checks this against
the directory to see if the cache is up-to-date. With QEMU user mode
emulation, the timestamp stored is incorrect, and upon booting the rootfs
natively, fontconfig discovers the mismatch, and proceeds to rebuild the
cache on the comparatively slow machine (low-power ARM vs x86). This
stalls the first attempt to open whatever application that incorporates
fontconfig.

This patch renames the "unused" padding trailing each timestamp element
to its nanosecond counterpart name if such an element exists in the
kernel sources for the given platform. Not all do. Then have the syscall
wrapper fill in the nanosecond portion if the host supports it, as
specified by the _POSIX_C_SOURCE and _XOPEN_SOURCE feature macros.

Recent versions of glibc only use stat64 and newfstatat syscalls on
32-bit and 64-bit platforms respectively. The changes in this patch
were tested by directly calling the stat, stat64 and newfstatat syscalls
directly, in addition to the glibc wrapper, on arm and aarch64 little
endian targets.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Message-Id: <20190522162147.26303-1-wens@kernel.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c      | 19 +++++++++++++++
 linux-user/syscall_defs.h | 49 +++++++++++++++++++++++++--------------
 2 files changed, 50 insertions(+), 18 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e43255c29e56..e311fcda0517 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6432,6 +6432,11 @@ static inline abi_long host_to_target_stat64(void *cpu_env,
         __put_user(host_st->st_atime, &target_st->target_st_atime);
         __put_user(host_st->st_mtime, &target_st->target_st_mtime);
         __put_user(host_st->st_ctime, &target_st->target_st_ctime);
+#if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
+        __put_user(host_st->st_atim.tv_nsec, &target_st->target_st_atime_nsec);
+        __put_user(host_st->st_mtim.tv_nsec, &target_st->target_st_mtime_nsec);
+        __put_user(host_st->st_ctim.tv_nsec, &target_st->target_st_ctime_nsec);
+#endif
         unlock_user_struct(target_st, target_addr, 1);
     } else
 #endif
@@ -6462,6 +6467,11 @@ static inline abi_long host_to_target_stat64(void *cpu_env,
         __put_user(host_st->st_atime, &target_st->target_st_atime);
         __put_user(host_st->st_mtime, &target_st->target_st_mtime);
         __put_user(host_st->st_ctime, &target_st->target_st_ctime);
+#if _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
+        __put_user(host_st->st_atim.tv_nsec, &target_st->target_st_atime_nsec);
+        __put_user(host_st->st_mtim.tv_nsec, &target_st->target_st_mtime_nsec);
+        __put_user(host_st->st_ctim.tv_nsec, &target_st->target_st_ctime_nsec);
+#endif
         unlock_user_struct(target_st, target_addr, 1);
     }
 
@@ -8915,6 +8925,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
                 __put_user(st.st_atime, &target_st->target_st_atime);
                 __put_user(st.st_mtime, &target_st->target_st_mtime);
                 __put_user(st.st_ctime, &target_st->target_st_ctime);
+#if (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) && \
+    defined(TARGET_STAT_HAVE_NSEC)
+                __put_user(st.st_atim.tv_nsec,
+                           &target_st->target_st_atime_nsec);
+                __put_user(st.st_mtim.tv_nsec,
+                           &target_st->target_st_mtime_nsec);
+                __put_user(st.st_ctim.tv_nsec,
+                           &target_st->target_st_ctime_nsec);
+#endif
                 unlock_user_struct(target_st, arg2, 1);
             }
         }
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index cb40620114f8..7f141f699c1a 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1185,6 +1185,7 @@ struct target_winsize {
 #if (defined(TARGET_I386) && defined(TARGET_ABI32)) \
     || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \
     || defined(TARGET_CRIS)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	unsigned short st_dev;
 	unsigned short __pad1;
@@ -1199,11 +1200,11 @@ struct target_stat {
 	abi_ulong  st_blksize;
 	abi_ulong  st_blocks;
 	abi_ulong  target_st_atime;
-	abi_ulong  __unused1;
+	abi_ulong  target_st_atime_nsec;
 	abi_ulong  target_st_mtime;
-	abi_ulong  __unused2;
+	abi_ulong  target_st_mtime_nsec;
 	abi_ulong  target_st_ctime;
-	abi_ulong  __unused3;
+	abi_ulong  target_st_ctime_nsec;
 	abi_ulong  __unused4;
 	abi_ulong  __unused5;
 };
@@ -1235,13 +1236,13 @@ struct target_stat64 {
 	abi_ulong	__pad4;		/* future possible st_blocks high bits */
 
 	abi_ulong	target_st_atime;
-	abi_ulong	__pad5;
+	abi_ulong	target_st_atime_nsec;
 
 	abi_ulong	target_st_mtime;
-	abi_ulong	__pad6;
+	abi_ulong	target_st_mtime_nsec;
 
 	abi_ulong	target_st_ctime;
-	abi_ulong	__pad7;		/* will be high 32 bits of ctime someday */
+	abi_ulong	target_st_ctime_nsec;
 
 	unsigned long long	st_ino;
 } QEMU_PACKED;
@@ -1320,19 +1321,20 @@ struct target_stat64 {
 	unsigned int	st_blocks;
 
 	abi_ulong	target_st_atime;
-	abi_ulong	__unused1;
+	abi_ulong	target_st_atime_nsec;
 
 	abi_ulong	target_st_mtime;
-	abi_ulong	__unused2;
+	abi_ulong	target_st_mtime_nsec;
 
 	abi_ulong	target_st_ctime;
-	abi_ulong	__unused3;
+	abi_ulong	target_st_ctime_nsec;
 
 	abi_ulong	__unused4[3];
 };
 
 #elif defined(TARGET_SPARC)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	unsigned short	st_dev;
 	abi_ulong	st_ino;
@@ -1343,14 +1345,14 @@ struct target_stat {
 	unsigned short	st_rdev;
 	abi_long	st_size;
 	abi_long	target_st_atime;
-	abi_ulong	__unused1;
+	abi_ulong	target_st_atime_nsec;
 	abi_long	target_st_mtime;
-	abi_ulong	__unused2;
+	abi_ulong	target_st_mtime_nsec;
 	abi_long	target_st_ctime;
-	abi_ulong	__unused3;
+	abi_ulong	target_st_ctime_nsec;
 	abi_long	st_blksize;
 	abi_long	st_blocks;
-	abi_ulong	__unused4[2];
+	abi_ulong	__unused1[2];
 };
 
 #define TARGET_HAS_STRUCT_STAT64
@@ -1378,20 +1380,21 @@ struct target_stat64 {
 	unsigned int	st_blocks;
 
 	unsigned int	target_st_atime;
-	unsigned int	__unused1;
+	unsigned int	target_st_atime_nsec;
 
 	unsigned int	target_st_mtime;
-	unsigned int	__unused2;
+	unsigned int	target_st_mtime_nsec;
 
 	unsigned int	target_st_ctime;
-	unsigned int	__unused3;
+	unsigned int	target_st_ctime_nsec;
 
-	unsigned int	__unused4;
-	unsigned int	__unused5;
+	unsigned int	__unused1;
+	unsigned int	__unused2;
 };
 
 #elif defined(TARGET_PPC)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	abi_ulong st_dev;
 	abi_ulong st_ino;
@@ -1449,6 +1452,7 @@ struct QEMU_PACKED target_stat64 {
 
 #elif defined(TARGET_MICROBLAZE)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	abi_ulong st_dev;
 	abi_ulong st_ino;
@@ -1564,6 +1568,7 @@ struct target_stat64 {
 
 #elif defined(TARGET_ABI_MIPSN64)
 
+#define TARGET_STAT_HAVE_NSEC
 /* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
 struct target_stat {
 	unsigned int		st_dev;
@@ -1603,6 +1608,7 @@ struct target_stat {
 
 #elif defined(TARGET_ABI_MIPSN32)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
         abi_ulong    st_dev;
         abi_ulong    st_pad0[3]; /* Reserved for st_dev expansion */
@@ -1627,6 +1633,7 @@ struct target_stat {
 
 #elif defined(TARGET_ABI_MIPSO32)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	unsigned	st_dev;
 	abi_long	st_pad1[3];		/* Reserved for network id */
@@ -1743,6 +1750,7 @@ struct target_stat64 {
 
 #elif defined(TARGET_SH4)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	abi_ulong  st_dev;
 	abi_ulong  st_ino;
@@ -1802,6 +1810,7 @@ struct QEMU_PACKED target_stat64 {
 };
 
 #elif defined(TARGET_I386) && !defined(TARGET_ABI32)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
 	abi_ulong	st_dev;
 	abi_ulong	st_ino;
@@ -1847,6 +1856,7 @@ struct target_stat {
     abi_ulong  __unused[3];
 };
 #elif defined(TARGET_AARCH64)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_ulong  st_dev;
     abi_ulong  st_ino;
@@ -1869,6 +1879,7 @@ struct target_stat {
     unsigned int __unused[2];
 };
 #elif defined(TARGET_XTENSA)
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_ulong       st_dev;
     abi_ulong       st_ino;
@@ -1918,6 +1929,7 @@ struct target_stat64  {
 
 /* These are the asm-generic versions of the stat and stat64 structures */
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_ulong st_dev;
     abi_ulong st_ino;
@@ -1969,6 +1981,7 @@ struct target_stat64 {
 
 #elif defined(TARGET_HPPA)
 
+#define TARGET_STAT_HAVE_NSEC
 struct target_stat {
     abi_uint   st_dev;
     abi_uint   st_ino;
-- 
2.20.1



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

* Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (9 preceding siblings ...)
  2019-05-23 14:43 ` [Qemu-devel] [PULL 10/10] linux-user: Pass through nanosecond timestamp components for stat syscalls Laurent Vivier
@ 2019-05-23 16:36 ` no-reply
  2019-05-23 17:31   ` Aleksandar Markovic
  2019-05-24 11:07 ` Peter Maydell
  11 siblings, 1 reply; 15+ messages in thread
From: no-reply @ 2019-05-23 16:36 UTC (permalink / raw)
  To: laurent; +Cc: arikalo, riku.voipio, qemu-devel, laurent, amarkovic, aurelien

Patchew URL: https://patchew.org/QEMU/20190523144336.13960-1-laurent@vivier.eu/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20190523144336.13960-1-laurent@vivier.eu
Type: series
Subject: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
   d418238dca..8dc7fd56dd  master     -> master
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20190523144336.13960-1-laurent@vivier.eu -> patchew/20190523144336.13960-1-laurent@vivier.eu
Switched to a new branch 'test'
4770ccf734 linux-user: Pass through nanosecond timestamp components for stat syscalls
1b5b9faa88 linux-user: Align mmap_find_vma to host page size
874caa8bfb linux-user: Fix shmat emulation by honoring host SHMLBA
d907278358 linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP
57d45df330 linux-user: Sanitize interp_info and, for mips only, init field fp_abi
7267248384 linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets
0eac2d71cc linux-user: Add support for SIOCSPGRP ioctl for all targets
f0e6b29b94 linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa
bd5d878a8c linux-user: add pseudo /proc/hardware for m68k
1384b0eeee linux-user: add pseudo /proc/cpuinfo for sparc

=== OUTPUT BEGIN ===
1/10 Checking commit 1384b0eeeeb5 (linux-user: add pseudo /proc/cpuinfo for sparc)
2/10 Checking commit bd5d878a8cee (linux-user: add pseudo /proc/hardware for m68k)
3/10 Checking commit f0e6b29b94d6 (linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa)
4/10 Checking commit 0eac2d71ccfa (linux-user: Add support for SIOCSPGRP ioctl for all targets)
5/10 Checking commit 72672483844f (linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets)
6/10 Checking commit 57d45df3304f (linux-user: Sanitize interp_info and, for mips only, init field fp_abi)
7/10 Checking commit d907278358c4 (linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP)
WARNING: architecture specific defines should be avoided
#70: FILE: linux-user/syscall.c:1929:
+#if __UAPI_DEF_IPV6_MREQ

total: 0 errors, 1 warnings, 29 lines checked

Patch 7/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
8/10 Checking commit 874caa8bfb4f (linux-user: Fix shmat emulation by honoring host SHMLBA)
WARNING: Block comments use a leading /* on a separate line
#54: FILE: linux-user/elfload.c:2070:
+            /* The same thing again, but with extra

total: 0 errors, 1 warnings, 221 lines checked

Patch 8/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/10 Checking commit 1b5b9faa88bd (linux-user: Align mmap_find_vma to host page size)
10/10 Checking commit 4770ccf73400 (linux-user: Pass through nanosecond timestamp components for stat syscalls)
ERROR: code indent should never use tabs
#105: FILE: linux-user/syscall_defs.h:1203:
+^Iabi_ulong  target_st_atime_nsec;$

ERROR: code indent should never use tabs
#108: FILE: linux-user/syscall_defs.h:1205:
+^Iabi_ulong  target_st_mtime_nsec;$

ERROR: code indent should never use tabs
#111: FILE: linux-user/syscall_defs.h:1207:
+^Iabi_ulong  target_st_ctime_nsec;$

ERROR: code indent should never use tabs
#120: FILE: linux-user/syscall_defs.h:1239:
+^Iabi_ulong^Itarget_st_atime_nsec;$

ERROR: code indent should never use tabs
#124: FILE: linux-user/syscall_defs.h:1242:
+^Iabi_ulong^Itarget_st_mtime_nsec;$

ERROR: code indent should never use tabs
#128: FILE: linux-user/syscall_defs.h:1245:
+^Iabi_ulong^Itarget_st_ctime_nsec;$

ERROR: code indent should never use tabs
#137: FILE: linux-user/syscall_defs.h:1324:
+^Iabi_ulong^Itarget_st_atime_nsec;$

ERROR: code indent should never use tabs
#141: FILE: linux-user/syscall_defs.h:1327:
+^Iabi_ulong^Itarget_st_mtime_nsec;$

ERROR: code indent should never use tabs
#145: FILE: linux-user/syscall_defs.h:1330:
+^Iabi_ulong^Itarget_st_ctime_nsec;$

ERROR: code indent should never use tabs
#161: FILE: linux-user/syscall_defs.h:1348:
+^Iabi_ulong^Itarget_st_atime_nsec;$

ERROR: code indent should never use tabs
#164: FILE: linux-user/syscall_defs.h:1350:
+^Iabi_ulong^Itarget_st_mtime_nsec;$

ERROR: code indent should never use tabs
#167: FILE: linux-user/syscall_defs.h:1352:
+^Iabi_ulong^Itarget_st_ctime_nsec;$

ERROR: code indent should never use tabs
#171: FILE: linux-user/syscall_defs.h:1355:
+^Iabi_ulong^I__unused1[2];$

ERROR: code indent should never use tabs
#180: FILE: linux-user/syscall_defs.h:1383:
+^Iunsigned int^Itarget_st_atime_nsec;$

ERROR: code indent should never use tabs
#184: FILE: linux-user/syscall_defs.h:1386:
+^Iunsigned int^Itarget_st_mtime_nsec;$

ERROR: code indent should never use tabs
#188: FILE: linux-user/syscall_defs.h:1389:
+^Iunsigned int^Itarget_st_ctime_nsec;$

ERROR: code indent should never use tabs
#192: FILE: linux-user/syscall_defs.h:1391:
+^Iunsigned int^I__unused1;$

ERROR: code indent should never use tabs
#193: FILE: linux-user/syscall_defs.h:1392:
+^Iunsigned int^I__unused2;$

total: 18 errors, 0 warnings, 211 lines checked

Patch 10/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190523144336.13960-1-laurent@vivier.eu/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches
  2019-05-23 16:36 ` [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches no-reply
@ 2019-05-23 17:31   ` Aleksandar Markovic
  0 siblings, 0 replies; 15+ messages in thread
From: Aleksandar Markovic @ 2019-05-23 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: arikalo, aurelien, riku.voipio, laurent, amarkovic

On May 23, 2019 6:51 PM, <no-reply@patchew.org> wrote:
>
> Patchew URL:
https://patchew.org/QEMU/20190523144336.13960-1-laurent@vivier.eu/
>
>
>
> Hi,
>
> This series seems to have some coding style problems. See output below for
> more information:
>
> Message-id: 20190523144336.13960-1-laurent@vivier.eu
> Type: series
> Subject: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches
>
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> git rev-parse base > /dev/null || exit 0
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> git config --local diff.algorithm histogram
> ./scripts/checkpatch.pl --mailback base..
> === TEST SCRIPT END ===
>
> From https://github.com/patchew-project/qemu
>    d418238dca..8dc7fd56dd  master     -> master
> From https://github.com/patchew-project/qemu
>  * [new tag]               patchew/
20190523144336.13960-1-laurent@vivier.eu -> patchew/
20190523144336.13960-1-laurent@vivier.eu
> Switched to a new branch 'test'
> 4770ccf734 linux-user: Pass through nanosecond timestamp components for
stat syscalls
> 1b5b9faa88 linux-user: Align mmap_find_vma to host page size
> 874caa8bfb linux-user: Fix shmat emulation by honoring host SHMLBA
> d907278358 linux-user: Add support for setsockopt() options
IPV6_<ADD|DROP>_MEMBERSHIP
> 57d45df330 linux-user: Sanitize interp_info and, for mips only, init
field fp_abi
> 7267248384 linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all
targets
> 0eac2d71cc linux-user: Add support for SIOCSPGRP ioctl for all targets
> f0e6b29b94 linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls
for xtensa
> bd5d878a8c linux-user: add pseudo /proc/hardware for m68k
> 1384b0eeee linux-user: add pseudo /proc/cpuinfo for sparc
>
> === OUTPUT BEGIN ===
> 1/10 Checking commit 1384b0eeeeb5 (linux-user: add pseudo /proc/cpuinfo
for sparc)
> 2/10 Checking commit bd5d878a8cee (linux-user: add pseudo /proc/hardware
for m68k)
> 3/10 Checking commit f0e6b29b94d6 (linux-user: Fix support for SIOCATMARK
and SIOCGPGRP ioctls for xtensa)
> 4/10 Checking commit 0eac2d71ccfa (linux-user: Add support for SIOCSPGRP
ioctl for all targets)
> 5/10 Checking commit 72672483844f (linux-user: Add support for
SIOC<G|S>IFPFLAGS ioctls for all targets)
> 6/10 Checking commit 57d45df3304f (linux-user: Sanitize interp_info and,
for mips only, init field fp_abi)
> 7/10 Checking commit d907278358c4 (linux-user: Add support for
setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP)
> WARNING: architecture specific defines should be avoided
> #70: FILE: linux-user/syscall.c:1929:
> +#if __UAPI_DEF_IPV6_MREQ
>
> total: 0 errors, 1 warnings, 29 lines checked
>

This warning was known to us, but we can't do anything about it, the line
in question is a “necessary evil” .

> Patch 7/10 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 8/10 Checking commit 874caa8bfb4f (linux-user: Fix shmat emulation by
honoring host SHMLBA)
> WARNING: Block comments use a leading /* on a separate line
> #54: FILE: linux-user/elfload.c:2070:
> +            /* The same thing again, but with extra
>
> total: 0 errors, 1 warnings, 221 lines checked
>
> Patch 8/10 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 9/10 Checking commit 1b5b9faa88bd (linux-user: Align mmap_find_vma to
host page size)
> 10/10 Checking commit 4770ccf73400 (linux-user: Pass through nanosecond
timestamp components for stat syscalls)
> ERROR: code indent should never use tabs
> #105: FILE: linux-user/syscall_defs.h:1203:
> +^Iabi_ulong  target_st_atime_nsec;$
>
> ERROR: code indent should never use tabs
> #108: FILE: linux-user/syscall_defs.h:1205:
> +^Iabi_ulong  target_st_mtime_nsec;$
>
> ERROR: code indent should never use tabs
> #111: FILE: linux-user/syscall_defs.h:1207:
> +^Iabi_ulong  target_st_ctime_nsec;$
>
> ERROR: code indent should never use tabs
> #120: FILE: linux-user/syscall_defs.h:1239:
> +^Iabi_ulong^Itarget_st_atime_nsec;$
>
> ERROR: code indent should never use tabs
> #124: FILE: linux-user/syscall_defs.h:1242:
> +^Iabi_ulong^Itarget_st_mtime_nsec;$
>
> ERROR: code indent should never use tabs
> #128: FILE: linux-user/syscall_defs.h:1245:
> +^Iabi_ulong^Itarget_st_ctime_nsec;$
>
> ERROR: code indent should never use tabs
> #137: FILE: linux-user/syscall_defs.h:1324:
> +^Iabi_ulong^Itarget_st_atime_nsec;$
>
> ERROR: code indent should never use tabs
> #141: FILE: linux-user/syscall_defs.h:1327:
> +^Iabi_ulong^Itarget_st_mtime_nsec;$
>
> ERROR: code indent should never use tabs
> #145: FILE: linux-user/syscall_defs.h:1330:
> +^Iabi_ulong^Itarget_st_ctime_nsec;$
>
> ERROR: code indent should never use tabs
> #161: FILE: linux-user/syscall_defs.h:1348:
> +^Iabi_ulong^Itarget_st_atime_nsec;$
>
> ERROR: code indent should never use tabs
> #164: FILE: linux-user/syscall_defs.h:1350:
> +^Iabi_ulong^Itarget_st_mtime_nsec;$
>
> ERROR: code indent should never use tabs
> #167: FILE: linux-user/syscall_defs.h:1352:
> +^Iabi_ulong^Itarget_st_ctime_nsec;$
>
> ERROR: code indent should never use tabs
> #171: FILE: linux-user/syscall_defs.h:1355:
> +^Iabi_ulong^I__unused1[2];$
>
> ERROR: code indent should never use tabs
> #180: FILE: linux-user/syscall_defs.h:1383:
> +^Iunsigned int^Itarget_st_atime_nsec;$
>
> ERROR: code indent should never use tabs
> #184: FILE: linux-user/syscall_defs.h:1386:
> +^Iunsigned int^Itarget_st_mtime_nsec;$
>
> ERROR: code indent should never use tabs
> #188: FILE: linux-user/syscall_defs.h:1389:
> +^Iunsigned int^Itarget_st_ctime_nsec;$
>
> ERROR: code indent should never use tabs
> #192: FILE: linux-user/syscall_defs.h:1391:
> +^Iunsigned int^I__unused1;$
>
> ERROR: code indent should never use tabs
> #193: FILE: linux-user/syscall_defs.h:1392:
> +^Iunsigned int^I__unused2;$
>
> total: 18 errors, 0 warnings, 211 lines checked
>
> Patch 10/10 has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
>
> === OUTPUT END ===
>
> Test command exited with code: 1
>
>
> The full log is available at
>
http://patchew.org/logs/20190523144336.13960-1-laurent@vivier.eu/testing.checkpatch/?type=message
.
> ---
> Email generated automatically by Patchew [https://patchew.org/].
> Please send your feedback to patchew-devel@redhat.com

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

* Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches
  2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
                   ` (10 preceding siblings ...)
  2019-05-23 16:36 ` [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches no-reply
@ 2019-05-24 11:07 ` Peter Maydell
  2019-05-24 11:19   ` Laurent Vivier
  11 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2019-05-24 11:07 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Aleksandar Rikalo, Aleksandar Markovic, Riku Voipio,
	QEMU Developers, Aurelien Jarno

On Thu, 23 May 2019 at 15:47, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit a4f667b6714916683408b983cfe0a615a725775f:
>
>   Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190521-3' into staging (2019-05-21 16:30:13 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/linux-user-for-4.1-pull-request
>
> for you to fetch changes up to 069a1504ee1e2943964d0357d798e11b66afd351:
>
>   linux-user: Pass through nanosecond timestamp components for stat syscalls (2019-05-22 20:50:55 +0200)
>
> ----------------------------------------------------------------
> Add /proc/hardware and /proc/cpuinfo,
> update SIOCXXX ioctls,
> update IPV6 options,
> fix shmat emulation,
> add nanoseconds in stat,
> init field fp_abi on mips
>
> ----------------------------------------------------------------

Hi; I'm afraid this fails to build on a couple of the hosts
I test on:

/home/pm215/qemu/linux-user/syscall.c: In function ‘do_setsockopt’:
/home/pm215/qemu/linux-user/syscall.c:1929:5: error:
"__UAPI_DEF_IPV6_MREQ" is not defined [-Werror=undef]
 #if __UAPI_DEF_IPV6_MREQ
     ^

(these were the ppc64 and aarch64 machines in the gcc compile farm, but
I suspect this is just "older kernel headers" rather than arch-specific.)


thanks
-- PMM


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

* Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches
  2019-05-24 11:07 ` Peter Maydell
@ 2019-05-24 11:19   ` Laurent Vivier
  0 siblings, 0 replies; 15+ messages in thread
From: Laurent Vivier @ 2019-05-24 11:19 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Aleksandar Rikalo, Aleksandar Markovic, Riku Voipio,
	QEMU Developers, Aurelien Jarno

On 24/05/2019 13:07, Peter Maydell wrote:
> On Thu, 23 May 2019 at 15:47, Laurent Vivier <laurent@vivier.eu> wrote:
>>
>> The following changes since commit a4f667b6714916683408b983cfe0a615a725775f:
>>
>>    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190521-3' into staging (2019-05-21 16:30:13 +0100)
>>
>> are available in the Git repository at:
>>
>>    git://github.com/vivier/qemu.git tags/linux-user-for-4.1-pull-request
>>
>> for you to fetch changes up to 069a1504ee1e2943964d0357d798e11b66afd351:
>>
>>    linux-user: Pass through nanosecond timestamp components for stat syscalls (2019-05-22 20:50:55 +0200)
>>
>> ----------------------------------------------------------------
>> Add /proc/hardware and /proc/cpuinfo,
>> update SIOCXXX ioctls,
>> update IPV6 options,
>> fix shmat emulation,
>> add nanoseconds in stat,
>> init field fp_abi on mips
>>
>> ----------------------------------------------------------------
> 
> Hi; I'm afraid this fails to build on a couple of the hosts
> I test on:
> 
> /home/pm215/qemu/linux-user/syscall.c: In function ‘do_setsockopt’:
> /home/pm215/qemu/linux-user/syscall.c:1929:5: error:
> "__UAPI_DEF_IPV6_MREQ" is not defined [-Werror=undef]
>   #if __UAPI_DEF_IPV6_MREQ
>       ^
> 
> (these were the ppc64 and aarch64 machines in the gcc compile farm, but
> I suspect this is just "older kernel headers" rather than arch-specific.)
> 

Thank you,

I'm going to remove the patch from the PR and we will rework it later.

Thanks,
Laurent



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

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

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 14:43 [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 03/10] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 05/10] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls " Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 06/10] linux-user: Sanitize interp_info and, for mips only, init field fp_abi Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 07/10] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 08/10] linux-user: Fix shmat emulation by honoring host SHMLBA Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 09/10] linux-user: Align mmap_find_vma to host page size Laurent Vivier
2019-05-23 14:43 ` [Qemu-devel] [PULL 10/10] linux-user: Pass through nanosecond timestamp components for stat syscalls Laurent Vivier
2019-05-23 16:36 ` [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches no-reply
2019-05-23 17:31   ` Aleksandar Markovic
2019-05-24 11:07 ` Peter Maydell
2019-05-24 11:19   ` Laurent Vivier

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.