Commit 44428e4
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>1 parent 6162b37 commit 44428e4
2 files changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11143 | 11143 | | |
11144 | 11144 | | |
11145 | 11145 | | |
11146 | | - | |
| 11146 | + | |
11147 | 11147 | | |
11148 | 11148 | | |
11149 | 11149 | | |
| |||
11152 | 11152 | | |
11153 | 11153 | | |
11154 | 11154 | | |
11155 | | - | |
11156 | | - | |
11157 | | - | |
11158 | 11155 | | |
11159 | 11156 | | |
11160 | 11157 | | |
| |||
11192 | 11189 | | |
11193 | 11190 | | |
11194 | 11191 | | |
| 11192 | + | |
11195 | 11193 | | |
11196 | 11194 | | |
11197 | 11195 | | |
11198 | | - | |
| 11196 | + | |
| 11197 | + | |
11199 | 11198 | | |
11200 | 11199 | | |
11201 | 11200 | | |
| |||
11331 | 11330 | | |
11332 | 11331 | | |
11333 | 11332 | | |
11334 | | - | |
| 11333 | + | |
11335 | 11334 | | |
11336 | 11335 | | |
11337 | 11336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
| 1612 | + | |
1612 | 1613 | | |
1613 | 1614 | | |
1614 | 1615 | | |
| |||
0 commit comments