vm-virtio: queue: add a missing memory barrier in get_used_event

Add a missing memory barrier in get_used_event to make sure we see the
last value written by the guest.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez 2020-03-10 05:20:57 -04:00 committed by Rob Bradford
parent df2570a472
commit e0bdfe826e

View File

@ -559,6 +559,8 @@ impl Queue {
}
};
// This fence ensures we're seeing the latest update from the guest.
fence(Ordering::Acquire);
match mem.read_obj::<u16>(used_event_addr) {
Ok(ret) => Some(Wrapping(ret)),
Err(_) => None,