]> git.ipfire.org Git - thirdparty/qemu.git/commit
accel/tcg: Introduce and use MO_ALIGN_TLB_ONLY
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 21 Oct 2025 19:35:39 +0000 (14:35 -0500)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 31 Oct 2025 11:49:46 +0000 (12:49 +0100)
commit4dea00368dc75189af1773e3a06cbdb320b1dc7b
treea31bfe0a8961174cafe2d67b7dc0df11ab42f43f
parent3728de31925ae9658e2ce3d1ff9b63c83609f310
accel/tcg: Introduce and use MO_ALIGN_TLB_ONLY

For Arm, we need 3 cases: (1) the alignment required when accessing
Normal memory, (2) the alignment required when accessing Device memory,
and (3) the atomicity of the access.

When we added TLB_CHECK_ALIGNED, we assumed that cases 2 and 3 were
identical, and thus used memop_atomicity_bits for TLB_CHECK_ALIGNED.

This is incorrect for multiple reasons, including that the atomicity
of the access is adjusted depending on whether or not we are executing
within a serial context.

For Arm, what is true is that there is an underlying alignment
requirement of the access, and for that access Normal memory
will support unalignement.

Introduce MO_ALIGN_TLB_ONLY to indicate that the alignment
specified in MO_AMASK only applies when the TLB entry has
TLB_CHECK_ALIGNED set; otherwise no alignment required.

Introduce memop_tlb_alignment_bits with an additional bool
argument that specifies whether TLB_CHECK_ALIGNED is set.
All other usage of memop_alignment_bits assumes it is not.

Remove memop_atomicity_bits as unused; it didn't properly
support MO_ATOM_SUBWORD anyway.

Update target/arm finalize_memop_atom to set MO_ALIGN_TLB_ONLY
when strict alignment isn't otherwise required.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3171
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
accel/tcg/cputlb.c
include/exec/memop.h
target/arm/ptw.c
target/arm/tcg/translate-a64.c
target/arm/tcg/translate-neon.c
target/arm/tcg/translate.h
tcg/tcg.c