]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Unexport x86_emulate_instruction()
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 23 Aug 2018 20:56:53 +0000 (13:56 -0700)
committerRadim Krčmář <rkrcmar@redhat.com>
Thu, 30 Aug 2018 14:20:44 +0000 (16:20 +0200)
commit2e564ab3b6c0ea54bef9ebc0327ba2fa62cffa5d
treeef2581bf6e2efe2921d851a4983a6be74df5b22f
parent759f99e1c9baaf96e01e9bddbce5b199142cac18
KVM: x86: Unexport x86_emulate_instruction()

Allowing x86_emulate_instruction() to be called directly has led to
subtle bugs being introduced, e.g. not setting EMULTYPE_NO_REEXECUTE
in the emulation type.  While most of the blame lies on re-execute
being opt-out, exporting x86_emulate_instruction() also exposes its
cr2 parameter, which may have contributed to commit f6fc2cda0f2e
("x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO
when running nested") using x86_emulate_instruction() instead of
emulate_instruction() because "hey, I have a cr2!", which in turn
introduced its EMULTYPE_NO_REEXECUTE bug.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h