提交 2118196b 编写于 作者: M Marcel Apfelbaum 提交者: Michael S. Tsirkin

hw/pci: inform bios if the system has extra pci root buses

The bios looks for 'etc/extra-pci-roots' to decide if
is going to scan further buses after bus 0 tree.
Signed-off-by: NMarcel Apfelbaum <marcel@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Acked-by: NLaszlo Ersek <lersek@redhat.com>
上级 40d14bef
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "hw/block/fdc.h" #include "hw/block/fdc.h"
#include "hw/ide.h" #include "hw/ide.h"
#include "hw/pci/pci.h" #include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
#include "monitor/monitor.h" #include "monitor/monitor.h"
#include "hw/nvram/fw_cfg.h" #include "hw/nvram/fw_cfg.h"
#include "hw/timer/hpet.h" #include "hw/timer/hpet.h"
...@@ -1119,6 +1120,25 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) ...@@ -1119,6 +1120,25 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data)
PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState *guest_info_state = container_of(notifier,
PcGuestInfoState, PcGuestInfoState,
machine_done); machine_done);
PCIBus *bus = find_i440fx();
if (bus) {
int extra_hosts = 0;
QLIST_FOREACH(bus, &bus->child, sibling) {
/* look for expander root buses */
if (pci_bus_is_root(bus)) {
extra_hosts++;
}
}
if (extra_hosts && guest_info_state->info.fw_cfg) {
uint64_t *val = g_malloc(sizeof(*val));
*val = cpu_to_le64(extra_hosts);
fw_cfg_add_file(guest_info_state->info.fw_cfg,
"etc/extra-pci-roots", val, sizeof(*val));
}
}
acpi_setup(&guest_info_state->info); acpi_setup(&guest_info_state->info);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册