LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Use soft irq-disable on all 64-bit machines
Date: Wed, 14 Jun 2006 17:08:40 +1000	[thread overview]
Message-ID: <20060614170840.3686cbad.sfr@canb.auug.org.au> (raw)
In-Reply-To: <17551.33574.27019.305680@cargo.ozlabs.ibm.com>

On Wed, 14 Jun 2006 13:31:50 +1000 Paul Mackerras <paulus@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@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)

  reply	other threads:[~2006-06-14  7:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14  3:31 [PATCH] powerpc: Use soft irq-disable on all 64-bit machines Paul Mackerras
2006-06-14  7:08 ` Stephen Rothwell [this message]
2006-06-14  7:23   ` Stephen Rothwell
2006-06-16  3:24     ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060614170840.3686cbad.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox