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 <dmytro_firsov@epam.com>
This commit is contained in:
Dmytro Firsov 2022-06-23 11:42:10 +03:00 committed by Anas Nashif
parent 1c1c72ea08
commit 5f4fd311fc

View file

@ -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,