From patchwork Thu Sep 26 21:50:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 278282 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77E172C0094 for ; Fri, 27 Sep 2013 07:48:37 +1000 (EST) Received: from localhost ([::1]:60045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPJQI-0008Ns-21 for incoming@patchwork.ozlabs.org; Thu, 26 Sep 2013 17:48:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPJPw-0008KH-TW for qemu-devel@nongnu.org; Thu, 26 Sep 2013 17:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPJPq-0006A9-UF for qemu-devel@nongnu.org; Thu, 26 Sep 2013 17:48:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPJPq-0006A2-LE for qemu-devel@nongnu.org; Thu, 26 Sep 2013 17:48:06 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8QLm4br006503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Sep 2013 17:48:05 -0400 Received: from redhat.com (vpn1-6-101.ams2.redhat.com [10.36.6.101]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id r8QLm2mW000742; Thu, 26 Sep 2013 17:48:03 -0400 Date: Fri, 27 Sep 2013 00:50:23 +0300 From: "Michael S. Tsirkin" To: Gerd Hoffmann Message-ID: <20130926215023.GA26451@redhat.com> References: <1380108120-18700-1-git-send-email-mst@redhat.com> <1380114776.3625.50.camel@nilsson.home.kraxel.org> <1380118503.3625.86.camel@nilsson.home.kraxel.org> <20130925144850.GA29330@redhat.com> <1380176811.11024.5.camel@nilsson.home.kraxel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1380176811.11024.5.camel@nilsson.home.kraxel.org> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, Anthony Liguori , afaerber@suse.de Subject: Re: [Qemu-devel] [PATCH v5 00/23] qemu: generate acpi tables for the guest 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 On Thu, Sep 26, 2013 at 08:26:51AM +0200, Gerd Hoffmann wrote: > Hi, > > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > > index 1ba86d0..d1ccdf7 100644 > > --- a/hw/i386/acpi-build.c > > +++ b/hw/i386/acpi-build.c > > @@ -961,8 +961,8 @@ static void acpi_build_update(void *build_opaque, uint32_t offset) > > if (build_state->mcfg_base) { > > AcpiMcfgAllocation *a; > > mcfg_base = qint_get_int(build_state->mcfg_base); > > + assert(build_state->mcfg_size); > > mcfg_size = qint_get_int(build_state->mcfg_size); > > - assert(mcfg_size); > > > > a = ACPI_BUILD_STATE_PTR(build_state, off_mcfg_allocation, > > AcpiMcfgAllocation); > > Well, that fixes the assert, but it still isn't working correctly. No > mcfg table in acpi, even though the mcfg bar is programmed correctly. > > Seeing this with both seabios+coreboot. > > cheers, > Gerd > OK here's a quick fix - it's ugly, I'll clean it up a bit before reposting. It's pushed, you can take the final one from my tree. Thanks for the testing! diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index d1ccdf7..e4fe196 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -938,6 +938,8 @@ struct AcpiBuildState { build_state->table_size, \ build_state->off, sizeof(type)))) +/* Hack: we don't really need this */ +static void acpi_set_pci_info(AcpiBuildState *build_state); static void acpi_build_update(void *build_opaque, uint32_t offset) { AcpiBuildState *build_state = build_opaque; @@ -954,6 +956,7 @@ static void acpi_build_update(void *build_opaque, uint32_t offset) acpi_get_pci_info(&pci_info); acpi_get_pm_info(&pm); + acpi_set_pci_info(build_state); fadt_update(ACPI_BUILD_STATE_PTR(build_state, off_fadt_base, AcpiFadtDescriptorRev1), &pm);