path: root/arch
diff options
authorWanpeng Li <>2021-05-18 05:00:31 -0700
committerPaolo Bonzini <>2021-05-27 07:45:50 -0400
commit6bd5b743686243dae7351d5dcceeb7f171201bb4 (patch)
treec760534f54aca88f683598abe4a28bdde9bb1e19 /arch
parent28a4aa1160d71187a44414dac40b57d1fd9fcd77 (diff)
KVM: PPC: exit halt polling on need_resched()
This is inspired by commit 262de4102c7bb8 (kvm: exit halt polling on need_resched() as well). Due to PPC implements an arch specific halt polling logic, we have to the need_resched() check there as well. This patch adds a helper function that can be shared between book3s and generic halt-polling loops. Reviewed-by: David Matlack <> Reviewed-by: Venkatesh Srinivas <> Cc: Ben Segall <> Cc: Venkatesh Srinivas <> Cc: Jim Mattson <> Cc: David Matlack <> Cc: Paul Mackerras <> Cc: Suraj Jitindar Singh <> Signed-off-by: Wanpeng Li <> Message-Id: <> [Make the function inline. - Paolo] Signed-off-by: Paolo Bonzini <>
Diffstat (limited to 'arch')
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 28a80d240b76..7360350e66ff 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -3936,7 +3936,7 @@ static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc)
cur = ktime_get();
- } while (single_task_running() && ktime_before(cur, stop));
+ } while (kvm_vcpu_can_poll(cur, stop));
vc->vcore_state = VCORE_INACTIVE;