Skip to content

RFC target/arm: Add MTE support to KVM guest

Haibo Xu qemu-arm qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest5 patches 9 repliesIn review
  2. v1 RFC5 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Update Linux headers with new MTE supportlinux-headers/linux/kvm.h+16 -00 replies
2/5Add basic MTE support to KVM guesthw/arm/virt.c target/arm/cpu.c target/arm/kvm.c +1 more+28 -120 replies
3/5Add APIs to get/set MTE tagstarget/arm/kvm64.c target/arm/kvm_arm.h+26 -02 replies
4/5Add migration support for KVM guest with MTEinclude/hw/arm/virt.h include/migration/misc.h migration/ram.c+88 -16 replies
5/5Enable the MTE support for KVM guesthw/arm/virt.c+19 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/5] target/arm: Add MTE support to KVM guest

This version is rebased against kernel patches v10, and only header files are updated since v1[1].

This series add support for MTE(Memory Tagging Extension)[2] in KVM guest. It's based on Steven Price's kernel KVM patches v10[3], and has been tested to ensure that test case[4] can be passed in a KVM guest. Basic pre-copy migration test also passed between two MTE enabled kvm guest.

This is a RFC patch series becuase:
(1) Need to add some arm MTE specific codes to the ram migration loop. There may be better way to do that in a more abstract way.
(2) Only pre-copy migration is supported and tested currently, post-copy as well as compress/zero page migration are still WIP.

All kinds of feedbacks are very welcomed, especially for the migration support.

Note:
(1) To support MTE migration, tags for one page are appended to the page data during ram save iteration which make it easier to sync the page data and tags.

[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://community.arm.com/developer/ip-products/processors/b/
processors-ip-blog/posts/enhancing-memory-safety
[3] https://patchew.org/QEMU/[email protected]/
[4] https://elixir.bootlin.com/linux/latest/source/Documentation/
arm64/memory-tagging-extension.rst

Haibo Xu (5):
Update Linux headers with new MTE support
Add basic MTE support to KVM guest
Add APIs to get/set MTE tags
Add migration support for KVM guest with MTE
Enable the MTE support for KVM guest

 hw/arm/virt.c             | 44 +++++++++++++-------
 include/hw/arm/virt.h     |  2 +
 include/migration/misc.h  |  1 +
 linux-headers/linux/kvm.h | 16 ++++++++
 migration/ram.c           | 86 ++++++++++++++++++++++++++++++++++++++-
 target/arm/cpu.c          |  2 +-
 target/arm/kvm.c          |  9 ++++
 target/arm/kvm64.c        | 31 ++++++++++++++
 target/arm/kvm_arm.h      |  2 +
 9 files changed, 177 insertions(+), 16 deletions(-)
Signature · 1 line
2.17.1