Skip to content

KVM: emulate: enable AVX moves

Paolo Bonzini kvm lkml llvm oe-kbuild-all 1 version Applied

Status from this message: Applied to kvm-x86 misc, with massaged shortlogs to make it obvious these are

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 9 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/10KVM: emulate: add MOVNTDQAarch/x86/kvm/emulate.c+9 -40 replies
2/10KVM: emulate: move Src2Shift up one bitarch/x86/kvm/emulate.c+2 -11 reply
3/10KVM: emulate: improve formatting of flags tablearch/x86/kvm/emulate.c+11 -161 reply
4/10KVM: emulate: move op_prefix to struct x86_emulate_ctxtarch/x86/kvm/emulate.c arch/x86/kvm/kvm_emulate.h+5 -41 reply
5/10KVM: emulate: share common register decoding codearch/x86/kvm/emulate.c+17 -321 reply
6/10KVM: emulate: add get_xcr callbackarch/x86/kvm/kvm_emulate.h arch/x86/kvm/x86.c+10 -01 reply
7/10KVM: emulate: add AVX support to register fetch and writebackarch/x86/kvm/emulate.c arch/x86/kvm/fpu.h arch/x86/kvm/kvm_emulate.h+110 -170 replies
8/10KVM: x86: Refactor REX prefix handling in instruction emulationarch/x86/kvm/emulate.c arch/x86/kvm/kvm_emulate.h+31 -131 reply
9/10KVM: emulate: decode VEX prefixarch/x86/kvm/emulate.c+112 -100 replies
10/10KVM: emulate: enable AVX movesarch/x86/kvm/emulate.c+7 -70 replies

Reviews trailers per patch

5 of 10 patches have a Reviewed-by or Acked-by.

PatchChang S. Bae
1/10
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10
8/10
9/10
10/10

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

Read the v1 thread

Cover letter [PATCH 00/10] KVM: emulate: enable AVX moves

Over a year ago, Keith Busch posted an RFC patch to enable VMOVDQA and VMOVDQU instructions in the KVM emulator. The reason to do so is that people are using QEMU to emulate fancy devices whose drivers use those instructions with BARs that, on real hardware, would presumably support write combining. These same people obviously would appreciate being able to use KVM instead of emulation, hence the request.

The original patch was not bad at all, but missed a few details:

- checking in XCR0 if AVX is enabled (which also protects against *hosts* with AVX disabled)

- 32-bit support

- clearing the high bytes of AVX registers if VEX.L=0

- checking some invalid prefix combinations

The ugly parts are in patch 7, which has to juggle the fact that the same instruction can decode to SSE and AVX, and we only know which are valid after all the groups are handled.

While at it I also included a small refactoring taken out of the APX series, by Chang S. Bae, some cleanups, and an extra MOVNTDQ instruction.

Paolo

Chang S. Bae (1):
KVM: x86: Refactor REX prefix handling in instruction emulation

Paolo Bonzini (9):
KVM: emulate: add MOVNTDQA
KVM: emulate: move Src2Shift up one bit
KVM: emulate: improve formatting of flags table
KVM: emulate: move op_prefix to struct x86_emulate_ctxt
KVM: emulate: share common register decoding code
KVM: emulate: add get_xcr callback
KVM: emulate: add AVX support to register fetch and writeback
KVM: emulate: decode VEX prefix
KVM: emulate: enable AVX moves

 arch/x86/kvm/emulate.c     | 320 ++++++++++++++++++++++++++-----------
 arch/x86/kvm/fpu.h         |  62 +++++++
 arch/x86/kvm/kvm_emulate.h |  20 ++-
 arch/x86/kvm/x86.c         |   9 ++
 4 files changed, 311 insertions(+), 100 deletions(-)
Signature · 1 line
2.43.5