kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: X86: set vcpu preempted only if it is preempted
@ 2022-01-12 12:02 Li RongQing
  2022-01-12 13:08 ` Peter Zijlstra
  0 siblings, 1 reply; 14+ messages in thread
From: Li RongQing @ 2022-01-12 12:02 UTC (permalink / raw)
  To: pbonzini, seanjc, vkuznets, wanpengli, jmattson, tglx, bp, x86,
	kvm, joro

vcpu can schedule out when run halt instruction, and set itself
to INTERRUPTIBLE and switch to idle thread, vcpu should not be
set preempted for this condition

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Wang GuangJu <wangguangju@baidu.com>
---
 arch/x86/kvm/x86.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9f5dbf7..10d76bf 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4407,6 +4407,9 @@ static void kvm_steal_time_set_preempted(struct kvm_vcpu *vcpu)
 	if (vcpu->arch.st.preempted)
 		return;
 
+	if (!vcpu->preempted)
+		return;
+
 	/* This happens on process exit */
 	if (unlikely(current->mm != vcpu->kvm->mm))
 		return;
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-02-06 13:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 12:02 [PATCH] KVM: X86: set vcpu preempted only if it is preempted Li RongQing
2022-01-12 13:08 ` Peter Zijlstra
2022-01-12 17:30   ` Sean Christopherson
2022-01-12 18:44     ` Paolo Bonzini
2022-01-12 19:07       ` Sean Christopherson
2022-01-12 21:31     ` Peter Zijlstra
2022-01-13  4:52       ` 答复: " Li,Rongqing
2022-01-13  9:33         ` Peter Zijlstra
2022-01-13 11:55           ` 答复: " Li,Rongqing
2022-01-13 12:48         ` Wanpeng Li
2022-01-14  9:58           ` 答复: " Li,Rongqing
2022-01-13 16:34       ` Sean Christopherson
2022-02-06 11:23       ` 答复: " Li,Rongqing
2022-02-06 13:42       ` Li,Rongqing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).