Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-m…
Browse files Browse the repository at this point in the history
…isc-180121-2' into staging

Testing, gdbstub and semihosting patches:

  - clean-ups to docker images
  - drop duplicate jobs from shippable
  - prettier tag generation (+gtags)
  - generate browsable source tree
  - more Travis->GitLab migrations
  - fix checkpatch to deal with commits
  - gate gdbstub tests on 8.3.1, expand tests
  - support Xfer:auxv:read gdb packet
  - better gdbstub cleanup
  - use GDB's SVE register layout
  - make arm-compat-semihosting common
  - add riscv semihosting support
  - add HEAPINFO, ELAPSED, TICKFREQ, TMPNAM and ISERROR to semihosting

# gpg: Signature made Mon 18 Jan 2021 10:09:11 GMT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-testing-and-misc-180121-2: (30 commits)
  semihosting: Implement SYS_ISERROR
  semihosting: Implement SYS_TMPNAM
  semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ
  riscv: Add semihosting support for user mode
  riscv: Add semihosting support
  semihosting: Support SYS_HEAPINFO when env->boot_info is not set
  semihosting: Change internal common-semi interfaces to use CPUState *
  semihosting: Change common-semi API to be architecture-independent
  semihosting: Move ARM semihosting code to shared directories
  target/arm: use official org.gnu.gdb.aarch64.sve layout for registers
  gdbstub: ensure we clean-up when terminated
  gdbstub: drop gdbserver_cleanup in favour of gdb_exit
  gdbstub: drop CPUEnv from gdb_exit()
  gdbstub: add support to Xfer:auxv:read: packet
  gdbstub: implement a softmmu based test
  Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test"
  configure: gate our use of GDB to 8.3.1 or above
  test/guest-debug: echo QEMU command as well
  scripts/checkpatch.pl: fix git-show invocation to include diffstat
  gitlab: migrate the minimal tools and unit tests from Travis
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

# Conflicts:
#	default-configs/targets/riscv32-linux-user.mak
#	default-configs/targets/riscv64-linux-user.mak
  • Loading branch information
pm215 committed Jan 18, 2021
2 parents 20b8016 + 767ba04 commit 8814b13
Show file tree
Hide file tree
Showing 64 changed files with 982 additions and 336 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -7,6 +7,9 @@
cscope.*
tags
TAGS
GPATH
GRTAGS
GTAGS
*~
*.ast_raw
*.depend_raw
30 changes: 24 additions & 6 deletions .gitlab-ci.yml
Expand Up @@ -79,7 +79,6 @@ build-system-ubuntu:
TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
moxie-softmmu microblazeel-softmmu mips64el-softmmu
MAKE_CHECK_ARGS: check-build
CONFIGURE_ARGS: --enable-docs
artifacts:
expire_in: 2 days
paths:
Expand Down Expand Up @@ -111,7 +110,6 @@ build-system-debian:
TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
MAKE_CHECK_ARGS: check-build
CONFIGURE_ARGS: --enable-docs
artifacts:
expire_in: 2 days
paths:
Expand All @@ -126,6 +124,19 @@ check-system-debian:
IMAGE: debian-amd64
MAKE_CHECK_ARGS: check

# No targets are built here, just tools, docs, and unit tests. This
# also feeds into the eventual documentation deployment steps later
build-tools-and-docs-debian:
<<: *native_build_job_definition
variables:
IMAGE: debian-amd64
MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
artifacts:
expire_in: 2 days
paths:
- build

acceptance-system-debian:
<<: *native_test_job_definition
needs:
Expand Down Expand Up @@ -596,14 +607,21 @@ build-libvhost-user:
- meson
- ninja

# Prepare for GitLab pages deployment. Anything copied into the
# "public" directory will be deployed to $USER.gitlab.io/$PROJECT
pages:
image: $CI_REGISTRY_IMAGE/qemu/ubuntu2004:latest
image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
stage: test
needs:
- job: build-system-ubuntu
artifacts: true
- job: build-tools-and-docs-debian
script:
- mkdir public
- mkdir -p public
# HTML-ised source tree
- make gtags
- htags -anT --tree-view=filetree -m qemu_init
-t "Welcome to the QEMU sourcecode"
- mv HTML public/src
# Project documentation
- mv build/docs/index.html public/
- for i in devel interop specs system tools user ; do mv build/docs/$i public/ ; done
artifacts:
Expand Down
14 changes: 1 addition & 13 deletions .shippable.yml
Expand Up @@ -7,20 +7,8 @@ env:
matrix:
- IMAGE=debian-amd64
TARGET_LIST=x86_64-softmmu,x86_64-linux-user
- IMAGE=debian-armel-cross
TARGET_LIST=arm-softmmu,arm-linux-user,armeb-linux-user
- IMAGE=debian-armhf-cross
TARGET_LIST=arm-softmmu,arm-linux-user,armeb-linux-user
- IMAGE=debian-arm64-cross
TARGET_LIST=aarch64-softmmu,aarch64-linux-user
- IMAGE=debian-s390x-cross
TARGET_LIST=s390x-softmmu,s390x-linux-user
- IMAGE=debian-mips-cross
TARGET_LIST=mips-softmmu,mipsel-linux-user
- IMAGE=debian-mips64el-cross
TARGET_LIST=mips64el-softmmu,mips64el-linux-user
- IMAGE=debian-ppc64el-cross
TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
TARGET_LIST=mips-softmmu
build:
pre_ci_boot:
image_name: registry.gitlab.com/qemu-project/qemu/qemu/${IMAGE}
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml
Expand Up @@ -119,15 +119,6 @@ after_script:

jobs:
include:
# Just build tools and run minimal unit and softfloat checks
- name: "GCC check-unit and check-softfloat"
env:
- BASE_CONFIG="--enable-tools"
- CONFIG="--disable-user --disable-system"
- TEST_CMD="make check-unit check-softfloat -j${JOBS}"
- CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"


# --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
- name: "GCC debug (main-softmmu)"
env:
Expand All @@ -148,22 +139,6 @@ jobs:
- CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"


# Check we can build docs and tools (out of tree)
- name: "tools and docs (bionic)"
dist: bionic
env:
- BUILD_DIR="out-of-tree/build/dir" SRC_DIR="../../.."
- BASE_CONFIG="--enable-tools --enable-docs"
- CONFIG="--target-list=x86_64-softmmu,aarch64-linux-user"
- CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
addons:
apt:
packages:
- ninja-build
- python3-sphinx
- perl


# Test with Clang for compile portability (Travis uses clang-5.0)
- name: "Clang (user)"
env:
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Expand Up @@ -2322,6 +2322,7 @@ R: Philippe Mathieu-Daudé <philmd@redhat.com>
S: Maintained
F: gdbstub*
F: gdb-xml/
F: tests/tcg/multiarch/gdbstub/

Memory API
M: Paolo Bonzini <pbonzini@redhat.com>
Expand Down Expand Up @@ -2736,6 +2737,7 @@ Yank feature
M: Lukas Straub <lukasstraub2@web.de>
S: Odd fixes
F: util/yank.c
F: stubs/yank.c
F: include/qemu/yank.h
F: qapi/yank.json

Expand Down
46 changes: 38 additions & 8 deletions Makefile
Expand Up @@ -250,19 +250,49 @@ find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o \( -name

.PHONY: ctags
ctags:
rm -f "$(SRC_PATH)/"tags
$(find-src-path) -exec ctags -f "$(SRC_PATH)/"tags --append {} +
$(call quiet-command, \
rm -f "$(SRC_PATH)/"tags, \
"CTAGS", "Remove old tags")
$(call quiet-command, \
$(find-src-path) -exec ctags \
-f "$(SRC_PATH)/"tags --append {} +, \
"CTAGS", "Re-index $(SRC_PATH)")

.PHONY: gtags
gtags:
$(call quiet-command, \
rm -f "$(SRC_PATH)/"GTAGS; \
rm -f "$(SRC_PATH)/"GRTAGS; \
rm -f "$(SRC_PATH)/"GPATH, \
"GTAGS", "Remove old $@ files")
$(call quiet-command, \
(cd $(SRC_PATH) && \
$(find-src-path) | gtags -f -), \
"GTAGS", "Re-index $(SRC_PATH)")

.PHONY: TAGS
TAGS:
rm -f "$(SRC_PATH)/"TAGS
$(find-src-path) -exec etags -f "$(SRC_PATH)/"TAGS --append {} +
$(call quiet-command, \
rm -f "$(SRC_PATH)/"TAGS, \
"TAGS", "Remove old $@")
$(call quiet-command, \
$(find-src-path) -exec etags \
-f "$(SRC_PATH)/"TAGS --append {} +, \
"TAGS", "Re-index $(SRC_PATH)")

.PHONY: cscope
cscope:
rm -f "$(SRC_PATH)"/cscope.*
$(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
cscope -b -i"$(SRC_PATH)/cscope.files" -f"$(SRC_PATH)"/cscope.out
$(call quiet-command, \
rm -f "$(SRC_PATH)/"cscope.* , \
"cscope", "Remove old $@ files")
$(call quiet-command, \
($(find-src-path) -print | sed -e 's,^\./,,' \
> "$(SRC_PATH)/cscope.files"), \
"cscope", "Create file list")
$(call quiet-command, \
cscope -b -i"$(SRC_PATH)/cscope.files" \
-f"$(SRC_PATH)"/cscope.out, \
"cscope", "Re-index $(SRC_PATH)")

# Needed by "meson install"
export DESTDIR
Expand All @@ -279,7 +309,7 @@ help:
$(call print-help,all,Build all)
$(call print-help,dir/file.o,Build specified target only)
$(call print-help,install,Install QEMU, documentation and tools)
$(call print-help,ctags/TAGS,Generate tags file for editors)
$(call print-help,ctags/gtags/TAGS,Generate tags file for editors)
$(call print-help,cscope,Generate cscope index)
$(call print-help,sparse,Run sparse on the QEMU source)
@echo ''
Expand Down
6 changes: 3 additions & 3 deletions bsd-user/syscall.c
Expand Up @@ -333,7 +333,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef CONFIG_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
gdb_exit(arg1);
qemu_plugin_atexit_cb();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
Expand Down Expand Up @@ -435,7 +435,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef CONFIG_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
gdb_exit(arg1);
qemu_plugin_atexit_cb();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
Expand Down Expand Up @@ -514,7 +514,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef CONFIG_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
gdb_exit(arg1);
qemu_plugin_atexit_cb();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
Expand Down
7 changes: 5 additions & 2 deletions configure
Expand Up @@ -6166,8 +6166,11 @@ if test "$plugins" = "yes" ; then
fi
fi

if test -n "$gdb_bin" ; then
echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak
if test -n "$gdb_bin"; then
gdb_version=$($gdb_bin --version | head -n 1)
if version_ge ${gdb_version##* } 8.3.1; then
echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak
fi
fi

if test "$secret_keyring" = "yes" ; then
Expand Down
1 change: 1 addition & 0 deletions default-configs/devices/arm-softmmu.mak
Expand Up @@ -42,4 +42,5 @@ CONFIG_FSL_IMX25=y
CONFIG_FSL_IMX7=y
CONFIG_FSL_IMX6UL=y
CONFIG_SEMIHOSTING=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
CONFIG_ALLWINNER_H3=y
2 changes: 2 additions & 0 deletions default-configs/devices/riscv32-softmmu.mak
Expand Up @@ -3,6 +3,8 @@
# Uncomment the following lines to disable these optional devices:
#
#CONFIG_PCI_DEVICES=n
CONFIG_SEMIHOSTING=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y

# Boards:
#
Expand Down
2 changes: 2 additions & 0 deletions default-configs/devices/riscv64-softmmu.mak
Expand Up @@ -3,6 +3,8 @@
# Uncomment the following lines to disable these optional devices:
#
#CONFIG_PCI_DEVICES=n
CONFIG_SEMIHOSTING=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y

# Boards:
#
Expand Down
1 change: 1 addition & 0 deletions default-configs/targets/aarch64-linux-user.mak
Expand Up @@ -2,3 +2,4 @@ TARGET_ARCH=aarch64
TARGET_BASE_ARCH=arm
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
TARGET_HAS_BFLT=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
1 change: 1 addition & 0 deletions default-configs/targets/aarch64_be-linux-user.mak
Expand Up @@ -3,3 +3,4 @@ TARGET_BASE_ARCH=arm
TARGET_WORDS_BIGENDIAN=y
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
TARGET_HAS_BFLT=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
1 change: 1 addition & 0 deletions default-configs/targets/arm-linux-user.mak
Expand Up @@ -3,3 +3,4 @@ TARGET_SYSTBL_ABI=common,oabi
TARGET_SYSTBL=syscall.tbl
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
TARGET_HAS_BFLT=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
1 change: 1 addition & 0 deletions default-configs/targets/armeb-linux-user.mak
Expand Up @@ -4,3 +4,4 @@ TARGET_SYSTBL=syscall.tbl
TARGET_WORDS_BIGENDIAN=y
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
TARGET_HAS_BFLT=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
1 change: 1 addition & 0 deletions default-configs/targets/riscv32-linux-user.mak
Expand Up @@ -2,3 +2,4 @@ TARGET_ARCH=riscv32
TARGET_BASE_ARCH=riscv
TARGET_ABI_DIR=riscv
TARGET_XML_FILES= gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-32bit-virtual.xml
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
1 change: 1 addition & 0 deletions default-configs/targets/riscv64-linux-user.mak
Expand Up @@ -2,3 +2,4 @@ TARGET_ARCH=riscv64
TARGET_BASE_ARCH=riscv
TARGET_ABI_DIR=riscv
TARGET_XML_FILES= gdb-xml/riscv-64bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xml/riscv-64bit-fpu.xml gdb-xml/riscv-64bit-virtual.xml
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y

0 comments on commit 8814b13

Please sign in to comment.