File tree Expand file tree Collapse file tree 4 files changed +36
-5
lines changed Expand file tree Collapse file tree 4 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,17 @@ static inline void _ppc_msgsnd(u32 msg)
4444 __asm__ __volatile__ (PPC_MSGSNDP (%0 ) : : "r" (msg ));
4545}
4646
47+ /* sync before sending message */
48+ static inline void ppc_msgsnd_sync (void )
49+ {
50+ __asm__ __volatile__ ("sync" : : : "memory" );
51+ }
52+
53+ /* sync after taking message interrupt */
54+ static inline void ppc_msgsync (void )
55+ {
56+ }
57+
4758#else /* CONFIG_PPC_BOOK3S */
4859
4960#define PPC_DBELL_MSGTYPE PPC_DBELL
@@ -53,6 +64,17 @@ static inline void _ppc_msgsnd(u32 msg)
5364 __asm__ __volatile__ (PPC_MSGSND (%0 ) : : "r" (msg ));
5465}
5566
67+ /* sync before sending message */
68+ static inline void ppc_msgsnd_sync (void )
69+ {
70+ __asm__ __volatile__ ("sync" : : : "memory" );
71+ }
72+
73+ /* sync after taking message interrupt */
74+ static inline void ppc_msgsync (void )
75+ {
76+ }
77+
5678#endif /* CONFIG_PPC_BOOK3S */
5779
5880extern void doorbell_global_ipi (int cpu );
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ extern const char *smp_ipi_name[];
128128extern void smp_muxed_ipi_message_pass (int cpu , int msg );
129129extern void smp_muxed_ipi_set_message (int cpu , int msg );
130130extern irqreturn_t smp_ipi_demux (void );
131+ extern irqreturn_t smp_ipi_demux_relaxed (void );
131132
132133void smp_init_pSeries (void );
133134void smp_init_cell (void );
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ void doorbell_global_ipi(int cpu)
3838
3939 kvmppc_set_host_ipi (cpu , 1 );
4040 /* Order previous accesses vs. msgsnd, which is treated as a store */
41- mb ();
41+ ppc_msgsnd_sync ();
4242 ppc_msgsnd (PPC_DBELL_MSGTYPE , 0 , tag );
4343}
4444
@@ -53,7 +53,7 @@ void doorbell_core_ipi(int cpu)
5353
5454 kvmppc_set_host_ipi (cpu , 1 );
5555 /* Order previous accesses vs. msgsnd, which is treated as a store */
56- mb ();
56+ ppc_msgsnd_sync ();
5757 ppc_msgsnd (PPC_DBELL_MSGTYPE , 0 , tag );
5858}
5959
@@ -82,12 +82,14 @@ void doorbell_exception(struct pt_regs *regs)
8282
8383 irq_enter ();
8484
85+ ppc_msgsync ();
86+
8587 may_hard_irq_enable ();
8688
8789 kvmppc_set_host_ipi (smp_processor_id (), 0 );
8890 __this_cpu_inc (irq_stat .doorbell_irqs );
8991
90- smp_ipi_demux ();
92+ smp_ipi_demux_relaxed (); /* already performed the barrier */
9193
9294 irq_exit ();
9395 set_irq_regs (old_regs );
Original file line number Diff line number Diff line change @@ -245,12 +245,18 @@ void smp_muxed_ipi_message_pass(int cpu, int msg)
245245#endif
246246
247247irqreturn_t smp_ipi_demux (void )
248+ {
249+ mb (); /* order any irq clear */
250+
251+ return smp_ipi_demux_relaxed ();
252+ }
253+
254+ /* sync-free variant. Callers should ensure synchronization */
255+ irqreturn_t smp_ipi_demux_relaxed (void )
248256{
249257 struct cpu_messages * info ;
250258 unsigned long all ;
251259
252- mb (); /* order any irq clear */
253-
254260 info = this_cpu_ptr (& ipi_message );
255261 do {
256262 all = xchg (& info -> messages , 0 );
You can’t perform that action at this time.
0 commit comments