target/arm: Implement FEAT_MOPS
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest12 patches 4 repliesIn review
- v114 patches 18 repliesSuperseded
Changes in v2 from the cover letter
* one patch already upstream
* patches 7, 9, 11 updated to have separate helper functions for SET vs SETG and CPY vs CPYF
* use cpu_st16_mmu() for SETG memory set
* fix CPYFP saturation limit
* CPYFM and CPYFE now correctly always copy forwards
* patch 12 now sets the MOPS hwcap bit
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | target/arm: Don't skip MTE checks for LDRT/STRT at EL0target/ | +9 | 0 replies | |
| 2/12 | target/arm: Implement FEAT_MOPS enable bitstarget/ target/ | +27 | 0 replies | |
| 3/12 | target/arm: Pass unpriv bool to get_a64_user_mem_index()target/ | +14 | 0 replies | |
| 4/12 | target/arm: Define syndrome function for MOPS exceptionstarget/ | +12 | 0 replies | |
| 5/12 | target/arm: New function allocation_tag_mem_probe()target/ | +37 | 0 replies | |
| 6/12 | target/arm: Implement MTE tag-checking functions for FEAT_MOPStarget/ target/ | +80 | 0 replies | |
| 7/12 | target/arm: Implement the SET* instructionstarget/ target/ target/ +1 more | +413 | 0 replies | |
| 8/12 | target/arm: Define new TB flag for ATA0target/ target/ target/ +1 more | +27 | 0 replies | |
| 9/12 | target/arm: Implement the SETG* instructionstarget/ target/ target/ +3 more | +155 | 2 replies | |
| 10/12 | target/arm: Implement MTE tag-checking functions for FEAT_MOPS copiestarget/ target/ | +116 | 0 replies | |
| 11/12 | target/arm: Implement the CPY* instructionstarget/ target/ target/ +1 more | +535 | 1 reply | |
| 12/12 | target/arm: Enable FEAT_MOPS for CPU 'max'docs/ linux-user/ target/ | +3 | 1 reply |
Reviews trailers per patch
All 12 patches have a Reviewed-by or Acked-by.
| Patch | Richard Henderson | Philippe Mathieu-Daudé |
|---|---|---|
| 1/12 | R-b | |
| 2/12 | R-b | |
| 3/12 | R-b | R-b |
| 4/12 | R-b | |
| 5/12 | R-b | |
| 6/12 | R-b | |
| 7/12 | R-b | |
| 8/12 | R-b | |
| 9/12 | R-b | |
| 10/12 | R-b | |
| 11/12 | R-b | |
| 12/12 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/12] target/arm: Implement FEAT_MOPS
This patchset implements the Arm FEAT_MOPS architectural feature, which is a set of instructions to implement memory copy and set operations. The new instructions come in sets of three:
* SETP, SETM, SETE -- memory set
* SETGP, SETGM, SETME -- memory set with MTE tag setting
* CPYP, CPYM, CPYE -- memory copy
In each case the copy or set is divided between the "prologue", "main" and "epilogue" instructions in an implementation-defined way; in guest code they are expected to always appear in order.
Based-on: [email protected] ("target/arm: hwcaps updates, FEAT_HBC")
so we can set the MOPS hwcap in the last patch.
Changes v1->v2:
* one patch already upstream
* patches 7, 9, 11 updated to have separate helper functions for SET vs SETG and CPY vs CPYF
* use cpu_st16_mmu() for SETG memory set
* fix CPYFP saturation limit
* CPYFM and CPYFE now correctly always copy forwards
* patch 12 now sets the MOPS hwcap bit
Patches still needing review: 11, 12
There are two things in this patchset that are not currently ideal:
(1) the MTE tag checking is correct, but not optimal for performance, because it reuses the existing checkN() function, which was designed to work on small memory areas and so prefers to read tag memory a byte at a time rather than in larger chunks that then need masking. I have opted to leave this as a TODO comment in the code for future improvement rather than try to address it in the initial submission.
(2) we use the same approach the s390 memcopy instruction does, of checking for interrupts periodically so that a memcopy of 2GB doesn't stall the whole system. This doesn't work for icount mode, because there interrupts are all timed to number of instructions executed and the memcopy is still only a single insn regardless of how long it takes. I've not tried to tackle this because I'm not totally sure of what the right thing is, and also because it's a preexisting problem with the s390 equivalent insn anyway...
I think it's OK for this to go as-is, and we can think about those problems later, but am open to other opinions on that.
thanks
-- PMM
Peter Maydell (12):
target/arm: Don't skip MTE checks for LDRT/STRT at EL0 target/arm: Implement FEAT_MOPS enable bits
target/arm: Pass unpriv bool to get_a64_user_mem_index() target/arm: Define syndrome function for MOPS exceptions target/arm: New function allocation_tag_mem_probe() target/arm: Implement MTE tag-checking functions for FEAT_MOPS target/arm: Implement the SET* instructions
target/arm: Define new TB flag for ATA0
target/arm: Implement the SETG* instructions
target/arm: Implement MTE tag-checking functions for FEAT_MOPS copies target/arm: Implement the CPY* instructions
target/arm: Enable FEAT_MOPS for CPU 'max'
docs/system/arm/emulation.rst | 1 + target/arm/cpu.h | 7 + target/arm/internals.h | 55 +++ target/arm/syndrome.h | 12 + target/arm/tcg/helper-a64.h | 14 + target/arm/tcg/translate.h | 4 +- target/arm/tcg/a64.decode | 35 ++ linux-user/elfload.c | 1 + target/arm/helper.c | 28 +- target/arm/tcg/cpu64.c | 1 + target/arm/tcg/helper-a64.c | 878 +++++++++++++++++++++++++++++++++ target/arm/tcg/hflags.c | 21 + target/arm/tcg/mte_helper.c | 241 ++++++++- target/arm/tcg/translate-a64.c | 160 +++++- 14 files changed, 1419 insertions(+), 39 deletions(-)
Signature · 1 line
2.34.1