thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
05bba0
From 5bf64f8c7302964bd5fd208d9db9fa38ee96e0fa Mon Sep 17 00:00:00 2001
05bba0
From: Alex Williamson <alex.williamson@redhat.com>
05bba0
Date: Fri, 10 Apr 2015 16:33:39 +0200
05bba0
Subject: [PATCH 01/14] vfio: warn if host device rom can't be read
05bba0
05bba0
Message-id: <20150410163339.15324.77513.stgit@gimli.home>
05bba0
Patchwork-id: 64789
05bba0
O-Subject: [RHEL7.2 qemu-kvm PATCH 1/8] vfio: warn if host device rom can't be read
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: d20b43dfea1587b561aae17e4fa0f7407779d253
05bba0
05bba0
If the device rom can't be read, report an error to the
05bba0
user. This alerts the user that the device has a bad
05bba0
state that is causing rom read failure or option rom
05bba0
loading has been disabled from the device boot menu
05bba0
(among other reasons).
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 | 7 +++++++
05bba0
 1 file changed, 7 insertions(+)
05bba0
05bba0
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
05bba0
index 40b0923..c9dbc28 100644
05bba0
--- a/hw/misc/vfio.c
05bba0
+++ b/hw/misc/vfio.c
05bba0
@@ -1197,6 +1197,13 @@ static void vfio_pci_load_rom(VFIODevice *vdev)
05bba0
     vdev->rom_offset = reg_info.offset;
05bba0
 
05bba0
     if (!vdev->rom_size) {
05bba0
+        error_report("vfio-pci: Cannot read device rom at "
05bba0
+                    "%04x:%02x:%02x.%x\n",
05bba0
+                    vdev->host.domain, vdev->host.bus, vdev->host.slot,
05bba0
+                    vdev->host.function);
05bba0
+        error_printf("Device option ROM contents are probably invalid "
05bba0
+                    "(check dmesg).\nSkip option ROM probe with rombar=0, "
05bba0
+                    "or load from file with romfile=\n");
05bba0
         return;
05bba0
     }
05bba0
 
05bba0
-- 
05bba0
1.8.3.1
05bba0