From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9BAFE1A1E0A for ; Mon, 12 Sep 2016 03:01:29 -0700 (PDT) Received: by mail-wm0-x230.google.com with SMTP id b187so127042397wme.1 for ; Mon, 12 Sep 2016 03:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3iT+JKKs7KaM2Tm+jZdZB8aU87P2sH6OM5GcDxSlr2c=; b=UVzdeJiyyQ9kynwtwbyoKI7Eb7nGT/cP+wmXUSc/9XIXq5DbMmjTI4PuYr6ICJB3kn q9035/YEkx1wQpzkasrH6rbAnhsPDV/lVfrkn5SQrg4+naBPgBsHUanFML6xIgIBTBQD 5TNbaqJK3bN5zGe5jlElAv3/9BEhKoO5Ae5JI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3iT+JKKs7KaM2Tm+jZdZB8aU87P2sH6OM5GcDxSlr2c=; b=ELO1EfTIPM5e6ooe1lANGk/m9Fwlfi7U7xHHmnSjLKQKq8mCuuk08sMBnYS2PbIbJO h/Js2py/OM/0i1VrDSO2yjbv04qBvb+rCqjSjkZw2R3LL4eNPkGP7o4oTLdhSWPYJNMn CkRA1AVK6vEf3mo7xTtdG3FR0rmuWwT1+ESjvVmXQQej+2pGIeOlZvvSVf9nyul9ijOc rVx4c7I2s/aHrVuo5tvpF5ML3toQWzII/prCbC1mlqIjL1U6CtREg4lQ8h68S6fTbKSv 2m6yK/EfITOtnB8mmAE9q/w4fcRmxDIQuBfe7OEvN8GhY1nimpwFOrHr5ae1vnWqdD0i qKUQ== X-Gm-Message-State: AE9vXwNjhQNY1NNZJUL5eoWRMOAWUSQGQfm/+AH3mr+rYeroz4/zSMH/ZqCtX2D4Izl9fUAV X-Received: by 10.194.57.244 with SMTP id l20mr14006649wjq.1.1473674487636; Mon, 12 Sep 2016 03:01:27 -0700 (PDT) Received: from localhost.localdomain ([197.128.106.42]) by smtp.gmail.com with ESMTPSA id ce6sm17092706wjc.27.2016.09.12.03.01.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Sep 2016 03:01:26 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, lersek@redhat.com Cc: Ard Biesheuvel Date: Mon, 12 Sep 2016 11:01:16 +0100 Message-Id: <1473674479-20207-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [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 10:01:30 -0000 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 -- 2.7.4