qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH  v1 0/3] semihosting/next (move from hw, heapinfo)
@ 2021-03-05 13:54 Alex Bennée
  2021-03-05 13:54 ` [PATCH v1 1/3] semihosting: Move include/hw/semihosting/ -> include/semihosting/ Alex Bennée
                   ` (2 more replies)
  0 siblings, 3 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-05 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Hi,

Not much in this series apart from moving semihosting out of hw (where
it sat a bit weirdly) and an attempt at fixing a bug in the
SYS_HEAPINFO code. It works AFAICT but still seems a little fugly to
me. See:

 - semihosting/arg-compat: fix up handling of SYS_HEAPINFO

Alex Bennée (1):
  semihosting/arg-compat: fix up handling of SYS_HEAPINFO

Philippe Mathieu-Daudé (2):
  semihosting: Move include/hw/semihosting/ -> include/semihosting/
  semihosting: Move hw/semihosting/ -> semihosting/

 meson.build                                   |   1 +
 include/{hw => }/semihosting/console.h        |   0
 include/{hw => }/semihosting/semihost.h       |   0
 {hw/semihosting => semihosting}/common-semi.h |   0
 tests/tcg/arm/semicall.h                      |   1 +
 gdbstub.c                                     |   2 +-
 hw/mips/malta.c                               |   2 +-
 linux-user/aarch64/cpu_loop.c                 |   2 +-
 linux-user/arm/cpu_loop.c                     |   2 +-
 linux-user/riscv/cpu_loop.c                   |   2 +-
 linux-user/semihost.c                         |   2 +-
 .../arm-compat-semi.c                         | 135 ++++++++++--------
 {hw/semihosting => semihosting}/config.c      |   2 +-
 {hw/semihosting => semihosting}/console.c     |   4 +-
 softmmu/vl.c                                  |   2 +-
 stubs/semihost.c                              |   2 +-
 target/arm/helper.c                           |   4 +-
 target/arm/m_helper.c                         |   4 +-
 target/arm/translate-a64.c                    |   2 +-
 target/arm/translate.c                        |   2 +-
 target/lm32/helper.c                          |   2 +-
 target/m68k/op_helper.c                       |   2 +-
 target/mips/cpu.c                             |   2 +-
 target/mips/mips-semi.c                       |   4 +-
 target/mips/translate.c                       |   2 +-
 target/nios2/helper.c                         |   2 +-
 target/riscv/cpu_helper.c                     |   2 +-
 target/unicore32/helper.c                     |   2 +-
 target/xtensa/translate.c                     |   2 +-
 target/xtensa/xtensa-semi.c                   |   2 +-
 tests/tcg/arm/semihosting.c                   |  34 ++++-
 Kconfig                                       |   1 +
 MAINTAINERS                                   |   4 +-
 hw/Kconfig                                    |   1 -
 hw/meson.build                                |   1 -
 {hw/semihosting => semihosting}/Kconfig       |   0
 {hw/semihosting => semihosting}/meson.build   |   0
 37 files changed, 142 insertions(+), 92 deletions(-)
 rename include/{hw => }/semihosting/console.h (100%)
 rename include/{hw => }/semihosting/semihost.h (100%)
 rename {hw/semihosting => semihosting}/common-semi.h (100%)
 rename {hw/semihosting => semihosting}/arm-compat-semi.c (94%)
 rename {hw/semihosting => semihosting}/config.c (99%)
 rename {hw/semihosting => semihosting}/console.c (98%)
 rename {hw/semihosting => semihosting}/Kconfig (100%)
 rename {hw/semihosting => semihosting}/meson.build (100%)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [PULL for 6.0 00/22] various fixes (kernel-doc, semihosting, testing)
@ 2021-03-24 14:29 Alex Bennée
  2021-03-24 14:30 ` [PULL 01/22] scripts/kernel-doc: strip QEMU_ from function definitions Alex Bennée
                   ` (23 more replies)
  0 siblings, 24 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-24 14:29 UTC (permalink / raw)
  To: peter.maydell; +Cc: Alex Bennée, qemu-devel

The following changes since commit 01874b15d36e3f9a3506c47941a92ccf8d8bed98:

  Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20210323' into staging (2021-03-24 11:22:08 +0000)

are available in the Git repository at:

  https://github.com/stsquad/qemu.git tags/pull-6.0-rc0-fixed-240321-1

for you to fetch changes up to a9eb2df27f117bbac9f370bf8cb79532005f19c2:

  gitlab: default to not building the documentation (2021-03-24 14:25:48 +0000)

----------------------------------------------------------------
Various fixes for 6.0:

  - include kernel-doc API reference for plugins
  - fix semihosting SYS_HEAPINFO
  - various tweaks to improve CI runtime
  - more stroz fixes
  - fix iotest CI regressions

----------------------------------------------------------------
Alex Bennée (11):
      scripts/kernel-doc: strip QEMU_ from function definitions
      docs/devel: include the plugin API information from the headers
      docs/devel: expand style section of memory management
      tools/virtiofsd: include --socket-group in help
      semihosting: move semihosting tests to multiarch
      semihosting/arm-compat-semi: unify GET/SET_ARG helpers
      semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO
      linux-user/riscv: initialise the TaskState heap/stack info
      tests/tcg: add HeapInfo checking to semihosting test
      gitlab: extend timeouts for CFI builds
      gitlab: default to not building the documentation

Eric Blake (2):
      utils: Tighter tests for qemu_strtosz
      utils: Work around mingw strto*l bug with 0x

Laurent Vivier (6):
      qdev: define list of archs with virtio-pci or virtio-ccw
      m68k: add the virtio devices aliases
      blockdev: with -drive if=virtio, use generic virtio-blk
      iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"
      iotests: test m68k with the virt machine
      iotests: iothreads need ioeventfd

Thomas Huth (3):
      gitlab-ci.yml: Merge the trace-backend testing into other jobs
      configure: Don't use the __atomic_*_16 functions for testing 128-bit support
      cirrus.yml: Update the FreeBSD task to version 12.2

 docs/devel/style.rst                               |  46 ++++--
 docs/devel/tcg-plugins.rst                         |   5 +
 configure                                          |   6 +-
 include/sysemu/arch_init.h                         |   9 ++
 tests/tcg/aarch64/semicall.h                       |  18 +++
 tests/tcg/arm/semicall.h                           |  15 +-
 tests/tcg/riscv64/semicall.h                       |  22 +++
 blockdev.c                                         |   6 +-
 linux-user/riscv/cpu_loop.c                        |   5 +
 semihosting/arm-compat-semi.c                      |  62 +++-----
 softmmu/qdev-monitor.c                             |  65 ++++----
 tests/tcg/arm/semihosting.c                        |  26 ----
 .../arm-compat-semi}/semiconsole.c                 |   2 +
 tests/tcg/multiarch/arm-compat-semi/semihosting.c  |  82 ++++++++++
 tests/unit/test-cutils.c                           | 171 ++++++++++++++++++++-
 tools/virtiofsd/fuse_lowlevel.c                    |   1 +
 util/cutils.c                                      |  33 ++--
 .cirrus.yml                                        |   7 +-
 .gitlab-ci.d/crossbuilds.yml                       |  15 +-
 .gitlab-ci.yml                                     |  43 ++----
 MAINTAINERS                                        |   1 +
 scripts/kernel-doc                                 |   3 +
 tests/qemu-iotests/040                             |   2 +-
 tests/qemu-iotests/051                             |  12 +-
 tests/qemu-iotests/051.out                         |   2 +-
 tests/qemu-iotests/051.pc.out                      |   2 +-
 tests/qemu-iotests/068                             |   4 +-
 tests/qemu-iotests/093                             |   3 +-
 tests/qemu-iotests/127                             |   3 +-
 tests/qemu-iotests/139                             |   9 +-
 tests/qemu-iotests/182                             |  13 +-
 tests/qemu-iotests/238                             |   4 +-
 tests/qemu-iotests/240                             |  10 +-
 tests/qemu-iotests/256                             |   6 +-
 tests/qemu-iotests/257                             |   4 +-
 tests/qemu-iotests/307                             |   4 +-
 tests/qemu-iotests/common.rc                       |  13 ++
 tests/qemu-iotests/iotests.py                      |  10 +-
 tests/qemu-iotests/testenv.py                      |   1 +
 tests/tcg/Makefile.target                          |   3 +
 tests/tcg/aarch64/Makefile.target                  |  18 ---
 tests/tcg/arm/Makefile.target                      |  22 ++-
 tests/tcg/multiarch/Makefile.target                |  31 ++++
 43 files changed, 548 insertions(+), 271 deletions(-)
 create mode 100644 tests/tcg/aarch64/semicall.h
 create mode 100644 tests/tcg/riscv64/semicall.h
 delete mode 100644 tests/tcg/arm/semihosting.c
 rename tests/tcg/{arm => multiarch/arm-compat-semi}/semiconsole.c (93%)
 create mode 100644 tests/tcg/multiarch/arm-compat-semi/semihosting.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [PATCH for 6.0 v2 00/22] fixes for rc1 pre-PR (kernel-doc, semihosting, testing)
@ 2021-03-23 16:52 Alex Bennée
  2021-03-23 16:52 ` [PATCH v2 01/22] scripts/kernel-doc: strip QEMU_ from function definitions Alex Bennée
                   ` (23 more replies)
  0 siblings, 24 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-23 16:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Hi,

I've added a testing patch to extend the CFI times, Laurent's series
to fix the iotest regressions currently keeping the CI from going
green and an optimisation to the --enable-docs build to try and start
bringing the total CI time down a bit. rc0 is being tagged today so
I'll probably roll a PR from this later in the week in time for rc1.

The following are still need review:

 - tests/tcg: add HeapInfo checking to semihosting test

Alex Bennée (11):
  scripts/kernel-doc: strip QEMU_ from function definitions
  docs/devel: include the plugin API information from the headers
  docs/devel: expand style section of memory management
  tools/virtiofsd: include --socket-group in help
  semihosting: move semihosting tests to multiarch
  semihosting/arm-compat-semi: unify GET/SET_ARG helpers
  semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO
  linux-user/riscv: initialise the TaskState heap/stack info
  tests/tcg: add HeapInfo checking to semihosting test
  gitlab: extend timeouts for CFI builds
  gitlab: default to not building the documentation

Eric Blake (2):
  utils: Tighter tests for qemu_strtosz
  utils: Work around mingw strto*l bug with 0x

Laurent Vivier (6):
  qdev: define list of archs with virtio-pci or virtio-ccw
  m68k: add the virtio devices aliases
  blockdev: with -drive if=virtio, use generic virtio-blk
  iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182"
  iotests: test m68k with the virt machine
  iotests: iothreads need ioeventfd

Thomas Huth (3):
  gitlab-ci.yml: Merge the trace-backend testing into other jobs
  configure: Don't use the __atomic_*_16 functions for testing 128-bit
    support
  cirrus.yml: Update the FreeBSD task to version 12.2

 docs/devel/style.rst                          |  46 +++--
 docs/devel/tcg-plugins.rst                    |   5 +
 configure                                     |   6 +-
 include/sysemu/arch_init.h                    |   9 +
 tests/tcg/aarch64/semicall.h                  |  18 ++
 tests/tcg/arm/semicall.h                      |  15 +-
 tests/tcg/riscv64/semicall.h                  |  22 +++
 blockdev.c                                    |   6 +-
 linux-user/riscv/cpu_loop.c                   |   5 +
 semihosting/arm-compat-semi.c                 |  62 +++----
 softmmu/qdev-monitor.c                        |  65 ++++---
 tests/tcg/arm/semihosting.c                   |  26 ---
 .../arm-compat-semi}/semiconsole.c            |   2 +
 .../multiarch/arm-compat-semi/semihosting.c   |  82 +++++++++
 tests/unit/test-cutils.c                      | 171 +++++++++++++++++-
 tools/virtiofsd/fuse_lowlevel.c               |   1 +
 util/cutils.c                                 |  33 +++-
 .cirrus.yml                                   |   7 +-
 .gitlab-ci.d/crossbuilds.yml                  |  15 +-
 .gitlab-ci.yml                                |  43 ++---
 MAINTAINERS                                   |   1 +
 scripts/kernel-doc                            |   3 +
 tests/qemu-iotests/040                        |   2 +-
 tests/qemu-iotests/051                        |  12 +-
 tests/qemu-iotests/051.out                    |   2 +-
 tests/qemu-iotests/051.pc.out                 |   2 +-
 tests/qemu-iotests/068                        |   4 +-
 tests/qemu-iotests/093                        |   3 +-
 tests/qemu-iotests/127                        |   3 +-
 tests/qemu-iotests/139                        |   9 +-
 tests/qemu-iotests/182                        |  13 +-
 tests/qemu-iotests/238                        |   4 +-
 tests/qemu-iotests/240                        |  10 +-
 tests/qemu-iotests/256                        |   6 +-
 tests/qemu-iotests/257                        |   4 +-
 tests/qemu-iotests/307                        |   4 +-
 tests/qemu-iotests/common.rc                  |  13 ++
 tests/qemu-iotests/iotests.py                 |  10 +-
 tests/qemu-iotests/testenv.py                 |   1 +
 tests/tcg/Makefile.target                     |   3 +
 tests/tcg/aarch64/Makefile.target             |  18 --
 tests/tcg/arm/Makefile.target                 |  22 +--
 tests/tcg/multiarch/Makefile.target           |  31 ++++
 43 files changed, 548 insertions(+), 271 deletions(-)
 create mode 100644 tests/tcg/aarch64/semicall.h
 create mode 100644 tests/tcg/riscv64/semicall.h
 delete mode 100644 tests/tcg/arm/semihosting.c
 rename tests/tcg/{arm => multiarch/arm-compat-semi}/semiconsole.c (93%)
 create mode 100644 tests/tcg/multiarch/arm-compat-semi/semihosting.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [PATCH for 6.0 v1 00/14] fixes for rc1 (kernel-doc, semihosting, testing)
@ 2021-03-20 13:36 Alex Bennée
  2021-03-20 13:36 ` [PATCH v1 01/14] scripts/kernel-doc: strip QEMU_ from function definitions Alex Bennée
                   ` (14 more replies)
  0 siblings, 15 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-20 13:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Hi,

Here is my current collection of fixes for rc1. We have a couple of
documentation tweaks including the final bit of enabling work for the
plugin API to be included via kernel-doc. We have some semihosting
fixes which have been on the list before which just need the final bit
of review. Finally there is a selection of tweaks for CI issues which
hopefully get BSD (and Cirrus) up and running again.

The following still need review:

 - tests/tcg: add HeapInfo checking to semihosting test
 - linux-user/riscv: initialise the TaskState heap/stack info
 - semihosting: move semihosting tests to multiarch
 - docs/devel: expand style section of memory management
 - scripts/kernel-doc: strip QEMU_ from function definitions

Alex Bennée (9):
  scripts/kernel-doc: strip QEMU_ from function definitions
  docs/devel: include the plugin API information from the headers
  docs/devel: expand style section of memory management
  tools/virtiofsd: include --socket-group in help
  semihosting: move semihosting tests to multiarch
  semihosting/arm-compat-semi: unify GET/SET_ARG helpers
  semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO
  linux-user/riscv: initialise the TaskState heap/stack info
  tests/tcg: add HeapInfo checking to semihosting test

Eric Blake (2):
  utils: Tighter tests for qemu_strtosz
  utils: Work around mingw strto*l bug with 0x

Thomas Huth (3):
  gitlab-ci.yml: Merge the trace-backend testing into other jobs
  configure: Don't use the __atomic_*_16 functions for testing 128-bit
    support
  cirrus.yml: Update the FreeBSD task to version 12.2

 docs/devel/style.rst                          |  46 +++--
 docs/devel/tcg-plugins.rst                    |   5 +
 configure                                     |   6 +-
 tests/tcg/aarch64/semicall.h                  |  18 ++
 tests/tcg/arm/semicall.h                      |  15 +-
 tests/tcg/riscv64/semicall.h                  |  22 +++
 linux-user/riscv/cpu_loop.c                   |   5 +
 semihosting/arm-compat-semi.c                 |  62 +++----
 tests/tcg/arm/semihosting.c                   |  26 ---
 .../arm-compat-semi}/semiconsole.c            |   2 +
 .../multiarch/arm-compat-semi/semihosting.c   |  71 ++++++++
 tests/unit/test-cutils.c                      | 171 +++++++++++++++++-
 tools/virtiofsd/fuse_lowlevel.c               |   1 +
 util/cutils.c                                 |  33 +++-
 .cirrus.yml                                   |   7 +-
 .gitlab-ci.yml                                |  30 +--
 MAINTAINERS                                   |   1 +
 scripts/kernel-doc                            |   3 +
 tests/tcg/Makefile.target                     |   3 +
 tests/tcg/aarch64/Makefile.target             |  18 --
 tests/tcg/arm/Makefile.target                 |  22 +--
 tests/tcg/multiarch/Makefile.target           |  31 ++++
 22 files changed, 430 insertions(+), 168 deletions(-)
 create mode 100644 tests/tcg/aarch64/semicall.h
 create mode 100644 tests/tcg/riscv64/semicall.h
 delete mode 100644 tests/tcg/arm/semihosting.c
 rename tests/tcg/{arm => multiarch/arm-compat-semi}/semiconsole.c (93%)
 create mode 100644 tests/tcg/multiarch/arm-compat-semi/semihosting.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [PATCH  v5 0/5] semihosting/next (SYS_HEAPINFO)
@ 2021-03-12 10:20 Alex Bennée
  2021-03-12 10:20 ` [PATCH v5 1/5] semihosting: move semihosting tests to multiarch Alex Bennée
                   ` (4 more replies)
  0 siblings, 5 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-12 10:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, keithp, qemu-arm, qemu-riscv

Hi,

Change from the last version include tweaking the test to be a little
less asnprintf heavy and also don't rely on brk() to do it's job. It
also threw up a linux-user failure for RiscV which didn't have the
needed TaskState info set. The series now applies cleanly to master.

The following patches need review:

 - tests/tcg: add HeapInfo checking to semihosting test
 - linux-user/riscv: initialise the TaskState heap/stack info
 - semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO
 - semihosting: move semihosting tests to multiarch

Alex Bennée (5):
  semihosting: move semihosting tests to multiarch
  semihosting/arm-compat-semi: unify GET/SET_ARG helpers
  semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO
  linux-user/riscv: initialise the TaskState heap/stack info
  tests/tcg: add HeapInfo checking to semihosting test

 tests/tcg/aarch64/semicall.h                  | 18 +++++
 tests/tcg/arm/semicall.h                      | 15 +---
 tests/tcg/riscv64/semicall.h                  | 22 ++++++
 linux-user/riscv/cpu_loop.c                   |  5 ++
 semihosting/arm-compat-semi.c                 | 62 +++++++---------
 tests/tcg/arm/semihosting.c                   | 26 -------
 .../arm-compat-semi}/semiconsole.c            |  2 +
 .../multiarch/arm-compat-semi/semihosting.c   | 71 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 tests/tcg/Makefile.target                     |  3 +
 tests/tcg/aarch64/Makefile.target             | 18 -----
 tests/tcg/arm/Makefile.target                 | 16 +----
 tests/tcg/multiarch/Makefile.target           | 31 ++++++++
 13 files changed, 180 insertions(+), 110 deletions(-)
 create mode 100644 tests/tcg/aarch64/semicall.h
 create mode 100644 tests/tcg/riscv64/semicall.h
 delete mode 100644 tests/tcg/arm/semihosting.c
 rename tests/tcg/{arm => multiarch/arm-compat-semi}/semiconsole.c (93%)
 create mode 100644 tests/tcg/multiarch/arm-compat-semi/semihosting.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [PATCH  v3 0/4] semihosting/next (SYS_HEAPINFO)
@ 2021-03-09 17:21 Alex Bennée
  2021-03-09 17:21 ` [PATCH v3 1/4] semihosting: move semihosting tests to multiarch Alex Bennée
                   ` (3 more replies)
  0 siblings, 4 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-09 17:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: keithp, Alex Bennée

Hi,

Hopefully the final revision, instead of hacking about args to
reverted to the orignal code (with minor tweaks for args). Still based
on my in-flight PR:

  pull-testing-docs-xen-updates-080321-1

which already moves the semihosting code out of hw/. Please review:

 - tests/tcg: add HeapInfo checking to semihosting test
 - semihosting/arm-compat-semi: deref parameter register for SYS_HEAPINFO
 - semihosting/arm-compat-semi: unify GET/SET_ARG helpers
 - semihosting: move semihosting tests to multiarch


Alex Bennée (4):
  semihosting: move semihosting tests to multiarch
  semihosting/arm-compat-semi: unify GET/SET_ARG helpers
  semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO
  tests/tcg: add HeapInfo checking to semihosting test

 tests/tcg/aarch64/semicall.h                  | 18 ++++++
 tests/tcg/arm/semicall.h                      | 15 +----
 tests/tcg/riscv64/semicall.h                  | 22 +++++++
 semihosting/arm-compat-semi.c                 | 62 +++++++------------
 tests/tcg/arm/semihosting.c                   | 26 --------
 .../arm-compat-semi}/semiconsole.c            |  2 +
 .../multiarch/arm-compat-semi/semihosting.c   | 62 +++++++++++++++++++
 tests/tcg/Makefile.target                     |  3 +
 tests/tcg/aarch64/Makefile.target             | 18 ------
 tests/tcg/arm/Makefile.target                 | 16 +----
 tests/tcg/multiarch/Makefile.target           | 31 ++++++++++
 11 files changed, 165 insertions(+), 110 deletions(-)
 create mode 100644 tests/tcg/aarch64/semicall.h
 create mode 100644 tests/tcg/riscv64/semicall.h
 delete mode 100644 tests/tcg/arm/semihosting.c
 rename tests/tcg/{arm => multiarch/arm-compat-semi}/semiconsole.c (93%)
 create mode 100644 tests/tcg/multiarch/arm-compat-semi/semihosting.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [PATCH  v2 0/4] semihosting/next (SYS_HEAPINFO fix)
@ 2021-03-09 14:17 Alex Bennée
  2021-03-09 14:17 ` [PATCH v2 1/4] semihosting: move semihosting tests to multiarch Alex Bennée
                   ` (3 more replies)
  0 siblings, 4 replies; 149+ messages in thread
From: Alex Bennée @ 2021-03-09 14:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: keithp, Alex Bennée

Hi,

OK I took another tilt at fixing the SYS_HEAPINFO bug with a lot less
code motion and also expanding the tcg tests. Currently based on my
in-flight PR:

  pull-testing-docs-xen-updates-080321-1

which already moves the semihosting code out of hw/. Please review:

 - tests/tcg: add HeapInfo checking to semihosting test
 - semihosting/arm-compat-semi: deref parameter register for SYS_HEAPINFO
 - semihosting/arm-compat-semi: unify GET/SET_ARG helpers
 - semihosting: move semihosting tests to multiarch


Alex Bennée (4):
  semihosting: move semihosting tests to multiarch
  semihosting/arm-compat-semi: unify GET/SET_ARG helpers
  semihosting/arm-compat-semi: deref parameter register for SYS_HEAPINFO
  tests/tcg: add HeapInfo checking to semihosting test

 tests/tcg/aarch64/semicall.h                  | 18 ++++++
 tests/tcg/arm/semicall.h                      | 15 +----
 tests/tcg/riscv64/semicall.h                  | 22 +++++++
 semihosting/arm-compat-semi.c                 | 56 ++++++-----------
 tests/tcg/arm/semihosting.c                   | 26 --------
 .../arm-compat-semi}/semiconsole.c            |  2 +
 .../multiarch/arm-compat-semi/semihosting.c   | 62 +++++++++++++++++++
 tests/tcg/Makefile.target                     |  3 +
 tests/tcg/aarch64/Makefile.target             | 18 ------
 tests/tcg/arm/Makefile.target                 | 16 +----
 tests/tcg/multiarch/Makefile.target           | 31 ++++++++++
 11 files changed, 161 insertions(+), 108 deletions(-)
 create mode 100644 tests/tcg/aarch64/semicall.h
 create mode 100644 tests/tcg/riscv64/semicall.h
 delete mode 100644 tests/tcg/arm/semihosting.c
 rename tests/tcg/{arm => multiarch/arm-compat-semi}/semiconsole.c (93%)
 create mode 100644 tests/tcg/multiarch/arm-compat-semi/semihosting.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 149+ messages in thread
* [Bug 1915925] [NEW] ARM semihosting HEAPINFO results wrote to wrong address
@ 2021-02-17 12:19 iNvEr7
  2021-02-17 14:50 ` [Bug 1915925] " Peter Maydell
                   ` (7 more replies)
  0 siblings, 8 replies; 149+ messages in thread
From: iNvEr7 @ 2021-02-17 12:19 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

This affects latest development branch of QEMU.

According to the ARM spec of the HEAPINFO semihosting call:

https://developer.arm.com/documentation/100863/0300/Semihosting-
operations/SYS-HEAPINFO--0x16-?lang=en

> the PARAMETER REGISTER contains the address of a pointer to a four-
field data block.

However, QEMU treated the PARAMETER REGISTER as pointing to a four-field
data block directly.

Here is a simple program that can demonstrate this problem:
https://github.com/iNvEr7/qemu-learn/tree/newlib-bug/semihosting-newlib

This code links with newlib with semihosting mode, which will call the
HEAPINFO SVC during crt0 routine. When running in QEMU (make run), it
may crash the program either because of invalid write or memory
curruption, depending on the compiled program structure.

Also refer to my discussion with newlib folks:
https://sourceware.org/pipermail/newlib/2021/018260.html

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: semihosting

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1915925

Title:
  ARM semihosting HEAPINFO results wrote to wrong address

Status in QEMU:
  New

Bug description:
  This affects latest development branch of QEMU.

  According to the ARM spec of the HEAPINFO semihosting call:

  https://developer.arm.com/documentation/100863/0300/Semihosting-
  operations/SYS-HEAPINFO--0x16-?lang=en

  > the PARAMETER REGISTER contains the address of a pointer to a four-
  field data block.

  However, QEMU treated the PARAMETER REGISTER as pointing to a four-
  field data block directly.

  Here is a simple program that can demonstrate this problem:
  https://github.com/iNvEr7/qemu-learn/tree/newlib-bug/semihosting-
  newlib

  This code links with newlib with semihosting mode, which will call the
  HEAPINFO SVC during crt0 routine. When running in QEMU (make run), it
  may crash the program either because of invalid write or memory
  curruption, depending on the compiled program structure.

  Also refer to my discussion with newlib folks:
  https://sourceware.org/pipermail/newlib/2021/018260.html

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1915925/+subscriptions


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

end of thread, other threads:[~2021-04-30  9:04 UTC | newest]

Thread overview: 149+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 13:54 [PATCH v1 0/3] semihosting/next (move from hw, heapinfo) Alex Bennée
2021-03-05 13:54 ` [PATCH v1 1/3] semihosting: Move include/hw/semihosting/ -> include/semihosting/ Alex Bennée
2021-03-05 13:54 ` [PATCH v1 2/3] semihosting: Move hw/semihosting/ -> semihosting/ Alex Bennée
2021-03-05 13:54 ` [PATCH v1 3/3] semihosting/arg-compat: fix up handling of SYS_HEAPINFO Alex Bennée
2021-03-05 13:54   ` [Bug 1915925] " Alex Bennée
2021-03-05 14:10   ` Peter Maydell
2021-03-05 14:10     ` [Bug 1915925] " Peter Maydell
2021-03-05 20:22     ` Keith Packard via
2021-03-05 20:22       ` [Bug 1915925] " Keith Packard
2021-03-05 22:54       ` Peter Maydell
2021-03-05 22:54         ` [Bug 1915925] " Peter Maydell
2021-03-05 23:54         ` Keith Packard via
2021-03-05 23:54           ` [Bug 1915925] " Keith Packard
2021-03-06  1:27           ` Richard Henderson
2021-03-06 14:07           ` Peter Maydell
2021-03-06 14:07             ` [Bug 1915925] " Peter Maydell
2021-03-06 16:54             ` Keith Packard via
2021-03-06 16:54               ` [Bug 1915925] " Keith Packard
2021-03-08 10:09               ` Peter Maydell
2021-03-08 10:09                 ` [Bug 1915925] " Peter Maydell
2021-03-08 13:36                 ` Alistair Francis
2021-03-08 17:28                   ` Keith Packard via
2021-03-08 17:28                     ` [Bug 1915925] " Keith Packard
2021-03-05 20:19   ` Keith Packard via
2021-03-05 20:19     ` [Bug 1915925] " Keith Packard
  -- strict thread matches above, loose matches on Subject: below --
2021-03-24 14:29 [PULL for 6.0 00/22] various fixes (kernel-doc, semihosting, testing) Alex Bennée
2021-03-24 14:30 ` [PULL 01/22] scripts/kernel-doc: strip QEMU_ from function definitions Alex Bennée
2021-03-24 14:30 ` [PULL 02/22] docs/devel: include the plugin API information from the headers Alex Bennée
2021-03-24 14:30 ` [PULL 03/22] docs/devel: expand style section of memory management Alex Bennée
2021-03-24 14:30 ` [PULL 04/22] tools/virtiofsd: include --socket-group in help Alex Bennée
2021-03-24 14:30 ` [PULL 05/22] semihosting: move semihosting tests to multiarch Alex Bennée
2021-03-24 14:30 ` [PULL 06/22] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Alex Bennée
2021-03-24 14:30 ` [PULL 07/22] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Alex Bennée
2021-03-24 14:30   ` [Bug 1915925] " Alex Bennée
2021-03-24 14:30 ` [PULL 08/22] linux-user/riscv: initialise the TaskState heap/stack info Alex Bennée
2021-03-24 14:30 ` [PULL 09/22] tests/tcg: add HeapInfo checking to semihosting test Alex Bennée
2021-03-24 14:30 ` [PULL 10/22] gitlab-ci.yml: Merge the trace-backend testing into other jobs Alex Bennée
2021-03-24 14:30 ` [PULL 11/22] configure: Don't use the __atomic_*_16 functions for testing 128-bit support Alex Bennée
2021-03-24 14:30 ` [PULL 12/22] cirrus.yml: Update the FreeBSD task to version 12.2 Alex Bennée
2021-03-24 14:30 ` [PULL 13/22] utils: Tighter tests for qemu_strtosz Alex Bennée
2021-03-24 14:30 ` [PULL 14/22] utils: Work around mingw strto*l bug with 0x Alex Bennée
2021-03-24 14:30 ` [PULL 15/22] gitlab: extend timeouts for CFI builds Alex Bennée
2021-03-24 14:30 ` [PULL 16/22] qdev: define list of archs with virtio-pci or virtio-ccw Alex Bennée
2021-03-24 14:30 ` [PULL 17/22] m68k: add the virtio devices aliases Alex Bennée
2021-03-24 14:30 ` [PULL 18/22] blockdev: with -drive if=virtio, use generic virtio-blk Alex Bennée
2021-03-24 14:30 ` [PULL 19/22] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Alex Bennée
2021-03-24 14:30 ` [PULL 20/22] iotests: test m68k with the virt machine Alex Bennée
2021-03-24 14:30 ` [PULL 21/22] iotests: iothreads need ioeventfd Alex Bennée
2021-03-24 14:30 ` [PULL 22/22] gitlab: default to not building the documentation Alex Bennée
2021-03-24 14:57 ` [PULL for 6.0 00/22] various fixes (kernel-doc, semihosting, testing) no-reply
2021-03-24 17:41 ` Peter Maydell
2021-03-23 16:52 [PATCH for 6.0 v2 00/22] fixes for rc1 pre-PR " Alex Bennée
2021-03-23 16:52 ` [PATCH v2 01/22] scripts/kernel-doc: strip QEMU_ from function definitions Alex Bennée
2021-03-23 16:52 ` [PATCH v2 02/22] docs/devel: include the plugin API information from the headers Alex Bennée
2021-03-23 16:52 ` [PATCH v2 03/22] docs/devel: expand style section of memory management Alex Bennée
2021-03-23 16:52 ` [PATCH v2 04/22] tools/virtiofsd: include --socket-group in help Alex Bennée
2021-03-23 16:52 ` [PATCH v2 05/22] semihosting: move semihosting tests to multiarch Alex Bennée
2021-03-23 16:52 ` [PATCH v2 06/22] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Alex Bennée
2021-03-23 16:52 ` [PATCH v2 07/22] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Alex Bennée
2021-03-23 16:52   ` [Bug 1915925] " Alex Bennée
2021-03-23 16:52 ` [PATCH v2 08/22] linux-user/riscv: initialise the TaskState heap/stack info Alex Bennée
2021-03-23 21:29   ` Alistair Francis
2021-03-23 16:52 ` [PATCH v2 09/22] tests/tcg: add HeapInfo checking to semihosting test Alex Bennée
2021-03-24  6:11   ` Thomas Huth
2021-03-24 14:09   ` Richard Henderson
2021-03-23 16:52 ` [PATCH v2 10/22] gitlab-ci.yml: Merge the trace-backend testing into other jobs Alex Bennée
2021-03-23 16:52 ` [PATCH v2 11/22] configure: Don't use the __atomic_*_16 functions for testing 128-bit support Alex Bennée
2021-03-23 16:52 ` [PATCH v2 12/22] cirrus.yml: Update the FreeBSD task to version 12.2 Alex Bennée
2021-03-23 16:52 ` [PATCH v2 13/22] utils: Tighter tests for qemu_strtosz Alex Bennée
2021-03-23 16:53 ` [PATCH v2 14/22] utils: Work around mingw strto*l bug with 0x Alex Bennée
2021-03-23 16:53 ` [PATCH v2 15/22] gitlab: extend timeouts for CFI builds Alex Bennée
2021-03-23 16:53 ` [PATCH v2 16/22] qdev: define list of archs with virtio-pci or virtio-ccw Alex Bennée
2021-03-23 16:53 ` [PATCH v2 17/22] m68k: add the virtio devices aliases Alex Bennée
2021-03-23 16:53 ` [PATCH v2 18/22] blockdev: with -drive if=virtio, use generic virtio-blk Alex Bennée
2021-03-23 16:53 ` [PATCH v2 19/22] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Alex Bennée
2021-03-23 16:53 ` [PATCH v2 20/22] iotests: test m68k with the virt machine Alex Bennée
2021-03-23 16:53 ` [PATCH v2 21/22] iotests: iothreads need ioeventfd Alex Bennée
2021-03-23 16:53 ` [PATCH v2 22/22] gitlab: default to not building the documentation Alex Bennée
2021-03-23 18:21 ` [PATCH for 6.0 v2 00/22] fixes for rc1 pre-PR (kernel-doc, semihosting, testing) no-reply
2021-03-24 13:40 ` Peter Maydell
2021-03-24 14:22   ` Alex Bennée
2021-03-24 15:58     ` Peter Maydell
2021-03-20 13:36 [PATCH for 6.0 v1 00/14] fixes for rc1 " Alex Bennée
2021-03-20 13:36 ` [PATCH v1 01/14] scripts/kernel-doc: strip QEMU_ from function definitions Alex Bennée
2021-03-20 16:04   ` Richard Henderson
2021-03-20 13:36 ` [PATCH v1 02/14] docs/devel: include the plugin API information from the headers Alex Bennée
2021-03-20 13:36 ` [PATCH v1 03/14] docs/devel: expand style section of memory management Alex Bennée
2021-03-20 16:00   ` Richard Henderson
2021-03-20 13:36 ` [PATCH v1 04/14] tools/virtiofsd: include --socket-group in help Alex Bennée
2021-03-22 11:46   ` Stefan Hajnoczi
2021-03-20 13:36 ` [PATCH v1 05/14] semihosting: move semihosting tests to multiarch Alex Bennée
2021-03-20 16:03   ` Richard Henderson
2021-03-20 13:36 ` [PATCH v1 06/14] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Alex Bennée
2021-03-20 13:36 ` [PATCH v1 07/14] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Alex Bennée
2021-03-20 13:36   ` [Bug 1915925] " Alex Bennée
2021-03-20 13:37 ` [PATCH v1 08/14] linux-user/riscv: initialise the TaskState heap/stack info Alex Bennée
2021-03-20 16:05   ` Richard Henderson
2021-03-20 13:37 ` [PATCH v1 09/14] tests/tcg: add HeapInfo checking to semihosting test Alex Bennée
2021-03-20 16:11   ` Richard Henderson
2021-03-20 13:37 ` [PATCH v1 10/14] gitlab-ci.yml: Merge the trace-backend testing into other jobs Alex Bennée
2021-03-22 17:03   ` Willian Rampazzo
2021-03-20 13:37 ` [PATCH v1 11/14] configure: Don't use the __atomic_*_16 functions for testing 128-bit support Alex Bennée
2021-03-20 13:37 ` [PATCH v1 12/14] cirrus.yml: Update the FreeBSD task to version 12.2 Alex Bennée
2021-03-20 13:37 ` [PATCH v1 13/14] utils: Tighter tests for qemu_strtosz Alex Bennée
2021-03-20 13:37 ` [PATCH v1 14/14] utils: Work around mingw strto*l bug with 0x Alex Bennée
2021-03-20 13:54 ` [PATCH for 6.0 v1 00/14] fixes for rc1 (kernel-doc, semihosting, testing) no-reply
2021-03-12 10:20 [PATCH v5 0/5] semihosting/next (SYS_HEAPINFO) Alex Bennée
2021-03-12 10:20 ` [PATCH v5 1/5] semihosting: move semihosting tests to multiarch Alex Bennée
2021-03-12 10:20 ` [PATCH v5 2/5] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Alex Bennée
2021-03-12 10:20 ` [PATCH v5 3/5] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Alex Bennée
2021-03-12 10:20   ` [Bug 1915925] " Alex Bennée
2021-03-12 10:32   ` Peter Maydell
2021-03-12 10:32     ` [Bug 1915925] " Peter Maydell
2021-03-12 10:20 ` [PATCH v5 4/5] linux-user/riscv: initialise the TaskState heap/stack info Alex Bennée
2021-03-12 10:20 ` [PATCH v5 5/5] tests/tcg: add HeapInfo checking to semihosting test Alex Bennée
2021-03-12 10:35   ` Peter Maydell
2021-03-12 11:23     ` Alex Bennée
2021-03-12 11:27       ` Peter Maydell
2021-03-12 14:08         ` Alex Bennée
2021-03-09 17:21 [PATCH v3 0/4] semihosting/next (SYS_HEAPINFO) Alex Bennée
2021-03-09 17:21 ` [PATCH v3 1/4] semihosting: move semihosting tests to multiarch Alex Bennée
2021-03-09 17:21 ` [PATCH v3 2/4] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Alex Bennée
2021-03-09 17:21 ` [PATCH v3 4/4] tests/tcg: add HeapInfo checking to semihosting test Alex Bennée
2021-03-11 13:32 ` [PATCH v3 0/4] semihosting/next (SYS_HEAPINFO) Peter Maydell
2021-03-11 20:05   ` Alex Bennée
2021-03-09 14:17 [PATCH v2 0/4] semihosting/next (SYS_HEAPINFO fix) Alex Bennée
2021-03-09 14:17 ` [PATCH v2 1/4] semihosting: move semihosting tests to multiarch Alex Bennée
2021-03-09 14:17 ` [PATCH v2 2/4] semihosting/arm-compat-semi: unify GET/SET_ARG helpers Alex Bennée
2021-03-09 16:33   ` Peter Maydell
2021-03-09 17:02   ` Keith Packard via
2021-03-09 17:24     ` Alex Bennée
2021-03-09 14:17 ` [PATCH v2 3/4] semihosting/arm-compat-semi: deref parameter register for SYS_HEAPINFO Alex Bennée
2021-03-09 14:17   ` [Bug 1915925] " Alex Bennée
2021-03-09 16:35   ` [Bug 1915925] " Peter Maydell
2021-03-09 16:35     ` Peter Maydell
2021-03-09 17:01     ` Alex Bennée
2021-03-09 17:01       ` [Bug 1915925] " Alex Bennée
2021-03-09 14:17 ` [PATCH v2 4/4] tests/tcg: add HeapInfo checking to semihosting test Alex Bennée
2021-03-09 17:08   ` Keith Packard via
2021-02-17 12:19 [Bug 1915925] [NEW] ARM semihosting HEAPINFO results wrote to wrong address iNvEr7
2021-02-17 14:50 ` [Bug 1915925] " Peter Maydell
2021-02-17 15:03 ` Peter Maydell
2021-02-17 16:13 ` Philippe Mathieu-Daudé
2021-03-05 13:33 ` Alex Bennée
2021-03-09 17:21 ` [Bug 1915925] [PATCH v3 3/4] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Alex Bennée
2021-03-09 17:21   ` Alex Bennée
2021-03-15 12:46 ` [Bug 1915925] Re: ARM semihosting HEAPINFO results wrote to wrong address Alex Bennée
2021-03-25 11:47 ` Alex Bennée
2021-04-30  8:54 ` Thomas Huth

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