From patchwork Wed Dec 19 20:56:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154303 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5381671ljp; Wed, 19 Dec 2018 12:57:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/UVS6Ah9LOnHhZNiUU7xTa5hYXOdnWGd+isC0aUYPd3kh59vyS7o/VLcMIejjUaZcpXEBiR X-Received: by 2002:a63:42c1:: with SMTP id p184mr20560258pga.202.1545253027714; Wed, 19 Dec 2018 12:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545253027; cv=none; d=google.com; s=arc-20160816; b=ZnVHxlcZBBCtlqWj2d7hrZiw1DM2KLs/7Jp/gvr67ignadOrF1MX2IJjH7l1VsddPs PRStm/nmODD9xYjfa0NnrayZ9Zqi/D2cNQwxw50Bynpd0gLEBhp19zKuCrG3/hDU6WxI fSnl8GGclLWhrBmBB5ucaEWaKsdVZiX1MfFBtg7HtjbGKseYu00aYw1LTSm4S8D4ENnY 14+d6E83UMGtRjSJ2/PQ7gg4BgdXNp17ITY2vZEQoQT+8SIkaLrEkbX206zWRDyaiR0Q sDo2aHKhNdxCxOd3DdENnrAouycNXS8+NzGcncy8HfeVdX4kwX1gsihgN0AN2fQapSad ry2A== 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=5qyqw1dINdPa3tlbsaPoJeEcj2NDW597AhvCcJmagwQ=; b=GgSAstKkzhIWEn8ue/LzrL0RzIknk6pTSPIwddiHwRJQXsp50yTDOgxHCNYZsXICIU QdGNAPcKAGQJ/oGIBalfAbuKms0f+ANunoCpqNqpfs/UPIm5gBSw5+fxCTbQuz67oeY0 vyccDlbOInycP9arCyRDK+6lHHN7UiOnX02B3dJpKCbHW+PUr7ebdHn7NMgrtu68H0Sf 2EDtZY+FOoRd7DBO77wjnmPbNLbjFqCUCaSR0HjstC+yKCAFikGkjPzAOO/ceVxXI7/3 gXLDTszPGfbe6bJJyvqIUvSlq1BAjtPEIxeUyumIzNN0Gs3Ji/DyGgRFW1AJHORWkPLO 2wnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e5lCZyj9; 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 g1si16917011pld.197.2018.12.19.12.57.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 12:57:07 -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=e5lCZyj9; 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 3773C211A2D9D; Wed, 19 Dec 2018 12:57:00 -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::443; helo=mail-wr1-x443.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 1650F211A2D83 for ; Wed, 19 Dec 2018 12:56:58 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id p4so20918189wrt.7 for ; Wed, 19 Dec 2018 12:56:58 -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=8o2UomuBLMrpu3ZOFLbhutPIjS8YZaTTqE4M6XaXwBI=; b=e5lCZyj9NAD/Pa3RwdnZuqJBFrN3TQGY2Qh7BFJ+RU43NCWMw9Hhh5ivy9kAyvApMX U2weiT6gTHawIbKzmYMUhvcfJ6SCurtF34yZQgAfm3yq/coD/vbcR3yTeX4y0vDbvKUU dUCOPwZasM+2HVDG4Mh73WrM/PIRl76g8Wxx8= 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=8o2UomuBLMrpu3ZOFLbhutPIjS8YZaTTqE4M6XaXwBI=; b=kEWbQoWMkzzkAJw3jkcfQe1t3du4cos6JfM07EOARjnzc/+XP+d1Xn2hsSMFZLpq8v 4MsRUPrszCXqRkM8VFoFhRuaNDUliBFO65zGZ7P9bTdHwgu/O/RTbRyPjzV8lQmuKxO5 1vqNar+8KM4Z+Pjx3unZVQHTORtbUj+KCn218t5dTI/ihOey2iWJ/YCgCXQZ7HmbM7dN RqvtZag/MCIwzTxIZiPOZlCDAoJcQJdW1r9Iboh+7yTjf2Vy9Gp7BWkDKy6gJRDW8xGI 5wjQdAHGMPKI0AH/Tb3AO+uUFhGkHjxd1WhsOFzoXXxLrYR8n9ZC6O/nzH1zqWZrxkPn lKwg== X-Gm-Message-State: AA+aEWaweMHV3Xvz5I2z2MM1xMVpyolsngik2QX195yX8iKWEPqVaduO 1Kdd4OQ3ad5X44f4Sqx9WqnsK4fCDYnoqQ== X-Received: by 2002:adf:e488:: with SMTP id i8mr20840857wrm.10.1545253017251; Wed, 19 Dec 2018 12:56:57 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 12:56:56 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 19 Dec 2018 21:56:39 +0100 Message-Id: <20181219205640.4704-6-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 5/6] ArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account 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" Limit the PEI memory region so it will not extend beyond what we can address architecturally when running with 4 KB pages. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c index 389a2e6f1abd..010f93add76b 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c @@ -105,12 +105,12 @@ InitializeMemory ( // Ensure PcdSystemMemorySize has been set ASSERT (PcdGet64 (PcdSystemMemorySize) != 0); - ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ADDRESS); + ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ALLOC_ADDRESS); SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase); SystemMemoryTop = SystemMemoryBase + PcdGet64 (PcdSystemMemorySize); - if (SystemMemoryTop - 1 > MAX_ADDRESS) { - SystemMemoryTop = (UINT64)MAX_ADDRESS + 1; + if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) { + SystemMemoryTop = (UINT64)MAX_ALLOC_ADDRESS + 1; } FdBase = (UINTN)PcdGet64 (PcdFdBaseAddress); FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);