KVM: x86: Don't re-execute instruction when not passing CR2 value
authorLiran Alon <[email protected]>
Sun, 5 Nov 2017 14:56:34 +0000 (16:56 +0200)
committerPaolo Bonzini <[email protected]>
Fri, 17 Nov 2017 12:20:12 +0000 (13:20 +0100)
commit9b8ae63798cb97e785a667ff27e43fa6220cb734
treee5732370f46844671ffe7644b5ae342e6de98480
parent1f4dcb3b213235e642088709a1c54964d23365e9
KVM: x86: Don't re-execute instruction when not passing CR2 value

In case of instruction-decode failure or emulation failure,
x86_emulate_instruction() will call reexecute_instruction() which will
attempt to use the cr2 value passed to x86_emulate_instruction().
However, when x86_emulate_instruction() is called from
emulate_instruction(), cr2 is not passed (passed as 0) and therefore
it doesn't make sense to execute reexecute_instruction() logic at all.

Fixes: 51d8b66199e9 ("KVM: cleanup emulate_instruction")
Signed-off-by: Liran Alon <[email protected]>
Reviewed-by: Nikita Leshenko <[email protected]>
Reviewed-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Reviewed-by: Wanpeng Li <[email protected]>
Signed-off-by: Radim Krčmář <[email protected]>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/vmx.c