misc doc and testing fixes
cover misc doc and testing fixes
Hi,
As we approach release I'm just bundling up my random fixes for 4.2 into one tree for each release candidate. This has a minor fix for debugging vm builds and a number of minor documentation fixes including moving the MTTCG docs across to rst format. The final patch is a tweak to Travis to drop the 32 bit targets from MAIN_SOFTMMU_TARGETS. This may be too controversial although the 32 bit targets still get built and tested under GCC.
Please review.
Alex Bennée (5):
tests/vm: make --interactive (and therefore DEBUG=1) unconditional docs/devel: rename plugins.rst to tcg-plugins.rst docs/devel: update tcg-plugins.rst with API versioning details docs/devel: convert multi-thread-tcg to a .rst document .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
docs/devel/index.rst | 3 +-
...ti-thread-tcg.txt => multi-thread-tcg.rst} | 28 ++++++++++++-------
docs/devel/{plugins.rst => tcg-plugins.rst} | 27 ++++++++++++++----
.travis.yml | 2 +-
MAINTAINERS | 1 +
tests/vm/basevm.py | 2 +-
6 files changed, 44 insertions(+), 19 deletions(-)
rename docs/devel/{multi-thread-tcg.txt => multi-thread-tcg.rst} (96%)
rename docs/devel/{plugins.rst => tcg-plugins.rst} (83%)Signature · 1 line
2.20.1
PATCH 1/5 tests/vm: make --interactive (and therefore DEBUG=1) unconditional
While the concept of only dropping to ssh if a test fails is nice it is more useful for this to be unconditional. You usually just want to get the build up and running and then noodle around debugging or attempting to replicate.
---
v2
- fix spelling
--- tests/vm/basevm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/vm/basevm.py +1 -1
@@ -403,7 +403,7 @@ def main(vmcls): exitcode = 0 if vm.ssh(*cmd) != 0: exitcode = 3 - if exitcode != 0 and args.interactive: + if args.interactive: vm.ssh() if not args.snapshot:
Signature · 1 line
2.20.1
Re: [PATCH v1 1/5] tests/vm: make --interactive (and therefore DEBUG=1) unconditional
Quoted 21 lines · Alex Bennée
While the concept of only dropping to ssh if a test fails is nice it is more useful for this to be unconditional. You usually just want to get the build up and running and then noodle around debugging or attempting to replicate.
Cc Peter Maydell <[email protected]>Signed-off-by Alex Bennée <[email protected]>---
v2
- fix spelling--- tests/vm/basevm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/vm/basevm.py +0
-0
tests/vm/basevm.py def main(vmcls): · line 409
Quoted 8 lines
tests/vm/basevm.py +1
-1@@ -403,7 +403,7 @@ def main(vmcls): exitcode = 0 if vm.ssh(*cmd) != 0: exitcode = 3 - if exitcode != 0 and args.interactive: + if args.interactive: vm.ssh() if not args.snapshot:
PATCH 2/5 docs/devel: rename plugins.rst to tcg-plugins.rst
In reply to Alex BennéeThis makes it a bit clearer what this is about.
---
docs/devel/index.rst | 2 +-
docs/devel/{plugins.rst => tcg-plugins.rst} | 0
MAINTAINERS | 1 +
3 files changed, 2 insertions(+), 1 deletion(-)
rename docs/devel/{plugins.rst => tcg-plugins.rst} (100%)docs/devel/index.rst +1 -1
@@ -22,4 +22,4 @@ Contents: decodetree secure-coding-practices tcg - plugins + tcg-plugins
docs/devel/tcg-plugins.rst renamed from docs/devel/plugins.rst +0 -0
MAINTAINERS +1 -0
@@ -2369,6 +2369,7 @@ F: tcg/ TCG Plugins M: Alex Bennée <[email protected]> S: Maintained +F: docs/devel/tcg-plugins.rst F: plugins/ F: tests/plugin
Signature · 1 line
2.20.1
Re: [PATCH v1 2/5] docs/devel: rename plugins.rst to tcg-plugins.rst
Quoted 29 lines · Alex Bennée
This makes it a bit clearer what this is about.
Signed-off-by Alex Bennée <[email protected]>--- docs/devel/index.rst | 2 +- docs/devel/{plugins.rst => tcg-plugins.rst} | 0 MAINTAINERS | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)rename
docs/devel/{plugins.rst=>tcg-plugins.rst} (100%)docs/devel/index.rst +1
-1@@ -22,4 +22,4 @@ Contents: decodetree secure-coding-practices tcg - plugins + tcg-pluginsdocs/devel/tcg-plugins.rst renamed from docs/devel/plugins.rst +0
-0MAINTAINERS +0
-0
MAINTAINERS F: tcg/ · line 2373
Quoted 5 lines
MAINTAINERS +1
-0@@ -2369,6 +2369,7 @@ F: tcg/ TCG Plugins M: Alex Bennée <[email protected]> S: Maintained +F: docs/devel/tcg-plugins.rst F: plugins/
What about (other patch):
plugins/ -> tcg/plugins/
MAINTAINERS F: tcg/ · line 2374
Quoted 1 line
MAINTAINERS +0
-0F: tests/plugin
tests/plugin/ -> tests/tcg/plugins/
Anyway for this patch:
Re: [PATCH v1 2/5] docs/devel: rename plugins.rst to tcg-plugins.rst
Quoted 7 lines
What about (other patch):
plugins/ -> tcg/plugins/
Quoted 1 line
F: tests/plugin
tests/plugin/ -> tests/tcg/plugins/
tests/tcg is for code that runs on the target in general, but perhaps tests/tcg-plugins would make sense.
Paolo
PATCH 3/5 docs/devel: update tcg-plugins.rst with API versioning details
In reply to Alex BennéeWhile we are at it fix up the quoted code sections with the inline ::
approach.
---
v2
- fix grammar
- mention we also will fail to load outside the range
- clean-up code sections
--- docs/devel/tcg-plugins.rst | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-)
docs/devel/tcg-plugins.rst +21 -6
@@ -25,6 +25,23 @@ process. However the project reserves the right to change or break the API should it need to do so. The best way to avoid this is to submit your plugin upstream so they can be updated if/when the API changes. +API versioning +-------------- + +All plugins need to declare a symbol which exports the plugin API +version they were built against. This can be done simply by:: + + QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +The core code will refuse to load a plugin that doesn't export a +`qemu_plugin_version` symbol or if plugin version is outside of QEMU's +supported range of API versions. + +Additionally the `qemu_info_t` structure which is passed to the +`qemu_plugin_install` method of a plugin will detail the minimum and +current API versions supported by QEMU. The API version will be +incremented if new APIs are added. The minimum API version will be +incremented if existing APIs are changed or removed. Exposure of QEMU internals --------------------------
@@ -40,16 +57,14 @@ instructions and events are opaque to the plugins themselves. Usage ===== -The QEMU binary needs to be compiled for plugin support: +The QEMU binary needs to be compiled for plugin support:: -:: - configure --enable-plugins + configure --enable-plugins Once built a program can be run with multiple plugins loaded each with -their own arguments: +their own arguments:: -:: - $QEMU $OTHER_QEMU_ARGS \ + $QEMU $OTHER_QEMU_ARGS \ -plugin tests/plugin/libhowvec.so,arg=inline,arg=hint \ -plugin tests/plugin/libhotblocks.so
Signature · 1 line
2.20.1
A message that is not in the archive (sent off-list or not yet received): SN6PR13MB2272B60021982C8C7F680CAA80760@SN6PR13MB2272.namprd13.prod.outlook.com
Robert Foley
Reviewed-byRe: FW: [PATCH v1 3/5] docs/devel: update tcg-plugins.rst with API versioning details
Quoted 65 lines · Alex Bennée
While we are at it fix up the quoted code sections with the inline ::
approach.Signed-off-by Alex Bennée <[email protected]>---
v2
- fix grammar
- mention we also will fail to load outside the range
- clean-up code sections--- docs/devel/tcg-plugins.rst | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-)docs/devel/tcg-plugins.rst +21
-7@@ -25,6 +25,23 @@ process. However the project reserves the right to change or break the API should it need to do so. The best way to avoid this is to submit your plugin upstream so they can be updated if/when the API changes. +API versioning +-------------- + +All plugins need to declare a symbol which exports the plugin API +version they were built against. This can be done simply by:: + + QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +The core code will refuse to load a plugin that doesn't export a +`qemu_plugin_version` symbol or if plugin version is outside of QEMU's +supported range of API versions. + +Additionally the `qemu_info_t` structure which is passed to the +`qemu_plugin_install` method of a plugin will detail the minimum and +current API versions supported by QEMU. The API version will be +incremented if new APIs are added. The minimum API version will be +incremented if existing APIs are changed or removed. Exposure of QEMU internals --------------------------@@ -40,16 +57,14 @@ instructions and events are opaque to the plugins themselves. Usage ===== -The QEMU binary needs to be compiled for plugin support: +The QEMU binary needs to be compiled for plugin support:: -:: - configure --enable-plugins + configure --enable-plugins Once built a program can be run with multiple plugins loaded each with -their own arguments: +their own arguments:: -:: - $QEMU $OTHER_QEMU_ARGS \ + $QEMU $OTHER_QEMU_ARGS \ -plugin tests/plugin/libhowvec.so,arg=inline,arg=hint \ -plugin tests/plugin/libhotblocks.so --
Quoted 3 lines
2.20.1
PATCH 4/5 docs/devel: convert multi-thread-tcg to a .rst document
In reply to Alex Bennée---
docs/devel/index.rst | 1 +
...ti-thread-tcg.txt => multi-thread-tcg.rst} | 28 ++++++++++++-------
2 files changed, 19 insertions(+), 10 deletions(-)
rename docs/devel/{multi-thread-tcg.txt => multi-thread-tcg.rst} (96%)docs/devel/index.rst +1 -0
@@ -22,4 +22,5 @@ Contents: decodetree secure-coding-practices tcg + multi-thread-tcg tcg-plugins
docs/devel/multi-thread-tcg.rst renamed from docs/devel/multi-thread-tcg.txt +18 -10
@@ -1,7 +1,10 @@ -Copyright (c) 2015-2016 Linaro Ltd. +.. Copyright (c) 2015-2016 Linaro Ltd. +.. This work is licensed under the terms of the GNU GPL, version 2 or +.. later. See the COPYING file in the top-level directory. -This work is licensed under the terms of the GNU GPL, version 2 or -later. See the COPYING file in the top-level directory. +================== +Multi-threaded TCG +================== Introduction ============
@@ -40,7 +43,7 @@ Main Run Loop Even when there is no code being generated there are a number of structures associated with the hot-path through the main run-loop. These are associated with looking up the next translation block to -execute. These include: +execute. These include:: tb_jmp_cache (per-vCPU, cache of recent jumps) tb_ctx.htable (global hash table, phys address->tb lookup)
@@ -61,7 +64,9 @@ have their block-to-block jumps patched. Global TCG State ---------------- -### User-mode emulation +User-mode emulation +~~~~~~~~~~~~~~~~~~~ + We need to protect the entire code generation cycle including any post generation patching of the translated code. This also implies a shared translation buffer which contains code running on all cores. Any
@@ -78,7 +83,9 @@ patching. Code generation is serialised with mmap_lock(). -### !User-mode emulation +System emulation +~~~~~~~~~~~~~~~~ + Each vCPU has its own TCG context and associated TCG region, thereby requiring no locking.
@@ -125,10 +132,11 @@ linked list of all Translation Blocks in that page (see page_next). Both the jump patching and the page cache involve linked lists that the invalidated TranslationBlock needs to be removed from. -DESIGN REQUIREMENT: Safely handle invalidation of TBs - - safely patch/revert direct jumps - - remove central PageDesc lookup entries - - ensure lookup caches/hashes are safely updated +DESIGN REQUIREMENTS: + - Safely handle invalidation of TBs + - safely patch/revert direct jumps + - remove central PageDesc lookup entries + - ensure lookup caches/hashes are safely updated (Current solution)
Signature · 1 line
2.20.1
PATCH 5/5 .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
In reply to Alex BennéeThe older clangs are still struggling to build and run everything withing the 50 minute timeout so lets lighten the load a bit more. We still have coverage for GCC and hopefully no obscure 32 bit guest only breakages slip through the cracks.
--- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
.travis.yml +1 -1
@@ -79,7 +79,7 @@ env: - BASE_CONFIG="--disable-docs --disable-tools" - TEST_CMD="make check V=1" # This is broadly a list of "mainline" softmmu targets which have support across the major distros - - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime" - CCACHE_MAXSIZE=1G
Signature · 1 line
2.20.1
Re: [PATCH v1 5/5] .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
Quoted 15 lines · Alex Bennée
The older clangs are still struggling to build and run everything withing the 50 minute timeout so lets lighten the load a bit more. We still have coverage for GCC and hopefully no obscure 32 bit guest only breakages slip through the cracks.
Signed-off-by Alex Bennée <[email protected]>--- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-).travis.yml +0
-0
.travis.yml env: · line 84
Quoted 7 lines
.travis.yml +1
-1@@ -79,7 +79,7 @@ env: - BASE_CONFIG="--disable-docs --disable-tools" - TEST_CMD="make check V=1" # This is broadly a list of "mainline" softmmu targets which have support across the major distros - - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime" - CCACHE_MAXSIZE=1G
Re: [PATCH v1 5/5] .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
Quoted 11 lines · Thomas Huth
Quoted 10 lines · Alex Bennée
The older clangs are still struggling to build and run everything withing the 50 minute timeout so lets lighten the load a bit more. We still have coverage for GCC and hopefully no obscure 32 bit guest only breakages slip through the cracks.
Signed-off-by Alex Bennée <[email protected]>--- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
.travis.yml env: · line 84
Quoted 12 lines
.travis.yml +1
-1@@ -79,7 +79,7 @@ env: - BASE_CONFIG="--disable-docs --disable-tools" - TEST_CMD="make check V=1" # This is broadly a list of "mainline" softmmu targets which have support across the major distros - - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime" - CCACHE_MAXSIZE=1GReviewed-by Thomas Huth <[email protected]>
On a second glance, we also have this entry with --target-list-exclude in our test matrix:
- env:
- CONFIG="--disable-user
--target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
- CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
compiler: clang
So while you've speed up one target, this one might get actually slower instead. That's a little bit unfortunate. Is there maybe a better way to tackle this?
Thomas
Re: [PATCH v1 5/5] .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
In reply to Alex BennéeQuoted 15 lines · Alex Bennée
The older clangs are still struggling to build and run everything withing the 50 minute timeout so lets lighten the load a bit more. We still have coverage for GCC and hopefully no obscure 32 bit guest only breakages slip through the cracks.
Signed-off-by Alex Bennée <[email protected]>--- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-).travis.yml +0
-0
.travis.yml env: · line 82
Quoted 5 lines
.travis.yml +1
-1@@ -79,7 +79,7 @@ env: - BASE_CONFIG="--disable-docs --disable-tools" - TEST_CMD="make check V=1" # This is broadly a list of "mainline" softmmu targets which have support across the major distros - - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
Aleksandar, since you mostly test 32-bit MIPS, are you OK we keep mips-softmmu and drop mips64-softmmu here? Another job (acceptance-test) builds the mips64el-softmmu.
Quoted 4 lines
.travis.yml +0
-0- CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime" - CCACHE_MAXSIZE=1G
Re: [EXTERNAL]Re: [PATCH v1 5/5] .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
Quoted 7 lines
From: Philippe Mathieu-Daudé <[email protected]>
.travis.yml env: · line 82
Quoted 2 lines
.travis.yml +1
-1- - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"Aleksandar, since you mostly test 32-bit MIPS, are you OK we keep mips-softmmu and drop mips64-softmmu here? Another job (acceptance-test) builds the mips64el-softmmu.
Philippe, thanks for bringing this to my attention. Yes, 32-bit mips targets are important to us, but, what can we do, time constraints are time constraints, so I agree with Alex change, please go ahead, Alex. We can test 32-bit mips targets via other acceptance tests (those that can run longer, so-called "slow" group), and perhaps we can extend them to test more 32-bit mips systems.
Thanks to everybody,
Aleksandar
Philippe Mathieu-Daudé
Reviewed-byRe: [EXTERNAL]Re: [PATCH v1 5/5] .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
Quoted 9 lines · Aleksandar Markovic
Quoted 7 lines
From: Philippe Mathieu-Daudé <[email protected]>
.travis.yml env: · line 82
Quoted 2 lines
.travis.yml +1
-1- - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"Aleksandar, since you mostly test 32-bit MIPS, are you OK we keep mips-softmmu and drop mips64-softmmu here? Another job (acceptance-test) builds the mips64el-softmmu.
Philippe, thanks for bringing this to my attention. Yes, 32-bit mips targets are important to us, but, what can we do, time constraints are time constraints, so I agree with Alex change, please go ahead, Alex. We can test 32-bit mips targets via other acceptance tests (those that can run longer, so-called "slow" group), and perhaps we can extend them to test more 32-bit mips systems.
OK, let's keep mips64 as suggested Alex then.
Re: [EXTERNAL]Re: [PATCH v1 5/5] .travis.yml: drop 32 bit systems from MAIN_SOFTMMU_TARGETS
In reply to Aleksandar MarkovicQuoted 8 lines · Aleksandar Markovic
Quoted 7 lines
From: Philippe Mathieu-Daudé <[email protected]>
.travis.yml env: · line 82
Quoted 2 lines
.travis.yml +1
-1- - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"Aleksandar, since you mostly test 32-bit MIPS, are you OK we keep mips-softmmu and drop mips64-softmmu here? Another job (acceptance-test) builds the mips64el-softmmu.
Quoted 6 lines
Philippe, thanks for bringing this to my attention. Yes, 32-bit mips targets are important to us, but, what can we do, time constraints are time constraints, so I agree with Alex change, please go ahead, Alex. We can test 32-bit mips targets via other acceptance tests (those that can run longer, so-called "slow" group), and perhaps we can extend them to test more 32-bit mips systems.
To be clear both gcc and clang have rules that test:
- CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
So the main targets which are reducing their coverage are:
- CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
- CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
- CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} "
- CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
compiler: clang
before_script:
- ./configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log && exit 1; }
- CONFIG="--enable-gprof --enable-gcov --disable-pie --target-list=${MAIN_SOFTMMU_TARGETS}"
and the MacOSX 9.4 build:
# MacOSX builds
- env:
- CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS}"
os: osx
osx_image: xcode9.4
compiler: clang
The Xcode 10.3 build is already a reduced list:
- CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
Quoted 3 lines
Thanks to everybody,
Aleksandar
--
Alex Bennée