KVM: x86: Refactor can_emulate_instruction() return to be more expressive
authorSean Christopherson <seanjc@google.com>
Fri, 25 Aug 2023 01:36:20 +0000 (18:36 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 4 Oct 2023 22:08:53 +0000 (15:08 -0700)
commitaeb904f6b9f1de588cf3130dc8a2c458b236704e
tree0773fdadcdcf863edc4f9f64cdb45940f30abc0d
parentbc3d7c5570a03ab45bde4bae83697c80900fb714
KVM: x86: Refactor can_emulate_instruction() return to be more expressive

Refactor and rename can_emulate_instruction() to allow vendor code to
return more than true/false, e.g. to explicitly differentiate between
"retry", "fault", and "unhandleable".  For now, just do the plumbing, a
future patch will expand SVM's implementation to signal outright failure
if KVM attempts EMULTYPE_SKIP on an SEV guest.

No functional change intended (or rather, none that are visible to the
guest or userspace).

Link: https://lore.kernel.org/r/20230825013621.2845700-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm-x86-ops.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c