Skip to content

Miscellaneous x86 emulator fixes

Gleb Natapov kvm 2 versions – Applied

Status from this message: Applied all, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 3 repliesApplied
  2. v18 patches 1 replySuperseded

Changes in v2 from the cover letter

- move IOPL permission checking functions into emulate.c
- rename them to more intuitive names
- fix tr segment limit checking

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/8KVM: Add group8 instruction decoding.arch/x86/kvm/emulate.c+6 -10 replies
2/8KVM: Add group9 instruction decoding.arch/x86/kvm/emulate.c+7 -20 replies
3/8KVM: Add Virtual-8086 mode of emulation.arch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+10 -60 replies
4/8KVM: fix memory access during x86 emulation.arch/x86/include/asm/kvm_emulate.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/emulate.c +4 more+142 -500 replies
5/8KVM: Check IOPL level during io instruction emulation.arch/x86/include/asm/kvm_host.h arch/x86/kvm/emulate.c arch/x86/kvm/x86.c+87 -130 replies
6/8KVM: Fix popf emulation.arch/x86/kvm/emulate.c+54 -10 replies
7/8KVM: Check CPL level during privilege instruction emulation.arch/x86/kvm/emulate.c+20 -150 replies
8/8KVM: Add LOCK prefix validity checking.arch/x86/kvm/emulate.c+48 -370 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/8] Miscellaneous x86 emulator fixes

X86 emulator fails to do permission/correctness checking like real CPU does for some instruction. This patch series fixes some of those discrepancies.

Changelog:
v1->v2
- move IOPL permission checking functions into emulate.c
- rename them to more intuitive names
- fix tr segment limit checking

Gleb Natapov (8):
KVM: Add group8 instruction decoding.
KVM: Add group9 instruction decoding.
KVM: Add Virtual-8086 mode of emulation.
KVM: fix memory access during x86 emulation.
KVM: Check IOPL level during io instruction emulation.
KVM: Fix popf emulation.
KVM: Check CPL level during privilege instruction emulation.
KVM: Add LOCK prefix validity checking.

 arch/x86/include/asm/kvm_emulate.h |   15 ++-
 arch/x86/include/asm/kvm_host.h    |    8 +-
 arch/x86/kvm/emulate.c             |  286 ++++++++++++++++++++++++++++--------
 arch/x86/kvm/mmu.c                 |   17 +--
 arch/x86/kvm/mmu.h                 |    6 +
 arch/x86/kvm/paging_tmpl.h         |   11 +-
 arch/x86/kvm/x86.c                 |  144 +++++++++++++-----
 7 files changed, 368 insertions(+), 119 deletions(-)