KVM: x86: allow defining return-0 static calls
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Feb 2022 18:07:10 +0000 (13:07 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Feb 2022 17:44:22 +0000 (12:44 -0500)
commit5be2226f417d5b06d17e6c52d6e341cf43c29e48
tree21110cf9b519a8c4de6fb799ed7db0ffdb4117a5
parentabb6d479e22642c82d552970d85edd9b5fe8beb6
KVM: x86: allow defining return-0 static calls

A few vendor callbacks are only used by VMX, but they return an integer
or bool value.  Introduce KVM_X86_OP_OPTIONAL_RET0 for them: if a func is
NULL in struct kvm_x86_ops, it will be changed to __static_call_return0
when updating static calls.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm-x86-ops.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/avic.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/x86.c
kernel/static_call.c