From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiejun Chen Subject: [v1][PATCH 1/1] KVM: PPC: disable preemption when using hard_irq_disable() Date: Wed, 10 Jul 2013 14:02:19 +0800 Message-ID: <1373436139-27998-1-git-send-email-tiejun.chen@windriver.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , To: Return-path: Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org We should ensure the preemption cannot occur while calling get_paca() insdide hard_irq_disable(), otherwise the paca_struct may be the wrong one just after. And btw, we may update timing stats in this case. Signed-off-by: Tiejun Chen --- arch/powerpc/kvm/booke.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index dcc94f0..9dae25d 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -839,6 +839,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, WARN_ON(local_paca->irq_happened != 0); #endif + preempt_disable(); /* * We enter with interrupts disabled in hardware, but * we need to call hard_irq_disable anyway to ensure that @@ -848,6 +849,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, /* update before a new last_exit_type is rewritten */ kvmppc_update_timing_stats(vcpu); + preempt_enable(); /* restart interrupts if they were meant for the host */ kvmppc_restart_interrupt(vcpu, exit_nr); -- 1.7.9.5