From patchwork Fri Dec 7 11:23:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 153139 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp376303ljp; Fri, 7 Dec 2018 03:23:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/UzSp4LyLsr8zacPougAj7CaYVWAQKuVY6FA1JUqaxogvBQxCL0/Y+H+VQvThFW8ullSwDF X-Received: by 2002:a63:ea4f:: with SMTP id l15mr1569855pgk.102.1544181805631; Fri, 07 Dec 2018 03:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544181805; cv=none; d=google.com; s=arc-20160816; b=t1woXGP5O65IQFyluU9IzGbktFibZdNobJNTdLYQau9jA/ZcweYQav7Dt6Iy7Wm3KG tZnvIFHdzcbIgTpg5S5gHebexAtDnlPzSWQal4a5QId1W3IfYog5gT9y6sM6fn7AO8Mm Fxh/kDYhZNkU0p1qBm2ubKc02II8uQlP5jOaGxjJNB32F4W/xnbyhkTEeWnM0Bwt35xq aYeY1upj6zzgc1akkbXLG9orvoJZg75BkTQRTVHp85AqknLMRhheQ0S6Jo9WJLfnSqCU ty4Rq5fTNkGHWwOg6OEaw11E1wH7zz7ihi8NsOHgimqhHZOqAcc250kxw6gjV8g1FRdZ D1Tg== 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=pbt3sloztgW0dXV5pvwZYPf0zdCFXYCjM6u7dezI2jk=; b=qAtke9lMhxkBnyfg4M3y/lHes6XHSqG4ss04DbCw3U4wSTapnHSC/Zd/0C3SenJWdY 7ucGASi9nDVkKjxDs7EoROZfIDKi52uAFIDYHX/lVQ17893M2uC0eebzZqdwKPYUGZJJ 5UCzEdEu8vYgATD+Agybsr92+bzRHHRa0u5BBOL/RYEVGtGqij5m9kpE+bOgv56/cplH kf4fId97dNVHvigCu0B6laKCj4EZqUXJZhUFpEbaod0oIka7VWfcwkfp0q3JPBjJS4oQ 0egagh8GZwxNXo99mP+jS2RMOYaZUVk3ego3w/0RldX0NPbNpqELkd3Fte0VGNomoE0e ACqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iei2piK4; 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 j10si1954287pgt.155.2018.12.07.03.23.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 03:23:25 -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=iei2piK4; 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 2491D21199B0E; Fri, 7 Dec 2018 03:23:18 -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::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-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 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: [edk2] [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: , Cc: Andrew Jones , Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek 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);