mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-01 17:35:19 +00:00
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:
parent
df2570a472
commit
e0bdfe826e
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user