[PATCH] powerpc: Use soft irq-disable on all 64-bit machines

Stephen Rothwell sfr at canb.auug.org.au
Wed Jun 14 17:08:40 EST 2006


On Wed, 14 Jun 2006 13:31:50 +1000 Paul Mackerras <paulus at samba.org> wrote:
>
> This patch extends the soft interrupt-disable strategy used on iSeries
> so that it applies to all 64-bit machines.  Basically, the idea is
> that local_irq_disable() and related functions don't actually change
> the MSR_EE (external interrupt enable) bit in the MSR, they just clear
> a per-cpu "interrupts enabled" flag.  If an interrupt does come along,
> the exception prolog code notices that interrupts are supposed to be
> disabled.  It then clears a per-cpu "interrupts are actually enabled"
> flag, and returns from the interrupt with MSR_EE clear.
> 
> Then, when interrupts later get enabled, we noticed that the
> "interrupts are actually enabled" flag got cleared, and set it and the
> MSR_EE bit in the MSR.
> 
> This should result in improved performance, since setting and clearing
> the MSR_EE bit in the MSR can be much more expensive than setting and
> clearing a per-cpu flag in memory.  This also reduces the
> iSeries-specific differences in the code.

Looks good.  A couple of small fixes below.

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 26729e9..44b8cdc 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -370,7 +370,7 @@ #ifndef CONFIG_PPC_ISERIES
 #define DISABLE_INTS				\
 	li	r11,0;				\
 	stb	r11,PACAPROCENABLED(r13);	\
-	stb	r10,PACAHARDIRQEN(r13)
+	stb	r11,PACAHARDIRQEN(r13)
 #else
 #define DISABLE_INTS				\
 	li	r11,0;				\
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index f231264..db0ce76 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -44,12 +44,6 @@ #else
 #if defined(CONFIG_BOOKE)
 #define SET_MSR_EE(x)	mtmsr(x)
 #define local_irq_restore(flags)	__asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
-#elif defined(__powerpc64__)
-#define SET_MSR_EE(x)	__mtmsrd(x, 1)
-#define local_irq_restore(flags) do { \
-	__asm__ __volatile__("": : :"memory"); \
-	__mtmsrd((flags), 1); \
-} while(0)
 #else
 #define SET_MSR_EE(x)	mtmsr(x)
 #define local_irq_restore(flags)	mtmsr(flags)



More information about the Linuxppc-dev mailing list