Linux user for 2.12 patches
The following changes since commit f0fa81767555fe2c4b5f8c9e0725a80eac1d7f56:
cuda.h: Fix multiple typedef (2018-02-16 18:38:21 +0000)
are available in the Git repository at:
git://github.com/vivier/qemu.git tags/linux-user-for-2.12-pull-request
for you to fetch changes up to b44316fb3610972e40849ec5710aeb42dfeba19d:
linux-user: Remove THREAD macro (2018-02-18 18:52:32 +0100)
----------------------------------------------------------------
----------------------------------------------------------------
Andreas Schwab (1):
linux-user: Implement ioctl cmd TIOCGPTPEER
Guido Günther (1):
linux-user: Fix register used for 6th and 7th syscall argument on
aarch64
Peter Maydell (1):
linux-user: Remove THREAD macro
Samuel Thibault (1):
linux-user: Fix sched_getaffinity mask size
linux-user/aarch64/termbits.h | 2 ++ linux-user/alpha/termbits.h | 1 + linux-user/arm/termbits.h | 1 + linux-user/cris/termbits.h | 1 + linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- linux-user/hppa/termbits.h | 2 ++ linux-user/i386/termbits.h | 1 + linux-user/ioctls.h | 3 +++ linux-user/m68k/termbits.h | 1 + linux-user/main.c | 2 +- linux-user/microblaze/termbits.h | 1 + linux-user/mips/termbits.h | 1 + linux-user/nios2/termbits.h | 2 ++ linux-user/openrisc/termbits.h | 2 ++ linux-user/ppc/termbits.h | 1 + linux-user/qemu.h | 4 +--- linux-user/s390x/termbits.h | 1 + linux-user/sh4/termbits.h | 1 + linux-user/sparc/termbits.h | 1 + linux-user/sparc64/termbits.h | 1 + linux-user/syscall.c | 13 ++++++++++++- linux-user/tilegx/termbits.h | 1 + linux-user/x86_64/termbits.h | 1 + 23 files changed, 42 insertions(+), 8 deletions(-)
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 2/4] linux-user: Fix register used for 6th and 7th syscall argument on aarch64
From: Guido Günther <[email protected]>
This unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.html
Thanks to Laurent Vivier for spotting the 7th one.
Message-Id: <671eaa99f4e0bf3a58f76f9151f7cfa24662227f.1517565566.git.agx@sigxcpu.org>
--- linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/host/aarch64/safe-syscall.inc.S +3 -3
@@ -36,7 +36,7 @@ safe_syscall_base: * and return the result in x0 * and the syscall instruction needs * x8 == syscall number - * x0 ... x7 == syscall arguments + * x0 ... x6 == syscall arguments * and returns the result in x0 * Shuffle everything around appropriately. */
@@ -47,8 +47,8 @@ safe_syscall_base: mov x2, x4 mov x3, x5 mov x4, x6 - mov x6, x7 - ldr x7, [sp] + mov x5, x7 + ldr x6, [sp] /* This next sequence of code works in conjunction with the * rewind_if_safe_syscall_function(). If a signal is taken
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 3/4] linux-user: Fix sched_getaffinity mask size
In reply to Laurent VivierFrom: Samuel Thibault <[email protected]>
We properly computed the capped mask size to be put to the application buffer, but didn't actually used it. Also, we need to return the capped mask size instead of 0 on success.
Message-Id: <[email protected]>
--- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
linux-user/syscall.c +3 -1
@@ -10502,7 +10502,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret = arg2; } - ret =host_to_target_cpu_mask (mask, mask_size, arg3, arg2); +if (host_to_target_cpu_mask (mask, mask_size, arg3, ret)) { + goto efault; + } } }break ;
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 1/4] linux-user: Implement ioctl cmd TIOCGPTPEER
In reply to Laurent VivierFrom: Andreas Schwab <[email protected]>
With glibc 2.27 the openpty function prefers the TIOCGPTPEER ioctl.
Message-Id: <[email protected]>
--- linux-user/aarch64/termbits.h | 2 ++ linux-user/alpha/termbits.h | 1 + linux-user/arm/termbits.h | 1 + linux-user/cris/termbits.h | 1 + linux-user/hppa/termbits.h | 2 ++ linux-user/i386/termbits.h | 1 + linux-user/ioctls.h | 3 +++ linux-user/m68k/termbits.h | 1 + linux-user/microblaze/termbits.h | 1 + linux-user/mips/termbits.h | 1 + linux-user/nios2/termbits.h | 2 ++ linux-user/openrisc/termbits.h | 2 ++ linux-user/ppc/termbits.h | 1 + linux-user/s390x/termbits.h | 1 + linux-user/sh4/termbits.h | 1 + linux-user/sparc/termbits.h | 1 + linux-user/sparc64/termbits.h | 1 + linux-user/syscall.c | 9 +++++++++ linux-user/tilegx/termbits.h | 1 + linux-user/x86_64/termbits.h | 1 + 20 files changed, 34 insertions(+)
linux-user/aarch64/termbits.h +2 -0
@@ -187,6 +187,8 @@ struct target_termios {/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) +/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/alpha/termbits.h +1 -0
@@ -245,6 +245,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_TIOCSERCONFIG 0x5453#define TARGET_TIOCSERGWILD 0x5454
linux-user/arm/termbits.h +1 -0
@@ -185,6 +185,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/cris/termbits.h +1 -0
@@ -182,6 +182,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/hppa/termbits.h +2 -0
@@ -186,6 +186,8 @@ struct target_termios {/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) +/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/i386/termbits.h +1 -0
@@ -195,6 +195,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/ioctls.h +3 -0
@@ -40,6 +40,9 @@ IOCTL(TIOCSETD, IOC_W, MK_PTR(TYPE_INT)) IOCTL(TIOCGPTN, IOC_R, MK_PTR(TYPE_INT)) IOCTL(TIOCSPTLCK, IOC_W, MK_PTR(TYPE_INT)) +#ifdef TIOCGPTPEER + IOCTL_SPECIAL(TIOCGPTPEER, 0, do_ioctl_tiocgptpeer, TYPE_INT) +#endif IOCTL(FIOCLEX, 0, TYPE_NULL) IOCTL(FIONCLEX, 0, TYPE_NULL)IOCTL (FIOASYNC ,IOC_W ,MK_PTR (TYPE_INT ))
linux-user/m68k/termbits.h +1 -0
@@ -196,6 +196,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/microblaze/termbits.h +1 -0
@@ -182,6 +182,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/mips/termbits.h +1 -0
@@ -233,6 +233,7 @@ struct target_termios {#define TARGET_TIOCGPKT TARGET_IOR('T', 0x38, int)#define TARGET_TIOCGPTLCK TARGET_IOR('T', 0x39, int)#define TARGET_TIOCGEXCL TARGET_IOR('T', 0x40, int) +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* I hope the range from 0x5480 on is free ... */ #define TARGET_TIOCSCTTY 0x5480/* become controlling tty */
linux-user/nios2/termbits.h +2 -0
@@ -187,6 +187,8 @@ struct target_termios {/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) +/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/openrisc/termbits.h +2 -0
@@ -245,6 +245,8 @@ struct target_termios3 {#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)/* Lock/unlock Pty */ #define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int) +/* Safely open the slave */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Get primary device node of /dev/console */ #define TARGET_TIOCGDEV TARGET_IOR('T', 0x32, unsigned int)#define TARGET_TCGETX 0x5432/* SYS5 TCGETX compatibility */
linux-user/ppc/termbits.h +1 -0
@@ -219,6 +219,7 @@ struct target_termios {#define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ #define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_TIOCSERCONFIG 0x5453#define TARGET_TIOCSERGWILD 0x5454
linux-user/s390x/termbits.h +1 -0
@@ -252,6 +252,7 @@ struct target_ktermios {#define TARGET_TIOCGPTN _IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK _IOW('T',0x31, int)/* Lock/unlock Pty */ #define TARGET_TIOCGDEV _IOR('T',0x32, unsigned int)/* Get real dev no below /dev/console */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
linux-user/sh4/termbits.h +1 -0
@@ -250,6 +250,7 @@ ID of FD */#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-m ux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_TIOCSERCONFIG TARGET_IO('T', 83)/* 0x5453 */
linux-user/sparc/termbits.h +1 -0
@@ -245,6 +245,7 @@ struct target_termios {/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */ #define TARGET_TIOCGPTN TARGET_IOR('t', 134, unsigned int)/* Get Pty Number */ #define TARGET_TIOCSPTLCK TARGET_IOW('t', 135, int)/* Lock/unlock PTY */ +#define TARGET_TIOCGPTPEER TARGET_IO('t', 137)/* Safely open the slave */ /* Little f */ #define TARGET_FIOCLEX TARGET_IO('f', 1)
linux-user/sparc64/termbits.h +1 -0
@@ -245,6 +245,7 @@ struct target_termios {/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */ #define TARGET_TIOCGPTN TARGET_IOR('t', 134, unsigned int)/* Get Pty Number */ #define TARGET_TIOCSPTLCK TARGET_IOW('t', 135, int)/* Lock/unlock PTY */ +#define TARGET_TIOCGPTPEER TARGET_IO('t', 137)/* Safely open the slave */ /* Little f */ #define TARGET_FIOCLEX TARGET_IO('f', 1)
linux-user/syscall.c +9 -0
@@ -5636,6 +5636,15 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp,return get_errno (safe_ioctl (fd, ie->host_cmd, sig)); } +#ifdef TIOCGPTPEER +static abi_long do_ioctl_tiocgptpeer (const IOCTLEntry *ie,uint8_t *buf_temp, +int fd,int cmd,abi_long arg) +{ +int flags =target_to_host_bitmask (arg, fcntl_flags_tbl); +return get_errno (safe_ioctl (fd, ie->host_cmd, flags)); +} +#endif + static IOCTLEntry ioctl_entries[] = { #define IOCTL(cmd, access, ...) \ { TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
linux-user/tilegx/termbits.h +1 -0
@@ -242,6 +242,7 @@ struct target_termios2 {#define TARGET_TIOCGPKT TARGET_IOR('T', 0x38, int)#define TARGET_TIOCGPTLCK TARGET_IOR('T', 0x39, int)#define TARGET_TIOCGEXCL TARGET_IOR('T', 0x40, int) +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)#define TARGET_FIONCLEX 0x5450#define TARGET_FIOCLEX 0x5451
linux-user/x86_64/termbits.h +1 -0
@@ -215,6 +215,7 @@ struct target_termios {#define TARGET_TCSETSF2 TARGET_IOW('T',0x2D, struct termios2)#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int)/* Lock/unlock Pty */ +#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)/* Safely open the slave */ #define TARGET_FIONCLEX 0x5450/* these numbers need to be adjusted. */ #define TARGET_FIOCLEX 0x5451
Signature · 1 line
2.14.3
[Qemu-devel] [PULL 4/4] linux-user: Remove THREAD macro
In reply to Laurent VivierFrom: Peter Maydell <[email protected]>
Back when we used to support compiling either with or without NPTL threading library support, we used a macro THREAD which would expand either to nothing (no thread support) or to __thread (threads supported). For a long time now we have required thread support, so remove the macro and just use __thread directly as other parts of QEMU do.
Message-Id: <[email protected]>
--- linux-user/main.c | 2 +- linux-user/qemu.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-)
linux-user/main.c +1 -1
@@ -3835,7 +3835,7 @@ void cpu_loop(CPUHPPAState *env)#endif /* TARGET_HPPA */ -THREAD CPUState *thread_cpu; +__threadCPUState *thread_cpu;bool qemu_cpu_is_self (CPUState *cpu) {
linux-user/qemu.h +1 -3
@@ -18,8 +18,6 @@#include "exec/gdbstub.h" #include "qemu/queue.h" -#define THREAD __thread -/* This is the size of the host kernel's sigset_t, needed where we make * direct system calls that take a sigset_t pointer and a size. */
@@ -201,7 +199,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -extern THREAD CPUState *thread_cpu; +extern __threadCPUState *thread_cpu;void cpu_loop (CPUArchState *env);const char *target_strerror (int err);int get_osversion (void );
Signature · 1 line
2.14.3
Peter Maydell
AppliedQuoted 8 lines · Laurent Vivier
The following changes since commit
f0fa81767555fe2c4b5f8c9e0725a80eac1d7f56:
cuda.h: Fix multiple typedef (2018-02-16 18:38:21 +0000)are available in the Git repository at:
git://github.com/vivier/qemu.gittags/linux-user-for-2.12-pull-request
Quoted 8 lines
for you to fetch changes up to
b44316fb3610972e40849ec5710aeb42dfeba19d:linux-user: Remove THREAD macro (2018-02-18 18:52:32 +0100)
----------------------------------------------------------------
----------------------------------------------------------------
Applied, thanks.
-- PMM