From bb9012b0f2748e1d9e9fffbb868bc8893a8a90f6 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 2 Mar 2022 18:18:27 +0000 Subject: [PATCH 15/49] mips/rmixl: Insert appropriate membars around IPIs. --- sys/arch/mips/rmi/rmixl_intr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arch/mips/rmi/rmixl_intr.c b/sys/arch/mips/rmi/rmixl_intr.c index 3e9b49731bdf..6b49ab96e72b 100644 --- a/sys/arch/mips/rmi/rmixl_intr.c +++ b/sys/arch/mips/rmi/rmixl_intr.c @@ -967,6 +967,7 @@ rmixl_send_ipi(struct cpu_info *ci, int tag) | (RMIXL_INTRVEC_IPI + tag); mutex_enter(&rmixl_ipi_lock); + membar_release(); atomic_or_64(&ci->ci_request_ipis, req); RMIXL_PICREG_WRITE(RMIXL_PIC_IPIBASE, r); mutex_exit(&rmixl_ipi_lock); @@ -984,8 +985,9 @@ rmixl_ipi_intr(void *arg) KASSERT((uintptr_t)arg < NIPIS); /* if the request is clear, it was previously processed */ - if ((ci->ci_request_ipis & ipi_mask) == 0) + if ((atomic_load_relaxed(&ci->ci_request_ipis) & ipi_mask) == 0) return 0; + membar_acquire(); atomic_or_64(&ci->ci_active_ipis, ipi_mask); atomic_and_64(&ci->ci_request_ipis, ~ipi_mask);