diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-08-23 18:46:03 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-08-23 18:46:03 +0000 |
commit | dc9447bd3777614529b711c9976979fe61822ba8 (patch) | |
tree | 02fe72a3e29eaea6d49b58a47dcf8e9e0a553f0b /OvmfPkg/VirtioNetDxe/Events.c | |
parent | 9bef3cdc8a9d9f9344bd9cb94af3bbdc4ec5ed4d (diff) | |
download | edk2-platforms-dc9447bd3777614529b711c9976979fe61822ba8.tar.xz |
OvmfPkg: Virtio: load used ring element strictly after loading used index
Enforce in-order execution of these steps even on not sequentially
consistent architectures, as discussed in [1]. These changes should be
unnecessary on x86 (the only architecture OVMF currently supports), but
they align the OVMF virtio code with the virtio specification and could be
necessary for future OVMF ports.
[1] http://lists.linuxfoundation.org/pipermail/virtualization/2013-June/024547.html
Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14601 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/VirtioNetDxe/Events.c')
-rw-r--r-- | OvmfPkg/VirtioNetDxe/Events.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/OvmfPkg/VirtioNetDxe/Events.c b/OvmfPkg/VirtioNetDxe/Events.c index 3a5b6b492e..b9d7bbf6c6 100644 --- a/OvmfPkg/VirtioNetDxe/Events.c +++ b/OvmfPkg/VirtioNetDxe/Events.c @@ -61,6 +61,7 @@ VirtioNetIsPacketAvailable ( //
MemoryFence ();
RxCurUsed = *Dev->RxRing.Used.Idx;
+ MemoryFence ();
if (Dev->RxLastUsed != RxCurUsed) {
gBS->SignalEvent (&Dev->Snp.WaitForPacket);
|