From 5f4fd311fc36155745c63dc899eea09d9eef9ba9 Mon Sep 17 00:00:00 2001 From: Dmytro Firsov Date: Thu, 23 Jun 2022 11:42:10 +0300 Subject: [PATCH] xenvm: evtchn: use proper barrier during events handling This commit fixes barrier usage in Xen event channel driver. Previously compiler_barrier() was used and it did not prevent processor from re-ordering of the write operations, that is needed for correct event handling. It is now changed to data memory barrier (dmb()), which will work as expected in this situation. Thanks @jgrall for suggestion. Signed-off-by: Dmytro Firsov --- drivers/xen/events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/events.c b/drivers/xen/events.c index cd56f7ec19..a29836a28c 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -218,7 +218,7 @@ static void events_isr(void *data) */ vcpu->evtchn_upcall_pending = 0; - compiler_barrier(); + dmb(); /* Can not use system atomic_t/atomic_set() due to 32-bit casting */ pos_selector = __atomic_exchange_n(&vcpu->evtchn_pending_sel,