From patchwork Sat Feb 27 00:23:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 63131 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp145852lbc; Fri, 26 Feb 2016 16:24:15 -0800 (PST) X-Received: by 10.66.62.132 with SMTP id y4mr5851563par.55.1456532647424; Fri, 26 Feb 2016 16:24:07 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id x89si4057403pfi.210.2016.02.26.16.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2016 16:24:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9C70E1A1E47; Fri, 26 Feb 2016 16:24:08 -0800 (PST) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DB9CD1A1E5C for ; Fri, 26 Feb 2016 16:24:06 -0800 (PST) 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 (Postfix) with ESMTPS id 1BFDE337742; Sat, 27 Feb 2016 00:24:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-45.phx2.redhat.com [10.3.113.45]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1R0NdFc026697; Fri, 26 Feb 2016 19:23:59 -0500 From: Laszlo Ersek To: edk2-devel-01 Date: Sat, 27 Feb 2016 01:23:31 +0100 Message-Id: <1456532616-32475-13-git-send-email-lersek@redhat.com> In-Reply-To: <1456532616-32475-1-git-send-email-lersek@redhat.com> References: <1456532616-32475-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: Ruiyu Ni , Jordan Justen , Marcel Apfelbaum Subject: [edk2] [PATCH 12/17] OvmfPkg: PciHostBridgeLib: set RootBus->AllocationAttributes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" InitRootBridge() in "OvmfPkg/PciHostBridgeDxe/PciHostBridge.c" passes the EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM allocation attribute to RootBridgeConstructor(); we should do the same here. >From "MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h": /// If this bit is set, then the PCI Root Bridge does not support separate /// windows for Non-prefetchable and Prefetchable memory. A PCI bus driver /// needs to include requests for Prefetchable memory in the /// Non-prefetchable memory pool. Which implies that both the 32-bit and 64-bit prefetchable MMIO apertures should be marked empty. (The CreateRootBridge() function actually enforces this in "MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c".) Furthermore, since OvmfPkg/PciHostBridgeDxe does *not* set the EFI_PCI_HOST_BRIDGE_MEM64_DECODE allocation attribute: /// If this bit is set, then the PCI Root Bridge supports 64 bit memory /// windows. If this bit is not set, the PCI bus driver needs to include /// requests for 64 bit memory address in the corresponding 32 bit memory /// pool. we follow suit in the PciHostBridgeLib instance. In turn, the 64-bit MMIO apertures (both prefetchable and non-prefetchable) should be marked empty. MdeModulePkg/Bus/Pci/PciHostBridgeDxe enforces this too. (64-bit MMIO aperture support, based on yet more fw_cfg files, is a planned future improvement.) Cc: Jordan Justen Cc: Ruiyu Ni Cc: Marcel Apfelbaum Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c index ba08c9b43b54..25849c1f51c5 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -17,6 +17,7 @@ #include +#include #include #include @@ -86,6 +87,14 @@ InitRootBridge ( RootBus->DmaAbove4G = FALSE; + RootBus->AllocationAttributes = EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM; + RootBus->PMem.Base = 0; + RootBus->PMem.Limit = 0; + RootBus->PMemAbove4G.Base = 0; + RootBus->PMemAbove4G.Limit = 0; + RootBus->MemAbove4G.Base = 0; + RootBus->MemAbove4G.Limit = 0; + return EFI_OUT_OF_RESOURCES; }