[PULL v2 00/37] Linux user for 5.0 patches

Laurent Vivier posted 37 patches 4 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Failed in applying to current master (apply log)
There is a newer version of this series
MAINTAINERS                            |   3 +
Makefile.target                        |   3 +-
configure                              |  35 ++
linux-user/Makefile.objs               |  19 +-
linux-user/aarch64/syscall_nr.h        |  34 +-
linux-user/alpha/Makefile.objs         |   5 +
linux-user/alpha/syscall.tbl           | 479 ++++++++++++++++
linux-user/alpha/syscall_nr.h          | 492 -----------------
linux-user/alpha/syscallhdr.sh         |  32 ++
linux-user/arm/Makefile.objs           |   8 +
linux-user/arm/syscall.tbl             | 453 +++++++++++++++
linux-user/arm/syscall_nr.h            | 447 ---------------
linux-user/arm/syscallhdr.sh           |  31 ++
linux-user/elfload.c                   |   3 +-
linux-user/hppa/Makefile.objs          |   5 +
linux-user/hppa/syscall.tbl            | 437 +++++++++++++++
linux-user/hppa/syscall_nr.h           | 358 ------------
linux-user/hppa/syscallhdr.sh          |  32 ++
linux-user/i386/Makefile.objs          |   5 +
linux-user/i386/cpu_loop.c             | 201 +++++--
linux-user/i386/syscall_32.tbl         | 444 +++++++++++++++
linux-user/i386/syscall_nr.h           | 387 -------------
linux-user/i386/syscallhdr.sh          |  28 +
linux-user/i386/target_cpu.h           |   4 +-
linux-user/m68k/Makefile.objs          |   5 +
linux-user/m68k/syscall.tbl            | 439 +++++++++++++++
linux-user/m68k/syscall_nr.h           | 434 ---------------
linux-user/m68k/syscallhdr.sh          |  32 ++
linux-user/microblaze/Makefile.objs    |   5 +
linux-user/microblaze/syscall.tbl      | 445 +++++++++++++++
linux-user/microblaze/syscall_nr.h     | 442 ---------------
linux-user/microblaze/syscallhdr.sh    |  32 ++
linux-user/mips/Makefile.objs          |   5 +
linux-user/mips/cpu_loop.c             | 440 +--------------
linux-user/mips/syscall-args-o32.c.inc | 436 +++++++++++++++
linux-user/mips/syscall_nr.h           | 425 ---------------
linux-user/mips/syscall_o32.tbl        | 427 +++++++++++++++
linux-user/mips/syscallhdr.sh          |  36 ++
linux-user/mips64/Makefile.objs        |  12 +
linux-user/mips64/syscall_n32.tbl      | 378 +++++++++++++
linux-user/mips64/syscall_n64.tbl      | 354 ++++++++++++
linux-user/mips64/syscall_nr.h         | 725 -------------------------
linux-user/mips64/syscallhdr.sh        |  33 ++
linux-user/mmap.c                      |   4 +
linux-user/nios2/syscall_nr.h          | 650 +++++++++++-----------
linux-user/openrisc/syscall_nr.h       | 309 +++--------
linux-user/ppc/Makefile.objs           |   6 +
linux-user/ppc/signal.c                |   2 +-
linux-user/ppc/syscall.tbl             | 521 ++++++++++++++++++
linux-user/ppc/syscall_nr.h            | 402 --------------
linux-user/ppc/syscallhdr.sh           |  34 ++
linux-user/riscv/syscall32_nr.h        | 295 ++++++++++
linux-user/riscv/syscall64_nr.h        | 301 ++++++++++
linux-user/riscv/syscall_nr.h          | 294 +---------
linux-user/s390x/Makefile.objs         |   5 +
linux-user/s390x/syscall.tbl           | 442 +++++++++++++++
linux-user/s390x/syscall_nr.h          | 398 --------------
linux-user/s390x/syscallhdr.sh         |  32 ++
linux-user/sh4/Makefile.objs           |   5 +
linux-user/sh4/syscall.tbl             | 442 +++++++++++++++
linux-user/sh4/syscall_nr.h            | 441 ---------------
linux-user/sh4/syscallhdr.sh           |  32 ++
linux-user/sparc/Makefile.objs         |   5 +
linux-user/sparc/syscall.tbl           | 485 +++++++++++++++++
linux-user/sparc/syscall_nr.h          | 363 -------------
linux-user/sparc/syscallhdr.sh         |  32 ++
linux-user/sparc64/Makefile.objs       |   5 +
linux-user/sparc64/syscall.tbl         | 485 +++++++++++++++++
linux-user/sparc64/syscall_nr.h        | 366 -------------
linux-user/sparc64/syscallhdr.sh       |  32 ++
linux-user/strace.c                    |  10 +-
linux-user/syscall.c                   | 178 +++++-
linux-user/x86_64/Makefile.objs        |   5 +
linux-user/x86_64/syscall_64.tbl       | 404 ++++++++++++++
linux-user/x86_64/syscall_nr.h         | 356 ------------
linux-user/x86_64/syscallhdr.sh        |  28 +
linux-user/xtensa/Makefile.objs        |   5 +
linux-user/xtensa/syscall.tbl          | 410 ++++++++++++++
linux-user/xtensa/syscall_nr.h         | 469 ----------------
linux-user/xtensa/syscallhdr.sh        |  32 ++
scripts/gensyscalls.sh                 | 102 ++++
scripts/update-mips-syscall-args.sh    |  57 ++
scripts/update-syscalltbl.sh           |  49 ++
target/i386/cpu.h                      |  12 +-
target/i386/translate.c                |  14 +-
85 files changed, 9665 insertions(+), 7904 deletions(-)
create mode 100644 linux-user/alpha/Makefile.objs
create mode 100644 linux-user/alpha/syscall.tbl
delete mode 100644 linux-user/alpha/syscall_nr.h
create mode 100644 linux-user/alpha/syscallhdr.sh
create mode 100644 linux-user/arm/Makefile.objs
create mode 100644 linux-user/arm/syscall.tbl
delete mode 100644 linux-user/arm/syscall_nr.h
create mode 100644 linux-user/arm/syscallhdr.sh
create mode 100644 linux-user/hppa/Makefile.objs
create mode 100644 linux-user/hppa/syscall.tbl
delete mode 100644 linux-user/hppa/syscall_nr.h
create mode 100644 linux-user/hppa/syscallhdr.sh
create mode 100644 linux-user/i386/Makefile.objs
create mode 100644 linux-user/i386/syscall_32.tbl
delete mode 100644 linux-user/i386/syscall_nr.h
create mode 100644 linux-user/i386/syscallhdr.sh
create mode 100644 linux-user/m68k/Makefile.objs
create mode 100644 linux-user/m68k/syscall.tbl
delete mode 100644 linux-user/m68k/syscall_nr.h
create mode 100644 linux-user/m68k/syscallhdr.sh
create mode 100644 linux-user/microblaze/Makefile.objs
create mode 100644 linux-user/microblaze/syscall.tbl
delete mode 100644 linux-user/microblaze/syscall_nr.h
create mode 100644 linux-user/microblaze/syscallhdr.sh
create mode 100644 linux-user/mips/Makefile.objs
create mode 100644 linux-user/mips/syscall-args-o32.c.inc
delete mode 100644 linux-user/mips/syscall_nr.h
create mode 100644 linux-user/mips/syscall_o32.tbl
create mode 100644 linux-user/mips/syscallhdr.sh
create mode 100644 linux-user/mips64/Makefile.objs
create mode 100644 linux-user/mips64/syscall_n32.tbl
create mode 100644 linux-user/mips64/syscall_n64.tbl
delete mode 100644 linux-user/mips64/syscall_nr.h
create mode 100644 linux-user/mips64/syscallhdr.sh
create mode 100644 linux-user/ppc/Makefile.objs
create mode 100644 linux-user/ppc/syscall.tbl
delete mode 100644 linux-user/ppc/syscall_nr.h
create mode 100644 linux-user/ppc/syscallhdr.sh
create mode 100644 linux-user/riscv/syscall32_nr.h
create mode 100644 linux-user/riscv/syscall64_nr.h
create mode 100644 linux-user/s390x/Makefile.objs
create mode 100644 linux-user/s390x/syscall.tbl
delete mode 100644 linux-user/s390x/syscall_nr.h
create mode 100755 linux-user/s390x/syscallhdr.sh
create mode 100644 linux-user/sh4/Makefile.objs
create mode 100644 linux-user/sh4/syscall.tbl
delete mode 100644 linux-user/sh4/syscall_nr.h
create mode 100644 linux-user/sh4/syscallhdr.sh
create mode 100644 linux-user/sparc/Makefile.objs
create mode 100644 linux-user/sparc/syscall.tbl
delete mode 100644 linux-user/sparc/syscall_nr.h
create mode 100644 linux-user/sparc/syscallhdr.sh
create mode 100644 linux-user/sparc64/Makefile.objs
create mode 100644 linux-user/sparc64/syscall.tbl
delete mode 100644 linux-user/sparc64/syscall_nr.h
create mode 100644 linux-user/sparc64/syscallhdr.sh
create mode 100644 linux-user/x86_64/Makefile.objs
create mode 100644 linux-user/x86_64/syscall_64.tbl
delete mode 100644 linux-user/x86_64/syscall_nr.h
create mode 100644 linux-user/x86_64/syscallhdr.sh
create mode 100644 linux-user/xtensa/Makefile.objs
create mode 100644 linux-user/xtensa/syscall.tbl
delete mode 100644 linux-user/xtensa/syscall_nr.h
create mode 100644 linux-user/xtensa/syscallhdr.sh
create mode 100755 scripts/gensyscalls.sh
create mode 100755 scripts/update-mips-syscall-args.sh
create mode 100755 scripts/update-syscalltbl.sh
[PULL v2 00/37] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
The following changes since commit 373c7068dd610e97f0b551b5a6d0a27cd6da4506:

  qemu.nsi: Install Sphinx documentation (2020-03-09 16:45:00 +0000)

are available in the Git repository at:

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

for you to fetch changes up to 85db278520fd800d8e8de9a527c8f0e1a962055e:

  linux-user, openrisc: sync syscall numbers with kernel v5.5 (2020-03-17 16:36:17 +0100)

----------------------------------------------------------------
update syscall numbers to linux 5.5 (with scripts)
add futex_time64/clock_gettime64/clock_settime64
add AT_EXECFN
Emulate x86_64 vsyscalls

v2: guard copy_to_user_timezone() with TARGET_NR_gettimeofday
    remove "Support futex_time64" patch
    guard sys_futex with TARGET_NR_exit

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

Alistair Francis (3):
  linux-user: Protect more syscalls
  linux-user/syscall: Add support for clock_gettime64/clock_settime64
  linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

Laurent Vivier (26):
  linux-user: fix socket() strace
  linux-user: introduce parameters to generate syscall_nr.h
  linux-user, alpha: add syscall table generation support
  linux-user, hppa: add syscall table generation support
  linux-user, m68k: add syscall table generation support
  linux-user, xtensa: add syscall table generation support
  linux-user, sh4: add syscall table generation support
  linux-user, microblaze: add syscall table generation support
  linux-user, arm: add syscall table generation support
  linux-user, ppc: add syscall table generation support
  linux-user, s390x: remove syscall definitions for !TARGET_S390X
  linux-user, s390x: add syscall table generation support
  linux-user, sparc, sparc64: add syscall table generation support
  linux-user, x86_64, i386: cleanup TARGET_NR_arch_prctl
  linux-user, i386: add syscall table generation support
  linux-user, x86_64: add syscall table generation support
  linux-user, mips: add syscall table generation support
  linux-user, mips64: add syscall table generation support
  linux-user, scripts: add a script to update syscall.tbl
  linux-user: update syscall.tbl from linux 0bf999f9c5e7
  linux-user,mips: move content of mips_syscall_args
  linux-user,mips: update syscall-args-o32.c.inc
  scripts: add a script to generate syscall_nr.h
  linux-user, aarch64: sync syscall numbers with kernel v5.5
  linux-user, nios2: sync syscall numbers with kernel v5.5
  linux-user, openrisc: sync syscall numbers with kernel v5.5

Lirong Yuan (2):
  linux-user: Add AT_EXECFN auxval
  linux-user: Update TASK_UNMAPPED_BASE for aarch64

Richard Henderson (5):
  target/i386: Renumber EXCP_SYSCALL
  linux-user/i386: Split out gen_signal
  linux-user/i386: Emulate x86_64 vsyscalls
  linux-user: Add x86_64 vsyscall page to /proc/self/maps
  linux-user: Flush out implementation of gettimeofday

Tobias Koch (1):
  linux-user: do prlimit selectively

 MAINTAINERS                            |   3 +
 Makefile.target                        |   3 +-
 configure                              |  35 ++
 linux-user/Makefile.objs               |  19 +-
 linux-user/aarch64/syscall_nr.h        |  34 +-
 linux-user/alpha/Makefile.objs         |   5 +
 linux-user/alpha/syscall.tbl           | 479 ++++++++++++++++
 linux-user/alpha/syscall_nr.h          | 492 -----------------
 linux-user/alpha/syscallhdr.sh         |  32 ++
 linux-user/arm/Makefile.objs           |   8 +
 linux-user/arm/syscall.tbl             | 453 +++++++++++++++
 linux-user/arm/syscall_nr.h            | 447 ---------------
 linux-user/arm/syscallhdr.sh           |  31 ++
 linux-user/elfload.c                   |   3 +-
 linux-user/hppa/Makefile.objs          |   5 +
 linux-user/hppa/syscall.tbl            | 437 +++++++++++++++
 linux-user/hppa/syscall_nr.h           | 358 ------------
 linux-user/hppa/syscallhdr.sh          |  32 ++
 linux-user/i386/Makefile.objs          |   5 +
 linux-user/i386/cpu_loop.c             | 201 +++++--
 linux-user/i386/syscall_32.tbl         | 444 +++++++++++++++
 linux-user/i386/syscall_nr.h           | 387 -------------
 linux-user/i386/syscallhdr.sh          |  28 +
 linux-user/i386/target_cpu.h           |   4 +-
 linux-user/m68k/Makefile.objs          |   5 +
 linux-user/m68k/syscall.tbl            | 439 +++++++++++++++
 linux-user/m68k/syscall_nr.h           | 434 ---------------
 linux-user/m68k/syscallhdr.sh          |  32 ++
 linux-user/microblaze/Makefile.objs    |   5 +
 linux-user/microblaze/syscall.tbl      | 445 +++++++++++++++
 linux-user/microblaze/syscall_nr.h     | 442 ---------------
 linux-user/microblaze/syscallhdr.sh    |  32 ++
 linux-user/mips/Makefile.objs          |   5 +
 linux-user/mips/cpu_loop.c             | 440 +--------------
 linux-user/mips/syscall-args-o32.c.inc | 436 +++++++++++++++
 linux-user/mips/syscall_nr.h           | 425 ---------------
 linux-user/mips/syscall_o32.tbl        | 427 +++++++++++++++
 linux-user/mips/syscallhdr.sh          |  36 ++
 linux-user/mips64/Makefile.objs        |  12 +
 linux-user/mips64/syscall_n32.tbl      | 378 +++++++++++++
 linux-user/mips64/syscall_n64.tbl      | 354 ++++++++++++
 linux-user/mips64/syscall_nr.h         | 725 -------------------------
 linux-user/mips64/syscallhdr.sh        |  33 ++
 linux-user/mmap.c                      |   4 +
 linux-user/nios2/syscall_nr.h          | 650 +++++++++++-----------
 linux-user/openrisc/syscall_nr.h       | 309 +++--------
 linux-user/ppc/Makefile.objs           |   6 +
 linux-user/ppc/signal.c                |   2 +-
 linux-user/ppc/syscall.tbl             | 521 ++++++++++++++++++
 linux-user/ppc/syscall_nr.h            | 402 --------------
 linux-user/ppc/syscallhdr.sh           |  34 ++
 linux-user/riscv/syscall32_nr.h        | 295 ++++++++++
 linux-user/riscv/syscall64_nr.h        | 301 ++++++++++
 linux-user/riscv/syscall_nr.h          | 294 +---------
 linux-user/s390x/Makefile.objs         |   5 +
 linux-user/s390x/syscall.tbl           | 442 +++++++++++++++
 linux-user/s390x/syscall_nr.h          | 398 --------------
 linux-user/s390x/syscallhdr.sh         |  32 ++
 linux-user/sh4/Makefile.objs           |   5 +
 linux-user/sh4/syscall.tbl             | 442 +++++++++++++++
 linux-user/sh4/syscall_nr.h            | 441 ---------------
 linux-user/sh4/syscallhdr.sh           |  32 ++
 linux-user/sparc/Makefile.objs         |   5 +
 linux-user/sparc/syscall.tbl           | 485 +++++++++++++++++
 linux-user/sparc/syscall_nr.h          | 363 -------------
 linux-user/sparc/syscallhdr.sh         |  32 ++
 linux-user/sparc64/Makefile.objs       |   5 +
 linux-user/sparc64/syscall.tbl         | 485 +++++++++++++++++
 linux-user/sparc64/syscall_nr.h        | 366 -------------
 linux-user/sparc64/syscallhdr.sh       |  32 ++
 linux-user/strace.c                    |  10 +-
 linux-user/syscall.c                   | 178 +++++-
 linux-user/x86_64/Makefile.objs        |   5 +
 linux-user/x86_64/syscall_64.tbl       | 404 ++++++++++++++
 linux-user/x86_64/syscall_nr.h         | 356 ------------
 linux-user/x86_64/syscallhdr.sh        |  28 +
 linux-user/xtensa/Makefile.objs        |   5 +
 linux-user/xtensa/syscall.tbl          | 410 ++++++++++++++
 linux-user/xtensa/syscall_nr.h         | 469 ----------------
 linux-user/xtensa/syscallhdr.sh        |  32 ++
 scripts/gensyscalls.sh                 | 102 ++++
 scripts/update-mips-syscall-args.sh    |  57 ++
 scripts/update-syscalltbl.sh           |  49 ++
 target/i386/cpu.h                      |  12 +-
 target/i386/translate.c                |  14 +-
 85 files changed, 9665 insertions(+), 7904 deletions(-)
 create mode 100644 linux-user/alpha/Makefile.objs
 create mode 100644 linux-user/alpha/syscall.tbl
 delete mode 100644 linux-user/alpha/syscall_nr.h
 create mode 100644 linux-user/alpha/syscallhdr.sh
 create mode 100644 linux-user/arm/Makefile.objs
 create mode 100644 linux-user/arm/syscall.tbl
 delete mode 100644 linux-user/arm/syscall_nr.h
 create mode 100644 linux-user/arm/syscallhdr.sh
 create mode 100644 linux-user/hppa/Makefile.objs
 create mode 100644 linux-user/hppa/syscall.tbl
 delete mode 100644 linux-user/hppa/syscall_nr.h
 create mode 100644 linux-user/hppa/syscallhdr.sh
 create mode 100644 linux-user/i386/Makefile.objs
 create mode 100644 linux-user/i386/syscall_32.tbl
 delete mode 100644 linux-user/i386/syscall_nr.h
 create mode 100644 linux-user/i386/syscallhdr.sh
 create mode 100644 linux-user/m68k/Makefile.objs
 create mode 100644 linux-user/m68k/syscall.tbl
 delete mode 100644 linux-user/m68k/syscall_nr.h
 create mode 100644 linux-user/m68k/syscallhdr.sh
 create mode 100644 linux-user/microblaze/Makefile.objs
 create mode 100644 linux-user/microblaze/syscall.tbl
 delete mode 100644 linux-user/microblaze/syscall_nr.h
 create mode 100644 linux-user/microblaze/syscallhdr.sh
 create mode 100644 linux-user/mips/Makefile.objs
 create mode 100644 linux-user/mips/syscall-args-o32.c.inc
 delete mode 100644 linux-user/mips/syscall_nr.h
 create mode 100644 linux-user/mips/syscall_o32.tbl
 create mode 100644 linux-user/mips/syscallhdr.sh
 create mode 100644 linux-user/mips64/Makefile.objs
 create mode 100644 linux-user/mips64/syscall_n32.tbl
 create mode 100644 linux-user/mips64/syscall_n64.tbl
 delete mode 100644 linux-user/mips64/syscall_nr.h
 create mode 100644 linux-user/mips64/syscallhdr.sh
 create mode 100644 linux-user/ppc/Makefile.objs
 create mode 100644 linux-user/ppc/syscall.tbl
 delete mode 100644 linux-user/ppc/syscall_nr.h
 create mode 100644 linux-user/ppc/syscallhdr.sh
 create mode 100644 linux-user/riscv/syscall32_nr.h
 create mode 100644 linux-user/riscv/syscall64_nr.h
 create mode 100644 linux-user/s390x/Makefile.objs
 create mode 100644 linux-user/s390x/syscall.tbl
 delete mode 100644 linux-user/s390x/syscall_nr.h
 create mode 100755 linux-user/s390x/syscallhdr.sh
 create mode 100644 linux-user/sh4/Makefile.objs
 create mode 100644 linux-user/sh4/syscall.tbl
 delete mode 100644 linux-user/sh4/syscall_nr.h
 create mode 100644 linux-user/sh4/syscallhdr.sh
 create mode 100644 linux-user/sparc/Makefile.objs
 create mode 100644 linux-user/sparc/syscall.tbl
 delete mode 100644 linux-user/sparc/syscall_nr.h
 create mode 100644 linux-user/sparc/syscallhdr.sh
 create mode 100644 linux-user/sparc64/Makefile.objs
 create mode 100644 linux-user/sparc64/syscall.tbl
 delete mode 100644 linux-user/sparc64/syscall_nr.h
 create mode 100644 linux-user/sparc64/syscallhdr.sh
 create mode 100644 linux-user/x86_64/Makefile.objs
 create mode 100644 linux-user/x86_64/syscall_64.tbl
 delete mode 100644 linux-user/x86_64/syscall_nr.h
 create mode 100644 linux-user/x86_64/syscallhdr.sh
 create mode 100644 linux-user/xtensa/Makefile.objs
 create mode 100644 linux-user/xtensa/syscall.tbl
 delete mode 100644 linux-user/xtensa/syscall_nr.h
 create mode 100644 linux-user/xtensa/syscallhdr.sh
 create mode 100755 scripts/gensyscalls.sh
 create mode 100755 scripts/update-mips-syscall-args.sh
 create mode 100755 scripts/update-syscalltbl.sh

-- 
2.24.1


Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Peter Maydell 4 years, 1 month ago
On Tue, 17 Mar 2020 at 16:05, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit 373c7068dd610e97f0b551b5a6d0a27cd6da4506:
>
>   qemu.nsi: Install Sphinx documentation (2020-03-09 16:45:00 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/linux-user-for-5.0-pull-request
>
> for you to fetch changes up to 85db278520fd800d8e8de9a527c8f0e1a962055e:
>
>   linux-user, openrisc: sync syscall numbers with kernel v5.5 (2020-03-17 16:36:17 +0100)
>
> ----------------------------------------------------------------
> update syscall numbers to linux 5.5 (with scripts)
> add futex_time64/clock_gettime64/clock_settime64
> add AT_EXECFN
> Emulate x86_64 vsyscalls
>
> v2: guard copy_to_user_timezone() with TARGET_NR_gettimeofday
>     remove "Support futex_time64" patch
>     guard sys_futex with TARGET_NR_exit
>
> ----------------------------------------------------------------

My set of "run ls for various architectures" linux-user tests
https://people.linaro.org/~peter.maydell/linux-user-test-pmm-20200114.tgz
fails with this pullreq:

e104462:bionic:linux-user-test-0.3$
/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
-L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting
RAX=000000000000003f RBX=000000006ffffe34 RCX=00000040008004c0
RDX=0000004000813180
RSI=0000000000000064 RDI=00000040007ffff0 RBP=000000006fffff40
RSP=00000040007fffe8
R8 =0000000000000000 R9 =00000040008004fe R10=0000004000801a18
R11=0000004000801260
R12=0000004000800240 R13=0000000000000008 R14=0000000000400040
R15=00000040008032d0
RIP=00000040008117e9 RFL=00000246 [---Z-P-] CPL=3 II=0 A20=1 SMM=0 HLT=0
ES =0000 0000000000000000 00000000 00000000
CS =0033 0000000000000000 ffffffff 00effb00 DPL=3 CS64 [-RA]
SS =002b 0000000000000000 ffffffff 00cff300 DPL=3 DS   [-WA]
DS =0000 0000000000000000 00000000 00000000
FS =0000 0000000000000000 00000000 00000000
GS =0000 0000000000000000 00000000 00000000
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT=     000000400091a000 0000007f
IDT=     0000004000919000 000001ff
CR0=80010001 CR2=0000000000000000 CR3=0000000000000000 CR4=00000220
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000500
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x602e5482


thanks
-- PMM

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Richard Henderson 4 years, 1 month ago
On 3/18/20 6:57 AM, Peter Maydell wrote:
> My set of "run ls for various architectures" linux-user tests
> https://people.linaro.org/~peter.maydell/linux-user-test-pmm-20200114.tgz
> fails with this pullreq:
> 
> e104462:bionic:linux-user-test-0.3$
> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
> -L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
> qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting


I replicated this on aarch64 host, with an existing build tree and merging in
the pull request.  It does not occur when building the same merged tree from
scratch.

I have no idea what the reason for this is.  Laurent suggested a file in the
build tree that is shadowed by one in the source tree, but to me that makes no
sense for this case:

It's target/i386/cpu.h that defines EXCP_SYSCALL (renumbered in this series
from 0x100 to 0x101), which is not in the build tree.  It is
linux-user/i386/cpu_loop.c that consumes EXCP_SYSCALL, and it is also not in
the build tree.

However, from the error message above, it's clear that cpu_loop.o has not been
rebuilt properly.


r~

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 18/03/2020 à 20:46, Richard Henderson a écrit :
> On 3/18/20 6:57 AM, Peter Maydell wrote:
>> My set of "run ls for various architectures" linux-user tests
>> https://people.linaro.org/~peter.maydell/linux-user-test-pmm-20200114.tgz
>> fails with this pullreq:
>>
>> e104462:bionic:linux-user-test-0.3$
>> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
>> -L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
>> qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting
> 
> 
> I replicated this on aarch64 host, with an existing build tree and merging in
> the pull request.  It does not occur when building the same merged tree from
> scratch.
> 
> I have no idea what the reason for this is.  Laurent suggested a file in the
> build tree that is shadowed by one in the source tree, but to me that makes no
> sense for this case:
> 
> It's target/i386/cpu.h that defines EXCP_SYSCALL (renumbered in this series
> from 0x100 to 0x101), which is not in the build tree.  It is
> linux-user/i386/cpu_loop.c that consumes EXCP_SYSCALL, and it is also not in
> the build tree.
> 
> However, from the error message above, it's clear that cpu_loop.o has not been
> rebuilt properly.
> 

In the series merged here syscall_nr.h are moved from source directory
to build directory.

The include path of the files is based on the dependecy files (*.d), and
to force the update of this path PATCH 13 removes all the .d files that
have a dependecy on the syscall_nr.h file in the source path.

This is added in configure:

--- a/configure
+++ b/configure
@@ -1887,6 +1887,17 @@ fi
 # Remove old dependency files to make sure that they get properly
regenerated
 rm -f */config-devices.mak.d

+# Remove syscall_nr.h to be sure they will be regenerated in the build
+# directory, not in the source directory
+for arch in ; do
+    # remove the file if it has been generated in the source directory
+    rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
+    # remove the dependency files
+    find . -name "*.d" \
+           -exec grep -q
"${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
+           -exec rm {} \;
+done
+
 if test -z "$python"
 then
     error_exit "Python not found. Use --python=/path/to/python"

For the use of the dependency see for instance PATCH 14:

--- a/configure
+++ b/configure
@@ -1889,7 +1889,7 @@ rm -f */config-devices.mak.d

 # Remove syscall_nr.h to be sure they will be regenerated in the build
 # directory, not in the source directory
-for arch in ; do
+for arch in alpha ; do
     # remove the file if it has been generated in the source directory
     rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
     # remove the dependency file
+++ b/linux-user/alpha/Makefile.objs
@@ -0,0 +1,5 @@
+generated-files-y += linux-user/alpha/syscall_nr.h
+
+syshdr := $(SRC_PATH)/linux-user/alpha/syscallhdr.sh
+%/syscall_nr.h: $(SRC_PATH)/linux-user/alpha/syscall.tbl $(syshdr)
+	$(call quiet-command, sh $(syshdr) $< $@ $(TARGET_SYSTBL_ABI),"GEN","$@")


%/syscall_nr.h is expanded with the absolute path found in the .d file.

Perhaps it removes a dependency that should trigger the rebuild of
cpu_loop.o?

Thanks,
Laurent

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Richard Henderson 4 years, 1 month ago
On 3/18/20 12:58 PM, Laurent Vivier wrote:
>> However, from the error message above, it's clear that cpu_loop.o has not been
>> rebuilt properly.
>>
> 
> In the series merged here syscall_nr.h are moved from source directory
> to build directory.
> 
> The include path of the files is based on the dependecy files (*.d), and
> to force the update of this path PATCH 13 removes all the .d files that
> have a dependecy on the syscall_nr.h file in the source path.
> 
> This is added in configure:
> 
> --- a/configure
> +++ b/configure
> @@ -1887,6 +1887,17 @@ fi
>  # Remove old dependency files to make sure that they get properly
> regenerated
>  rm -f */config-devices.mak.d
> 
> +# Remove syscall_nr.h to be sure they will be regenerated in the build
> +# directory, not in the source directory
> +for arch in ; do
> +    # remove the file if it has been generated in the source directory
> +    rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
> +    # remove the dependency files
> +    find . -name "*.d" \
> +           -exec grep -q
> "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
> +           -exec rm {} \;
> +done
...
> Perhaps it removes a dependency that should trigger the rebuild of
> cpu_loop.o?

Ah, yes indeed. It removes *all* dependencies for cpu_loop.o, so unless we
touch the cpu_loop.c source file, nothing gets done.

I think you're trying to be too fine grained here, since the *.o file has to go
away with the *.d file.  Why not just

  make ${arch}-linux-user/clean

?

r~

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 18/03/2020 à 21:17, Richard Henderson a écrit :
> On 3/18/20 12:58 PM, Laurent Vivier wrote:
>>> However, from the error message above, it's clear that cpu_loop.o has not been
>>> rebuilt properly.
>>>
>>
>> In the series merged here syscall_nr.h are moved from source directory
>> to build directory.
>>
>> The include path of the files is based on the dependecy files (*.d), and
>> to force the update of this path PATCH 13 removes all the .d files that
>> have a dependecy on the syscall_nr.h file in the source path.
>>
>> This is added in configure:
>>
>> --- a/configure
>> +++ b/configure
>> @@ -1887,6 +1887,17 @@ fi
>>  # Remove old dependency files to make sure that they get properly
>> regenerated
>>  rm -f */config-devices.mak.d
>>
>> +# Remove syscall_nr.h to be sure they will be regenerated in the build
>> +# directory, not in the source directory
>> +for arch in ; do
>> +    # remove the file if it has been generated in the source directory
>> +    rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
>> +    # remove the dependency files
>> +    find . -name "*.d" \
>> +           -exec grep -q
>> "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
>> +           -exec rm {} \;
>> +done
> ...
>> Perhaps it removes a dependency that should trigger the rebuild of
>> cpu_loop.o?
> 
> Ah, yes indeed. It removes *all* dependencies for cpu_loop.o, so unless we
> touch the cpu_loop.c source file, nothing gets done.
> 
> I think you're trying to be too fine grained here, since the *.o file has to go
> away with the *.d file.  Why not just
> 
>   make ${arch}-linux-user/clean
> 
> ?

The idea was to be able to bisect the series as the syscall_nr.h were
added incrementally without rebuilding all the files.

If I remove the loop in the configure where to add the "make
${arch}-linux-user/clean"?

Thanks,
Laurent


Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Richard Henderson 4 years, 1 month ago
On 3/18/20 1:23 PM, Laurent Vivier wrote:
> Le 18/03/2020 à 21:17, Richard Henderson a écrit :
>> On 3/18/20 12:58 PM, Laurent Vivier wrote:
>>>> However, from the error message above, it's clear that cpu_loop.o has not been
>>>> rebuilt properly.
>>>>
>>>
>>> In the series merged here syscall_nr.h are moved from source directory
>>> to build directory.
>>>
>>> The include path of the files is based on the dependecy files (*.d), and
>>> to force the update of this path PATCH 13 removes all the .d files that
>>> have a dependecy on the syscall_nr.h file in the source path.
>>>
>>> This is added in configure:
>>>
>>> --- a/configure
>>> +++ b/configure
>>> @@ -1887,6 +1887,17 @@ fi
>>>  # Remove old dependency files to make sure that they get properly
>>> regenerated
>>>  rm -f */config-devices.mak.d
>>>
>>> +# Remove syscall_nr.h to be sure they will be regenerated in the build
>>> +# directory, not in the source directory
>>> +for arch in ; do
>>> +    # remove the file if it has been generated in the source directory
>>> +    rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
>>> +    # remove the dependency files
>>> +    find . -name "*.d" \
>>> +           -exec grep -q
>>> "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
>>> +           -exec rm {} \;
>>> +done
>> ...
>>> Perhaps it removes a dependency that should trigger the rebuild of
>>> cpu_loop.o?
>>
>> Ah, yes indeed. It removes *all* dependencies for cpu_loop.o, so unless we
>> touch the cpu_loop.c source file, nothing gets done.
>>
>> I think you're trying to be too fine grained here, since the *.o file has to go
>> away with the *.d file.  Why not just
>>
>>   make ${arch}-linux-user/clean
>>
>> ?
> 
> The idea was to be able to bisect the series as the syscall_nr.h were
> added incrementally without rebuilding all the files.
> 
> If I remove the loop in the configure where to add the "make
> ${arch}-linux-user/clean"?

I don't know.  Can you get an exit status out of the find?

Another option might be

for f in $(find ${arch}-linux-user -name '*.d' \
           -exec grep -q ${arch_syscall} \
           -print); do
  rm -f $(basename $f .d).*
done

But frankly I don't care if all of every file gets rebuilt while bisecting, it
just needs to work.


r~

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 18/03/2020 à 21:42, Richard Henderson a écrit :
> On 3/18/20 1:23 PM, Laurent Vivier wrote:
>> Le 18/03/2020 à 21:17, Richard Henderson a écrit :
>>> On 3/18/20 12:58 PM, Laurent Vivier wrote:
>>>>> However, from the error message above, it's clear that cpu_loop.o has not been
>>>>> rebuilt properly.
>>>>>
>>>>
>>>> In the series merged here syscall_nr.h are moved from source directory
>>>> to build directory.
>>>>
>>>> The include path of the files is based on the dependecy files (*.d), and
>>>> to force the update of this path PATCH 13 removes all the .d files that
>>>> have a dependecy on the syscall_nr.h file in the source path.
>>>>
>>>> This is added in configure:
>>>>
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -1887,6 +1887,17 @@ fi
>>>>  # Remove old dependency files to make sure that they get properly
>>>> regenerated
>>>>  rm -f */config-devices.mak.d
>>>>
>>>> +# Remove syscall_nr.h to be sure they will be regenerated in the build
>>>> +# directory, not in the source directory
>>>> +for arch in ; do
>>>> +    # remove the file if it has been generated in the source directory
>>>> +    rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
>>>> +    # remove the dependency files
>>>> +    find . -name "*.d" \
>>>> +           -exec grep -q
>>>> "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
>>>> +           -exec rm {} \;
>>>> +done
>>> ...
>>>> Perhaps it removes a dependency that should trigger the rebuild of
>>>> cpu_loop.o?
>>>
>>> Ah, yes indeed. It removes *all* dependencies for cpu_loop.o, so unless we
>>> touch the cpu_loop.c source file, nothing gets done.
>>>
>>> I think you're trying to be too fine grained here, since the *.o file has to go
>>> away with the *.d file.  Why not just
>>>
>>>   make ${arch}-linux-user/clean
>>>
>>> ?
>>
>> The idea was to be able to bisect the series as the syscall_nr.h were
>> added incrementally without rebuilding all the files.
>>
>> If I remove the loop in the configure where to add the "make
>> ${arch}-linux-user/clean"?
> 
> I don't know.  Can you get an exit status out of the find?
> 
> Another option might be
> 
> for f in $(find ${arch}-linux-user -name '*.d' \
>            -exec grep -q ${arch_syscall} \
>            -print); do
>   rm -f $(basename $f .d).*
> done
> 
> But frankly I don't care if all of every file gets rebuilt while bisecting, it
> just needs to work.

ok, thank you for your help.

I'm going to resend the pull request without this series to have more
time to find a solution and to test it.

Thanks,
Laurent

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 18/03/2020 à 20:46, Richard Henderson a écrit :
> On 3/18/20 6:57 AM, Peter Maydell wrote:
>> My set of "run ls for various architectures" linux-user tests
>> https://people.linaro.org/~peter.maydell/linux-user-test-pmm-20200114.tgz
>> fails with this pullreq:
>>
>> e104462:bionic:linux-user-test-0.3$
>> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
>> -L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
>> qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting
> 
> 
> I replicated this on aarch64 host, with an existing build tree and merging in
> the pull request.  It does not occur when building the same merged tree from
> scratch.
> 
> I have no idea what the reason for this is.  Laurent suggested a file in the
> build tree that is shadowed by one in the source tree, but to me that makes no
> sense for this case:
> 
> It's target/i386/cpu.h that defines EXCP_SYSCALL (renumbered in this series
> from 0x100 to 0x101), which is not in the build tree.  It is
> linux-user/i386/cpu_loop.c that consumes EXCP_SYSCALL, and it is also not in
> the build tree.
> 
> However, from the error message above, it's clear that cpu_loop.o has not been
> rebuilt properly.
> 

I removed this series from the final pull request as the problem doesn't
seem related to change I made in configure.

I didn't find from where the problem comes.

Could you check if you are always able to reproduce the problem with master?

Thanks,
Laurent




Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Richard Henderson 4 years, 1 month ago
On 3/23/20 1:33 PM, Laurent Vivier wrote:
> Le 18/03/2020 à 20:46, Richard Henderson a écrit :
>> On 3/18/20 6:57 AM, Peter Maydell wrote:
>>> My set of "run ls for various architectures" linux-user tests
>>> https://people.linaro.org/~peter.maydell/linux-user-test-pmm-20200114.tgz
>>> fails with this pullreq:
>>>
>>> e104462:bionic:linux-user-test-0.3$
>>> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
>>> -L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
>>> qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting
>>
>>
>> I replicated this on aarch64 host, with an existing build tree and merging in
>> the pull request.  It does not occur when building the same merged tree from
>> scratch.
>>
>> I have no idea what the reason for this is.  Laurent suggested a file in the
>> build tree that is shadowed by one in the source tree, but to me that makes no
>> sense for this case:
>>
>> It's target/i386/cpu.h that defines EXCP_SYSCALL (renumbered in this series
>> from 0x100 to 0x101), which is not in the build tree.  It is
>> linux-user/i386/cpu_loop.c that consumes EXCP_SYSCALL, and it is also not in
>> the build tree.
>>
>> However, from the error message above, it's clear that cpu_loop.o has not been
>> rebuilt properly.
>>
> 
> I removed this series from the final pull request as the problem doesn't
> seem related to change I made in configure.
> 
> I didn't find from where the problem comes.
> 
> Could you check if you are always able to reproduce the problem with master?

I could not replicate it today with master at 787f82407c5.


r~

Re: [PULL v2 00/37] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 18/03/2020 à 14:57, Peter Maydell a écrit :
> On Tue, 17 Mar 2020 at 16:05, Laurent Vivier <laurent@vivier.eu> wrote:
>>
>> The following changes since commit 373c7068dd610e97f0b551b5a6d0a27cd6da4506:
>>
>>   qemu.nsi: Install Sphinx documentation (2020-03-09 16:45:00 +0000)
>>
>> are available in the Git repository at:
>>
>>   git://github.com/vivier/qemu.git tags/linux-user-for-5.0-pull-request
>>
>> for you to fetch changes up to 85db278520fd800d8e8de9a527c8f0e1a962055e:
>>
>>   linux-user, openrisc: sync syscall numbers with kernel v5.5 (2020-03-17 16:36:17 +0100)
>>
>> ----------------------------------------------------------------
>> update syscall numbers to linux 5.5 (with scripts)
>> add futex_time64/clock_gettime64/clock_settime64
>> add AT_EXECFN
>> Emulate x86_64 vsyscalls
>>
>> v2: guard copy_to_user_timezone() with TARGET_NR_gettimeofday
>>     remove "Support futex_time64" patch
>>     guard sys_futex with TARGET_NR_exit
>>
>> ----------------------------------------------------------------
> 
> My set of "run ls for various architectures" linux-user tests
> https://people.linaro.org/~peter.maydell/linux-user-test-pmm-20200114.tgz
> fails with this pullreq:
> 
> e104462:bionic:linux-user-test-0.3$
> /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
> -L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
> qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting
> RAX=000000000000003f RBX=000000006ffffe34 RCX=00000040008004c0
> RDX=0000004000813180
> RSI=0000000000000064 RDI=00000040007ffff0 RBP=000000006fffff40
> RSP=00000040007fffe8
> R8 =0000000000000000 R9 =00000040008004fe R10=0000004000801a18
> R11=0000004000801260
> R12=0000004000800240 R13=0000000000000008 R14=0000000000400040
> R15=00000040008032d0
> RIP=00000040008117e9 RFL=00000246 [---Z-P-] CPL=3 II=0 A20=1 SMM=0 HLT=0
> ES =0000 0000000000000000 00000000 00000000
> CS =0033 0000000000000000 ffffffff 00effb00 DPL=3 CS64 [-RA]
> SS =002b 0000000000000000 ffffffff 00cff300 DPL=3 DS   [-WA]
> DS =0000 0000000000000000 00000000 00000000
> FS =0000 0000000000000000 00000000 00000000
> GS =0000 0000000000000000 00000000 00000000
> LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
> TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
> GDT=     000000400091a000 0000007f
> IDT=     0000004000919000 000001ff
> CR0=80010001 CR2=0000000000000000 CR3=0000000000000000 CR4=00000220
> DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
> DR3=0000000000000000
> DR6=00000000ffff0ff0 DR7=0000000000000400
> EFER=0000000000000500
> qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x602e5482
> 

Is this x86 on x86?
I would say the problem is with the vsyscall patches.

Thanks,
Laurent