]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Fix x86_decode_insn() return when fetching insn bytes fails
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 15 Aug 2019 16:20:32 +0000 (09:20 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 22 Aug 2019 08:09:17 +0000 (10:09 +0200)
commit8ac933db1791740ec42605e9f74a488afe32ba12
tree1514db0d32c2190220c48ade2ee2619a38472f9f
parentb5cfc7e691bb36b13949872f5d81788a86805ce7
KVM: x86: Fix x86_decode_insn() return when fetching insn bytes fails

Jump to the common error handling in x86_decode_insn() if
__do_insn_fetch_bytes() fails so that its error code is converted to the
appropriate return type.  Although the various helpers used by
x86_decode_insn() return X86EMUL_* values, x86_decode_insn() itself
returns EMULATION_FAILED or EMULATION_OK.

This doesn't cause a functional issue as the sole caller,
x86_emulate_instruction(), currently only cares about success vs.
failure, and success is indicated by '0' for both types
(X86EMUL_CONTINUE and EMULATION_OK).

Fixes: 572c75c5f496 ("KVM: emulate: speed up do_insn_fetch")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c