KVM: x86: SVM: Set EMULTYPE_NO_REEXECUTE for RSM emulation
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 23 Aug 2018 20:56:47 +0000 (13:56 -0700)
committerRadim Krčmář <rkrcmar@redhat.com>
Thu, 30 Aug 2018 14:20:43 +0000 (16:20 +0200)
commit35be0aded76b54a24dc8aa678a71bca22273e8d8
tree15f666c5fa16471f9ee542aa97dde24b4925d294
parentc4409905cd6eb42cfd06126e9226b0150e05a715
KVM: x86: SVM: Set EMULTYPE_NO_REEXECUTE for RSM emulation

Re-execution after an emulation decode failure is only intended to
handle a case where two or vCPUs race to write a shadowed page, i.e.
we should never re-execute an instruction as part of RSM emulation.

Add a new helper, kvm_emulate_instruction_from_buffer(), to support
emulating from a pre-defined buffer.  This eliminates the last direct
call to x86_emulate_instruction() outside of kvm_mmu_page_fault(),
which means x86_emulate_instruction() can be unexported in a future
patch.

Fixes: 7607b7174405 ("KVM: SVM: install RSM intercept")
Cc: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm.c