Skip to content

Fixes for unaligned scalar accesses

Brian Cain qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v14 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5target/hexagon: handle misaligned load/store cause codes in cpu_looplinux-user/hexagon/cpu_loop.c+5 -00 replies
2/5target/hexagon: raise SIGBUS on unaligned scalar loadstarget/hexagon/genptr.c target/hexagon/idef-parser/parser-helpers.c target/hexagon/macros.h+20 -140 replies
3/5target/hexagon: raise SIGBUS on unaligned scalar storestarget/hexagon/genptr.c target/hexagon/op_helper.c target/hexagon/translate.c+15 -80 replies
4/5target/hexagon: raise SIGBUS on unaligned data access in sysemutarget/hexagon/cpu.c+25 -00 replies
5/5tests/tcg/hexagon: add unaligned scalar testtests/tcg/hexagon/Makefile.target tests/tcg/hexagon/unaligned_data.c+120 -01 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchPierrick BouvierMatheus Tavares Bernardino
1/5R-b R-b
2/5R-b R-b
3/5R-b R-b
4/5R-b R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] Fixes for unaligned scalar accesses

I took some "working" programs under userspace emulation into a linux instance running on a fork with comprehensive system mode support and discovered a compiler bug causing unaligned accesses. This bug had gone undetected in userspace tests because they were not handled correctly by QEMU.

With these patches, unaligned accesses cause an exception that generates SIGBUS.

Changes for v2: moved linux-user cpu loop to its own commit.

v1: https://lore.kernel.org/qemu-devel/[email protected]/

Brian Cain (5):
target/hexagon: handle misaligned load/store cause codes in cpu_loop target/hexagon: raise SIGBUS on unaligned scalar loads target/hexagon: raise SIGBUS on unaligned scalar stores target/hexagon: raise SIGBUS on unaligned data access in sysemu tests/tcg/hexagon: add unaligned scalar test

 linux-user/hexagon/cpu_loop.c               |   5 +
 target/hexagon/cpu.c                        |  25 +++++
 target/hexagon/genptr.c                     |  10 +-
 target/hexagon/idef-parser/parser-helpers.c |   2 +-
 target/hexagon/macros.h                     |  26 +++--
 target/hexagon/op_helper.c                  |  13 ++-
 target/hexagon/translate.c                  |   6 +-
 tests/tcg/hexagon/Makefile.target           |   2 +
 tests/tcg/hexagon/unaligned_data.c          | 118 ++++++++++++++++++++
 9 files changed, 185 insertions(+), 22 deletions(-)
 create mode 100644 tests/tcg/hexagon/unaligned_data.c
Signature · 1 line
2.34.1