qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: [PATCH 00/14] target/arm: Implement FEAT_MOPS
Date: Thu,  7 Sep 2023 17:03:26 +0100	[thread overview]
Message-ID: <20230907160340.260094-1-peter.maydell@linaro.org> (raw)

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.

The first couple of patches here are a cleanup (already been seen
on list) and a bugfix for something I noticed while testing the
MTE related parts of this.

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

Aaron Lindsay (1):
  target/arm: Add ID_AA64ISAR2_EL1

Peter Maydell (13):
  target/arm: Remove unused allocation_tag_mem() argument
  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               |   8 +
 target/arm/internals.h         |  55 +++
 target/arm/syndrome.h          |  12 +
 target/arm/tcg/helper-a64.h    |   8 +
 target/arm/tcg/translate.h     |   4 +-
 target/arm/tcg/a64.decode      |  33 ++
 target/arm/helper.c            |  32 +-
 target/arm/hvf/hvf.c           |   1 +
 target/arm/kvm64.c             |   2 +
 target/arm/tcg/cpu64.c         |   4 +
 target/arm/tcg/helper-a64.c    | 816 +++++++++++++++++++++++++++++++++
 target/arm/tcg/hflags.c        |  21 +
 target/arm/tcg/mte_helper.c    | 280 +++++++++--
 target/arm/tcg/translate-a64.c | 157 ++++++-
 15 files changed, 1366 insertions(+), 68 deletions(-)

-- 
2.34.1



             reply	other threads:[~2023-09-07 16:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 16:03 Peter Maydell [this message]
2023-09-07 16:03 ` [PATCH 01/14] target/arm: Remove unused allocation_tag_mem() argument Peter Maydell
2023-09-08 14:12   ` Philippe Mathieu-Daudé
2023-09-07 16:03 ` [PATCH 02/14] target/arm: Don't skip MTE checks for LDRT/STRT at EL0 Peter Maydell
2023-09-08 19:53   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 03/14] target/arm: Add ID_AA64ISAR2_EL1 Peter Maydell
2023-09-08 14:14   ` Philippe Mathieu-Daudé
2023-09-07 16:03 ` [PATCH 04/14] target/arm: Implement FEAT_MOPS enable bits Peter Maydell
2023-09-08 20:56   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 05/14] target/arm: Pass unpriv bool to get_a64_user_mem_index() Peter Maydell
2023-09-08 14:19   ` Philippe Mathieu-Daudé
2023-09-08 20:45   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 06/14] target/arm: Define syndrome function for MOPS exceptions Peter Maydell
2023-09-08 20:45   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 07/14] target/arm: New function allocation_tag_mem_probe() Peter Maydell
2023-09-08 20:51   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 08/14] target/arm: Implement MTE tag-checking functions for FEAT_MOPS Peter Maydell
2023-09-08 20:52   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 09/14] target/arm: Implement the SET* instructions Peter Maydell
2023-09-09 15:58   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 10/14] target/arm: Define new TB flag for ATA0 Peter Maydell
2023-09-09 16:03   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 11/14] target/arm: Implement the SETG* instructions Peter Maydell
2023-09-09 16:38   ` Richard Henderson
2023-09-11 14:17     ` Peter Maydell
2023-09-11 21:17       ` Richard Henderson
2023-09-07 16:03 ` [PATCH 12/14] target/arm: Implement MTE tag-checking functions for FEAT_MOPS copies Peter Maydell
2023-09-09 16:42   ` Richard Henderson
2023-09-07 16:03 ` [PATCH 13/14] target/arm: Implement the CPY* instructions Peter Maydell
2023-09-09 17:06   ` Richard Henderson
2023-09-12 12:27     ` Peter Maydell
2023-09-07 16:03 ` [PATCH 14/14] target/arm: Enable FEAT_MOPS for CPU 'max' Peter Maydell
2023-09-09 16:53   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230907160340.260094-1-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).