From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C1A181A1E0A for ; Mon, 12 Sep 2016 04:57:02 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3654643A37; Mon, 12 Sep 2016 11:57:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-102.phx2.redhat.com [10.3.116.102]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8CBv0j0007597; Mon, 12 Sep 2016 07:57:01 -0400 To: Ard Biesheuvel , edk2-devel@ml01.01.org, leif.lindholm@linaro.org References: <1473674479-20207-1-git-send-email-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: <9e187728-7127-d665-16e8-3b661571e3a3@redhat.com> Date: Mon, 12 Sep 2016 13:57:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1473674479-20207-1-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 12 Sep 2016 11:57:02 +0000 (UTC) Subject: Re: [PATCH 0/3] ArmPkg ArmVirtPkg: prevent 64-bit MMIO BAR degradation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 11:57:02 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 09/12/16 12:01, Ard Biesheuvel wrote: > On ARM/Linux systems, the PCI layer is usually reconfigured from scratch, > given the embedded legacy of ARM systems. However, when booting arm64/Linux > in ACPI mode, such reconfiguration can be avoided, since ACPI implies UEFI > implies firmware (as opposed to DT mode, which could be booted via QEMU's > ~10 instruction bootloader) > > In this case, it is important for the firmware to leave the PCI configuration > in a reasonable state, and one of the things that UEFI does by default, and > which makes no sense at all on an arm64 system, is to degrade 64-bit MMIO BARs > to 32-bit in the presence of a ROM BAR on the same device. (It does makes sense > on an Intel system running legacy option ROMs under a CSM) > > Fortunately, we have a way of influencing this policy without having to hack > the generic PCI bus driver: we can install the IncompatiblePciDeviceSupport > protocol, and the PCI bus driver will invoke it for each PCI device it > configures. > > Our implementation for ArmPkg is simply the OVMF version with the bits ripped > out that care about CSMs and legacy BIOSes > > Ard Biesheuvel (3): > ArmPkg: add driver to force 64-bit MMIO BARs to be allocated above 4 > GB > ArmVirtPkg/FdtPciPcdProducerLib: add discovery of PcdPciMmio64Size > ArmVirtPkg/ArmVirtQemu: add IncompatiblePciDeviceSupportDxe > > ArmPkg/Drivers/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c | 223 ++++++++++++++++++++ > ArmPkg/Drivers/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf | 49 +++++ > ArmVirtPkg/ArmVirtQemu.dsc | 5 + > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 1 + > ArmVirtPkg/ArmVirtQemuKernel.dsc | 5 + > ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c | 31 +-- > ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf | 1 + > 7 files changed, 302 insertions(+), 13 deletions(-) > create mode 100644 ArmPkg/Drivers/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c > create mode 100644 ArmPkg/Drivers/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf > Formatting / reviewing the first patch with "--find-copies-harder" works wonders, so I recommend that flag for similar future posts. Series Reviewed-by: Laszlo Ersek Thanks Laszlo