From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::441; helo=mail-wr1-x441.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 B05712119489A for ; Fri, 23 Nov 2018 04:14:45 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id j2so12163024wrw.1 for ; Fri, 23 Nov 2018 04:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Da7a/3z7QQDjJjgH8T5oH0XsH39r1Qg/EdsgOLfTJpk=; b=TKAgx80erRyTyZ1kX0o2bSJcjfMtUIF/ekhrVP8Ta5iwh2urgc2Qhdo3UeipoGaWGA SY3nUtUeZIMbd9/znLYqQhzG8XlpCkjdrSCjfvF4XWLb1u6xQ7snW872hPGG1FwVxYCZ 4f4/sZSk87cu3DZ7rahW3TaaSVoE2czMOhRrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Da7a/3z7QQDjJjgH8T5oH0XsH39r1Qg/EdsgOLfTJpk=; b=ByIgtF5DJma6+LWOXeuSzBqa9BR3ntxOcHB5P6po5o3mmBVu6qe+yDNg3zypQcfhlr FznuQaTi58LVawtWCw25CbYmoRJG3aZD/DIXt+SS7Fbwb20aL/xcpp9CzSoR3Cs9kzRm ox/Et4nNvkykrgybTEPJg+GpxbonAKrFeKApNeSXuFKNeP7Ha2YpQSsHOCIOlcHOnjWN A4tb4gwzG/Bfjx4W/wlGQqUJ13lQ9H6AWxRDJmcA9RYW7zBErC+HViobrxlZbZMBhkUL 3vX5v3sonog4MIlldkDSPKXs190WG4a9NCDoxBVH8t9RNpL9BzN+BEaMqJ2HgRqY5PTI BB5w== X-Gm-Message-State: AA+aEWaEzTx8FkNx0GgqQNPzWTurTOlBeuhGPaHIOvxQ0iLxUb1ZlEjl eRkPHVMuLXdHtjfoWGzWq8//45AsxmYOHg== X-Google-Smtp-Source: AFSGD/WjETgmyfTgTTH/eTSb49J3XSxSBIMW1Nt44EoETPApx+xL38DP9v5ILRhz35xhdTlAf0rs9Q== X-Received: by 2002:adf:b201:: with SMTP id u1mr5569326wra.165.1542975283505; Fri, 23 Nov 2018 04:14:43 -0800 (PST) Received: from mba13.wifi.ns.nl (33.153.69.91.rev.sfr.net. [91.69.153.33]) by smtp.gmail.com with ESMTPSA id x79sm16469106wmd.42.2018.11.23.04.14.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 04:14:42 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: Ard Biesheuvel , Laszlo Ersek , Leif Lindholm , Eric Auger , Andrew Jones , Philippe Mathieu-Daude , Julien Grall Date: Fri, 23 Nov 2018 13:14:26 +0100 Message-Id: <20181123121431.22353-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [PATCH 0/5] ArmPkg, ArmVirtPkg: lift 40-bit IPA space limit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 12:14:46 -0000 The ArmVirtQemu targets currently limit the size of the IPA space to 40 bits because that is all what KVM supports. However, this is about to change, and so we need to update the code if we want to ensure that our UEFI firmware builds can keep running on systems that set values other than 40 (which could be > 40 or < 40) So add a helper to ArmLib to read the number of supported address bits (#1) and take this into account in the page table code (#2), which allows PcdPrePiCpuMemorySize to assume a value that exceeds the capabilities of the CPU. Patch #3 is mostly a cleanup patch, to switch to the new helper added in patch #1. No functional changes intended. Patch #4 builds the CPU hob (and thus declares the size of the GCD memory space) based on the CPU capabilities rather than the value of PcdPrePiCpuMemorySize, to prevent any potential regressions in memory utilization when we bump PcdPrePiCpuMemorySize back to 48. Patch #5 drops the definitions of PcdPrePiCpuMemorySize, reverting its value back to the default 48. Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Eric Auger Cc: Andrew Jones Cc: Philippe Mathieu-Daude Cc: Julien Grall Ard Biesheuvel (5): ArmPkg/ArmLib: add support for reading the max physical address space size ArmPkg/ArmMmuLib: take the CPU supported maximum PA space into account ArmVirtPkg: refactor reading of the physical address space size ArmVirtPkg: disregard PcdPrePiCpuMemorySize PCD when sizing the GCD space ArmVirtPkg: revert PcdPrePiCpuMemorySize to is default value of 48 ArmPkg/Include/Library/ArmLib.h | 6 +++ ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S | 16 ++++++++ ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S | 8 ++++ .../Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 5 ++- ArmVirtPkg/ArmVirtQemu.dsc | 5 --- ArmVirtPkg/ArmVirtQemu.fdf | 1 - ArmVirtPkg/ArmVirtQemuKernel.dsc | 4 -- .../Include/Library/ArmVirtMemInfoLib.h | 1 + .../ArmVirtMemoryInitPeiLib.c | 7 +++- .../ArmVirtMemoryInitPeiLib.inf | 1 + .../QemuVirtMemInfoLib/AArch64/PhysAddrTop.S | 39 ------------------- .../QemuVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ------------ .../QemuVirtMemInfoLib/QemuVirtMemInfoLib.c | 6 +-- .../QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf | 7 ---- .../QemuVirtMemInfoPeiLib.inf | 7 ---- .../XenVirtMemInfoLib/AArch64/PhysAddrTop.S | 39 ------------------- .../XenVirtMemInfoLib/Arm/PhysAddrTop.S | 24 ------------ .../XenVirtMemInfoLib/XenVirtMemInfoLib.c | 8 +--- .../XenVirtMemInfoLib/XenVirtMemInfoLib.inf | 6 --- .../PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 -- ArmVirtPkg/PrePi/PrePi.c | 3 -- 21 files changed, 46 insertions(+), 174 deletions(-) delete mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/AArch64/PhysAddrTop.S delete mode 100644 ArmVirtPkg/Library/QemuVirtMemInfoLib/Arm/PhysAddrTop.S delete mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/AArch64/PhysAddrTop.S delete mode 100644 ArmVirtPkg/Library/XenVirtMemInfoLib/Arm/PhysAddrTop.S -- 2.17.1