Skip to content

Direct decode in emulator

Avi Kivity kvm 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest22 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/22KVM: x86 emulator: drop parentheses in repreat macrosarch/x86/kvm/emulate.c+3 -30 replies
2/22KVM: x86 emulator: introduce 'struct opcode'arch/x86/kvm/emulate.c+12 -80 replies
3/22KVM: x86 emulator: Add wrappers for easily defining opcodesarch/x86/kvm/emulate.c+150 -1440 replies
4/22KVM: x86 emulator: move group tables to toparch/x86/kvm/emulate.c+38 -380 replies
5/22KVM: x86 emulator: reserve group code 0arch/x86/kvm/emulate.c+1 -10 replies
6/22KVM: x86 emulator: allow specifying group directly in opcodearch/x86/kvm/emulate.c+38 -90 replies
7/22KVM: x86 emulator: convert group 1 to new stylearch/x86/kvm/emulate.c+9 -70 replies
8/22KVM: x86 emulator: convert group 1A to new stylearch/x86/kvm/emulate.c+6 -40 replies
9/22KVM: x86 emulator: convert group 3 to new stylearch/x86/kvm/emulate.c+6 -40 replies
10/22KVM: x86 emulator: convert group 4 to new stylearch/x86/kvm/emulate.c+6 -40 replies
11/22KVM: x86 emulator: convert group 5 to new stylearch/x86/kvm/emulate.c+6 -40 replies
12/22KVM: x86 emulator: convert group 7 to new stylearch/x86/kvm/emulate.c+10 -80 replies
13/22KVM: x86 emulator: convert group 8 to new stylearch/x86/kvm/emulate.c+6 -40 replies
14/22KVM: x86 emulator: convert group 9 to new stylearch/x86/kvm/emulate.c+8 -60 replies
15/22KVM: x86 emulator: drop support for old-style groupsarch/x86/kvm/emulate.c+7 -250 replies
16/22KVM: x86 emulator: move ByteOp and Dst back to bits 0:3arch/x86/kvm/emulate.c+8 -80 replies
17/22KVM: x86 emulator: store x86_emulate_ops in emulation contextarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+13 -110 replies
18/22KVM: x86 emulator: allow storing emulator execution function in decode tablesarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c+13 -00 replies
19/22KVM: x86 emulator: move x86_decode_insn() downwardsarch/x86/kvm/emulate.c+372 -3720 replies
20/22KVM: x86 emulator: move decode tables downwardsarch/x86/kvm/emulate.c+236 -2360 replies
21/22KVM: x86 emulator: allow repeat macro arguments to contain commasarch/x86/kvm/emulate.c+8 -80 replies
22/22KVM: x86 emulator: convert some push instructions to direct decodearch/x86/kvm/emulate.c+9 -90 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/22] Direct decode in emulator

Currently the emulator decoder is indirect in two ways: groups are looked up in a separate table based on group number; and opcode execution is looked up in a big switch (actually two) after the opcode flags lookup.

This patchset converts groups to direct decode and begins the work for opcode decode.

The motivations are:
- reduce errors from discrepancies between the two tables (like we had for IRET)
- make the code easier to read, removing many switch () statements
- eventually remove the #UD mini-decoder in x86.c by adding subgroup support to the emulator

Avi Kivity (22):
KVM: x86 emulator: drop parentheses in repreat macros
KVM: x86 emulator: introduce 'struct opcode'
KVM: x86 emulator: Add wrappers for easily defining opcodes
KVM: x86 emulator: move group tables to top
KVM: x86 emulator: reserve group code 0
KVM: x86 emulator: allow specifying group directly in opcode
KVM: x86 emulator: convert group 1 to new style
KVM: x86 emulator: convert group 1A to new style
KVM: x86 emulator: convert group 3 to new style
KVM: x86 emulator: convert group 4 to new style
KVM: x86 emulator: convert group 5 to new style
KVM: x86 emulator: convert group 7 to new style
KVM: x86 emulator: convert group 8 to new style
KVM: x86 emulator: convert group 9 to new style
KVM: x86 emulator: drop support for old-style groups
KVM: x86 emulator: move ByteOp and Dst back to bits 0:3
KVM: x86 emulator: store x86_emulate_ops in emulation context
KVM: x86 emulator: allow storing emulator execution function in
decode tables
KVM: x86 emulator: move x86_decode_insn() downwards
KVM: x86 emulator: move decode tables downwards
KVM: x86 emulator: allow repeat macro arguments to contain commas
KVM: x86 emulator: convert some push instructions to direct decode

 arch/x86/include/asm/kvm_emulate.h |   10 +-
 arch/x86/kvm/emulate.c             | 1253 +++++++++++++++++++-----------------
 arch/x86/kvm/x86.c                 |    7 +-
 3 files changed, 661 insertions(+), 609 deletions(-)