qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/7] linux-user updates
@ 2013-03-07 10:21 riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 1/7] linux-user: Add Alpha socket constants riku.voipio
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

Hi,

I did a dig through the archive for linux-user patches
that have slipped through during my inactivity. The ones
in this patchset appear good and pass smoketest.

I will send these as pull request once I'm back from travel 
and can update my git repository.

Riku

Dillon Amburgey (3):
  linux-user: Add Alpha socket constants
  linux-user: Support setgroups syscall with no groups
  linux-user: Add more sparc syscall numbers

John Rigby (2):
  linux-user/syscall.c: handle FUTEX_WAIT_BITSET in do_futex
  linux-user: fix futex strace of FUTEX_CLOCK_REALTIME

Laurent Vivier (2):
  linux-user: improve print_fcntl()
  linux-user: correct semctl() and shmctl()

 linux-user/socket.h           |  69 ++++++++++++++++++++++++++++
 linux-user/sparc/syscall_nr.h |   2 +
 linux-user/strace.c           | 103 ++++++++++++++++++++++++++++++++++--------
 linux-user/syscall.c          |  81 ++++++++++++++++++++-------------
 4 files changed, 205 insertions(+), 50 deletions(-)

-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 1/7] linux-user: Add Alpha socket constants
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 2/7] linux-user: improve print_fcntl() riku.voipio
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dillon Amburgey

From: Dillon Amburgey <dillona@dillona.com>

Without these, some networking programs will not work

Signed-off-by: Dillon Amburgey <dillona@dillona.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/socket.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/linux-user/socket.h b/linux-user/socket.h
index 93d4782..339cae5 100644
--- a/linux-user/socket.h
+++ b/linux-user/socket.h
@@ -87,6 +87,75 @@
 
 	#define TARGET_SOCK_MAX (SOCK_PACKET + 1)
 
+#elif defined(TARGET_ALPHA)
+
+    /* For setsockopt(2) */
+    #define TARGET_SOL_SOCKET   0xffff
+
+    #define TARGET_SO_DEBUG 0x0001
+    #define TARGET_SO_REUSEADDR 0x0004
+    #define TARGET_SO_KEEPALIVE 0x0008
+    #define TARGET_SO_DONTROUTE 0x0010
+    #define TARGET_SO_BROADCAST 0x0020
+    #define TARGET_SO_LINGER    0x0080
+    #define TARGET_SO_OOBINLINE 0x0100
+    /* To add :#define TARGET_SO_REUSEPORT 0x0200 */
+
+    #define TARGET_SO_TYPE      0x1008
+    #define TARGET_SO_ERROR 0x1007
+    #define TARGET_SO_SNDBUF    0x1001
+    #define TARGET_SO_RCVBUF    0x1002
+    #define TARGET_SO_SNDBUFFORCE   0x100a
+    #define TARGET_SO_RCVBUFFORCE   0x100b
+    #define TARGET_SO_RCVLOWAT  0x1010
+    #define TARGET_SO_SNDLOWAT  0x1011
+    #define TARGET_SO_RCVTIMEO  0x1012
+    #define TARGET_SO_SNDTIMEO  0x1013
+    #define TARGET_SO_ACCEPTCONN    0x1014
+    #define TARGET_SO_PROTOCOL  0x1028
+    #define TARGET_SO_DOMAIN    0x1029
+
+    /* linux-specific, might as well be the same as on i386 */
+    #define TARGET_SO_NO_CHECK  11
+    #define TARGET_SO_PRIORITY  12
+    #define TARGET_SO_BSDCOMPAT 14
+
+    #define TARGET_SO_PASSCRED  17
+    #define TARGET_SO_PEERCRED  18
+    #define TARGET_SO_BINDTODEVICE 25
+
+    /* Socket filtering */
+    #define TARGET_SO_ATTACH_FILTER        26
+    #define TARGET_SO_DETACH_FILTER        27
+
+    #define TARGET_SO_PEERNAME      28
+    #define TARGET_SO_TIMESTAMP     29
+    #define TARGET_SCM_TIMESTAMP        TARGET_SO_TIMESTAMP
+
+    #define TARGET_SO_PEERSEC       30
+    #define TARGET_SO_PASSSEC       34
+    #define TARGET_SO_TIMESTAMPNS       35
+    #define TARGET_SCM_TIMESTAMPNS      TARGET_SO_TIMESTAMPNS
+
+    /* Security levels - as per NRL IPv6 - don't actually do anything */
+    #define TARGET_SO_SECURITY_AUTHENTICATION       19
+    #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 20
+    #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK       21
+
+    #define TARGET_SO_MARK          36
+
+    #define TARGET_SO_TIMESTAMPING      37
+    #define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING
+
+    #define TARGET_SO_RXQ_OVFL             40
+
+    #define TARGET_SO_WIFI_STATUS       41
+    #define TARGET_SCM_WIFI_STATUS      TARGET_SO_WIFI_STATUS
+    #define TARGET_SO_PEEK_OFF      42
+
+    /* Instruct lower device to use last 4-bytes of skb data as FCS */
+    #define TARGET_SO_NOFCS     43
+
 #else
 
 	/* For setsockopt(2) */
-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 2/7] linux-user: improve print_fcntl()
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 1/7] linux-user: Add Alpha socket constants riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 3/7] linux-user/syscall.c: handle FUTEX_WAIT_BITSET in do_futex riku.voipio
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

From: Laurent Vivier <Laurent@Vivier.EU>

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/strace.c | 97 +++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 79 insertions(+), 18 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 4e91a6e..9a18146 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -462,18 +462,6 @@ UNUSED static struct flags mmap_flags[] = {
     FLAG_END,
 };
 
-UNUSED static struct flags fcntl_flags[] = {
-    FLAG_TARGET(F_DUPFD),
-    FLAG_TARGET(F_GETFD),
-    FLAG_TARGET(F_SETFD),
-    FLAG_TARGET(F_GETFL),
-    FLAG_TARGET(F_SETFL),
-    FLAG_TARGET(F_GETLK),
-    FLAG_TARGET(F_SETLK),
-    FLAG_TARGET(F_SETLKW),
-    FLAG_END,
-};
-
 UNUSED static struct flags clone_flags[] = {
     FLAG_GENERIC(CLONE_VM),
     FLAG_GENERIC(CLONE_FS),
@@ -867,12 +855,85 @@ print_fcntl(const struct syscallname *name,
 {
     print_syscall_prologue(name);
     print_raw_param("%d", arg0, 0);
-    print_flags(fcntl_flags, arg1, 0);
-    /*
-     * TODO: check flags and print following argument only
-     *       when needed.
-     */
-    print_pointer(arg2, 1);
+    switch(arg1) {
+    case TARGET_F_DUPFD:
+        gemu_log("F_DUPFD,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
+        break;
+    case TARGET_F_GETFD:
+        gemu_log("F_GETFD");
+        break;
+    case TARGET_F_SETFD:
+        gemu_log("F_SETFD,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
+        break;
+    case TARGET_F_GETFL:
+        gemu_log("F_GETFL");
+        break;
+    case TARGET_F_SETFL:
+        gemu_log("F_SETFL,");
+        print_open_flags(arg2, 1);
+        break;
+    case TARGET_F_GETLK:
+        gemu_log("F_GETLK,");
+        print_pointer(arg2, 1);
+        break;
+    case TARGET_F_SETLK:
+        gemu_log("F_SETLK,");
+        print_pointer(arg2, 1);
+        break;
+    case TARGET_F_SETLKW:
+        gemu_log("F_SETLKW,");
+        print_pointer(arg2, 1);
+        break;
+    case TARGET_F_GETOWN:
+        gemu_log("F_GETOWN");
+        break;
+    case TARGET_F_SETOWN:
+        gemu_log("F_SETOWN,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 0);
+        break;
+    case TARGET_F_GETSIG:
+        gemu_log("F_GETSIG");
+        break;
+    case TARGET_F_SETSIG:
+        gemu_log("F_SETSIG,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 0);
+        break;
+#if TARGET_ABI_BITS == 32
+    case TARGET_F_GETLK64:
+        gemu_log("F_GETLK64,");
+        print_pointer(arg2, 1);
+        break;
+    case TARGET_F_SETLK64:
+        gemu_log("F_SETLK64,");
+        print_pointer(arg2, 1);
+        break;
+    case TARGET_F_SETLKW64:
+        gemu_log("F_SETLKW64,");
+        print_pointer(arg2, 1);
+        break;
+#endif
+    case TARGET_F_SETLEASE:
+        gemu_log("F_SETLEASE,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 0);
+        break;
+    case TARGET_F_GETLEASE:
+        gemu_log("F_GETLEASE");
+        break;
+    case TARGET_F_DUPFD_CLOEXEC:
+        gemu_log("F_DUPFD_CLOEXEC,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
+        break;
+    case TARGET_F_NOTIFY:
+        gemu_log("F_NOTIFY,");
+        print_raw_param(TARGET_ABI_FMT_ld, arg2, 0);
+        break;
+    default:
+        print_raw_param(TARGET_ABI_FMT_ld, arg1, 0);
+        print_pointer(arg2, 1);
+        break;
+    }
     print_syscall_epilogue(name);
 }
 #define print_fcntl64   print_fcntl
-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 3/7] linux-user/syscall.c: handle FUTEX_WAIT_BITSET in do_futex
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 1/7] linux-user: Add Alpha socket constants riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 2/7] linux-user: improve print_fcntl() riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 4/7] linux-user: fix futex strace of FUTEX_CLOCK_REALTIME riku.voipio
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Rigby

From: John Rigby <john.rigby@linaro.org>

Upstream libc has recently changed to start using
FUTEX_WAIT_BITSET instead of FUTEX_WAIT and this
is causing do_futex to return -TARGET_ENOSYS.

Pass bitset in val3 to sys_futex which will be
ignored by kernel for the FUTEX_WAIT case.

Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/syscall.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 19630ea..c7fcfc0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4922,6 +4922,7 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
 #endif
     switch (base_op) {
     case FUTEX_WAIT:
+    case FUTEX_WAIT_BITSET:
         if (timeout) {
             pts = &ts;
             target_to_host_timespec(pts, timeout);
@@ -4929,7 +4930,7 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout,
             pts = NULL;
         }
         return get_errno(sys_futex(g2h(uaddr), op, tswap32(val),
-                         pts, NULL, 0));
+                         pts, NULL, val3));
     case FUTEX_WAKE:
         return get_errno(sys_futex(g2h(uaddr), op, val, NULL, NULL, 0));
     case FUTEX_FD:
-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 4/7] linux-user: fix futex strace of FUTEX_CLOCK_REALTIME
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
                   ` (2 preceding siblings ...)
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 3/7] linux-user/syscall.c: handle FUTEX_WAIT_BITSET in do_futex riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 5/7] linux-user: correct semctl() and shmctl() riku.voipio
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Rigby

From: John Rigby <john.rigby@linaro.org>

Handle same as existing FUTEX_PRIVATE_FLAG.

Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/strace.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 9a18146..0fbae3c 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1498,6 +1498,12 @@ if( cmd == val ) { \
         cmd &= ~FUTEX_PRIVATE_FLAG;
     }
 #endif
+#ifdef FUTEX_CLOCK_REALTIME
+    if (cmd & FUTEX_CLOCK_REALTIME) {
+        gemu_log("FUTEX_CLOCK_REALTIME|");
+        cmd &= ~FUTEX_CLOCK_REALTIME;
+    }
+#endif
     print_op(FUTEX_WAIT)
     print_op(FUTEX_WAKE)
     print_op(FUTEX_FD)
-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 5/7] linux-user: correct semctl() and shmctl()
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
                   ` (3 preceding siblings ...)
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 4/7] linux-user: fix futex strace of FUTEX_CLOCK_REALTIME riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 6/7] linux-user: Support setgroups syscall with no groups riku.voipio
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

From: Laurent Vivier <laurent@vivier.eu>

The parameter "union semun" of semctl() is not a value
but a pointer to the value.

Moreover, all fields of target_su must be swapped (if needed).

The third argument of shmctl is a pointer.

WITHOUT this patch:

$ ipcs

kernel not configured for shared memory

qemu: uncaught target signal 11 (Segmentation fault) - core dumped

WITH this patch:

$ ipcs

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x4e545030 0          root      600        96         1
0x4e545031 32769      root      600        96         1
0x4e545032 65538      root      666        96         1
0x4e545033 98307      root      666        96         1
0x47505344 131076     root      666        8240       1
0x3c81b7f5 163845     laurent   666        4096       0
0x00000000 729513990  laurent   600        393216     2          dest
0x00000000 729546759  laurent   600        393216     2          dest
0x00000000 1879179273 laurent   600        393216     2          dest

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x3c81b7f6 32768      laurent   666        1
0x1c44ac47 6586369    laurent   600        1

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
0x1c44ac45 458752     laurent    600        0            0
0x1c44ac46 491521     laurent    600        0            0

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/syscall.c | 56 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 35 insertions(+), 21 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c7fcfc0..7f12563 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2652,8 +2652,9 @@ static inline abi_long host_to_target_semarray(int semid, abi_ulong target_addr,
 }
 
 static inline abi_long do_semctl(int semid, int semnum, int cmd,
-                                 union target_semun target_su)
+                                 abi_ulong ptr)
 {
+    union target_semun *target_su;
     union semun arg;
     struct semid_ds dsarg;
     unsigned short *array = NULL;
@@ -2662,43 +2663,55 @@ static inline abi_long do_semctl(int semid, int semnum, int cmd,
     abi_long err;
     cmd &= 0xff;
 
+    if (!lock_user_struct(VERIFY_READ, target_su, ptr, 1)) {
+        return -TARGET_EFAULT;
+    }
     switch( cmd ) {
 	case GETVAL:
 	case SETVAL:
-            arg.val = tswap32(target_su.val);
+            arg.val = tswap32(target_su->val);
             ret = get_errno(semctl(semid, semnum, cmd, arg));
-            target_su.val = tswap32(arg.val);
+            target_su->val = tswap32(arg.val);
             break;
 	case GETALL:
 	case SETALL:
-            err = target_to_host_semarray(semid, &array, target_su.array);
-            if (err)
-                return err;
+            err = target_to_host_semarray(semid, &array,
+                                          tswapal(target_su->array));
+            if (err) {
+                ret = err;
+                break;
+            }
             arg.array = array;
             ret = get_errno(semctl(semid, semnum, cmd, arg));
-            err = host_to_target_semarray(semid, target_su.array, &array);
-            if (err)
-                return err;
+            err = host_to_target_semarray(semid, tswapal(target_su->array),
+                                          &array);
+            if (err) {
+                ret = err;
+            }
             break;
 	case IPC_STAT:
 	case IPC_SET:
 	case SEM_STAT:
-            err = target_to_host_semid_ds(&dsarg, target_su.buf);
-            if (err)
-                return err;
+            err = target_to_host_semid_ds(&dsarg, tswapal(target_su->buf));
+            if (err) {
+                ret = err;
+                break;
+            }
             arg.buf = &dsarg;
             ret = get_errno(semctl(semid, semnum, cmd, arg));
-            err = host_to_target_semid_ds(target_su.buf, &dsarg);
-            if (err)
-                return err;
+            err = host_to_target_semid_ds(tswapal(target_su->buf), &dsarg);
+            if (err) {
+                ret = err;
+            }
             break;
 	case IPC_INFO:
 	case SEM_INFO:
             arg.__buf = &seminfo;
             ret = get_errno(semctl(semid, semnum, cmd, arg));
-            err = host_to_target_seminfo(target_su.__buf, &seminfo);
-            if (err)
-                return err;
+            err = host_to_target_seminfo(tswapal(target_su->__buf), &seminfo);
+            if (err) {
+                ret = err;
+            }
             break;
 	case IPC_RMID:
 	case GETPID:
@@ -2707,6 +2720,7 @@ static inline abi_long do_semctl(int semid, int semnum, int cmd,
             ret = get_errno(semctl(semid, semnum, cmd, NULL));
             break;
     }
+    unlock_user_struct(target_su, ptr, 0);
 
     return ret;
 }
@@ -3177,7 +3191,7 @@ static abi_long do_ipc(unsigned int call, int first,
         break;
 
     case IPCOP_semctl:
-        ret = do_semctl(first, second, third, (union target_semun)(abi_ulong) ptr);
+        ret = do_semctl(first, second, third, ptr);
         break;
 
     case IPCOP_msgget:
@@ -3244,7 +3258,7 @@ static abi_long do_ipc(unsigned int call, int first,
 
 	/* IPC_* and SHM_* command values are the same on all linux platforms */
     case IPCOP_shmctl:
-        ret = do_shmctl(first, second, third);
+        ret = do_shmctl(first, second, ptr);
         break;
     default:
 	gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
@@ -6936,7 +6950,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_semctl
     case TARGET_NR_semctl:
-        ret = do_semctl(arg1, arg2, arg3, (union target_semun)(abi_ulong)arg4);
+        ret = do_semctl(arg1, arg2, arg3, arg4);
         break;
 #endif
 #ifdef TARGET_NR_msgctl
-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 6/7] linux-user: Support setgroups syscall with no groups
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
                   ` (4 preceding siblings ...)
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 5/7] linux-user: correct semctl() and shmctl() riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 7/7] linux-user: Add more sparc syscall numbers riku.voipio
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dillon Amburgey

From: Dillon Amburgey <dillona@dillona.com>

Signed-off-by: Dillon Amburgey <dillona@dillona.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/syscall.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7f12563..e0c71fb 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7694,18 +7694,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         {
             int gidsetsize = arg1;
             target_id *target_grouplist;
-            gid_t *grouplist;
+            gid_t *grouplist = NULL;
             int i;
-
-            grouplist = alloca(gidsetsize * sizeof(gid_t));
-            target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * 2, 1);
-            if (!target_grouplist) {
-                ret = -TARGET_EFAULT;
-                goto fail;
+            if (gidsetsize) {
+                grouplist = alloca(gidsetsize * sizeof(gid_t));
+                target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * 2, 1);
+                if (!target_grouplist) {
+                    ret = -TARGET_EFAULT;
+                    goto fail;
+                }
+                for (i = 0; i < gidsetsize; i++) {
+                    grouplist[i] = low2highgid(tswapid(target_grouplist[i]));
+                }
+                unlock_user(target_grouplist, arg2, 0);
             }
-            for(i = 0;i < gidsetsize; i++)
-                grouplist[i] = low2highgid(tswapid(target_grouplist[i]));
-            unlock_user(target_grouplist, arg2, 0);
             ret = get_errno(setgroups(gidsetsize, grouplist));
         }
         break;
-- 
1.8.1.2

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

* [Qemu-devel] [PATCH 7/7] linux-user: Add more sparc syscall numbers
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
                   ` (5 preceding siblings ...)
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 6/7] linux-user: Support setgroups syscall with no groups riku.voipio
@ 2013-03-07 10:21 ` riku.voipio
  2013-03-07 14:56 ` [Qemu-devel] [PATCH 0/7] linux-user updates Peter Maydell
  2013-03-09 11:14 ` Peter Maydell
  8 siblings, 0 replies; 11+ messages in thread
From: riku.voipio @ 2013-03-07 10:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dillon Amburgey

From: Dillon Amburgey <dillona@dillona.com>

Signed-off-by: Dillon Amburgey <dillona@dillona.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/sparc/syscall_nr.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/sparc/syscall_nr.h b/linux-user/sparc/syscall_nr.h
index 061711c..534e6e9 100644
--- a/linux-user/sparc/syscall_nr.h
+++ b/linux-user/sparc/syscall_nr.h
@@ -200,6 +200,8 @@
 #define TARGET_NR__newselect         230 /* Linux Specific                              */
 #define TARGET_NR_time               231 /* Linux Specific                              */
 #define TARGET_NR_stime              233 /* Linux Specific                              */
+#define TARGET_NR_statfs64           234 /* Linux Specific                              */
+#define TARGET_NR_fstatfs64          235 /* Linux Specific                              */
 #define TARGET_NR__llseek            236 /* Linux Specific                              */
 #define TARGET_NR_mlock              237
 #define TARGET_NR_munlock            238
-- 
1.8.1.2

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

* Re: [Qemu-devel] [PATCH 0/7] linux-user updates
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
                   ` (6 preceding siblings ...)
  2013-03-07 10:21 ` [Qemu-devel] [PATCH 7/7] linux-user: Add more sparc syscall numbers riku.voipio
@ 2013-03-07 14:56 ` Peter Maydell
  2013-03-09 11:14 ` Peter Maydell
  8 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2013-03-07 14:56 UTC (permalink / raw)
  To: riku.voipio; +Cc: qemu-devel

On 7 March 2013 18:21,  <riku.voipio@linaro.org> wrote:
> I did a dig through the archive for linux-user patches
> that have slipped through during my inactivity. The ones
> in this patchset appear good and pass smoketest.

>   linux-user: correct semctl() and shmctl()

This one's not correct, I'm afraid -- see my comments
on the list on the last version Laurent posted. The
patch as it stands breaks x86 at least and needs more
work before it can go in.

http://lists.gnu.org/archive/html/qemu-devel/2013-02/msg00447.html

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 0/7] linux-user updates
  2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
                   ` (7 preceding siblings ...)
  2013-03-07 14:56 ` [Qemu-devel] [PATCH 0/7] linux-user updates Peter Maydell
@ 2013-03-09 11:14 ` Peter Maydell
  2013-03-11 15:02   ` Riku Voipio
  8 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2013-03-09 11:14 UTC (permalink / raw)
  To: riku.voipio; +Cc: qemu-devel

On 7 March 2013 18:21,  <riku.voipio@linaro.org> wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
> I did a dig through the archive for linux-user patches
> that have slipped through during my inactivity. The ones
> in this patchset appear good and pass smoketest.

These are the linux-user patches I've submitted that are
still waiting for review/commit:

linux-user: Fix layout of usage table to account for option text
  http://patchwork.ozlabs.org/patch/220481/
linux-user: make bogus negative iovec lengths fail EINVAL
  http://patchwork.ozlabs.org/patch/219240/
linux-user: Implement sendfile and sendfile64
  http://patchwork.ozlabs.org/patch/219229/
linux-user: Implement accept4
  http://patchwork.ozlabs.org/patch/219160/
linux-user/syscall.c: Don't warn about unimplemented get_robust_list
  http://patchwork.ozlabs.org/patch/219159/

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 0/7] linux-user updates
  2013-03-09 11:14 ` Peter Maydell
@ 2013-03-11 15:02   ` Riku Voipio
  0 siblings, 0 replies; 11+ messages in thread
From: Riku Voipio @ 2013-03-11 15:02 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

Hi Peter,

On 9 March 2013 13:14, Peter Maydell <peter.maydell@linaro.org> wrote:
> linux-user: Fix layout of usage table to account for option text
>   http://patchwork.ozlabs.org/patch/220481/
> linux-user: make bogus negative iovec lengths fail EINVAL
>   http://patchwork.ozlabs.org/patch/219240/
> linux-user: Implement sendfile and sendfile64
>   http://patchwork.ozlabs.org/patch/219229/
> linux-user: Implement accept4
>   http://patchwork.ozlabs.org/patch/219160/
> linux-user/syscall.c: Don't warn about unimplemented get_robust_list
>   http://patchwork.ozlabs.org/patch/219159/

I've added these (and removed the semctl one) to the patchset I'm testing:

http://git.linaro.org/gitweb?p=people/rikuvoipio/qemu.git;a=shortlog;h=refs/heads/linux-user-for-upstream

Riku

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

end of thread, other threads:[~2013-03-11 15:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07 10:21 [Qemu-devel] [PATCH 0/7] linux-user updates riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 1/7] linux-user: Add Alpha socket constants riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 2/7] linux-user: improve print_fcntl() riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 3/7] linux-user/syscall.c: handle FUTEX_WAIT_BITSET in do_futex riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 4/7] linux-user: fix futex strace of FUTEX_CLOCK_REALTIME riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 5/7] linux-user: correct semctl() and shmctl() riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 6/7] linux-user: Support setgroups syscall with no groups riku.voipio
2013-03-07 10:21 ` [Qemu-devel] [PATCH 7/7] linux-user: Add more sparc syscall numbers riku.voipio
2013-03-07 14:56 ` [Qemu-devel] [PATCH 0/7] linux-user updates Peter Maydell
2013-03-09 11:14 ` Peter Maydell
2013-03-11 15:02   ` Riku Voipio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).