kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v1][PATCH 1/1] KVM: PPC: disable preemption when using hard_irq_disable()
@ 2013-07-10  6:02 Tiejun Chen
  2013-07-10  9:49 ` Alexander Graf
  2013-07-10 19:15 ` Scott Wood
  0 siblings, 2 replies; 25+ messages in thread
From: Tiejun Chen @ 2013-07-10  6:02 UTC (permalink / raw)
  To: agraf; +Cc: kvm-ppc, kvm

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 <tiejun.chen@windriver.com>
---
 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

^ permalink raw reply related	[flat|nested] 25+ messages in thread
[parent not found: <1373559480.8183.258@snotra>]
[parent not found: <1373651433.8183.276@snotra>]

end of thread, other threads:[~2013-07-16  2:15 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10  6:02 [v1][PATCH 1/1] KVM: PPC: disable preemption when using hard_irq_disable() Tiejun Chen
2013-07-10  9:49 ` Alexander Graf
2013-07-11  2:48   ` tiejun.chen
2013-07-11  9:49     ` Alexander Graf
2013-07-11 12:28       ` Benjamin Herrenschmidt
2013-07-11 12:47         ` Alexander Graf
2013-07-11 12:54           ` Benjamin Herrenschmidt
2013-07-11 13:07             ` Alexander Graf
2013-07-12  0:19               ` Benjamin Herrenschmidt
2013-07-12  2:13                 ` tiejun.chen
2013-07-12  3:57                   ` Benjamin Herrenschmidt
2013-07-12  4:54                     ` tiejun.chen
2013-07-14  4:13                       ` Benjamin Herrenschmidt
2013-07-15  3:04                         ` tiejun.chen
2013-07-10 19:15 ` Scott Wood
2013-07-11  3:00   ` tiejun.chen
2013-07-11 14:13     ` Scott Wood
     [not found] <1373559480.8183.258@snotra>
2013-07-12  0:30 ` Benjamin Herrenschmidt
     [not found] ` <FB21594A-C233-4A97-8503-E2A1275F8F17@suse.de>
     [not found]   ` <1373560585.8183.261@snotra>
2013-07-12  3:22     ` tiejun.chen
     [not found] <1373651433.8183.276@snotra>
2013-07-12 23:05 ` Benjamin Herrenschmidt
2013-07-15  2:20   ` tiejun.chen
2013-07-15  2:47     ` Benjamin Herrenschmidt
2013-07-15  3:03       ` tiejun.chen
     [not found]     ` <1373909248.8183.303@snotra>
2013-07-16  2:15       ` tiejun.chen
2013-07-15  2:25 ` tiejun.chen

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