]> www.infradead.org Git - users/dwmw2/qemu.git/commit
target/i386: allow access_ptr to force slow path on failed probe
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 13 Aug 2024 20:23:15 +0000 (21:23 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Fri, 16 Aug 2024 13:04:19 +0000 (14:04 +0100)
commitcf584a908acd62bf7bc08b8f7a055209f497a266
treeb25925f733c71d51505efad8e03ddd37a49cad1c
parent503eb470e087d4f611be1c584e58fe3b0bf250e2
target/i386: allow access_ptr to force slow path on failed probe

When we are using TCG plugin memory callbacks probe_access_internal
will return TLB_MMIO to force the slow path for memory access. This
results in probe_access returning NULL but the x86 access_ptr function
happily accepts an empty haddr resulting in segfault hilarity.

Check for an empty haddr to prevent the segfault and enable plugins to
track all the memory operations for the x86 save/restore helpers. As
we also want to run the slow path when instrumenting *-user we should
also not have the short cutting test_ptr macro.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2489
Fixes: 6d03226b42 (plugins: force slow path when plugins instrument memory ops)
Reviewed-by: Alexandre Iooss <erdnaxe@crans.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240813202329.1237572-8-alex.bennee@linaro.org>
target/i386/tcg/access.c