]> git.hungrycats.org Git - linux/commitdiff
kvm: async_pf: fix rcu_irq_enter() with irqs enabled
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Apr 2017 14:56:26 +0000 (16:56 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 26 Jun 2017 02:02:18 +0000 (22:02 -0400)
[ Upstream commit bbaf0e2b1c1b4f88abd6ef49576f0efb1734eae5 ]

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>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
arch/x86/kernel/kvm.c

index 9435620062df30e549d1510baaf9c4c72ab90290..27e63c1770e68f436683e41d7284789f29b00b1d 100644 (file)
@@ -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)