]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/xtensa: fix access ring in l32ex
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 19 May 2021 10:40:00 +0000 (03:40 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 20 May 2021 20:02:58 +0000 (13:02 -0700)
l32ex does memory access as all regular load/store operations at CRING
level. Fix apparent pasto from l32e that caused it to use RING instead.

This is a correctness issue, not a security issue, because in the worst
case the privilege level of memory access may be lowered, resulting in
an exception when the correct implementation would've succeeded.
In no case it would allow memory access that would've raised an
exception in the correct implementation.

Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target/xtensa/translate.c

index f93df87ec4903e1b35b382d518fe602588e87678..95f6b21c2a1e1521fbc25d38d7931cdc7177a438 100644 (file)
@@ -1814,7 +1814,7 @@ static void translate_l32ex(DisasContext *dc, const OpcodeArg arg[],
     tcg_gen_mov_i32(addr, arg[1].in);
     gen_load_store_alignment(dc, 2, addr, true);
     gen_check_exclusive(dc, addr, false);
-    tcg_gen_qemu_ld_i32(arg[0].out, addr, dc->ring, MO_TEUL);
+    tcg_gen_qemu_ld_i32(arg[0].out, addr, dc->cring, MO_TEUL);
     tcg_gen_mov_i32(cpu_exclusive_addr, addr);
     tcg_gen_mov_i32(cpu_exclusive_val, arg[0].out);
     tcg_temp_free(addr);