[PATCH v2 2/4] x86/traps: remove smp_mb() ahead of IPI dispatch

Roger Pau Monne posted 4 patches 5 months, 1 week ago
There is a newer version of this series
[PATCH v2 2/4] x86/traps: remove smp_mb() ahead of IPI dispatch
Posted by Roger Pau Monne 5 months, 1 week ago
The IPI dispatch functions should already have the required barriers to
ensure correct memory ordering.

Note other callers of send_IPI_mask() don't use any barriers.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/arch/x86/traps.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index c94779b4ad4f..22f20629327d 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -785,8 +785,6 @@ void fatal_trap(const struct cpu_user_regs *regs, bool show_remote)
             cpumask_andnot(&show_state_mask, &cpu_online_map,
                            cpumask_of(smp_processor_id()));
             set_nmi_callback(nmi_show_execution_state);
-            /* Ensure new callback is set before sending out the NMI. */
-            smp_wmb();
             smp_send_nmi_allbutself();
 
             /* Wait at most 10ms for some other CPU to respond. */
-- 
2.49.0


Re: [PATCH v2 2/4] x86/traps: remove smp_mb() ahead of IPI dispatch
Posted by Jan Beulich 5 months, 1 week ago
On 22.05.2025 09:54, Roger Pau Monne wrote:
> The IPI dispatch functions should already have the required barriers to
> ensure correct memory ordering.

To be quite honest, "should" isn't sufficient here for my taste. Either
they are there or they aren't. According to my check they are, so ...

> Note other callers of send_IPI_mask() don't use any barriers.
> 
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with the word dropped.

Jan