yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 9c591e6f1c691fcd8ed9e7294e8220e1e3b22572 Mon Sep 17 00:00:00 2001
From: Thomas Huth <thuth@redhat.com>
Date: Mon, 26 Jun 2017 07:48:24 +0200
Subject: [PATCH] hw/ppc/spapr: Adjust firmware name for PCI bridges

RH-Author: Thomas Huth <thuth@redhat.com>
Message-id: <1498463304-23230-2-git-send-email-thuth@redhat.com>
Patchwork-id: 75682
O-Subject: [Pegas-1.0 qemu-kvm PATCH 1/1] hw/ppc/spapr: Adjust firmware name for PCI bridges
Bugzilla: 1459170
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: David Hildenbrand <david@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>

SLOF uses "pci" as name for PCI bridges nodes in the device tree instead
of "pci-bridges", so booting via bootindex from a device behind a PCI
bridge currently does not work since QEMU passes the wrong name in the
"qemu,boot-list" property. Fix it by changing the name of the PCI bridge
nodes to "pci" instead.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1459170
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 4871dd4c3f70f528147f426fe42676b4193cb3b7)
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>

Conflicts:
	hw/ppc/spapr.c
	(contextual conflict due to missing commit c4e13492afad2c49)
---
 hw/ppc/spapr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 62e2696..aadb562 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2454,6 +2454,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
         return g_strdup_printf("pci@%"PRIX64, phb->buid);
     }
 
+    if (g_str_equal("pci-bridge", qdev_fw_name(dev))) {
+        /* SLOF uses "pci" instead of "pci-bridge" for PCI bridges */
+        PCIDevice *pcidev = CAST(PCIDevice, dev, TYPE_PCI_DEVICE);
+        return g_strdup_printf("pci@%x", PCI_SLOT(pcidev->devfn));
+    }
+
     return NULL;
 }
 
-- 
1.8.3.1