summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/dbell.h
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2012-11-14 19:49:47 +0100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-01-10 05:09:06 +0100
commit919ca8681f48ce81848c76f0ed66edb1bb99209b (patch)
treeb0aebbe1929e653e9a8b19196e64853baf58f2d6 /arch/powerpc/include/asm/dbell.h
parentpowerpc: Add book3s privileged doorbell exception vectors (diff)
downloadlinux-919ca8681f48ce81848c76f0ed66edb1bb99209b.tar.xz
linux-919ca8681f48ce81848c76f0ed66edb1bb99209b.zip
powerpc: Select either privileged or hypervisor doorbell when sending
On book3s we have two msgsnd instructions with differing privilege levels. This patch selects the appropriate instruction to use whenever we send a doorbell interrupt. Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Tested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/dbell.h')
-rw-r--r--arch/powerpc/include/asm/dbell.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h
index 3b338565f992..5fa6b20eba10 100644
--- a/arch/powerpc/include/asm/dbell.h
+++ b/arch/powerpc/include/asm/dbell.h
@@ -37,12 +37,25 @@ enum ppc_dbell {
#define SPRN_DOORBELL_CPUTAG SPRN_TIR
#define PPC_DBELL_TAG_MASK 0x7f
+static inline void _ppc_msgsnd(u32 msg)
+{
+ if (cpu_has_feature(CPU_FTR_HVMODE))
+ __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
+ else
+ __asm__ __volatile__ (PPC_MSGSNDP(%0) : : "r" (msg));
+}
+
#else /* CONFIG_PPC_BOOK3S */
#define PPC_DBELL_MSGTYPE PPC_DBELL
#define SPRN_DOORBELL_CPUTAG SPRN_PIR
#define PPC_DBELL_TAG_MASK 0x3fff
+static inline void _ppc_msgsnd(u32 msg)
+{
+ __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
+}
+
#endif /* CONFIG_PPC_BOOK3S */
extern void doorbell_cause_ipi(int cpu, unsigned long data);
@@ -54,7 +67,7 @@ static inline void ppc_msgsnd(enum ppc_dbell type, u32 flags, u32 tag)
u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) |
(tag & 0x07ffffff);
- __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
+ _ppc_msgsnd(msg);
}
#endif /* _ASM_POWERPC_DBELL_H */