Received: from eggs.gnu.org ([2001:4830:134:3::10]:49243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3tUj-0004zE-HG for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:33:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3tUf-0008Ry-HG for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:33:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3tUf-0008Ru-BW for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:33:53 -0500 Date: Tue, 1 Dec 2015 20:33:50 -0200 From: Eduardo Habkost Message-ID: <20151201223350.GP23717@thinpad.lan.raisama.net> 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> <565E08B3.5030007@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565E08B3.5030007@redhat.com> 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: Marcel Apfelbaum 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 Tue, Dec 01, 2015 at 10:53:07PM +0200, Marcel Apfelbaum wrote: > 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'm a bit confused by how generic acpi-build.c is supposed to be. It has some code that seems to be an attempt to be more generic (e.g. the "if (pci_host)" check at build_ssdt()), but lots of other code that only work with PC machines. Maybe we should stop pretending and simply use PCMachineState everywhere inside acpi-build.c? > I think we can change this later when acpi_get_i386_pci_host will be generic. No problem to me. :) -- Eduardo