Skip to content

RFC AMX support in Qemu

Yang Zhong qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7x86: Fix the 64-byte boundary enumeration for extended statetarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/kvm-cpu.c+5 -04 replies
2/7x86: Add AMX XTILECFG and XTILEDATA componentstarget/i386/cpu.c target/i386/cpu.h+23 -14 replies
3/7x86: Grant AMX permission for guesthw/i386/x86.c target/i386/cpu.h+35 -05 replies
4/7x86: Add XFD faulting bit for state componentstarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/kvm-cpu.c+3 -24 replies
5/7x86: Add AMX CPUIDs enumerationtarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/kvm.c+56 -40 replies
6/7x86: Use new XSAVE ioctls handlinglinux-headers/asm-x86/kvm.h linux-headers/linux/kvm.h target/i386/cpu.h +2 more+70 -26 replies
7/7x86: Support XFD and AMX xsave data migrationtarget/i386/cpu.h target/i386/kvm/kvm.c target/i386/machine.c+69 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/7] AMX support in Qemu

Intel introduces Advanced Matrix Extensions (AMX) [1] feature that consists of configurable two-dimensional "TILE" registers and new accelerator instructions that operate on them. TMUL (Tile matrix MULtiply) is the first accelerator instruction set to use the new registers.

This series is based on the AMX KVM series [2] and exposes AMX feature to guest (The detailed design discussions can be found in [3]).

According to the KVM design, the userspace VMM (e.g. Qemu) is expected to request guest permission for the dynamically-enabled XSAVE features only once when the first vCPU is created, and KVM checks guest permission in KVM_SET_CPUID2.

Intel AMX is XSAVE supported and XSAVE enabled. Those extended features has large state while current kvm_xsave only allows 4KB. The AMX KVM has extended struct kvm_xsave to meet this requirenment and added one extra KVM_GET_XSAVE2 ioctl to handle extended features. From our test, the AMX live migration work well.

Notice: This version still includes some definitions in the linux-headers, once AMX KVM is merged and Qemu sync those linux-headers, I will remove those definitions. So please ignore those changes.

[1] Intel Architecture Instruction Set Extension Programming Reference

    https://software.intel.com/content/dam/develop/external/us/en/documents/\
    architecture-instruction-set-extensions-programming-reference.pdf

[2] https://www.spinics.net/lists/kvm/msg263577.html
[3] https://www.spinics.net/lists/kvm/msg259015.html

Thanks,
Yang
----

Jing Liu (5):
x86: Fix the 64-byte boundary enumeration for extended state
x86: Add AMX XTILECFG and XTILEDATA components
x86: Add XFD faulting bit for state components
x86: Add AMX CPUIDs enumeration
x86: Use new XSAVE ioctls handling

Yang Zhong (1):
x86: Grant AMX permission for guest

Zeng Guang (1):
x86: Support XFD and AMX xsave data migration

 linux-headers/asm-x86/kvm.h | 14 ++++++++
 linux-headers/linux/kvm.h   |  2 ++
 target/i386/cpu.h           | 40 ++++++++++++++++++++++-
 hw/i386/x86.c               | 28 ++++++++++++++++
 target/i386/cpu.c           | 64 +++++++++++++++++++++++++++++++++++--
 target/i386/kvm/kvm-cpu.c   |  4 +++
 target/i386/kvm/kvm.c       | 37 +++++++++++++++++++--
 target/i386/machine.c       | 42 ++++++++++++++++++++++++
 target/i386/xsave_helper.c  | 35 ++++++++++++++++++++
 9 files changed, 259 insertions(+), 7 deletions(-)