From patchwork Mon Nov 17 16:16:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 40932 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1961724035 for ; Mon, 17 Nov 2014 16:17:07 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf986399eek.6 for ; Mon, 17 Nov 2014 08:17:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=YsNfAlpdIX7QxTDgGKrvHJpYJvSJuzprASi/wq5TCt8=; b=WfPhpVAB4x+CsFU/bpvJ9U3L8HvO9o/dYkFynTOMFVbnhMRjSyAG+d2FyxcPJKITuW ii2WnxI2CfQqusigUJ6YzkmWlgfssJB3GJAHcn6uBZKFGRjii9UIjKv9NukKnVaVgJjJ /FxKycK8SvHSVFzW1Cq+oMriQIdnCoWerlAQCEQiH9eJroTeImzMdNErQR440uP9b/8i iitUHKp7jPgG/xUe0ZmCwZ5BAsWA92CvdoN4sRPjRPneF0bd+nDEz5dozqcqJcUP2y5I 99AKYAnlWjFEapUCALtu7FYO159l/RWD6VClNK7N2B0cRaEguku3XHb9gXSqx3s3YhLF Ea0g== X-Gm-Message-State: ALoCoQnJajQlm2qRJ4dmer45Tx1Je3DEQsRZVz8kjZ8R0eNCXSGVnm7yTeNpZpFLGvgTnk0Vdd12 X-Received: by 10.194.86.66 with SMTP id n2mr222940wjz.7.1416241026050; Mon, 17 Nov 2014 08:17:06 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.36 with SMTP id cr4ls1213721lad.41.gmail; Mon, 17 Nov 2014 08:17:05 -0800 (PST) X-Received: by 10.152.4.229 with SMTP id n5mr28711318lan.1.1416241025856; Mon, 17 Nov 2014 08:17:05 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id k17si52448412laa.67.2014.11.17.08.17.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 08:17:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id w7so7458732lbi.5 for ; Mon, 17 Nov 2014 08:17:05 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr15152353lab.40.1416241025716; Mon, 17 Nov 2014 08:17:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp1180895lbc; Mon, 17 Nov 2014 08:17:04 -0800 (PST) X-Received: by 10.107.133.17 with SMTP id h17mr11948845iod.47.1416241024256; Mon, 17 Nov 2014 08:17:04 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id s65si8715998ioi.30.2014.11.17.08.17.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Nov 2014 08:17:04 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XqOyx-0003TV-Sq; Mon, 17 Nov 2014 16:16:51 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XqOyw-0003TK-55 for edk2-devel@lists.sourceforge.net; Mon, 17 Nov 2014 16:16:50 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XqOyu-0005fZ-Jp for edk2-devel@lists.sourceforge.net; Mon, 17 Nov 2014 16:16:50 +0000 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 sAHGGfvv031427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 17 Nov 2014 11:16:42 -0500 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-121.ams2.redhat.com [10.36.116.121]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAHGGdV7030867 for ; Mon, 17 Nov 2014 11:16:40 -0500 From: Laszlo Ersek To: edk2-devel@lists.sourceforge.net Date: Mon, 17 Nov 2014 17:16:35 +0100 Message-Id: <1416240995-17646-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1XqOyu-0005fZ-Jp Subject: [edk2] [PATCH] OvmfPkg: AcpiPlatformDxe: make dependency on PCI enumeration explicit X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The ACPI payload that OVMF downloads from QEMU via fw_cfg depends on the PCI enumaration and resource assignment performed by MdeModulePkg/Bus/Pci/PciBusDxe. Namely, although the ACPI payload is pre-generated in qemu during machine initialization, in main() [vl.c] qemu_run_machine_init_done_notifiers() pc_guest_info_machine_done() [hw/i386/pc.c] acpi_setup() [hw/i386/acpi-build.c] acpi_build() acpi_add_rom_blob() rom_add_blob(... acpi_build_update ...) [hw/core/loader.c] fw_cfg_add_file_callback() [hw/nvram/fw_cfg.c] the ACPI data is rebuilt at the first time any of the related fw_cfg files are read, through the acpi_build_update() fw_cfg read-callback function: fw_cfg_read() [hw/nvram/fw_cfg.c] acpi_build_update() [hw/i386/acpi-build.c] acpi_build() (See qemu commit d87072ceeccf4f84a64d4bc59124bcd64286c070 and its containing series.) For this reason we must not dispatch AcpiPlatformDxe before PciBusDxe completes the enumeration. Luckily, the PI Specification 1.3 defines EFI_PCI_ENUMERATION_COMPLETE_GUID in Volume 5, "10.9 End of PCI Enumeration Overview", as an indicia to inform the platform when the PCI enumeration process has completed. PciBusDxe installs this protocol at the end of the PciEnumerator() function. Let's add this GUID to the Depex section of AcpiPlatformDxe, in order to state the dependency explicitly. On Xen, and on older QEMU where the linker/loader fw_cfg interface is unavailable, this introduces a harmless ordering constraint -- we'll always include PciBusDxe in OVMF, so the dependency will always be satisfied. I tested this change as follows: - I dumped the ACPI tables in a Fedora 20 guest, before and after the change, and compared them. The only thing that actually changed was the FACS address. (Which I promptly tested with S3 suspend/resume.) Plus, of course, the FACP checksum changed, because the FACP links the FACS. - Tested S3 in my Windows Server 2008 R2 and Windows Server 2012 R2 guests. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf index 3229d71..c6dced2 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -66,5 +66,5 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress [Depex] - gEfiAcpiTableProtocolGuid + gEfiAcpiTableProtocolGuid AND gEfiPciEnumerationCompleteProtocolGuid