Skip to content

target/arm: Fix M-profile helper loads/stores alignment checks

William Kosasih qemu-arm qemu-devel 4 versions – Applied

Status from this message: Applied to target-arm.next. Thanks for these patches!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 2 repliesApplied
  2. v312 patches 15 repliesSuperseded
  3. v212 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/11target/arm: Bring VLSTM/VLLDM helper store/load closer to the ARM pseudocodetarget/arm/tcg/m_helper.c+15 -90 replies
2/11target/arm: Fix BLXNS helper store alignment checkstarget/arm/tcg/m_helper.c+5 -20 replies
3/11target/arm: Fix function_return helper load alignment checkstarget/arm/tcg/m_helper.c+1 -10 replies
4/11target/arm: Fix VLDR helper load alignment checkstarget/arm/tcg/mve_helper.c+13 -110 replies
5/11target/arm: Fix VSTR helper store alignment checkstarget/arm/tcg/mve_helper.c+10 -80 replies
6/11target/arm: Fix VLDR_SG helper load alignment checkstarget/arm/tcg/mve_helper.c+25 -170 replies
7/11target/arm: Fix VSTR_SG helper store alignment checkstarget/arm/tcg/mve_helper.c+17 -130 replies
8/11target/arm: Fix VLD4 helper load alignment checkstarget/arm/tcg/mve_helper.c+9 -30 replies
9/11target/arm: Fix VLD2 helper load alignment checkstarget/arm/tcg/mve_helper.c+9 -30 replies
10/11target/arm: Fix VST4 helper store alignment checkstarget/arm/tcg/mve_helper.c+9 -30 replies
11/11target/arm: Fix VST2 helper store alignment checkstarget/arm/tcg/mve_helper.c+9 -30 replies

Reviews trailers per patch

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

PatchRichard Henderson
1/11R-b
2/11R-b
3/11R-b
4/11R-b
5/11R-b
6/11R-b
7/11R-b
8/11R-b
9/11R-b
10/11R-b
11/11R-b

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

Read the v4 thread

Cover letter [PATCH v4 00/11] target/arm: Fix M-profile helper loads/stores alignment checks

Historically, M-profile helper functions in m_helper.c and mve_helper.c used the unaligned cpu_*_data_ra() routines to perform guest memory accesses. This meant we had no way to enforce alignment constraints when executing helper-based loads/stores. With the addition of the cpu_*_mmu() APIs, we can now combine the current MMU state with MO_ALIGN flags to build a MemOpIdx that enforces alignment at the helper level.

This patch series:
- Replaces all calls to cpu_ld*_data_ra(), cpu_st*_data_ra() in the M-profile helpers (m_helper.c) and the MVE helpers (mve_helper.c) with their cpu_*_mmu() equivalents.
- Leaves SME and SVE helper code untouched, as those extensions support unaligned accesses by design.

With this change, all M-profile and MVE helper-based loads and stores will now correctly honor their alignment requirements.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154

William Kosasih (11):
target/arm: Bring VLSTM/VLLDM helper store/load closer to the ARM
pseudocode
target/arm: Fix BLXNS helper store alignment checks target/arm: Fix function_return helper load alignment checks target/arm: Fix VLDR helper load alignment checks target/arm: Fix VSTR helper store alignment checks target/arm: Fix VLDR_SG helper load alignment checks target/arm: Fix VSTR_SG helper store alignment checks target/arm: Fix VLD4 helper load alignment checks target/arm: Fix VLD2 helper load alignment checks target/arm: Fix VST4 helper store alignment checks target/arm: Fix VST2 helper store alignment checks

 target/arm/tcg/m_helper.c   |  33 +++++---
 target/arm/tcg/mve_helper.c | 162 ++++++++++++++++++++++--------------
 2 files changed, 122 insertions(+), 73 deletions(-)
Signature · 1 line
2.48.1