aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorBinbin Wu <binbin.wu@linux.intel.com>2025-02-22 09:42:18 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2025-03-14 14:20:54 -0400
commit44428e4936022a7a31743017849b167e64f33a32 (patch)
treece208f8baea8e5ce8072f559f508e333dec5041d /include/linux/kvm_host.h
parentKVM: x86: Have ____kvm_emulate_hypercall() read the GPRs (diff)
downloadwireguard-linux-44428e4936022a7a31743017849b167e64f33a32.tar.xz
wireguard-linux-44428e4936022a7a31743017849b167e64f33a32.zip
KVM: x86: Move pv_unhalted check out of kvm_vcpu_has_events()
Move pv_unhalted check out of kvm_vcpu_has_events(), check pv_unhalted explicitly when handling PV unhalt and expose kvm_vcpu_has_events(). kvm_vcpu_has_events() returns true if pv_unhalted is set, and pv_unhalted is only cleared on transitions to KVM_MP_STATE_RUNNABLE. If the guest initiates a spurious wakeup, pv_unhalted could be left set in perpetuity. Currently, this is not problematic because kvm_vcpu_has_events() is only called when handling PV unhalt. However, if kvm_vcpu_has_events() is used for other purposes in the future, it could return the unexpected results. Export kvm_vcpu_has_events() for its usage in broader contexts. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com> Message-ID: <20250222014225.897298-3-binbin.wu@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--include/linux/kvm_host.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 3bfe3140f444..ed1968f6f841 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1609,6 +1609,7 @@ void kvm_arch_disable_virtualization(void);
int kvm_arch_enable_virtualization_cpu(void);
void kvm_arch_disable_virtualization_cpu(void);
#endif
+bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu);
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);
int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);