From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwuOv-0006X0-VP for qemu-devel@nongnu.org; Mon, 25 May 2015 11:34:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwuOq-0003vZ-Bq for qemu-devel@nongnu.org; Mon, 25 May 2015 11:34:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwuOq-0003vU-5q for qemu-devel@nongnu.org; Mon, 25 May 2015 11:34:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D1B3A8E518 for ; Mon, 25 May 2015 15:34:43 +0000 (UTC) From: Marcel Apfelbaum Date: Mon, 25 May 2015 18:33:57 +0300 Message-Id: <1432568042-19553-20-git-send-email-marcel@redhat.com> In-Reply-To: <1432568042-19553-1-git-send-email-marcel@redhat.com> References: <1432568042-19553-1-git-send-email-marcel@redhat.com> Subject: [Qemu-devel] [PATCH V7 19/24] hw/pci: inform bios if the system has extra pci root buses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcel@redhat.com, pbonzini@redhat.com, mst@redhat.com From: Marcel Apfelbaum The bios looks for 'etc/extra-pci-roots' to decide if is going to scan further buses after bus 0 tree. Signed-off-by: Marcel Apfelbaum --- hw/i386/pc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 769eb25..484bf86 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -30,6 +30,7 @@ #include "hw/block/fdc.h" #include "hw/ide.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_bus.h" #include "monitor/monitor.h" #include "hw/nvram/fw_cfg.h" #include "hw/timer/hpet.h" @@ -1119,6 +1120,25 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState, 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); } -- 2.1.0