aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2012-11-14 13:49:47 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-01-09 23:09:06 -0500
commit919ca8681f48ce81848c76f0ed66edb1bb99209b (patch)
treeb0aebbe1929e653e9a8b19196e64853baf58f2d6
parent1dbdafec5d63a1de6c83c89a3e953575d60fd393 (diff)
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>
-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 {
37#define SPRN_DOORBELL_CPUTAG SPRN_TIR 37#define SPRN_DOORBELL_CPUTAG SPRN_TIR
38#define PPC_DBELL_TAG_MASK 0x7f 38#define PPC_DBELL_TAG_MASK 0x7f
39 39
40static inline void _ppc_msgsnd(u32 msg)
41{
42 if (cpu_has_feature(CPU_FTR_HVMODE))
43 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
44 else
45 __asm__ __volatile__ (PPC_MSGSNDP(%0) : : "r" (msg));
46}
47
40#else /* CONFIG_PPC_BOOK3S */ 48#else /* CONFIG_PPC_BOOK3S */
41 49
42#define PPC_DBELL_MSGTYPE PPC_DBELL 50#define PPC_DBELL_MSGTYPE PPC_DBELL
43#define SPRN_DOORBELL_CPUTAG SPRN_PIR 51#define SPRN_DOORBELL_CPUTAG SPRN_PIR
44#define PPC_DBELL_TAG_MASK 0x3fff 52#define PPC_DBELL_TAG_MASK 0x3fff
45 53
54static inline void _ppc_msgsnd(u32 msg)
55{
56 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
57}
58
46#endif /* CONFIG_PPC_BOOK3S */ 59#endif /* CONFIG_PPC_BOOK3S */
47 60
48extern void doorbell_cause_ipi(int cpu, unsigned long data); 61extern 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)
54 u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) | 67 u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) |
55 (tag & 0x07ffffff); 68 (tag & 0x07ffffff);
56 69
57 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg)); 70 _ppc_msgsnd(msg);
58} 71}
59 72
60#endif /* _ASM_POWERPC_DBELL_H */ 73#endif /* _ASM_POWERPC_DBELL_H */