[PATCH v3 0/3] Hexagon: Fix undefined behavior bugs

Brian Cain posted 3 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261020151720.728888-1-brian.cain@oss.qualcomm.com
Maintainers: Brian Cain <brian.cain@oss.qualcomm.com>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
target/hexagon/decode.c           | 5 ++++-
target/hexagon/mmvec/hvx_qfloat.c | 5 +++++
target/hexagon/translate.c        | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
[PATCH v3 0/3] Hexagon: Fix undefined behavior bugs
Posted by Brian Cain 1 month ago
Coverity reported an undefined behavior issue and UBSan showed another
issue with UB.

In v3:
- testing with UBSan didn't show issues at v2 but I was using gcc.  clang
exposes another UB bug, this one in decode_set_slot_number().  Added a patch
"avoid negative slot shift" to fix that bug.  Pointed out by Peter.

In v2:
- updated shift assertion to use `shift >= 41` instead of 3.

v2: https://lore.kernel.org/qemu-devel/20261019223253.3243067-1-brian.cain@oss.qualcomm.com/
v1: https://lore.kernel.org/qemu-devel/20261019153558.2422277-1-brian.cain@oss.qualcomm.com/

Brian Cain (3):
  target/hexagon: assert qfloat shift
  target/hexagon: reset implicit USR write state
  target/hexagon: avoid negative slot shift

 target/hexagon/decode.c           | 5 ++++-
 target/hexagon/mmvec/hvx_qfloat.c | 5 +++++
 target/hexagon/translate.c        | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

-- 
2.34.1