-----BEGIN PGP SIGNATURE-----

iQIcBAABAgAGBQJai+diAAoJEPMMOL0/L748BpQP/RV1OjzS0Mk22cN7e1OCdpvz
 SZeMNnUUSHZzODHa1UkRqByrltkyZ8b+kXA/cYd4pRKfJbYmB/Tl/ZZG/YMPJVVv
 EFlG3n0aqgXq22FR1G8A9AIxX914WLDzG04wnNEZaGv8iyBJbbtjb1K3QC8BRixc
 TY+zjaLRg6tSIlZ8nZTJN8ZFHnN7XguHk4uHJOJkkjxUN9aTpe3/1L1Dvc7sVyQP
 5vhlcSL38NXa5P1wz1mSklVw62YdDuuldDiaGkn/Jhl5pNAwJB6ZpNa7n3kEjdUY
 EPJvpzDv8ELVHh2END69oLRSLSD0v5eM1wCtJr/PqmqTNJF0aj4jPyHvhu+3fxng
 rUxrcW+WPmfpaDylrg+K74prWwhlakXu9+7R6bh6FAYaW5NreyENI4zDh+/GCnPV
 0MKT+ei/87OLhsZw37hha47LT3NZZuit4RACbztqIjlZ2Mm/qZbxnbDv8bL4PmzM
 J0PU0Id5q58eTi+x468wFtc078GR+CTbak773qBNgN201TYjttKdUnj67edvXl7V
 hDRJijARHzw6roORwZBIPh3T6EJENbrir+iQVLSWygVHMGu2YdIcnJP6RXs3nVl/
 tZ3BMF0TBOtDv1FJ9ShzOo6M2zy8KDySz90l0J8TkqLqNkkdjJBVnyBK9JzMMFA2
 K6L2sCBgUL6FOuBPzLeg
 =vGv2
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging

# gpg: Signature made Tue 20 Feb 2018 09:16:18 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-2.12-pull-request:
  linux-user: Remove THREAD macro
  linux-user: Fix sched_getaffinity mask size
  linux-user: Fix register used for 6th and 7th syscall argument on aarch64
  linux-user: Implement ioctl cmd TIOCGPTPEER

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-02-20 09:40:51 +00:00
commit f4718c033b
23 changed files with 42 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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

View File

@ -3835,7 +3835,7 @@ void cpu_loop(CPUHPPAState *env)
#endif /* TARGET_HPPA */
THREAD CPUState *thread_cpu;
__thread CPUState *thread_cpu;
bool qemu_cpu_is_self(CPUState *cpu)
{

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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 __thread CPUState *thread_cpu;
void cpu_loop(CPUArchState *env);
const char *target_strerror(int err);
int get_osversion(void);

View File

@ -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

View File

@ -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 */

View File

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

View File

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

View File

@ -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__ } },
@ -10493,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;

View File

@ -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

View File

@ -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