kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: fix kvm_vcpu_is_preempted
@ 2022-01-12 11:19 Li RongQing
  2022-01-12 16:43 ` Sean Christopherson
  2022-01-13 11:03 ` Paolo Bonzini
  0 siblings, 2 replies; 6+ messages in thread
From: Li RongQing @ 2022-01-12 11:19 UTC (permalink / raw)
  To: pbonzini, seanjc, vkuznets, wanpengli, jmattson, tglx, mingo, bp,
	x86, hpa, rkrcmar, kvm, joro

After support paravirtualized TLB shootdowns, steal_time.preempted
includes not only KVM_VCPU_PREEMPTED, but also KVM_VCPU_FLUSH_TLB

and kvm_vcpu_is_preempted should test only with KVM_VCPU_PREEMPTED

Fixes: 858a43aae2367 ("KVM: X86: use paravirtualized TLB Shootdown")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 arch/x86/kernel/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 59abbda..a9202d9 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -1025,8 +1025,8 @@ asm(
 ".type __raw_callee_save___kvm_vcpu_is_preempted, @function;"
 "__raw_callee_save___kvm_vcpu_is_preempted:"
 "movq	__per_cpu_offset(,%rdi,8), %rax;"
-"cmpb	$0, " __stringify(KVM_STEAL_TIME_preempted) "+steal_time(%rax);"
-"setne	%al;"
+"movb	" __stringify(KVM_STEAL_TIME_preempted) "+steal_time(%rax), %al;"
+"andb	$" __stringify(KVM_VCPU_PREEMPTED) ", %al;"
 "ret;"
 ".size __raw_callee_save___kvm_vcpu_is_preempted, .-__raw_callee_save___kvm_vcpu_is_preempted;"
 ".popsection");
-- 
2.9.4


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

end of thread, other threads:[~2022-01-14  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 11:19 [PATCH] KVM: x86: fix kvm_vcpu_is_preempted Li RongQing
2022-01-12 16:43 ` Sean Christopherson
2022-01-13  8:06   ` 答复: " Li,Rongqing
2022-01-13 10:00   ` Peter Zijlstra
2022-01-13 11:03 ` Paolo Bonzini
2022-01-14  9:49   ` 答复: " 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).