On 10/1/24 08:03, Ilya Leoshkevich wrote:
commit f025692c992c ("accel/tcg: Clear PAGE_WRITE before translation") fixed cross-modifying code handling, but did not add a test. The changed code was further improved recently [1], and I was not sure whether these modifications were safe (spoiler: they were fine).Add a test to make sure there are no regressions. [1]https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg00034.html Signed-off-by: Ilya Leoshkevich<[email protected]> --- v3:https://lore.kernel.org/qemu-devel/[email protected]/ v3 -> v4: Rebase. I've been looking into the .NET failures under QEMU again and what this test looks for was a suspect. It turned out to be https://gitlab.com/qemu-project/qemu/-/issues/2600 but it would be good to have this test upstream to ensure there are no regressions. v2:https://patchew.org/QEMU/[email protected]/ v2 -> v3: Resend with a trivial rebase. v1:https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg00455.html v1 -> v2: Fix tweaking the flags (Alex). Keep the custom build rule for now. tests/tcg/x86_64/Makefile.target | 4 ++ tests/tcg/x86_64/cross-modifying-code.c | 80 +++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 tests/tcg/x86_64/cross-modifying-code.c
Reviewed-by: Richard Henderson <[email protected]> r~
