]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: SVM: Use asm goto to handle unexpected #UD on SVM instructions
authorSean Christopherson <seanjc@google.com>
Thu, 31 Dec 2020 00:27:00 +0000 (16:27 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:33 +0000 (05:27 -0500)
commit35a7831912f455d7d19b31cd9300e73f585a077b
tree8de462b69c885d232be5a771cf5901d328559bba
parent6a289139479845f12e44108b4d52cf0194bd5ff3
KVM: SVM: Use asm goto to handle unexpected #UD on SVM instructions

Add svm_asm*() macros, a la the existing vmx_asm*() macros, to handle
faults on SVM instructions instead of using the generic __ex(), a.k.a.
__kvm_handle_fault_on_reboot().  Using asm goto generates slightly
better code as it eliminates the in-line JMP+CALL sequences that are
needed by __kvm_handle_fault_on_reboot() to avoid triggering BUG()
from fixup (which generates bad stack traces).

Using SVM specific macros also drops the last user of __ex() and the
the last asm linkage to kvm_spurious_fault(), and adds a helper for
VMSAVE, which may gain an addition call site in the future (as part
of optimizing the SVM context switching).

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20201231002702.2223707-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm_ops.h [new file with mode: 0644]