qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 00/10] target/arm: add support for MTE4
@ 2025-11-17  1:40 Gabriel Brookman
  2025-11-17  1:40 ` [PATCH RFC v2 01/10] target/arm: explicitly disable MTE4 for max Gabriel Brookman
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Gabriel Brookman @ 2025-11-17  1:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Gustavo Romero, qemu-arm, Gabriel Brookman

This patch implements ARM's Enhanced Memory Tagging Extension (MTE4).
MTE4 guarantees the presence of several subfeatures:
FEAT_MTE_CANONICAL_TAGS, FEAT_MTE_TAGGED_FAR, FEAT_MTE_STORE_ONLY,
FEAT_MTE_NO_ADDRESS_TAGS, and FEAT_MTE_PERM, none of which are
currently implemented in QEMU.

According to the ARM ARM, the presence of any of these features (except
FEAT_MTE_PERM) implies the presence of all the others. For simplicity  
and ease of review, I plan to introduce them one at a time. This patch
handles all features except FEAT_MTE_PERM, with the plan to introduce
FEAT_MTE_PERM in the next iteration of the patch.

Testing:
  - To test this code, I used the tests included, plus modifications to
    enable the EL1 control bits for the features being tested. These
    features rely on EL1 control bits, which cannot be set in user-mode.
    Please advise on the preferred strategy for testing EL1-dependent
    behavior in user-mode tests.

The next version of this patch will include the MTE_PERM feature, since
MTE4 guarantees its existence.

Thanks,
Gabriel Brookman

Signed-off-by: Gabriel Brookman <brookmangabriel@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3116
---
Changes in v2:
- Added tests for STORE_ONLY.
- Refined commit messages.
- Added FEAT_MTE_CANONICAL_TAGS and FEAT_MTE_NO_ADDRESS_TAGS + tests.
- fixed TCSO bit macro names.
- Link to v1: https://lore.kernel.org/qemu-devel/20251111-feat-mte4-v1-0-72ef5cf276f9@gmail.com

---
Gabriel Brookman (10):
      target/arm: explicitly disable MTE4 for max
      tests/tcg: added test for MTE FAR
      target/arm: add TCSO bitmasks to SCTLR
      target/arm: add FEAT_MTE_STORE_ONLY logic
      tests/tcg: added test for MTE write-only
      target/arm: add canonical and no-address tag logic
      target/arm: ldg on canonical tag loads the tag
      target/arm: storing to canonical tags faults
      tests/tcg: added test for MTE canonical and NAT
      docs: added MTE4 features to docs

 docs/system/arm/emulation.rst     |  4 ++
 target/arm/cpu.h                  |  2 +
 target/arm/helper.c               |  4 +-
 target/arm/internals.h            | 40 +++++++++++++++++
 target/arm/tcg/cpu64.c            |  8 ++++
 target/arm/tcg/mte_helper.c       | 95 ++++++++++++++++++++++++++++++++++++++-
 tests/tcg/aarch64/Makefile.target |  2 +-
 tests/tcg/aarch64/mte-10.c        | 55 +++++++++++++++++++++++
 tests/tcg/aarch64/mte-11.c        | 46 +++++++++++++++++++
 tests/tcg/aarch64/mte-9.c         | 48 ++++++++++++++++++++
 10 files changed, 299 insertions(+), 5 deletions(-)
---
base-commit: 9febfa94b69b7146582c48a868bd2330ac45037f
change-id: 20251109-feat-mte4-6740a6202e83

Best regards,
-- 
Gabriel Brookman <brookmangabriel@gmail.com>



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2025-11-19  7:52 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17  1:40 [PATCH RFC v2 00/10] target/arm: add support for MTE4 Gabriel Brookman
2025-11-17  1:40 ` [PATCH RFC v2 01/10] target/arm: explicitly disable MTE4 for max Gabriel Brookman
2025-11-17  9:48   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 02/10] tests/tcg: added test for MTE FAR Gabriel Brookman
2025-11-17  9:51   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 03/10] target/arm: add TCSO bitmasks to SCTLR Gabriel Brookman
2025-11-17 15:14   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 04/10] target/arm: add FEAT_MTE_STORE_ONLY logic Gabriel Brookman
2025-11-17 15:26   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 05/10] tests/tcg: added test for MTE write-only Gabriel Brookman
2025-11-17 15:39   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 06/10] target/arm: add canonical and no-address tag logic Gabriel Brookman
2025-11-17 16:18   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 07/10] target/arm: ldg on canonical tag loads the tag Gabriel Brookman
2025-11-17 16:26   ` Richard Henderson
2025-11-18 17:31     ` brookmangabriel
2025-11-17  1:40 ` [PATCH RFC v2 08/10] target/arm: storing to canonical tags faults Gabriel Brookman
2025-11-19  7:48   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 09/10] tests/tcg: added test for MTE canonical and NAT Gabriel Brookman
2025-11-19  7:49   ` Richard Henderson
2025-11-17  1:40 ` [PATCH RFC v2 10/10] docs: added MTE4 features to docs Gabriel Brookman
2025-11-19  7:51   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).