浏览代码

powerpc/smp: Support more IPI messages

This patch increases the number of demuxed messages for a
controller with a single ipi to 8 for 64-bit systems.

This is required because we want to use the IPI mechanism
to send messages from a CPU running in KVM real mode in a
guest to a CPU in the host to take some action. Currently,
we only support 4 messages and all 4 are already taken.

Define a fifth message PPC_MSG_RM_HOST_ACTION for this
purpose.

Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Suresh Warrier 9 年之前
父节点
当前提交
bd7f561f76
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 3 0
      arch/powerpc/include/asm/smp.h
  2. 4 4
      arch/powerpc/kernel/smp.c

+ 3 - 0
arch/powerpc/include/asm/smp.h

@@ -114,6 +114,9 @@ extern int cpu_to_core_id(int cpu);
 #define PPC_MSG_TICK_BROADCAST	2
 #define PPC_MSG_TICK_BROADCAST	2
 #define PPC_MSG_DEBUGGER_BREAK  3
 #define PPC_MSG_DEBUGGER_BREAK  3
 
 
+/* This is only used by the powernv kernel */
+#define PPC_MSG_RM_HOST_ACTION	4
+
 /* for irq controllers that have dedicated ipis per message (4) */
 /* for irq controllers that have dedicated ipis per message (4) */
 extern int smp_request_message_ipi(int virq, int message);
 extern int smp_request_message_ipi(int virq, int message);
 extern const char *smp_ipi_name[];
 extern const char *smp_ipi_name[];

+ 4 - 4
arch/powerpc/kernel/smp.c

@@ -206,7 +206,7 @@ int smp_request_message_ipi(int virq, int msg)
 
 
 #ifdef CONFIG_PPC_SMP_MUXED_IPI
 #ifdef CONFIG_PPC_SMP_MUXED_IPI
 struct cpu_messages {
 struct cpu_messages {
-	int messages;			/* current messages */
+	long messages;			/* current messages */
 	unsigned long data;		/* data for cause ipi */
 	unsigned long data;		/* data for cause ipi */
 };
 };
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct cpu_messages, ipi_message);
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct cpu_messages, ipi_message);
@@ -236,15 +236,15 @@ void smp_muxed_ipi_message_pass(int cpu, int msg)
 }
 }
 
 
 #ifdef __BIG_ENDIAN__
 #ifdef __BIG_ENDIAN__
-#define IPI_MESSAGE(A) (1 << (24 - 8 * (A)))
+#define IPI_MESSAGE(A) (1uL << ((BITS_PER_LONG - 8) - 8 * (A)))
 #else
 #else
-#define IPI_MESSAGE(A) (1 << (8 * (A)))
+#define IPI_MESSAGE(A) (1uL << (8 * (A)))
 #endif
 #endif
 
 
 irqreturn_t smp_ipi_demux(void)
 irqreturn_t smp_ipi_demux(void)
 {
 {
 	struct cpu_messages *info = this_cpu_ptr(&ipi_message);
 	struct cpu_messages *info = this_cpu_ptr(&ipi_message);
-	unsigned int all;
+	unsigned long all;
 
 
 	mb();	/* order any irq clear */
 	mb();	/* order any irq clear */