[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug 1861605] Re: LL/SC broken for MIPS after 7dd547e5ab6b31e7a0cfc182d3
From: |
Alexander Richardson |
Subject: |
[Bug 1861605] Re: LL/SC broken for MIPS after 7dd547e5ab6b31e7a0cfc182d3ad131dd55a948f |
Date: |
Sun, 02 Feb 2020 13:23:56 -0000 |
New patch:
https://github.com/qemu/qemu/commit/6ff8dec97f1a105d0da96c67ee24c75e437df162
** Description changed:
In that commit the env->llval value is loaded as an unsigned value
(instead of sign-extended as before and therefore the CMPXCHG in
gen_st_cond() in translate.c fails.
- I have committed a fix for this issue as https://github.com/CTSRD-
- CHERI/qemu/commit/a18d80c629989d002794f558968e1561edaf3dfd
+ I have committed a fix for this issue as
+ https://github.com/qemu/qemu/commit/6ff8dec97f1a105d0da96c67ee24c75e437df162
An alternative solution would be to change the cmpxchg line to perform a
non-sign-extended compare, i.e. replace
- tcg_gen_atomic_cmpxchg_tl(t0, addr, cpu_llval, val,
- eva ? MIPS_HFLAG_UM : ctx->mem_idx, tcg_mo);
+ tcg_gen_atomic_cmpxchg_tl(t0, cpu_lladdr, cpu_llval, val,
+ eva ? MIPS_HFLAG_UM : ctx->mem_idx, tcg_mo);
with
- tcg_gen_atomic_cmpxchg_tl(t0, addr, cpu_llval, val,
- eva ? MIPS_HFLAG_UM : ctx->mem_idx, tcg_mo &
~MO_SIGN);
+ tcg_gen_atomic_cmpxchg_tl(t0, cpu_lladdr, cpu_llval, val,
+ eva ? MIPS_HFLAG_UM : ctx->mem_idx, tcg_mo &
~MO_SIGN);
+ However, that change does not fix the fact that the result of ll is no
+ longer sign-extended, therefore I think adding a cast in the helpers is
+ better.
I cannot send this patch to the QEMU mailing list as I am not able to setup
git-send-email.
Feel free to apply this commit or the alternative solution.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1861605
Title:
LL/SC broken for MIPS after 7dd547e5ab6b31e7a0cfc182d3ad131dd55a948f
Status in QEMU:
New
Bug description:
In that commit the env->llval value is loaded as an unsigned value
(instead of sign-extended as before and therefore the CMPXCHG in
gen_st_cond() in translate.c fails.
I have committed a fix for this issue as
https://github.com/qemu/qemu/commit/6ff8dec97f1a105d0da96c67ee24c75e437df162
An alternative solution would be to change the cmpxchg line to perform a
non-sign-extended compare, i.e. replace
tcg_gen_atomic_cmpxchg_tl(t0, cpu_lladdr, cpu_llval, val,
eva ? MIPS_HFLAG_UM : ctx->mem_idx, tcg_mo);
with
tcg_gen_atomic_cmpxchg_tl(t0, cpu_lladdr, cpu_llval, val,
eva ? MIPS_HFLAG_UM : ctx->mem_idx, tcg_mo &
~MO_SIGN);
However, that change does not fix the fact that the result of ll is no
longer sign-extended, therefore I think adding a cast in the helpers
is better.
I cannot send this patch to the QEMU mailing list as I am not able to setup
git-send-email.
Feel free to apply this commit or the alternative solution.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1861605/+subscriptions