KVM: x86: Add function for vectoring error generation
authorIvan Orlov <iorlov@amazon.com>
Tue, 17 Dec 2024 18:14:52 +0000 (18:14 +0000)
committerSean Christopherson <seanjc@google.com>
Wed, 18 Dec 2024 23:14:41 +0000 (15:14 -0800)
commit11c98fa07a792c7667c9c0d4f3c7f2d620bfb7f0
treea85d26fc9c109609cf636e93c7186abc789e978d
parent871ac338ef553faf8c1c2f71dc4636b35d176ef4
KVM: x86: Add function for vectoring error generation

Extract VMX code for unhandleable VM-Exit during vectoring into
vendor-agnostic function so that boiler-plate code can be shared by SVM.

To avoid unnecessarily complexity in the helper, unconditionally report a
GPA to userspace instead of having a conditional entry.  For exits that
don't report a GPA, i.e. everything except EPT Misconfig, simply report
KVM's "invalid GPA".

Signed-off-by: Ivan Orlov <iorlov@amazon.com>
Link: https://lore.kernel.org/r/20241217181458.68690-2-iorlov@amazon.com
[sean: clarify that the INVALID_GPA logic is new]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c