On 6/26/25 9:37 AM, Alex Bennée wrote:
Alex Bennée <alex.ben...@linaro.org> writes:
Rowan Hart <rowanbh...@gmail.com> writes:
This patch series adds several new API functions focused on enabling use
cases around reading and writing guest memory from QEMU plugins. To support
these new APIs, some utility functionality around retrieving information about
address spaces is added as well.
Queued to plugins/next, thanks.
So this fails a number of the CI tests, mostly due to 32 bit issues:
https://gitlab.com/stsquad/qemu/-/pipelines/1890883927/failures
The tci failure is easy enough:
--8<---------------cut here---------------start------------->8---
modified tests/tcg/x86_64/Makefile.softmmu-target
@@ -34,9 +34,11 @@ memory: CFLAGS+=-DCHECK_UNALIGNED=1
# Running
QEMU_OPTS+=-device isa-debugcon,chardev=output -device
isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel
+ifeq ($(CONFIG_PLUGIN),y)
run-plugin-patch-target-with-libpatch.so: \
PLUGIN_ARGS=$(COMMA)target=ffc0$(COMMA)patch=9090$(COMMA)use_hwaddr=true
run-plugin-patch-target-with-libpatch.so: \
CHECK_PLUGIN_OUTPUT_COMMAND=$(X64_SYSTEM_SRC)/validate-patch.py $@.out
run-plugin-patch-target-with-libpatch.so: patch-target libpatch.so
EXTRA_RUNS+=run-plugin-patch-target-with-libpatch.so
+endif
--8<---------------cut here---------------end--------------->8---
The other problem is trying to stuff a uint64_t into a void * on 32 bit.
We did disable plugins for 32 bit but then reverted because we were able
to fixup the cases:
cf2a78cbbb (deprecation: don't enable TCG plugins by default on 32 bit hosts)
db7a06ade1 (configure: reenable plugins by default for 32-bit hosts)
So I don't what is easier:
- re-deprecate for 32 bit systems
- only build libpatch on 64 bit systems
- fix libpatch to handle being built on 32 bit systems
More context:
../tests/tcg/plugins/patch.c: In function ‘patch_hwaddr’:
../tests/tcg/plugins/patch.c:50:21: error: cast from pointer to integer
of different size [-Werror=pointer-to-int-cast]
50 | uint64_t addr = (uint64_t)userdata;
| ^
../tests/tcg/plugins/patch.c: In function ‘patch_vaddr’:
../tests/tcg/plugins/patch.c:93:21: error: cast from pointer to integer
of different size [-Werror=pointer-to-int-cast]
93 | uint64_t addr = (uint64_t)userdata;
| ^
../tests/tcg/plugins/patch.c: In function ‘vcpu_tb_trans_cb’:
../tests/tcg/plugins/patch.c:159:54: error: cast to pointer from integer
of different size [-Werror=int-to-pointer-cast]
159 | (void *)addr);
| ^
../tests/tcg/plugins/patch.c:163:54: error: cast to pointer from integer
of different size [-Werror=int-to-pointer-cast]
163 | (void *)addr);
|
Since we disabled 64 bit targets on 32 bit hosts, and that data passed
by pointers concern addresses, it should be safe to cast values to
(uintptr_t) instead of (uint64_t).
Pierrick