Skip to content

arm: enable MTE for QEMU + kvm

Cornelia Huck kvm qemu-arm qemu-devel 7 versions – Applied

Status from this message: Applied to target-arm.next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest1 patch 13 repliesApplied
  2. v62 patches 14 repliesSuperseded
  3. v53 patches 18 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v42 patches15 repliesSuperseded
v32 patches3 repliesSuperseded
v2 RFC2 patches9 repliesSuperseded
v1 RFC2 patches10 repliesSuperseded

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/1arm/kvm: add support for MTEhw/arm/virt.c target/arm/cpu.c target/arm/cpu.h +3 more+107 -349 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchPeter MaydellRichard Henderson
1/1R-b R-b

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

Read the v7 thread

Cover letter [PATCH v7 0/1] arm: enable MTE for QEMU + kvm

v7 takes a different approach to wiring up MTE, so I still include a cover letter where I can explain things better, even though it is now only a single patch :)

Previous versions used a cpu property to control MTE enablement, while keeping the same semantics for the virt machine "mte" property as used with tcg. This version now uses the machine property for kvm as well; while it continues to control allocation of tag memory for tcg, it now also controls enablement of the kvm capability. Since the cpu prop is now gone, so is the testing via the arm cpu props test; I don't have a good idea for testing mte on kvm automatically, since it has a hard dependency on host support. (Should I tack some futher documentation somewhere? I'm not seeing an obvious place.)

A kvm guest with mte enabled still cannot be migrated (we need some uffd interface enhancements before we can support postcopy), so it is still off per default.

Another open problem is mte vs mte3: tcg emulates mte3, kvm gives the guest whatever the host supports. Without migration support, this is not too much of a problem yet, but for compatibility handling, we'll need a way to keep QEMU from handing out mte3 for guests that might be migrated to a mte3-less host. We could tack this unto the mte property (specifying the version or max supported), or we could handle this via cpu properties if we go with handling compatibility via cpu models (sorting this out for kvm is probably going to be interesting in general.) In any case, I think we'll need a way to inform kvm of it.

Tested with kvm selftests on FVP (as I still don't have any hardware with MTE...) and some make check(-tcg) incantations. Hopefully, I haven't (re)- introduced too many issues.

Cornelia Huck (1):
arm/kvm: add support for MTE

 hw/arm/virt.c        | 69 +++++++++++++++++++++++++-------------------
 target/arm/cpu.c     |  9 +++---
 target/arm/cpu.h     |  4 +++
 target/arm/kvm.c     | 35 ++++++++++++++++++++++
 target/arm/kvm64.c   |  5 ++++
 target/arm/kvm_arm.h | 19 ++++++++++++
 6 files changed, 107 insertions(+), 34 deletions(-)
Signature · 1 line
2.40.0