From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYfak-0001t8-Ua for qemu-devel@nongnu.org; Thu, 19 Mar 2015 14:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYfaf-0002ib-4a for qemu-devel@nongnu.org; Thu, 19 Mar 2015 14:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYfae-0002iV-Ve for qemu-devel@nongnu.org; Thu, 19 Mar 2015 14:54:45 -0400 From: Marcel Apfelbaum Date: Thu, 19 Mar 2015 20:52:56 +0200 Message-Id: <1426791181-23831-22-git-send-email-marcel@redhat.com> In-Reply-To: <1426791181-23831-1-git-send-email-marcel@redhat.com> References: <1426791181-23831-1-git-send-email-marcel@redhat.com> Subject: [Qemu-devel] [PATCH V6 for-2.3 21/26] 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: kraxel@redhat.com, mst@redhat.com, quintela@redhat.com, agraf@suse.de, marcel@redhat.com, alex.williamson@redhat.com, kevin@koconnor.net, hare@suse.de, imammedo@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net, rth@twiddle.net 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 79eaad5..7a8c6dd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1076,6 +1076,19 @@ void pc_guest_info_machine_done(Notifier *notifier, void *data) PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState, machine_done); + PCIHostState *snooped_host = find_i440fx(); + PCIHostBridgeSnoopedClass *snooped_class = + PCI_HOST_BRIDGE_SNOOPED_GET_CLASS(snooped_host); + GPtrArray *snooping_hosts = snooped_class->snooping_hosts(snooped_host); + int extra_hosts = snooping_hosts->len; + + 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