[PATCH] KVM: X86: set vcpu preempted only if it is preempted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Wang GuangJu <wangguangju@xxxxxxxxx>
---
 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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux