]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Add a helper to check for user interception of KVM hypercalls
authorBinbin Wu <binbin.wu@linux.intel.com>
Thu, 28 Nov 2024 00:43:40 +0000 (16:43 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 22 Dec 2024 18:00:25 +0000 (13:00 -0500)
commitc4c083d95105445ebf1cadfb7d05dd2630976241
tree03ab07a860124c8a178ada6f62862144f6cf76f1
parent9a1dfeff4414112ce89652a5017538016ccd656c
KVM: x86: Add a helper to check for user interception of KVM hypercalls

Add and use user_exit_on_hypercall() to check if userspace wants to handle
a KVM hypercall instead of open-coding the logic everywhere.

No functional change intended.

Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
[sean: squash into one patch, keep explicit KVM_HC_MAP_GPA_RANGE check]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Message-ID: <20241128004344.4072099-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h