From patchwork Thu Jan 22 19:52:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 431973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5CF37140276 for ; Fri, 23 Jan 2015 07:03:59 +1100 (AEDT) Received: from localhost ([::1]:55772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YENyu-0002Ao-Iu for incoming@patchwork.ozlabs.org; Thu, 22 Jan 2015 15:03:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YENpW-000343-MM for qemu-devel@nongnu.org; Thu, 22 Jan 2015 14:54:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YENpT-0008AE-Br for qemu-devel@nongnu.org; Thu, 22 Jan 2015 14:54:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YENpT-0008A8-4Q; Thu, 22 Jan 2015 14:54:11 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0MJrrpl011736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Jan 2015 14:53:54 -0500 Received: from work.redhat.com (vpn1-5-41.ams2.redhat.com [10.36.5.41]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0MJqhN3020669; Thu, 22 Jan 2015 14:53:48 -0500 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 22 Jan 2015 21:52:39 +0200 Message-Id: <1421956363-23502-14-git-send-email-marcel@redhat.com> In-Reply-To: <1421956363-23502-1-git-send-email-marcel@redhat.com> References: <1421956363-23502-1-git-send-email-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: seabios@seabios.org, kraxel@redhat.com, mst@redhat.com, quintela@redhat.com, agraf@suse.de, alex.williamson@redhat.com, kevin@koconnor.net, qemu-ppc@nongnu.org, hare@suse.de, imammedo@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH RFC 13/17] hw/pci: inform bios if the system has more than one pci bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 e07f1fa..9ef0917 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1073,9 +1073,22 @@ typedef struct PcGuestInfoState { static void pc_guest_info_machine_done(Notifier *notifier, void *data) { + PCIHostState *host; + int hosts = 0; PcGuestInfoState *guest_info_state = container_of(notifier, PcGuestInfoState, machine_done); + HOST_BRIDGE_FOREACH(host) { + hosts++; + } + + if (hosts && guest_info_state->info.fw_cfg) { + uint64_t *val = g_malloc(sizeof(*val)); + *val = cpu_to_le64(hosts - 1); + fw_cfg_add_file(guest_info_state->info.fw_cfg, + "etc/extra-pci-roots", val, sizeof(*val)); + } + acpi_setup(&guest_info_state->info); }