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::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-Google-Smtp-Source: AFSGD/Xg0P65tSr73oqz1v4GjHRLeMZkz5CzA1tRzl4xLhj72rBD23sqOen/9ArXojvTvMi+jWzpsQ== 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 Cc: Ard Biesheuvel , Michael D Kinney , Liming Gao , Jian J Wang , Hao Wu , Leif Lindholm , Laszlo Ersek , Eric Auger , Andrew Jones , Philippe Mathieu-Daude 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: [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: , X-List-Received-Date: Wed, 19 Dec 2018 20:56:59 -0000 Content-Transfer-Encoding: 8bit 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(-) 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); -- 2.19.2