Skip to contentSkip to conversation

microblaze: Remove __ARCH_WANT_INTERRUPTS_ON_CTXSW usage

PATCH New Peter Zijlstra 1 participant 1 message Aug 24, 2011 Microblaze architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 microblaze: Remove __ARCH_WANT_INTERRUPTS_ON_CTXSW usage

As far as I can tell the only reason microblaze has __ARCH_WANT_INTERRUPTS_ON_CTXSW is because it initializes new task state with interrupts enabled so that on switch_to() interrupts get enabled.

So change copy_thread() to clear MSR_IE instead of set it, this will ensure switch_to() will always keep IRQs disabled.

The scheduler will disable IRQs when taking rq->lock in schedule() and enable IRQs in finish_lock_switch() after its done its magic.

This leaves ARM the only __ARCH_WANT_INTERRUPTS_ON_CTXSW user.

---
 arch/microblaze/include/asm/system.h |    2 --
 arch/microblaze/kernel/process.c     |    2 +-
 2 files changed, 1 insertions(+), 3 deletions(-)
arch/microblaze/include/asm/system.h +0 -2
index e6a2284..ec4f3d0 100644
@@ -17,8 +17,6 @@
 #include <asm-generic/cmpxchg.h>
 #include <asm-generic/cmpxchg-local.h>
 
-#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
-
 struct task_struct;
 struct thread_info;
 
arch/microblaze/kernel/process.c +1 -1
index dbb8124..c72d044 100644
@@ -172,7 +172,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 	 * right now MSR is a copy of parent one */
 	childregs->msr |= MSR_BIP;
 	childregs->msr &= ~MSR_EIP;
-	childregs->msr |= MSR_IE;
+	childregs->msr &= ~MSR_IE;
 	childregs->msr &= ~MSR_VM;
 	childregs->msr |= MSR_VMS;
 	childregs->msr |= MSR_EE; /* exceptions will be enabled*/