From patchwork Fri Dec 7 11:23:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153140 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp376346ljp; Fri, 7 Dec 2018 03:23:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/XRQEp7gobxcHDZmvlO0lGY+RiccxrIufY9qzFCY0xSC59y4ScWAScGYeQsXqLk49pudzNs X-Received: by 2002:a17:902:7044:: with SMTP id h4mr1748177plt.35.1544181809541; Fri, 07 Dec 2018 03:23:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544181809; cv=none; d=google.com; s=arc-20160816; b=ANihzNafj+tn1EcFiWxbR+ihfYgOZcw2hQcTbM6S/a7n0j9tDeBcGrXtAFhYSkghaG 5ZKKl/Lhd51jYgny0xN7m9LDWsxGmatqyS8rOzIwBXhq0VeA5XYuMLACarJOjAf6b1lo E8c8YSTW0rVtLW6dny/wJ1QtqfDjUT6r0EH6Id3gjNUKMDM/HgAqe2UKScXNMphX+rh1 EkDQzBCUaD8xM4ynrh4iHHS6T46aEz7qrJYIm5n85XzjnbBLmfxw3dF8d1Uz8Ojw0yUt j4Qk5NLyI2HbZkmoCgS0VXmzIWsQGa+KBrK2fyF+9cponr+oIvhQ7jOxJg2+dzOj/LBP 7FyA== 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=BN/XuSDFClwe69/uE1FurFs3J1nyV4mKxmFJfxcLjjI=; b=dsEnnMhuZ9N3baGnnwMesk42Kkv/rzX4wVCR0TSNTiSCoeVstmvq5A4jstjcLfXowC bCQirsdwXGcKtSNke0R6TAqKNStPh/ynY1SBso3HatReaDZG/hQclZ0T1IPRytIxnwko wJ2+UrBSiHkFlV58l37c1JpGjKiGxMAiHhK+G/3GF6GZcSS9nZB33/15Wv2mic9gyc3z wnwv/R0RoWAj8sb/rrzk44rK+gylP/f7C4HheXvubEdXtjHoOcCjUEWvNE/vHvt2I7wt GKer/ofGGJt2IythQW9LRLkOcBaHSD9VjsmlYd6KoB5lUfnFFXpdCsoe0gWdRQxwzwjo SYPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=IpZ+KKbG; 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 b18si2632570plz.105.2018.12.07.03.23.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:23:29 -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=IpZ+KKbG; 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 4FA1021199554; Fri, 7 Dec 2018 03:23:19 -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::341; helo=mail-wm1-x341.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 730C321199B0D for ; Fri, 7 Dec 2018 03:23:17 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id g67so4137880wmd.2 for ; Fri, 07 Dec 2018 03:23:17 -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=i3cWjav9UST3HWLrezcpXfEn3OuGMecc/UMuZDc9PZ4=; b=IpZ+KKbG+EEzfzGJF7jLxfUupt6QLrS5g0m0YrF9873jQ2uhOpVokucY0XdHPKgyUG 01ZdiVbhvS00isH3kyBuRfn0gOplR25YWoAPowywix1ejNFOJNRLO71RxiJqh0cFCdxJ BMttFh3N1UQamZh6XOiZRa2wVtxABivMtLZRU= 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=i3cWjav9UST3HWLrezcpXfEn3OuGMecc/UMuZDc9PZ4=; b=RQXFCvISBWSyx2dp7KMl74HNHaRVfw2mJ3TREYhFy0gdHA0tMJMRUHFDbqpsqwu2Io aT0iQ4I6DlXgBA/tYFVwuqm6zTClU8neie2QVOGmkM6a1SBLYuhghTHRKAorhIVtv6oE tisHI/tty8X/EZSIoYYvS7FArA7Cj9MvNURVlkO3FOLf53CGsePuWo4aF283zEJ1VUjN +oULPm3+SdfFZWkSZfpHO0pH0hydlKOr7pWViwPG6QGITkYX8DFvkloURPebSLdNmlPG P5nBZCiEhQCrYUrVVgDRl46iDoqkiDygZRFacPWHrI+tGGVIXjnRbFpCTEhx7oMi0dZL upZA== X-Gm-Message-State: AA+aEWasIyajPFuolWiRBYWdPmCI2x3I9yLhXChsS26yVTY5BRaIfops MhnSbccX315OcSkQmR2RaZGcubA4ackvvw== X-Received: by 2002:a1c:f116:: with SMTP id p22mr1913448wmh.0.1544181795780; Fri, 07 Dec 2018 03:23:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:23:15 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 7 Dec 2018 12:23:02 +0100 Message-Id: <20181207112304.19765-6-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 5/7] 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c index 389a2e6f1abd..25db87fb2374 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c @@ -109,8 +109,8 @@ InitializeMemory ( 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);