Blame SOURCES/kvm-vfio-Correction-in-vfio_rom_read-when-attempting-rom.patch

05bba0
From d6d48e0a9ce4dfc91085e450f2a9a334b1ece89b Mon Sep 17 00:00:00 2001
05bba0
From: Alex Williamson <alex.williamson@redhat.com>
05bba0
Date: Fri, 10 Apr 2015 16:33:51 +0200
05bba0
Subject: [PATCH 03/14] vfio: Correction in vfio_rom_read when attempting rom
05bba0
 loading
05bba0
05bba0
Message-id: <20150410163351.15324.30965.stgit@gimli.home>
05bba0
Patchwork-id: 64785
05bba0
O-Subject: [RHEL7.2 qemu-kvm PATCH 3/8] vfio: Correction in vfio_rom_read when attempting rom loading
05bba0
Bugzilla: 1210503
05bba0
RH-Acked-by: Thomas Huth <thuth@redhat.com>
05bba0
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
05bba0
RH-Acked-by: Bandan Das <bsd@redhat.com>
05bba0
05bba0
From: Bandan Das <bsd@redhat.com>
05bba0
05bba0
Upstream: db01eedb6d883a1fed5b4079f8a6ff048b9c1217
05bba0
05bba0
commit e638073c569e801ce9de added a flag to track whether
05bba0
a previous rom read had failed. Accidentally, the code
05bba0
ended up adding vfio_load_option_rom twice. (Thanks to Alex
05bba0
for spotting it)
05bba0
05bba0
Signed-off-by: Bandan Das <bsd@redhat.com>
05bba0
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
05bba0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
---
05bba0
 hw/misc/vfio.c | 5 +----
05bba0
 1 file changed, 1 insertion(+), 4 deletions(-)
05bba0
05bba0
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
05bba0
index f3bf491..57bc974 100644
05bba0
--- a/hw/misc/vfio.c
05bba0
+++ b/hw/misc/vfio.c
05bba0
@@ -1235,11 +1235,8 @@ static uint64_t vfio_rom_read(void *opaque, hwaddr addr, unsigned size)
05bba0
     uint64_t val = ((uint64_t)1 << (size * 8)) - 1;
05bba0
 
05bba0
     /* Load the ROM lazily when the guest tries to read it */
05bba0
-    if (unlikely(!vdev->rom)) {
05bba0
+    if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
05bba0
         vfio_pci_load_rom(vdev);
05bba0
-        if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
05bba0
-            vfio_pci_load_rom(vdev);
05bba0
-        }
05bba0
     }
05bba0
 
05bba0
     memcpy(&val, vdev->rom + addr,
05bba0
-- 
05bba0
1.8.3.1
05bba0