From patchwork Fri Dec 7 11:23:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153141 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp376394ljp; Fri, 7 Dec 2018 03:23:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/XtxVgh7fscX0iCE7hwSfUst/VSRGTI7xm515g3kx7PCaaPBxbI7uwTcZIWOsvZi7jq+zO4 X-Received: by 2002:a17:902:7d82:: with SMTP id a2mr1760011plm.163.1544181813379; Fri, 07 Dec 2018 03:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544181813; cv=none; d=google.com; s=arc-20160816; b=Mt7SZVB/oHWXEhK6QP58Y1oDBYSHo47WH+euHG3gdR3fWjmpKvlK3GABeLLr3O4+LS Qr7agG7xxpDq9tWmTXqYGRP2tlD+jaHZa/UnbAAHZ5H/MwzM5DllfQCrpLDepruYCYGC cWuSA5H7uUgLHBLLmkjgP8V0/bXXjVDvW7CO07BESvUrlN2UNklBrObrsUSptrubQrCF rpFKz9En2hBpMNSHOIpUzprkfFUBcPe+VhQqA73KICxEOB7qGnC7SEbwMLqGHv5Uz8Hg jeGy1RZ16NcP6U9vpWXU/xBqcIFqYpm3qScmLJJRYR9SsFVmn4+waZZMd5yrxO1tY9pv s/eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=4K2PBMpZdNXfkpKx1jGM9otKYeiX3M1YVK5ui4OaP+c=; b=AS20lV8VZX7PLiOFSJ2+itpBMkP3DHB/0kjaa3sxFuGtMeFkTnhNf45UmiG+dTyQOr Gtb2BCYBRcdzduAbqAG0m1iBbcBUFr35qv+Db6k9nZLk6xtl5oZ3ajxKzJeCWlnJtvgK Yko3xwHM+bljz/DSg+2h1Qo2kI/rBQcq1U94kI7hFQq0EBvaXjiD5nfFf9jdkRBnVoFx l20TLD4qP63E0T3W9MSs8ZdINBkLO97nOKoIMdg9yETxU+btWNCDJs6QuSFi0T2x+Hei /ZKm+1bPKZWJLj0+FUd3YcKGdWDp261XB/1pWCDCSzT7t0Vo5KevUpn6nOWORALw0w4y 92kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=IJ4u+JlT; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id n1si2997255pfh.96.2018.12.07.03.23.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:23:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=IJ4u+JlT; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7ABB221199B15; Fri, 7 Dec 2018 03:23:20 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::343; helo=mail-wm1-x343.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 E0A6F2194D3B3 for ; Fri, 7 Dec 2018 03:23:18 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id q26so4128541wmf.5 for ; Fri, 07 Dec 2018 03:23:18 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=3IE+0gzD9Q1fewtX4Fi1C84/sWK8X+MtQY2OcUr/9e0=; b=IJ4u+JlTrxdle6zenBvYNzPmfA50Ar8iZGoVNWesMRzg5jbEV56gdvyl1MDjB3loYw OWZVH6JKnmvYl2UDi6gkFC1C5F91fiju6Cyfgd4vnhrBcneiZxiMPYLiBPm+u9Gy2fMn NsMevN7zZ0aycJZdIKjtFZuXejDfl4vWqoBew= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=3IE+0gzD9Q1fewtX4Fi1C84/sWK8X+MtQY2OcUr/9e0=; b=MbiNlv9qAzztNqpSmCZ0Hq8aqVlnIO8A3NX8Kj8oaxcyRvmPHVEjlUTprUY/ldm+Zb N1SlfrXEfnNBy5RBh1AywXzcMCxms8FxKy8mohJ0L1+yx0+OtkkOS24qhY3YMR2Fvf4q mBDBycAhKM3ruh2tTHP4GG6kexlhL4CBrJL+PZhOyGg682YogoE9Cf1Yi1M7k1QZWhJg VqAscCwRRMbR69Mob/G9FDwTcQidgkp5foa9kXX+9Gp2TFU7sr3K7LjA16NEHOXIo8fa C9OxVrsLbNw80sJdCCQz3mOKc8yaEppAw8+AF/kX6nuFCDCEi6ITOKEHAsVHnjm78pKP LC6Q== X-Gm-Message-State: AA+aEWYz28Dx0QGXL7NzQp0+cQ/0EvU3iSf3s1PpNKjrkq63F7e0H1rd nmRokARDWBbUmuQ9QGxyc3hTqLfDLZtIJw== X-Received: by 2002:a1c:c2d4:: with SMTP id s203mr1890785wmf.3.1544181797113; Fri, 07 Dec 2018 03:23:17 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:2cd0:a19e:84ff:4800]) by smtp.gmail.com with ESMTPSA id f187sm2813542wma.4.2018.12.07.03.23.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:23:16 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 7 Dec 2018 12:23:03 +0100 Message-Id: <20181207112304.19765-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181207112304.19765-1-ard.biesheuvel@linaro.org> References: <20181207112304.19765-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [RFC PATCH 6/7] ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS 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: , Cc: Andrew Jones , Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The current ArmVirtMemoryInitPeiLib code splits the memory region passed via PcdSystemMemoryBase/PcdSystemMemorySize in two if the region extends beyond the MAX_ADDRESS limit. This was introduced for 32-bit ARM, which may support more than 4 GB of physical address space, but cannot address all of it via a 1:1 mapping, and a single region that is not mappable in its entirety is unusable by the PEI core. AArch64 is in a similar situation now: platforms may support more than 256 TB of physical address space, but only 256 TB is addressable by the CPU, and so a memory region that extends from below this limit to above it should be split. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c index 05afd1282422..66925fc05ebd 100644 --- a/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c +++ b/ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c @@ -75,18 +75,18 @@ MemoryPeim ( SystemMemoryTop = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize); - if (SystemMemoryTop - 1 > MAX_ADDRESS) { + if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) { BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, ResourceAttributes, PcdGet64 (PcdSystemMemoryBase), - (UINT64)MAX_ADDRESS - PcdGet64 (PcdSystemMemoryBase) + 1 + (UINT64)MAX_ALLOC_ADDRESS - PcdGet64 (PcdSystemMemoryBase) + 1 ); BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, ResourceAttributes, - (UINT64)MAX_ADDRESS + 1, - SystemMemoryTop - MAX_ADDRESS - 1 + (UINT64)MAX_ALLOC_ADDRESS + 1, + SystemMemoryTop - MAX_ALLOC_ADDRESS - 1 ); } else { BuildResourceDescriptorHob (