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::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-Google-Smtp-Source: AFSGD/UD38NszLY12rRx1nmkPeWmEU1yuvvPGRgFXq9lO+WNHkkQpyEYoTKa/8GWRUXmi68TUVNZ7w== 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 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: 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: [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: , X-List-Received-Date: Fri, 07 Dec 2018 11:23:17 -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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.19.2