]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Refactor __kvm_emulate_hypercall() into a macro
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Dec 2024 16:21:03 +0000 (11:21 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 22 Dec 2024 18:00:25 +0000 (13:00 -0500)
commitc50be1c9457d6c7486a7f592aa96ffbb8c3cde96
treed9b3a161c12d8cf4a2e5fad6da3447a4b9eb3690
parentd9eb86a6f43d74f08ee3b6eb99ad7eb2a7d7fce0
KVM: x86: Refactor __kvm_emulate_hypercall() into a macro

Rework __kvm_emulate_hypercall() into a macro so that completion of
hypercalls that don't exit to userspace use direct function calls to the
completion helper, i.e. don't trigger a retpoline when RETPOLINE=y.

Opportunistically take the names of the input registers, as opposed to
taking the input values, to preemptively dedup more of the calling code
(TDX needs to use different registers).  Use the direct GPR accessors to
read values to avoid the pointless marking of the registers as available
(KVM requires GPRs to always be available).

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Message-ID: <20241128004344.4072099-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h