Linux user for v11 patches
From: Helge Deller <[email protected]>
The following changes since commit 2339d0a1cfac6ecc667e6e062a593865c1541c35:
Merge tag 'hw-misc-20260120' of https://github.com/philmd/qemu into staging (2026-01-21 07:39:57 +1100)
are available in the Git repository at:
https://github.com/hdeller/qemu-hppa.git tags/linux-user-for-v11-pull-request
for you to fetch changes up to 3829bb3f187598501051b582053bed693aced988:
linux-user: Fix MADV_XXX constants on hppa target (2026-01-23 20:40:15 +0100)
----------------------------------------------------------------
linux-user: statx() syscall, termios2 support and futext() syscall fixes
Please pull if no obvious breakages happen in the testsuite.
Thanks!
Helge
----------------------------------------------------------------
Andreas Schwab (1):
linux-user: update statx emulation
Helge Deller (2):
linux-user: strace: Fix 5th argument of futex syscall
linux-user: Fix MADV_XXX constants on hppa target
Icenowy Zheng (1):
linux-user: fixup termios2 related things on PowerPC
Luca Bonissi (6):
linux-user: Add termios2 support
linux-user: Add termios2 support to alpha target
linux-user: Add termios2 support to hppa target
linux-user: Add termios2 support to mips target
linux-user: Add termios2 support to sh4 target
linux-user: Add termios2 support to sparc target
Vivian Wang (1):
linux-user: Add missing termios baud rates
linux-user/alpha/termbits.h | 30 +++++ linux-user/generic/termbits.h | 2 +- linux-user/hppa/termbits.h | 45 +++++++- linux-user/ioctls.h | 6 + linux-user/mips/termbits.h | 35 +++++- linux-user/ppc/termbits.h | 1 + linux-user/sh4/termbits.h | 51 ++++++--- linux-user/sparc/termbits.h | 33 +++++- linux-user/strace.c | 76 ++++++++++++- linux-user/syscall.c | 199 ++++++++++++++++++++++++++++++---- linux-user/syscall_defs.h | 6 +- linux-user/syscall_types.h | 3 + linux-user/user-internals.h | 3 + 13 files changed, 447 insertions(+), 43 deletions(-)
Signature · 1 line
2.52.0
[PULL 01/11] linux-user: update statx emulation
From: Andreas Schwab <[email protected]>
--- linux-user/syscall.c | 3 +++ linux-user/syscall_defs.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-)
linux-user/syscall.c +3 -0
@@ -7882,6 +7882,9 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx,__put_user (host_stx->stx_rdev_minor, &target_stx->stx_rdev_minor);__put_user (host_stx->stx_dev_major, &target_stx->stx_dev_major);__put_user (host_stx->stx_dev_minor, &target_stx->stx_dev_minor); +__put_user (host_stx->stx_mnt_id, &target_stx->stx_mnt_id); +__put_user (host_stx->stx_dio_mem_align, &target_stx->stx_dio_mem_align); +__put_user (host_stx->stx_dio_offset_align, &target_stx->stx_dio_offset_align);unlock_user_struct (target_stx, target_addr,1 );
linux-user/syscall_defs.h +5 -1
@@ -2734,7 +2734,11 @@ struct target_statx {abi_uint stx_dev_major;/* ID of device containing file [uncond] */ abi_uint stx_dev_minor;/* 0x90 */ -abi_ullong __spare2[14 ];/* Spare space for future expansion */ +abi_ullong stx_mnt_id; +abi_uint stx_dio_mem_align; +abi_uint stx_dio_offset_align; +/* 0xa0 */ +abi_ullong __spare2[12 ];/* Spare space for future expansion */ /* 0x100 */ };
Signature · 1 line
2.52.0
[PULL 02/11] linux-user: Add termios2 support
In reply to [email protected]From: Luca Bonissi <[email protected]>
--- linux-user/ioctls.h | 6 +++ linux-user/strace.c | 69 ++++++++++++++++++++++++++++++ linux-user/syscall.c | 84 +++++++++++++++++++++++++++++++++++++ linux-user/syscall_types.h | 3 ++ linux-user/user-internals.h | 3 ++ 5 files changed, 165 insertions(+)
linux-user/ioctls.h +6 -0
@@ -1,5 +1,11 @@/* emulated ioctl list */ +#ifdef TARGET_TCGETS2 + IOCTL(TCGETS2, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios2))) + IOCTL(TCSETS2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2))) + IOCTL(TCSETSW2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2))) + IOCTL(TCSETSF2, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios2))) +#endif IOCTL(TCGETS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios))) IOCTL(TCSETS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_termios)))IOCTL (TCSETSF ,IOC_W ,MK_PTR (MK_STRUCT (STRUCT_termios)))
linux-user/strace.c +69 -0
75 lines not on this page · raw message
linux-user/syscall.c +84 -0
96 lines not on this page · raw message
linux-user/syscall_types.h +3 -0
@@ -1,4 +1,7 @@ STRUCT_SPECIAL(termios) +#ifdef TARGET_TCGETS2 +STRUCT_SPECIAL(termios2) +#endif STRUCT (winsize,TYPE_SHORT ,TYPE_SHORT ,TYPE_SHORT ,TYPE_SHORT )
linux-user/user-internals.h +3 -0
@@ -129,6 +129,9 @@ static inline uint64_t target_offset64(uint64_t word0, uint64_t word1)#endif /* TARGET_ABI_BITS != 32 */ void print_termios (void *arg); +#ifdef TARGET_TCGETS2 +void print_termios2 (void *arg); +#endif /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */ #ifdef TARGET_ARM
Signature · 1 line
2.52.0
[PULL 04/11] linux-user: Add termios2 support to hppa target
In reply to [email protected]From: Luca Bonissi <[email protected]>
--- linux-user/hppa/termbits.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
linux-user/hppa/termbits.h +29 -0
@@ -18,6 +18,29 @@ struct target_termios {target_cc_t c_cc[TARGET_NCCS ];/* control characters */ }; +struct target_termios2 { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +struct target_ktermios { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +/* c_iflag bits */ #define TARGET_IGNBRK 0000001#define TARGET_BRKINT 0000002
@@ -190,6 +213,12 @@ struct target_termios {#define TARGET_TIOCSBRK 0x5427/* BSD compatibility */ #define TARGET_TIOCCBRK 0x5428/* BSD compatibility */ #define TARGET_TIOCGSID TARGET_IOR('T', 20, int) +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485)#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)
Signature · 1 line
2.52.0
[PULL 05/11] linux-user: Add termios2 support to mips target
In reply to [email protected]From: Luca Bonissi <[email protected]>
--- linux-user/mips/termbits.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-)
linux-user/mips/termbits.h +27 -4
@@ -18,6 +18,29 @@ struct target_termios {target_cc_t c_cc[TARGET_NCCS ];/* control characters */ }; +struct target_termios2 { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +struct target_ktermios { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +/* c_iflag bits */ #define TARGET_IGNBRK 0000001#define TARGET_BRKINT 0000002
@@ -227,10 +250,10 @@ struct target_termios {#define TARGET_TIOCSBRK 0x5427/* BSD compatibility */ #define TARGET_TIOCCBRK 0x5428/* BSD compatibility */ #define TARGET_TIOCGSID 0x7416/* Return the session ID of FD */ -#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct termios2) -#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct termios2) -#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct termios2) -#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct termios2) +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2)#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485)#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485)#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */
Signature · 1 line
2.52.0
[PULL 06/11] linux-user: Add termios2 support to sh4 target
In reply to [email protected]From: Luca Bonissi <[email protected]>
--- linux-user/sh4/termbits.h | 46 +++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-)
linux-user/sh4/termbits.h +34 -12
@@ -18,6 +18,28 @@ struct target_termios {target_cc_t c_cc[TARGET_NCCS ];/* control characters */ }; +struct target_termios2 { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +struct target_ktermios { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; +/* c_cc characters */ #define TARGET_VINTR 0
@@ -251,14 +273,17 @@ struct target_termios {#define TARGET_TIOCNOTTY TARGET_IO('T', 34)/* 0x5422 */ #define TARGET_TIOCSETD TARGET_IOW('T', 35, int)/* 0x5423 */ #define TARGET_TIOCGETD TARGET_IOR('T', 36, int)/* 0x5424 */ -#define TARGET_TCSBRKP TARGET_IOW('T', 37, int)/* 0x5425 */ /* Needed for POSIX tcse -ndbreak() */ +#define TARGET_TCSBRKP TARGET_IOW('T', 37, int)/* 0x5425 */ /* Needed for POSIX tcsendbreak() */ #define TARGET_TIOCSBRK TARGET_IO('T', 39)/* 0x5427 */ /* BSD compatibility */ #define TARGET_TIOCCBRK TARGET_IO('T', 40)/* 0x5428 */ /* BSD compatibility */ -#define TARGET_TIOCGSID TARGET_IOR('T', 41, pid_t)/* 0x5429 */ /* Return the session -ID of FD */ -#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-m -ux device) */ +#define TARGET_TIOCGSID TARGET_IOR('T', 41, pid_t)/* 0x5429 */ /* Return the session ID of FD */ +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485) +#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 */
@@ -270,8 +295,7 @@ ux device) */#define TARGET_TIOCSLCKTRMIOS 0x5457#define TARGET_TIOCSERGSTRUCT TARGET_IOR('T', 88, int)/* 0x5458 */ /* For d ebugging only */ -#define TARGET_TIOCSERGETLSR TARGET_IOR('T', 89, unsigned int)/* 0x5459 */ /* Get line sta -tus register */ +#define TARGET_TIOCSERGETLSR TARGET_IOR('T', 89, unsigned int)/* 0x5459 */ /* Get line status register */ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ # define TARGET_TIOCSER_TEMT 0x01/* Transmitter physically empty */ #define TARGET_TIOCSERGETMULTI TARGET_IOR('T', 90, int)/* 0x545A
@@ -279,9 +303,7 @@ tus register */#define TARGET_TIOCSERSETMULTI TARGET_IOW('T', 91, int)/* 0x545B */ /* Set multiport config */ -#define TARGET_TIOCMIWAIT TARGET_IO('T', 92)/* 0x545C */ /* wait for a change on -serial input line(s) */ -#define TARGET_TIOCGICOUNT TARGET_IOR('T', 93, int)/* 0x545D */ /* read -serial port inline interrupt counts */ +#define TARGET_TIOCMIWAIT TARGET_IO('T', 92)/* 0x545C */ /* wait for a change on serial input line(s) */ +#define TARGET_TIOCGICOUNT TARGET_IOR('T', 93, int)/* 0x545D */ /* read serial port inline interrupt counts */ #endif
Signature · 1 line
2.52.0
[PULL 03/11] linux-user: Add termios2 support to alpha target
In reply to [email protected]From: Luca Bonissi <[email protected]>
--- linux-user/alpha/termbits.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
linux-user/alpha/termbits.h +29 -0
@@ -17,6 +17,29 @@ struct target_termios {target_speed_t c_ospeed;/* output speed */ }; +struct target_termios2 { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_cc_t c_line;/* line discipline (== c_cc[19]) */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +struct target_ktermios { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_cc_t c_line;/* line discipline (== c_cc[19]) */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +/* c_cc characters */ #define TARGET_VEOF 0#define TARGET_VEOL 1
@@ -247,6 +270,12 @@ struct target_termios {#define TARGET_TIOCSBRK 0x5427/* BSD compatibility */ #define TARGET_TIOCCBRK 0x5428/* BSD compatibility */ #define TARGET_TIOCGSID 0x5429/* Return the session ID of FD */ +#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x2E, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x2F, struct serial_rs485)#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 */
Signature · 1 line
2.52.0
[PULL 07/11] linux-user: Add termios2 support to sparc target
In reply to [email protected]From: Luca Bonissi <[email protected]>
--- linux-user/sparc/termbits.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
linux-user/sparc/termbits.h +28 -0
@@ -18,6 +18,28 @@ struct target_termios {target_cc_t c_cc[TARGET_NCCS ];/* control characters */ }; +struct target_termios2 { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; + +struct target_ktermios { +target_tcflag_t c_iflag;/* input mode flags */ +target_tcflag_t c_oflag;/* output mode flags */ +target_tcflag_t c_cflag;/* control mode flags */ +target_tcflag_t c_lflag;/* local mode flags */ +target_cc_t c_line;/* line discipline */ +target_cc_t c_cc[TARGET_NCCS ];/* control characters */ +target_speed_t c_ispeed;/* input speed */ +target_speed_t c_ospeed;/* output speed */ +}; +/* c_cc characters */ #define TARGET_VINTR 0
@@ -251,6 +273,12 @@ struct target_termios {#define TARGET_TIOCGPGRP TARGET_IOR('t', 131, int)#define TARGET_TIOCSCTTY TARGET_IO('t', 132)#define TARGET_TIOCGSID TARGET_IOR('t', 133, int) +#define TARGET_TCGETS2 TARGET_IOR('T', 12, struct target_termios2) +#define TARGET_TCSETS2 TARGET_IOW('T', 13, struct target_termios2) +#define TARGET_TCSETSW2 TARGET_IOW('T', 14, struct target_termios2) +#define TARGET_TCSETSF2 TARGET_IOW('T', 15, struct target_termios2) +#define TARGET_TIOCGRS485 TARGET_IOR('T', 0x41, struct serial_rs485) +#define TARGET_TIOCSRS485 TARGET_IOWR('T', 0x42, struct serial_rs485)/* 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 */
Signature · 1 line
2.52.0
[PULL 09/11] linux-user: fixup termios2 related things on PowerPC
In reply to [email protected]From: Icenowy Zheng <[email protected]>
The termios things on PowerPC equal to termios2 things otherwhere.
Use some simple #define's to allow both termios and termios2 to map to termios on PowerPC.
--- linux-user/syscall.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
linux-user/syscall.c +15 -0
@@ -148,6 +148,21 @@#include "fd-trans.h" #include "user/cpu_loop.h" +#if defined(__powerpc__) +/* +* On PowerPC termios2 is lacking and termios along with ioctls w/o 2 +* behaves like termios2 and things with 2 on other architectures. +* +* Just define termios2-related things to be the same with termios-related +* ones to support PowerPC. +*/ +#define host_termios2 host_termios +#define TCGETS2 TCGETS +#define TCSETS2 TCSETS +#define TCSETSW2 TCSETSW +#define TCSETSF2 TCSETSF +#endif +#ifndef CLONE_IO #define CLONE_IO 0x80000000/* Clone io context */ #endif
Signature · 1 line
2.52.0
[PULL 08/11] linux-user: Add missing termios baud rates
In reply to [email protected]From: Vivian Wang <[email protected]>
Add several missing baud rates and inputs baud rates in cflag_tbl.
Add these missing definitions in termbits.h:
- TARGET_BOTHER for alpha, hppa, ppc, sh4, sparc
- TARGET_IBSHIFT for hppa, mips, ppc, sh4, sparc
- Missing standard baud rates for hppa
These are required for the glibc test tst-termios-linux.
--- linux-user/alpha/termbits.h | 1 + linux-user/generic/termbits.h | 2 +- linux-user/hppa/termbits.h | 16 ++++++- linux-user/mips/termbits.h | 4 +- linux-user/ppc/termbits.h | 1 + linux-user/sh4/termbits.h | 5 ++- linux-user/sparc/termbits.h | 5 ++- linux-user/syscall.c | 83 ++++++++++++++++++++++++++--------- 8 files changed, 92 insertions(+), 25 deletions(-)
linux-user/alpha/termbits.h +1 -0
@@ -149,6 +149,7 @@ struct target_ktermios {#define TARGET_B3000000 00034#define TARGET_B3500000 00035#define TARGET_B4000000 00036 +#define TARGET_BOTHER 00037#define TARGET_CSIZE 00001400#define TARGET_CS5 00000000
linux-user/generic/termbits.h +1 -1
@@ -157,7 +157,7 @@ struct target_ktermios {#define TARGET_B3000000 0010015#define TARGET_B3500000 0010016#define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000/* input baud rate (not used) */ +#define TARGET_CIBAUD 002003600000/* input baud rate */ #define TARGET_CMSPAR 010000000000/* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000/* flow control */
linux-user/hppa/termbits.h +15 -1
@@ -123,14 +123,28 @@ struct target_ktermios {#define TARGET_HUPCL 0002000#define TARGET_CLOCAL 0004000#define TARGET_CBAUDEX 0010000 +#define TARGET_BOTHER 0010000#define TARGET_B57600 0010001#define TARGET_B115200 0010002#define TARGET_B230400 0010003#define TARGET_B460800 0010004 -#define TARGET_CIBAUD 002003600000/* input baud rate (not used) */ +#define TARGET_B500000 0010005 +#define TARGET_B576000 0010006 +#define TARGET_B921600 0010007 +#define TARGET_B1000000 0010010 +#define TARGET_B1152000 0010011 +#define TARGET_B1500000 0010012 +#define TARGET_B2000000 0010013 +#define TARGET_B2500000 0010014 +#define TARGET_B3000000 0010015 +#define TARGET_B3500000 0010016 +#define TARGET_B4000000 0010017 +#define TARGET_CIBAUD 002003600000/* input baud rate */ #define TARGET_CMSPAR 010000000000/* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000/* flow control */ +#define TARGET_IBSHIFT 16/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define TARGET_ISIG 0000001#define TARGET_ICANON 0000002
linux-user/mips/termbits.h +3 -1
@@ -139,10 +139,12 @@ struct target_ktermios {#define TARGET_B3000000 0010015#define TARGET_B3500000 0010016#define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000/* input baud rate (not used) */ +#define TARGET_CIBAUD 002003600000/* input baud rate */ #define TARGET_CMSPAR 010000000000/* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000/* flow control */ +#define TARGET_IBSHIFT 16/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define TARGET_ISIG 0000001#define TARGET_ICANON 0000002
linux-user/ppc/termbits.h +1 -0
@@ -129,6 +129,7 @@ struct target_termios {#define TARGET_B3000000 00034#define TARGET_B3500000 00035#define TARGET_B4000000 00036 +#define TARGET_BOTHER 00037#define TARGET_CSIZE 00001400#define TARGET_CS5 00000000
linux-user/sh4/termbits.h +4 -1
@@ -142,6 +142,7 @@ struct target_ktermios {#define TARGET_HUPCL 0002000#define TARGET_CLOCAL 0004000#define TARGET_CBAUDEX 0010000 +#define TARGET_BOTHER 0010000#define TARGET_B57600 0010001#define TARGET_B115200 0010002#define TARGET_B230400 0010003
@@ -157,10 +158,12 @@ struct target_ktermios {#define TARGET_B3000000 0010015#define TARGET_B3500000 0010016#define TARGET_B4000000 0010017 -#define TARGET_CIBAUD 002003600000/* input baud rate (not used) */ +#define TARGET_CIBAUD 002003600000/* input baud rate */ #define TARGET_CMSPAR 010000000000/* mark or space (stick) parity */ #define TARGET_CRTSCTS 020000000000/* flow control */ +#define TARGET_IBSHIFT 16/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define TARGET_ISIG 0000001#define TARGET_ICANON 0000002
linux-user/sparc/termbits.h +4 -1
@@ -150,6 +150,7 @@ struct target_ktermios {#define TARGET_HUPCL 0x00000400#define TARGET_CLOCAL 0x00000800#define TARGET_CBAUDEX 0x00001000 +#define TARGET_BOTHER 0x00001000/* We'll never see these speeds with the Zilogs, but for completeness... */ #define TARGET_B57600 0x00001001#define TARGET_B115200 0x00001002
@@ -176,10 +177,12 @@ struct target_ktermios {#define B3000000 0x00001011 #define B3500000 0x00001012 #define B4000000 0x00001013 */ -#define TARGET_CIBAUD 0x100f0000/* input baud rate (not used) */ +#define TARGET_CIBAUD 0x100f0000/* input baud rate */ #define TARGET_CMSPAR 0x40000000/* mark or space (stick) parity */ #define TARGET_CRTSCTS 0x80000000/* flow control */ +#define TARGET_IBSHIFT 16/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define TARGET_ISIG 0x00000001#define TARGET_ICANON 0x00000002
linux-user/syscall.c +63 -20
90 lines not on this page · raw message
Signature · 1 line
2.52.0
[PULL 10/11] linux-user: strace: Fix 5th argument of futex syscall
In reply to [email protected]From: Helge Deller <[email protected]>
The 5th argument isn't printed, but instead the 4th argument is shown twice. Fix this, and print the FUTEX_BITSET_MATCH_ANY string constant instead of -1 if the op is FUTEX_WAIT_BITSET or FUTEX_WAKE_BITSET.
--- linux-user/strace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
linux-user/strace.c +6 -1
@@ -4150,7 +4150,12 @@ print_futex(CPUArchState *cpu_env, const struct syscallname *name, break; }print_pointer (arg4,0 ); -print_raw_param ("%d" , arg4,1 ); +if ((op ==FUTEX_WAIT_BITSET || (op ==FUTEX_WAKE_BITSET )) && + (arg5 ==FUTEX_BITSET_MATCH_ANY )) { +qemu_log ("FUTEX_BITSET_MATCH_ANY" ); + }else { +print_raw_param ("%#x" , arg5,1 ); + }print_syscall_epilogue (name); }#endif
Signature · 1 line
2.52.0
[PULL 11/11] linux-user: Fix MADV_XXX constants on hppa target
In reply to [email protected]From: Helge Deller <[email protected]>
Older hppa binaries may still use the old MADV_XXX constants for the madivise() syscall. Fix it up in the same manner as it's done in the Linux kernel in the parisc_madvise() function.
--- linux-user/syscall.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
linux-user/syscall.c +14 -0
@@ -12922,6 +12922,20 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,#ifdef TARGET_NR_madvisecase TARGET_NR_madvise: +#ifdef TARGET_HPPA +/* Emulate old hppa mapping of MADV_xxx constants. */ +switch (arg3) { +case 65 : arg3 =MADV_MERGEABLE ;break ; +case 66 : arg3 =MADV_UNMERGEABLE ;break ; +case 67 : arg3 =MADV_HUGEPAGE ;break ; +case 68 : arg3 =MADV_NOHUGEPAGE ;break ; +case 69 : arg3 =MADV_DONTDUMP ;break ; +case 70 : arg3 =MADV_DODUMP ;break ; +case 71 : arg3 =MADV_WIPEONFORK ;break ; +case 72 : arg3 =MADV_KEEPONFORK ;break ; +case 73 : arg3 =MADV_COLLAPSE ;break ; + } +#endif /* TARGET_HPPA */ return target_madvise (arg1, arg2, arg3);#endif #ifdef TARGET_NR_fcntl64
Signature · 1 line
2.52.0
Re: [PULL 11/11] linux-user: Fix MADV_XXX constants on hppa target
Quoted 24 lines · On 1/24/26 07:52, [email protected] wrote:
From: Helge Deller <[email protected]>
Older hppa binaries may still use the old
MADV_XXXconstants for themadivise()syscall. Fix it up in the same manner as it's done in the Linux kernel in theparisc_madvise()function.Signed-off-by Helge Deller <[email protected]>Reviewed-by Peter Maydell <[email protected]>--- linux-user/syscall.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)linux-user/syscall.c +4
-0@@ -12922,6 +12922,20 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_madvise case TARGET_NR_madvise: +#ifdef TARGET_HPPA + /* Emulate old hppa mapping of MADV_xxx constants. */ + switch (arg3) { + case 65: arg3 = MADV_MERGEABLE; break;
linux-user/syscall.c static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, · line 12938
Quoted 10 lines
linux-user/syscall.c +10
-0+case 66 : arg3 =MADV_UNMERGEABLE ;break ; +case 67 : arg3 =MADV_HUGEPAGE ;break ; +case 68 : arg3 =MADV_NOHUGEPAGE ;break ; +case 69 : arg3 =MADV_DONTDUMP ;break ; +case 70 : arg3 =MADV_DODUMP ;break ; +case 71 : arg3 =MADV_WIPEONFORK ;break ; +case 72 : arg3 =MADV_KEEPONFORK ;break ; + case 73: arg3 = MADV_COLLAPSE; break; + } +#endif /* TARGET_HPPA */
Build failure:
Quoted 5 lines
../linux-user/syscall.c: In function ‘do_syscall1’:../linux-user/syscall.c:12936:25: error: ‘MADV_COLLAPSE’ undeclared (first use in this function); did you mean ‘MADV_COLD’?12936 | case 73: arg3 = MADV_COLLAPSE; break; | ^~~~~~~~~~~~~ | MADV_COLD
r~