vm-virtio: queue: Use a SeqCst fence on get_used_event

On x86_64, a hint to the compiler is not enough, we need to issue a
MFENCE instruction. Replace the Acquire fence with a SeqCst one.

Without this, it's still possible to miss an used_event update,
leading to the omission of a notification, possibly stalling the
vring.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez 2020-03-18 13:50:14 +01:00 committed by Rob Bradford
parent 63eeed29cc
commit 6329219749

View File

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