Skip to content

next round of emulator cleanups

Gleb Natapov kvm 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest23 patches 5 repliesApplied
  2. v123 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- add x86_emulator_ops callback to get cached segment base
- use double underscore on helper functions
- fold "remove unneeded initialization" patch

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/23KVM: x86 emulator: introduce read cache.arch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c+43 -140 replies
2/23KVM: x86 emulator: fix Move r/m16 to segment register decoding.arch/x86/kvm/emulate.c+1 -10 replies
3/23KVM: x86 emulator: cleanup xchg emulation.arch/x86/kvm/emulate.c+2 -20 replies
4/23KVM: x86 emulator: cleanup nop emulationarch/x86/kvm/emulate.c+2 -20 replies
5/23KVM: x86 emulator: handle "far address" source operand.arch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c+37 -250 replies
6/23KVM: x86 emulator: add (set|get)_dr callbacks to x86_emulate_opsarch/x86/include/asm/kvm_emulate.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/emulate.c +1 more+13 -120 replies
7/23KVM: x86 emulator: add (set|get)_msr callbacks to x86_emulate_opsarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+22 -180 replies
8/23KVM: x86 emulator: add get_cached_segment_base() callback to x86_emulate_ops.arch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+9 -120 replies
9/23KVM: x86 emulator: cleanup some direct calls into kvm to use existing callbacksarch/x86/kvm/emulate.c+105 -950 replies
10/23KVM: x86 emulator: make set_cr() callback return error if it failsarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+84 -760 replies
11/23KVM: x86 emulator: make (get|set)_dr() callback return error if it failsarch/x86/kvm/emulate.c arch/x86/kvm/x86.c+45 -290 replies
12/23KVM: x86 emulator: fix X86EMUL_RETRY_INSTR and X86EMUL_CMPXCHG_FAILED valuesarch/x86/include/asm/kvm_emulate.h+3 -20 replies
13/23KVM: fill in run->mmio details in (read|write)_emulated function.arch/x86/kvm/x86.c+9 -160 replies
14/23KVM: x86 emulator: x86_emulate_insn() return -1 only in case of emulation failurearch/x86/include/asm/kvm_emulate.h arch/x86/kvm/x86.c+19 -180 replies
15/23KVM: remove export of emulator_write_emulated().arch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+0 -60 replies
16/23KVM: do not inject #PF in (read|write)_emulated() callbacksarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+28 -150 replies
17/23KVM: handle emulation failure case first.arch/x86/kvm/x86.c+15 -160 replies
18/23KVM: x86 emulator: advance RIP outside x86 emulator codearch/x86/kvm/emulate.c arch/x86/kvm/x86.c+7 -40 replies
19/23KVM: x86 emulator: set RFLAGS outside x86 emulator code.arch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+1 -80 replies
20/23KVM: x86 emulator: use shadowed register in emulate_sysexit()arch/x86/kvm/emulate.c+2 -20 replies
21/23KVM: x86 exmulator: handle shadowed registers outside emulator.arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+13 -180 replies
22/23KVM: x86 emulator: move interruptibility state tracking out of emulatorarch/x86/kvm/emulate.c arch/x86/kvm/x86.c+19 -200 replies
23/23KVM: x86 emulator: do not inject exception directly into vcpuarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+100 -503 replies

Reviews trailers per patch

None of the 23 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAvi Kivity
SeriesR-b
1/23
2/23
3/23
4/23
5/23
6/23
7/23
8/23
9/23
10/23
11/23
12/23
13/23
14/23
15/23
16/23
17/23
18/23
19/23
20/23
21/23
22/23
23/23

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

Read the v2 thread

Cover letter [PATCHv2 00/23] next round of emulator cleanups

This is the next round of emulator cleanups. Make it even more detached from kvm. First patch introduces IO read cache which is needed to correctly emulate instructions that require more then one IO read exit during emulation.

ChangeLog;

v1->v2:
- add x86_emulator_ops callback to get cached segment base
- use double underscore on helper functions
- fold "remove unneeded initialization" patch

Gleb Natapov (23):
KVM: x86 emulator: introduce read cache.
KVM: x86 emulator: fix Move r/m16 to segment register decoding.
KVM: x86 emulator: cleanup xchg emulation.
KVM: x86 emulator: cleanup nop emulation
KVM: x86 emulator: handle "far address" source operand.
KVM: x86 emulator: add (set|get)_dr callbacks to x86_emulate_ops
KVM: x86 emulator: add (set|get)_msr callbacks to x86_emulate_ops
KVM: x86 emulator: add get_cached_segment_base() callback to

    x86_emulate_ops.

KVM: x86 emulator: cleanup some direct calls into kvm to use existing
callbacks
KVM: x86 emulator: make set_cr() callback return error if it fails
KVM: x86 emulator: make (get|set)_dr() callback return error if it
fails
KVM: x86 emulator: fix X86EMUL_RETRY_INSTR and X86EMUL_CMPXCHG_FAILED
values
KVM: fill in run->mmio details in (read|write)_emulated function.
KVM: x86 emulator: x86_emulate_insn() return -1 only in case of
emulation failure
KVM: remove export of emulator_write_emulated().
KVM: do not inject #PF in (read|write)_emulated() callbacks
KVM: handle emulation failure case first.
KVM: x86 emulator: advance RIP outside x86 emulator code
KVM: x86 emulator: set RFLAGS outside x86 emulator code.
KVM: x86 emulator: use shadowed register in emulate_sysexit()
KVM: x86 exmulator: handle shadowed registers outside emulator.
KVM: x86 emulator: move interruptibility state tracking out of
emulator
KVM: x86 emulator: do not inject exception directly into vcpu

 arch/x86/include/asm/kvm_emulate.h |   30 ++-
 arch/x86/include/asm/kvm_host.h    |    9 -
 arch/x86/kvm/emulate.c             |  559 ++++++++++++++++++++----------------
 arch/x86/kvm/x86.c                 |  382 ++++++++++++++-----------
 4 files changed, 549 insertions(+), 431 deletions(-)