From patchwork Wed Dec 19 20:56:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154304 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5381724ljp; Wed, 19 Dec 2018 12:57:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xh3cWxv+L6BFEZn/0fmofmL0xXnHO1jUsoLWU24qEEUumV+sA5ChIPHzr89/ZbEbx2XgoW X-Received: by 2002:a62:8893:: with SMTP id l141mr21589648pfd.1.1545253031221; Wed, 19 Dec 2018 12:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545253031; cv=none; d=google.com; s=arc-20160816; b=LgsLRbdBkHuox3tvF2MWkGhbmRkYKxtImKOuGDnMCKylajOS44zl04epIPFPRGZZs4 K7M13gGmYiSqFHviVydR6KXJhdgUEs1U81SF+KCVgsUADKeXT8yl3Hl5ychmkmcMHTEQ DhNzFXwsxciQ4fdXcUu4Uz7BfOIo9vubCnVLnxuV3toYELazndsZBkhHiwb6UNHBogHZ oSqR/Z1WgiZNrku4S7yLGiRzxtiyCLL9iF8jnw3+pD3rjKyULVKzbPzf2c/u6wFn7uoI ObfGBy3saL5I40yviKdSCOrLT64w9G9R36zIMW+2vsZTuGYakmdK+dL5yijxx+EMNSCg kJ/A== 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=rjvJbcCoNur8QGw3+dwKfFGc9jNiBi2aWvcOAmAd59E=; b=ZWPN5ULZQ2K2uz97UFv7Ciblze1jaE11cDaobk120k6bo5bb9bFvzAxJw5ALlS5Seg lbHRULEOKVS8H5V5bPoR4h2CBzEr2QmBJ4gxS1bAMeuR4NxF8vi2wPhhYdrRN9SpNkka p7z3+1itpCnIZ4d+aDnEpYUU4tr6Qun6VWdqpIv3O8n/XBYZ4kTKGNyYo4FTfkpBHVqn pcvgfBX8/MtXOyMt46U52EZOyBUBqt75mNYv8zs0gLns/Yvwp3tgaZUjstWreh+Morml otwnYDh9b6l228I5ZYV/SFlPYLrBxbZq0+v9NNyixm4rwsJWllWjiYyF/2ShHFW1Pw7N ugCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XqffMjF8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id j20si16955675pgb.520.2018.12.19.12.57.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 12:57:11 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XqffMjF8; 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; 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 6C58F211A2D83; Wed, 19 Dec 2018 12:57:02 -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::342; helo=mail-wm1-x342.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (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 7A97D21BADAB9 for ; Wed, 19 Dec 2018 12:57:00 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id r24so10406777wmh.0 for ; Wed, 19 Dec 2018 12:57:00 -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=7bVdvuU83h2P9wiPhuvrP/br1/gddPHt80CRT2KZ8K0=; b=XqffMjF85REkVOSEgheDjq1vRhm5pK8DFV1uhUVsYRryjY4lOLcFBRDA/J3oL56fh+ WrfCjqPUqL2R1HwLMG1Vk8nkT+2ZbEl8FaeOnEtL+iut4NTqBseCt+IFNDv1v/5kcn/H flLUbZV74RIzXVj62xOq/Kbx0nqCRaPEkvuho= 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=7bVdvuU83h2P9wiPhuvrP/br1/gddPHt80CRT2KZ8K0=; b=hTstE4desJpKOmOW6TYzZt+C+RujKT81Zopk7Smi9ilPcKeMsXQh7crw6qKaK+babk fLxaDiamktyWwApfpnYTiOi7aPNLty8+pwp3pbs7JmcCfeXFQptwhYHX0JhCkXraQyfJ P8HrwPWV6DAStM8FG0wfqXUVqpWN0KqmXJyWSNvgySAEn29X84rCHrrqdRgs06A7EEk9 nzHJ/Wq9sGARS+rDuc53/ZnyU4YjNhwCk+5BGmwHYlhluF13B2q0V1O1y7HnNj2wP4N1 q/muQTflDjIUrc3oOaiGQv2Py6BTKLi4i59zdsaWtkMg9TuBlUEr3G3XRaBBID1LCwmr wl8A== X-Gm-Message-State: AA+aEWY/FzCsTFQpBN2EbjRNVXIyEv5H/jGArjayvtJ8vM9FVExpt6mA gIm1bOjo534brAhxL5eJBeh0FKf+Vf759g== X-Received: by 2002:a1c:c10f:: with SMTP id r15mr8582727wmf.27.1545253018638; Wed, 19 Dec 2018 12:56:58 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:e5c9:6e00:25cb:e32e]) by smtp.gmail.com with ESMTPSA id j202sm16267294wmf.15.2018.12.19.12.56.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 12:56:57 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 19 Dec 2018 21:56:40 +0100 Message-Id: <20181219205640.4704-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181219205640.4704-1-ard.biesheuvel@linaro.org> References: <20181219205640.4704-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 6/6] 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 Reviewed-by: Laszlo Ersek --- 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 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 (