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::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 3045A21197073 for ; Fri, 7 Dec 2018 03:23:16 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id z18so4018314wmc.4 for ; Fri, 07 Dec 2018 03:23:16 -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=986LJYRJSexLnJiwlOxmyPLRPWQWMAWGD/EBilKLGuw=; b=iei2piK4IJAs0VCGKe3AvbO+kXw8wT9weVNlhXeoGgcF30ERfe4IdNUvOt/p1x0yhL wVt/mdGEKv51GTJAi7tmcGoNfbJRFglW7jb52OQAHCGGdYYRbzWOSbAd9Uah104LNdN3 zAa56Tyoc6gxNHwmUhkme1ECZiUP8+CxnsqVE= 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=986LJYRJSexLnJiwlOxmyPLRPWQWMAWGD/EBilKLGuw=; b=p9yCRj1MD0b8MMz6j+GTkxJX99L1fZzcgTy9kTmvVIKyfMY9xFZ9yYjejHwUX5wtx1 yKT+yjI/IxofXbg0XmWkQQFXCeS2ZIral7+mRXeQ6ZqAtlOw5gyA8m89UJ2qP9HMdybW TxLa570UT8TtmyBAI4Zv/JP4hADixN4yoGWmw5j1rbS/VxWSfY1oXhROc+LuplEHBB0C a5XUBjDBc1UrDJuLc5mTzmwkM+aOOnC48A5NUJj2ypsTVrg3g66uSEVth/gNpBpI16RG paCsEkI0mlGsdwfvV+2HCvoPFQ6sEf+fTrrXaKCfh602BApaPGq97wlMuUlI9BoJAp+i FHtA== X-Gm-Message-State: AA+aEWaU8O1Nlzvob53vS29lnVSdtOF4ZwgCo8JcgLbuKaQ+lh6wv6oT FgH0bDxGwj59KdHnvTfNX/keXPSRmzVwfg== X-Google-Smtp-Source: AFSGD/XMZ6oFvbEr3vZGCqVdlS8nPYVfB15iscFmnS9JOWNhldRymWmQcWP+qOYkZA0sEmE0eOjdYw== X-Received: by 2002:a1c:8b09:: with SMTP id n9mr1883605wmd.38.1544181794505; Fri, 07 Dec 2018 03:23:14 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:23:13 -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:01 +0100 Message-Id: <20181207112304.19765-5-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 4/7] ArmPkg/ArmMmuLib: 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:16 -0000 Content-Transfer-Encoding: 8bit When creating the page tables for the 1:1 mapping, ensure that we don't attempt to map more than what is architecturally permitted when running with 4 KB pages, which is 48 bits of VA. This will be reflected in the value of MAX_ALLOC_ADDRESS once we override it for AArch64, so use that macro instead of MAX_ADDRESS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c index 5403b8d4070e..e41044142ef4 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c @@ -612,7 +612,7 @@ ArmConfigureMmu ( // use of 4 KB pages. // MaxAddress = MIN (LShiftU64 (1ULL, ArmGetPhysicalAddressBits ()) - 1, - MAX_ADDRESS); + MAX_ALLOC_ADDRESS); // Lookup the Table Level to get the information LookupAddresstoRootTable (MaxAddress, &T0SZ, &RootTableEntryCount); -- 2.19.2