qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/2] arm: enable MTE for QEMU + kvm
@ 2022-07-07 16:16 Cornelia Huck
  2022-07-07 16:16 ` [PATCH RFC v2 1/2] arm/kvm: add support for MTE Cornelia Huck
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Cornelia Huck @ 2022-07-07 16:16 UTC (permalink / raw)
  To: Peter Maydell, Thomas Huth, Laurent Vivier
  Cc: Eric Auger, Dr. David Alan Gilbert, Juan Quintela, qemu-arm,
	qemu-devel, kvm, Cornelia Huck

This series makes it possible to enable MTE for kvm guests, if the kernel
supports it. Again, tested on the simulator via patiently waiting for the
arm64/mte kselftests to finish successfully.

For tcg, turning on mte on the machine level (to get tag memory) stays a
requirement. If the new mte cpu feature is not explicitly specified, a tcg
vm will get mte depending on the presence of tag memory (just as today).

For kvm, mte stays off by default; this is because migration is not yet
supported (postcopy will need an extension of the kernel interface, possibly
an extension of the userfaultfd interface), and turning on mte will add a
migration blocker.

My biggest question going forward is actually concerning migration; I gather
that we should not bother adding something unless postcopy is working as well?
If I'm not misunderstanding things, we need a way to fault in a page together
with the tag; doing that in one go is probably the only way that we can be
sure that this is race-free on the QEMU side. Comments welcome :)

Changes v1->v2: [Thanks to Eric for the feedback!]
- add documentation
- switch the mte prop to OnOffAuto; this improves the interaction with the
  existing mte machine prop
- leave mte off for kvm by default
- improve tests; the poking in QDicts feels a bit ugly, but seems to work

Cornelia Huck (2):
  arm/kvm: add support for MTE
  qtests/arm: add some mte tests

 docs/system/arm/cpu-features.rst |  21 +++++
 target/arm/cpu.c                 |  18 ++---
 target/arm/cpu.h                 |   1 +
 target/arm/cpu64.c               | 132 +++++++++++++++++++++++++++++++
 target/arm/internals.h           |   1 +
 target/arm/kvm64.c               |   5 ++
 target/arm/kvm_arm.h             |  12 +++
 target/arm/monitor.c             |   1 +
 tests/qtest/arm-cpu-features.c   |  77 ++++++++++++++++++
 9 files changed, 256 insertions(+), 12 deletions(-)

-- 
2.35.3



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

end of thread, other threads:[~2022-07-11 15:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-07 16:16 [PATCH RFC v2 0/2] arm: enable MTE for QEMU + kvm Cornelia Huck
2022-07-07 16:16 ` [PATCH RFC v2 1/2] arm/kvm: add support for MTE Cornelia Huck
2022-07-07 16:16 ` [PATCH RFC v2 2/2] qtests/arm: add some mte tests Cornelia Huck
2022-07-09  2:59 ` [PATCH RFC v2 0/2] arm: enable MTE for QEMU + kvm Richard Henderson
2022-07-11 13:24 ` Dr. David Alan Gilbert
2022-07-11 13:39   ` Peter Maydell
2022-07-11 14:26     ` Dr. David Alan Gilbert
2022-07-11 14:56       ` Cornelia Huck
2022-07-11 15:30         ` Dr. David Alan Gilbert
2022-07-11 13:55   ` Dr. David Alan Gilbert
2022-07-11 15:08   ` Cornelia Huck
2022-07-11 15:28     ` Dr. David Alan Gilbert

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).