linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: async_pf: fix rcu_irq_enter() with irqs enabled
@ 2017-04-26 14:56 Paolo Bonzini
  2017-04-26 15:14 ` Paul E. McKenney
  2017-06-05  4:21 ` Wanpeng Li
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2017-04-26 14:56 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: rkrcmar, ross.zwisler, paulmck, jack, linux-ext4, tytso, josh, stable

native_safe_halt enables interrupts, and you just shouldn't
call rcu_irq_enter() with interrupts enabled.  Reorder the
call with the following local_irq_disable() to respect the
invariant.

Reported-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kernel/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 14f65a5f938e..2a7835932b71 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -161,8 +161,8 @@ void kvm_async_pf_task_wait(u32 token)
 			 */
 			rcu_irq_exit();
 			native_safe_halt();
-			rcu_irq_enter();
 			local_irq_disable();
+			rcu_irq_enter();
 		}
 	}
 	if (!n.halted)
-- 
2.9.3

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

end of thread, other threads:[~2017-06-06 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 14:56 [PATCH] kvm: async_pf: fix rcu_irq_enter() with irqs enabled Paolo Bonzini
2017-04-26 15:14 ` Paul E. McKenney
2017-06-05  4:21 ` Wanpeng Li
2017-06-06 13:28   ` Radim Krcmar

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).