Skip to contentSkip to conversation

powerpc/tm: Remove interrupt disable in __switch_to()

PATCH New Michael Neuling 1 participant 2 messages Oct 2, 2013 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 powerpc/tm: Remove interrupt disable in __switch_to()

We currently turn IRQs off in __switch_to(0 but this is unnecessary as it's already disabled in the caller.

This removes the IRQ disable but adds a check to make sure it is really off in case this changes in future.

---
 arch/powerpc/kernel/process.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/powerpc/kernel/process.c +2 -5
index 96d2fdf..384c27e 100644
@@ -596,12 +596,13 @@ struct task_struct *__switch_to(struct task_struct *prev,
 	struct task_struct *new)
 {
 	struct thread_struct *new_thread, *old_thread;
-	unsigned long flags;
 	struct task_struct *last;
 #ifdef CONFIG_PPC_BOOK3S_64
 	struct ppc64_tlb_batch *batch;
 #endif
 
+	WARN_ON(!irqs_disabled());
+
 	/* Back up the TAR across context switches.
 	 * Note that the TAR is not available for use in the kernel.  (To
 	 * provide this, the TAR should be backed up/restored on exception
@@ -721,8 +722,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
 	}
 #endif /* CONFIG_PPC_BOOK3S_64 */
 
-	local_irq_save(flags);
-
 	/*
 	 * We can't take a PMU exception inside _switch() since there is a
 	 * window where the kernel stack SLB and the kernel stack are out
@@ -742,8 +741,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
 	}
 #endif /* CONFIG_PPC_BOOK3S_64 */
 
-	local_irq_restore(flags);
-
 	return last;
 }
 
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/2 powerpc/tm: Turn interrupts hard off in tm_reclaim()

We can't take IRQs in tm_reclaim as we might have a bogus r13 and r1.

This turns IRQs hard off in this function.

---
 arch/powerpc/kernel/tm.S | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/tm.S +1 -0
index 7b60b98..8ece190 100644
@@ -123,6 +123,7 @@ _GLOBAL(tm_reclaim)
 	mr	r15, r14
 	ori	r15, r15, MSR_FP
 	li	r16, MSR_RI
+	ori	r16, r16, MSR_EE /* IRQs hard off */
 	andc	r15, r15, r16
 	oris	r15, r15, MSR_VEC@h
 #ifdef CONFIG_VSX
Signature · 1 line
1.8.1.2