]> xenbits.xensource.com Git - qemu-xen.git/commit
target/mips: Use correct MMU index in get_pte()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 13 Aug 2024 10:05:42 +0000 (12:05 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 19 Aug 2024 22:38:48 +0000 (00:38 +0200)
commit7ce9760d64e8a884f044f95a1f32f96c2e0fafa0
tree70d5d523103919afac5341adc8c63e1792e587da
parent453ba4f675f751fe4dceaff57ac1ebf72f28f6d0
target/mips: Use correct MMU index in get_pte()

When refactoring page_table_walk_refill() in commit 4e999bf419
we missed the indirect call to cpu_mmu_index() in get_pte():

  page_table_walk_refill()
  -> get_pte()
     -> cpu_ld[lq]_code()
        -> cpu_mmu_index()

Since we don't mask anymore the modes in hflags, cpu_mmu_index()
can return UM or SM, while we only expect KM or ERL.

Fix by propagating ptw_mmu_idx to get_pte(), and use the
cpu_ld/st_code_mmu() API with the correct MemOpIdx.

Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reported-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2470
Fixes: 4e999bf419 ("target/mips: Pass ptw_mmu_idx down from mips_cpu_tlb_fill")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240814090452.2591-3-philmd@linaro.org>
target/mips/tcg/sysemu/tlb_helper.c