[PATCH v2] ch: Enable callbacks for ch domain events

2024-09-10 Thread Praveen K Paladugu
From: Praveen K Paladugu Enable callbacks for define, undefine, started, booted, stopped, destroyed events of ch guests. Signed-off-by: Praveen K Paladugu --- src/ch/ch_conf.h | 4 +++ src/ch/ch_driver.c | 82 -- 2 files changed, 84 insertions(+),

Re: [PATCH v2 01/10] tests/docker: remove debian-armel-cross

2024-09-10 Thread Philippe Mathieu-Daudé
On 10/9/24 19:38, Alex Bennée wrote: As debian-11 transitions to LTS we are starting to have problems building the image. While we could update to a later Debian building a 32 bit QEMU without modern floating point is niche host amongst the few remaining 32 bit hosts we regularly build for. For n

[PATCH v2 10/10] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-09-10 Thread Alex Bennée
From: Gustavo Romero Extend MTE gdbstub tests to also run in system mode (share tests between user mode and system mode). The tests will only run if a version of GDB that supports MTE on baremetal is available in the test environment and if available compiler supports the 'memtag' flag (-march=ar

[PATCH v2 09/10] tests/tcg/aarch64: Improve linker script organization

2024-09-10 Thread Alex Bennée
From: Gustavo Romero Improve kernel.ld linker script organization by using MEMORY command. Signed-off-by: Richard Henderson Signed-off-by: Gustavo Romero Message-Id: <20240906143316.657436-5-gustavo.rom...@linaro.org> Signed-off-by: Alex Bennée --- tests/tcg/aarch64/system/kernel.ld | 24 +++

[PATCH v2 07/10] gdbstub: Add support for MTE in system mode

2024-09-10 Thread Alex Bennée
From: Gustavo Romero This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/620 Signed-off-by

[PATCH v2 06/10] gdbstub: Use specific MMU index when probing MTE addresses

2024-09-10 Thread Alex Bennée
From: Gustavo Romero Use cpu_mmu_index() to determine the specific translation regime (MMU index) before probing addresses using allocation_tag_mem_probe(). Currently, the MMU index is hardcoded to 0 and only works for user mode. By obtaining the specific MMU index according to the translation r

[PATCH v2 08/10] tests/guest-debug: Support passing arguments to the GDB test script

2024-09-10 Thread Alex Bennée
From: Gustavo Romero This commit adds support for passing arguments to the GDB test scripts so it's possible to parse the args in an "argparse way" in the test scripts launched by the runner. The arguments should be preceded by -- when passed to the runner. For example, passing "--help" arg to th

[PATCH v2 05/10] scripts/ci: update the gitlab-runner playbook

2024-09-10 Thread Alex Bennée
The upstream install instructions: https://docs.gitlab.com/runner/install/linux-repository.html Now refer to repositories and a setup script. Modernise the playbook to use the preferred delivery method. Message-Id: <20240910140733.4007719-5-alex.ben...@linaro.org> Reviewed-by: Pierrick Bouvier

[PATCH v2 02/10] tests/docker: update debian i686 and mipsel images to bookworm

2024-09-10 Thread Alex Bennée
Whatever issues there were which stopped these being updates when the rest were have now been resolved. However mips64el continues to be broken so don't update it here. Message-Id: <20240910140733.4007719-3-alex.ben...@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée --- tes

[PATCH v2 01/10] tests/docker: remove debian-armel-cross

2024-09-10 Thread Alex Bennée
As debian-11 transitions to LTS we are starting to have problems building the image. While we could update to a later Debian building a 32 bit QEMU without modern floating point is niche host amongst the few remaining 32 bit hosts we regularly build for. For now we still have armhf-debian-cross-con

[PATCH v2 04/10] docs/devel: fix duplicate line

2024-09-10 Thread Alex Bennée
I guess the same change came in via two patch series. Remove the repetition. Fixes: 2a851fca9f (docs/devel: remind developers to run CI container pipeline when updating images) Message-Id: <20240910140733.4007719-4-alex.ben...@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée

[PATCH v2 00/10] Maintainer updates (testing, gdbstub) pre-PR

2024-09-10 Thread Alex Bennée
Hi, Testing I've updated a number of the docker containers to deal with breakages in the crossdev environments as bullseye moves to LTS. I've dropped the armel environment which doesn't really add much to the armhf cross build we have that works. i686 and mipsel cross containers are bumped up to

[PATCH v2 03/10] tests/docker: use debian-all-test-cross for mips64el tests

2024-09-10 Thread Alex Bennée
While the mips64el cross compilation environment is busted in Debian we can use the debian-all-test-cross image for building TCG tests like we do in the CI. Signed-off-by: Alex Bennée --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index d0

[PATCH] ch: Enable callbacks for ch domain events

2024-09-10 Thread Praveen K Paladugu
From: Praveen K Paladugu Enable callbacks for define, undefine, started, booted, stopped, destroyed events of ch guests. Signed-off-by: Praveen K Paladugu --- src/ch/ch_conf.h | 4 +++ src/ch/ch_driver.c | 81 -- 2 files changed, 83 insertions(+),

[PATCH 21/26] tests/tcg: add a system test to check memory instrumentation

2024-09-10 Thread Alex Bennée
At first I thought I could compile the user-mode test for system mode however we already have a fairly comprehensive test case for system mode in "memory" so lets use that. First we extend the test to report where the test_data region is. Then we expand the pdot() function to track the total numbe

[PATCH 25/26] plugins: add option to dump write argument to syscall plugin

2024-09-10 Thread Alex Bennée
From: Rowan Hart Signed-off-by: Rowan Hart Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier Message-Id: <20240827215329.248434-3-rowanbh...@gmail.com> [AJB: tweak fmt string for vaddr] Signed-off-by: Alex Bennée --- vAJB - tweak fmt string for PRIu64 --- docs/about/emulation.rst

[PATCH 20/26] tests/tcg: only read/write 64 bit words on 64 bit systems

2024-09-10 Thread Alex Bennée
While the compilers will generally happily synthesise a 64 bit value for you on 32 bit systems it doesn't exercise anything on QEMU. It also makes it hard to accurately compare the accesses to test_data when instrumenting. Signed-off-by: Alex Bennée --- tests/tcg/multiarch/system/memory.c | 26 +

[PATCH 22/26] util/timer: avoid deadlock when shutting down

2024-09-10 Thread Alex Bennée
When we shut down a guest we disable the timers. However this can cause deadlock if the guest has queued some async work that is trying to advance system time and spins forever trying to wind time forward. Pay attention to the return code and bail early if we can't wind time forward. Signed-off-by

[PATCH 23/26] contrib/plugins: Add a plugin to generate basic block vectors

2024-09-10 Thread Alex Bennée
From: Akihiko Odaki SimPoint is a widely used tool to find the ideal microarchitecture simulation points so Valgrind[2] and Pin[3] support generating basic block vectors for use with them. Let's add a corresponding plugin to QEMU too. Note that this plugin has a different goal with tests/plugin/

[PATCH 24/26] plugins: add plugin API to read guest memory

2024-09-10 Thread Alex Bennée
From: Rowan Hart Signed-off-by: Rowan Hart Reviewed-by: Pierrick Bouvier Message-Id: <20240827215329.248434-2-rowanbh...@gmail.com> [AJB: tweaked cpu_memory_rw_debug call] Signed-off-by: Alex Bennée --- vAJB: - explicit bool for cpu_memory_rw_debug --- include/qemu/qemu-plugin.h | 32 +++

[PATCH 19/26] tests/tcg: clean up output of memory system test

2024-09-10 Thread Alex Bennée
This is useful information when debugging memory issues so lets improve by: - include the ptr address for u8 fills (like the others) - indicate the number of operations for reads and writes - explicitly note when we are flushing - move the fill printf to after the reset Signed-off-by: Ale

[PATCH 26/26] plugins: add ability to register a GDB triggered callback

2024-09-10 Thread Alex Bennée
Now gdbstub has gained the ability to extend its command tables we can allow it to trigger plugin callbacks. This is probably most useful for QEMU developers debugging plugins themselves but might be useful for other stuff. Trigger the callback by sending: maintenance packet Qqemu.plugin_cb I'

[PATCH 13/26] contrib/plugins: control flow plugin

2024-09-10 Thread Alex Bennée
This is a simple control flow tracking plugin that uses the latest inline and conditional operations to detect and track control flow changes. It is currently an exercise at seeing how useful the changes are. Based-on: <20240312075428.244210-1-pierrick.bouv...@linaro.org> Cc: Gustavo Romero Cc: P

[PATCH 18/26] tests/plugin/mem: add option to print memory accesses

2024-09-10 Thread Alex Bennée
From: Pierrick Bouvier By using "print-accesses=true" option, mem plugin will now print every value accessed, with associated size, type (store vs load), symbol, instruction address and phys/virt address accessed. Reviewed-by: Richard Henderson Reviewed-by: Xingtao Yao Signed-off-by: Pierrick

[PATCH 16/26] tests/tcg: add mechanism to run specific tests with plugins

2024-09-10 Thread Alex Bennée
From: Pierrick Bouvier Only multiarch tests are run with plugins, and we want to be able to run per-arch test with plugins too. Tested-by: Xingtao Yao Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20240724194708.1843704-4-pierrick.bouv...@linaro.org> Signed-off-b

[PATCH 17/26] tests/tcg: allow to check output of plugins

2024-09-10 Thread Alex Bennée
From: Pierrick Bouvier A specific plugin test can now read and check a plugin output, to ensure it contains expected values. Tested-by: Xingtao Yao Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20240724194708.1843704-5-pierrick.bouv...@linaro.org> Signed-off-by:

[PATCH 12/26] deprecation: don't enable TCG plugins by default with TCI

2024-09-10 Thread Alex Bennée
The softmmu memory instrumentation test sees so many more accesses than a normal translated host and its really not worth fixing up. Lets deprecate this odd configuration and save on the CI cycles. Signed-off-by: Alex Bennée --- docs/about/deprecated.rst | 8 configure

[PATCH 11/26] deprecation: don't enable TCG plugins by default on 32 bit hosts

2024-09-10 Thread Alex Bennée
The existing plugins already liberally use host pointer stuffing for passing user data which will fail when doing 64 bit guests on 32 bit hosts. We should discourage this by officially deprecating support and adding another nail to the 32 bit host coffin. Signed-off-by: Alex Bennée --- v2 - do

[PATCH 14/26] plugins: save value during memory accesses

2024-09-10 Thread Alex Bennée
From: Pierrick Bouvier Different code paths handle memory accesses: - tcg generated code - load/store helpers - atomic helpers This value is saved in cpu->neg.plugin_mem_value_{high,low}. Values are written only for accessed word size (upper bits are not set). Atomic operations are doing read/w

[PATCH 09/26] tests/tcg/aarch64: Extend MTE gdbstub tests to system mode

2024-09-10 Thread Alex Bennée
From: Gustavo Romero Extend MTE gdbstub tests to also run in system mode (share tests between user mode and system mode). The tests will only run if a version of GDB that supports MTE on baremetal is available in the test environment and if available compiler supports the 'memtag' flag (-march=ar

[PATCH 15/26] plugins: extend API to get latest memory value accessed

2024-09-10 Thread Alex Bennée
From: Pierrick Bouvier This value can be accessed only during a memory callback, using new qemu_plugin_mem_get_value function. Returned value can be extended when QEMU will support accesses wider than 128 bits. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1719 Resolves: https://gitla

[PATCH 08/26] tests/tcg/aarch64: Improve linker script organization

2024-09-10 Thread Alex Bennée
From: Gustavo Romero Improve kernel.ld linker script organization by using MEMORY command. Signed-off-by: Richard Henderson Signed-off-by: Gustavo Romero Message-Id: <20240906143316.657436-5-gustavo.rom...@linaro.org> Signed-off-by: Alex Bennée --- tests/tcg/aarch64/system/kernel.ld | 24 +++

[PATCH 05/26] gdbstub: Use specific MMU index when probing MTE addresses

2024-09-10 Thread Alex Bennée
From: Gustavo Romero Use cpu_mmu_index() to determine the specific translation regime (MMU index) before probing addresses using allocation_tag_mem_probe(). Currently, the MMU index is hardcoded to 0 and only works for user mode. By obtaining the specific MMU index according to the translation r

[PATCH 10/26] contrib/plugins/Makefile: Add a 'distclean' target

2024-09-10 Thread Alex Bennée
From: Thomas Huth Running "make distclean" in the build tree currently fails since this tries to run the "distclean" target in the contrib/plugins/ folder, too, but the Makefile there is missing this target. Thus add 'distclean' there to fix this issue. And to avoid regressions with "make distcl

[PATCH 02/26] tests/docker: update debian i686 and mipsel images to bookworm

2024-09-10 Thread Alex Bennée
Whatever issues there were which stopped these being updates when the rest were have now been resolved. However mips64el continues to be broken so don't update it here. Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/debian-i686-cross.docker | 10 -- tests/docker/dockerfiles/de

[PATCH 07/26] tests/guest-debug: Support passing arguments to the GDB test script

2024-09-10 Thread Alex Bennée
From: Gustavo Romero This commit adds support for passing arguments to the GDB test scripts so it's possible to parse the args in an "argparse way" in the test scripts launched by the runner. The arguments should be preceded by -- when passed to the runner. For example, passing "--help" arg to th

[PATCH 03/26] docs/devel: fix duplicate line

2024-09-10 Thread Alex Bennée
I guess the same change came in via two patch series. Remove the repetition. Fixes: 2a851fca9f (docs/devel: remind developers to run CI container pipeline when updating images) Signed-off-by: Alex Bennée --- docs/devel/testing/main.rst | 6 -- 1 file changed, 6 deletions(-) diff --git a/do

[PATCH 00/26] Maintainer updates (testing, gdbstub, plugins)

2024-09-10 Thread Alex Bennée
Hi, Here is the current state of my maintainer trees. Testing I've updated a number of the docker containers to deal with breakages in the crossdev environments as bullseye moves to LTS. I've dropped the armel environment which doesn't really add much to the armhf cross build we have that works.

[PATCH 06/26] gdbstub: Add support for MTE in system mode

2024-09-10 Thread Alex Bennée
From: Gustavo Romero This commit makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/620 Signed-off-by

[PATCH 04/26] scripts/ci: update the gitlab-runner playbook

2024-09-10 Thread Alex Bennée
The upstream install instructions: https://docs.gitlab.com/runner/install/linux-repository.html Now refer to repositories and a setup script. Modernise the playbook to use the preferred delivery method. Signed-off-by: Alex Bennée --- scripts/ci/setup/gitlab-runner.yml | 39 ++

[PATCH 01/26] tests/docker: remove debian-armel-cross

2024-09-10 Thread Alex Bennée
As debian-11 transitions to LTS we are starting to have problems building the image. While we could update to a later Debian building a 32 bit QEMU without modern floating point is niche host amongst the few remaining 32 bit hosts we regularly build for. For now we still have armhf-debian-cross-con

[PATCH v2 4/4] qemu_tpm: handle file/block storage source

2024-09-10 Thread marcandre . lureau
From: Marc-André Lureau When swtpm reports "nvram-backend-dir", it can accepts a single file or block device where TPM state will be stored. --tpmstate must be backend-uri=file://. Teach the storage to use custom directory or file source location. Signed-off-by: Marc-André Lureau --- src/qemu

[PATCH v2 3/4] schema: add TPM emulator

2024-09-10 Thread marcandre . lureau
From: Marc-André Lureau Learn to parse a directory for the TPM state. Signed-off-by: Marc-André Lureau --- docs/formatdomain.rst | 3 +++ src/conf/domain_conf.c | 13 ++--- src/conf/domain_conf.h | 1 + src/c

[PATCH v2 2/4] schema: add TPM emulator

2024-09-10 Thread marcandre . lureau
From: Marc-André Lureau Learn to parse a file path for the TPM state. Signed-off-by: Marc-André Lureau --- docs/formatdomain.rst | 15 +++ src/conf/domain_conf.c | 21 + src/conf/domain_conf.h | 6

[PATCH v2 1/4] util: check swtpm nvram-backend-dir capability

2024-09-10 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/util/virtpm.c | 1 + src/util/virtpm.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 81fd6166cf..84ed2f0edd 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -40,6 +40,7

[PATCH v2 0/4] Add TPM emulator

2024-09-10 Thread marcandre . lureau
From: Marc-André Lureau Hi, When swtpm capabilities reports "nvram-backend-dir", it can accepts a single file or block device where TPM state will be stored. --tpmstate must be backend-uri=file://. v2: - add support as well (Daniel) Related: https://issues.redhat.com/browse/CNV-35250 Marc-A