From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3rvI-0005Tm-HF for qemu-devel@nongnu.org; Tue, 01 Dec 2015 15:53:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3rvE-0004or-7i for qemu-devel@nongnu.org; Tue, 01 Dec 2015 15:53:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3rvE-0004om-22 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 15:53:12 -0500 References: <1448553628-5446-1-git-send-email-marcel@redhat.com> <1448553628-5446-4-git-send-email-marcel@redhat.com> <20151201182038.GD18957@thinpad.lan.raisama.net> From: Marcel Apfelbaum Message-ID: <565E08B3.5030007@redhat.com> Date: Tue, 1 Dec 2015 22:53:07 +0200 MIME-Version: 1.0 In-Reply-To: <20151201182038.GD18957@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: mst@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com, laine@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, lersek@redhat.com, rth@twiddle.net On 12/01/2015 08:20 PM, Eduardo Habkost wrote: > On Thu, Nov 26, 2015 at 06:00:28PM +0200, Marcel Apfelbaum wrote: >> Add bus property to PC machines and use it when looking >> for primary PCI root bus (bus 0). >> >> Signed-off-by: Marcel Apfelbaum >> --- >> hw/i386/acpi-build.c | 3 +-- >> hw/i386/pc.c | 2 +- >> hw/i386/pc_piix.c | 1 + >> hw/i386/pc_q35.c | 1 + >> include/hw/i386/pc.h | 1 + >> 5 files changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c >> index 736b252..bca3f06 100644 >> --- a/hw/i386/acpi-build.c >> +++ b/hw/i386/acpi-build.c >> @@ -950,8 +950,7 @@ build_ssdt(GArray *table_data, GArray *linker, >> /* Reserve space for header */ >> acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader)); >> >> - /* Extra PCI root buses are implemented only for i440fx */ >> - bus = find_i440fx(); >> + bus = PC_MACHINE(machine)->bus; > > You can use acpi_get_i386_pci_host()->bus here, so we can reduce > the amount of PC-specific code inside acpi-build.c. > > (Making acpi_get_i386_pci_host() more generic and not depend on > piix- and q35-specific checks is also on my plans) Well, at this point, looking at the names PC_MACHINE and acpi_get_i386_pci_host, I don't see much difference :) I think we can change this later when acpi_get_i386_pci_host will be generic. Thanks, Marcel > >> if (bus) { >> QLIST_FOREACH(bus, &bus->child, sibling) { >> uint8_t bus_num = pci_bus_num(bus); > [...] >