From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymh5P-00046o-DZ for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:20:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymh5L-0001KX-E8 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:20:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymh5L-0001KR-6W for qemu-devel@nongnu.org; Mon, 27 Apr 2015 07:20:23 -0400 Date: Mon, 27 Apr 2015 13:19:53 +0200 From: "Michael S. Tsirkin" Message-ID: <20150427131940-mutt-send-email-mst@redhat.com> References: <1426791181-23831-1-git-send-email-marcel@redhat.com> <1426791181-23831-26-git-send-email-marcel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426791181-23831-26-git-send-email-marcel@redhat.com> Subject: Re: [Qemu-devel] [PATCH V6 for-2.3 25/26] apci: fix PXB behaviour if used with unsupported BIOS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: kraxel@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, 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 On Thu, Mar 19, 2015 at 08:53:00PM +0200, Marcel Apfelbaum wrote: > PXB does not work with unsupported bioses, but should > not interfere with normal OS operation. > We don't ship them anymore, but it's reasonable > to keep the work-around until we update the bios in qemu. Can be dropped now we have updated the bios? > Fix this by not adding PXB mem/IO chunks to _CRS > if they weren't configured by BIOS. > > Signed-off-by: Marcel Apfelbaum > --- > hw/i386/acpi-build.c | 87 ++++++++++++++++++++++++++++++++++------------------ > 1 file changed, 58 insertions(+), 29 deletions(-) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 36888ae..219b1b6 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -823,6 +823,14 @@ static Aml *build_crs(PCIHostState *host, > range_base = r->addr; > range_limit = r->addr + r->size - 1; > > + /* > + * Work-around for old bioses > + * that do not support multiple root buses > + */ > + if (!range_base || range_base > range_limit) { > + continue; > + } > + > if (r->type & PCI_BASE_ADDRESS_SPACE_IO) { > aml_append(crs, > aml_word_io(aml_min_fixed, aml_max_fixed, > @@ -856,45 +864,66 @@ static Aml *build_crs(PCIHostState *host, > > range_base = pci_bridge_get_base(dev, PCI_BASE_ADDRESS_SPACE_IO); > range_limit = pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_SPACE_IO); > - aml_append(crs, > - aml_word_io(aml_min_fixed, aml_max_fixed, > - aml_pos_decode, aml_entire_range, > - 0, > - range_base, > - range_limit, > - 0, > - range_limit - range_base + 1)); > - crs_range_insert(io_ranges, range_base, range_limit); > + > + /* > + * Work-around for old bioses > + * that do not support multiple root buses > + */ > + if (range_base || range_base > range_limit) { > + aml_append(crs, > + aml_word_io(aml_min_fixed, aml_max_fixed, > + aml_pos_decode, aml_entire_range, > + 0, > + range_base, > + range_limit, > + 0, > + range_limit - range_base + 1)); > + crs_range_insert(io_ranges, range_base, range_limit); > + } > > range_base = > pci_bridge_get_base(dev, PCI_BASE_ADDRESS_SPACE_MEMORY); > range_limit = > pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_SPACE_MEMORY); > - aml_append(crs, > - aml_dword_memory(aml_pos_decode, aml_min_fixed, > - aml_max_fixed, aml_non_cacheable, > - aml_ReadWrite, > - 0, > - range_base, > - range_limit, > - 0, > - range_limit - range_base + 1)); > - crs_range_insert(mem_ranges, range_base, range_limit); > + > + /* > + * Work-around for old bioses > + * that do not support multiple root buses > + */ > + if (range_base || range_base > range_limit) { > + aml_append(crs, > + aml_dword_memory(aml_pos_decode, aml_min_fixed, > + aml_max_fixed, aml_non_cacheable, > + aml_ReadWrite, > + 0, > + range_base, > + range_limit, > + 0, > + range_limit - range_base + 1)); > + crs_range_insert(mem_ranges, range_base, range_limit); > + } > > range_base = > pci_bridge_get_base(dev, PCI_BASE_ADDRESS_MEM_PREFETCH); > range_limit = > pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_MEM_PREFETCH); > - aml_append(crs, > - aml_dword_memory(aml_pos_decode, aml_min_fixed, > - aml_max_fixed, aml_non_cacheable, > - aml_ReadWrite, > - 0, > - range_base, > - range_limit, > - 0, > - range_limit - range_base + 1)); > - crs_range_insert(mem_ranges, range_base, range_limit); > + > + /* > + * Work-around for old bioses > + * that do not support multiple root buses > + */ > + if (range_base || range_base > range_limit) { > + aml_append(crs, > + aml_dword_memory(aml_pos_decode, aml_min_fixed, > + aml_max_fixed, aml_non_cacheable, > + aml_ReadWrite, > + 0, > + range_base, > + range_limit, > + 0, > + range_limit - range_base + 1)); > + crs_range_insert(mem_ranges, range_base, range_limit); > + } > } > } > > -- > 2.1.0