diff options
author | Suresh Warrier <warrier@linux.vnet.ibm.com> | 2015-12-17 15:59:05 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2016-02-29 00:25:06 -0500 |
commit | ec13e9b6b13d66c54951fec7f1158bf85f68fecd (patch) | |
tree | 7d9c389b1fc6c6b9aa85d7abf9adb5baea80c4ff | |
parent | 31639c77e0a7f9f742c813ae697f337b44981ed2 (diff) |
powerpc/xics: Add icp_native_cause_ipi_rm
Function to cause an IPI by directly updating the MFFR register
in the XICS. The function is meant for real-mode callers since
they cannot use the smp_ops->cause_ipi function which uses an
ioremapped address.
Normal usage is for the the KVM real mode code to set the IPI message
using smp_muxed_ipi_message_pass and then invoke icp_native_cause_ipi_rm
to cause the actual IPI.
The function requires kvm_hstate.xics_phys to have been initialized
with the physical address of XICS.
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>
-rw-r--r-- | arch/powerpc/include/asm/xics.h | 1 | ||||
-rw-r--r-- | arch/powerpc/sysdev/xics/icp-native.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/xics.h b/arch/powerpc/include/asm/xics.h index 0e25bdb190bb..254604856e69 100644 --- a/arch/powerpc/include/asm/xics.h +++ b/arch/powerpc/include/asm/xics.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #ifdef CONFIG_PPC_ICP_NATIVE | 30 | #ifdef CONFIG_PPC_ICP_NATIVE |
31 | extern int icp_native_init(void); | 31 | extern int icp_native_init(void); |
32 | extern void icp_native_flush_interrupt(void); | 32 | extern void icp_native_flush_interrupt(void); |
33 | extern void icp_native_cause_ipi_rm(int cpu); | ||
33 | #else | 34 | #else |
34 | static inline int icp_native_init(void) { return -ENODEV; } | 35 | static inline int icp_native_init(void) { return -ENODEV; } |
35 | #endif | 36 | #endif |
diff --git a/arch/powerpc/sysdev/xics/icp-native.c b/arch/powerpc/sysdev/xics/icp-native.c index eae32654bdf2..afdf62f2a695 100644 --- a/arch/powerpc/sysdev/xics/icp-native.c +++ b/arch/powerpc/sysdev/xics/icp-native.c | |||
@@ -159,6 +159,27 @@ static void icp_native_cause_ipi(int cpu, unsigned long data) | |||
159 | icp_native_set_qirr(cpu, IPI_PRIORITY); | 159 | icp_native_set_qirr(cpu, IPI_PRIORITY); |
160 | } | 160 | } |
161 | 161 | ||
162 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE | ||
163 | void icp_native_cause_ipi_rm(int cpu) | ||
164 | { | ||
165 | /* | ||
166 | * Currently not used to send IPIs to another CPU | ||
167 | * on the same core. Only caller is KVM real mode. | ||
168 | * Need the physical address of the XICS to be | ||
169 | * previously saved in kvm_hstate in the paca. | ||
170 | */ | ||
171 | unsigned long xics_phys; | ||
172 | |||
173 | /* | ||
174 | * Just like the cause_ipi functions, it is required to | ||
175 | * include a full barrier (out8 includes a sync) before | ||
176 | * causing the IPI. | ||
177 | */ | ||
178 | xics_phys = paca[cpu].kvm_hstate.xics_phys; | ||
179 | out_rm8((u8 *)(xics_phys + XICS_MFRR), IPI_PRIORITY); | ||
180 | } | ||
181 | #endif | ||
182 | |||
162 | /* | 183 | /* |
163 | * Called when an interrupt is received on an off-line CPU to | 184 | * Called when an interrupt is received on an off-line CPU to |
164 | * clear the interrupt, so that the CPU can go back to nap mode. | 185 | * clear the interrupt, so that the CPU can go back to nap mode. |