From patchwork Wed Dec 19 20:56:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154302 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5381635ljp; Wed, 19 Dec 2018 12:57:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/UIjnfd5bfYdLHvMJ7eTF0m+8gf59z2uD9a/A4WmNFX0e7iDqZzEuIdC27x/dweOq5glOJE X-Received: by 2002:a63:d40a:: with SMTP id a10mr20369054pgh.394.1545253024411; Wed, 19 Dec 2018 12:57:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545253024; cv=none; d=google.com; s=arc-20160816; b=d9UeqJaNUB1pmRxmM7IhoSry3MXoZC+X6V4PB1SaW86Uk1Uf1kTTiEXEy3s8aUjpvm HPn3lNIDDunxV4T5uT95vqQupvCgFI+leKSBUL6JhV5uk4PQzMQu0RnD/EHeG7IqW7Pv q+34bjU+Fxl8ZIlYws0JOrq3raBapPx9Gx720vF7VDxcxFjfCEQ0Ae3M7DIUYsYuKz9f Rtldfo1HLD3vecFYf/besna/NaVX2PMz5MYj7qB3cGbDIm2WE237kts2/X1o7IfcDgny 3bJSu+JjMtdc0LX7fQXw7vwXrwofLLmZuCoCmlGLVJZ+ACGxEpRwikx1erU5EBuok/m2 uT0A== 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=9wYNmT0xZ7fxsCaGjCqPmIJmy2Q/uql/Ox/Sp2lNuUA=; b=HEDSSGm0nFmtrGzsZVYVaGh5/2shvpi0dX6W19DeIsAO7IvnGnJw/RDkQ5BqcD3YwU 2azLpse4qbGJlmBVRvwBCRUg6E1z0Y7oxqz7761y6ognH9deMl56NtChIBHpAiaiptEk ry5882g/Nw/aMZr4pTj4eTghBxI4b4OETfE+BripTOH/2XSgeA9jqA7vxGe3nDrdSaml nNzcRe+DRfQ758e5AiInKTcKj6FrNfWy70r+uKHiRtNkfCdhfegCo53GN5aTyhoocC0w nFGrlOfIYlqPVtccXQY+laIZy4MK0HIY8kzGaJEoYCJwVbLKAoWhxOluW7j4KYyPBDxf hLJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iUvmngVL; 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 c32si16800741plj.38.2018.12.19.12.57.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 12:57:04 -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=iUvmngVL; 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 0BB3C211A2D99; Wed, 19 Dec 2018 12:57:00 -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::343; helo=mail-wm1-x343.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 9408E211A2098 for ; Wed, 19 Dec 2018 12:56:57 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id a62so7421543wmh.4 for ; Wed, 19 Dec 2018 12:56:57 -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=vdxkNkHkdkTSDdm/fPvLD3Gzy8B9mEIMa4UrE55LChU=; b=iUvmngVL8lBUtlC1TQGRGoartXp/UUGT0SHmTYcxBP/b5r4tItIBh/kPP3BhAXG14e KYnnQyh9mx12TelAh7727sAMikNAJb9/3QtzUASgInnzQ0a358kQkIV3o5vU00RO+LLw 7JRZvAEacDvbpPfRMgWbpchDdVDnghDLtJ7P0= 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=vdxkNkHkdkTSDdm/fPvLD3Gzy8B9mEIMa4UrE55LChU=; b=fOr1nQ07vvXyc5RaRfDtn5DFv8E9UOxRNGRvoIs5RvsCqHTuqDGt34cO6sU7Zb67eY L7PqBVS5iytkOvjyFc/F9Hnkyk7xY0d7jqVWuEQ2xRVVvuTrcHVfsUrA/oR2M2StHKvX 0WBMgDrPHIW2GOnwmBCIeyWgYc8mYQJnJsJLptc8bf2Kon7HEBBGwvwEMMRWSM7GBPtl eI/LdiraEktjVHtY2D/4hWxOYwaqT4OzjDO2gY/ZfGXlydxWMiJ9a2A8hbbuQhC6vMyx iJmXrhk1FeErcd39j6sYIuHXXFuOmUfuSegxEgyz/ZRxpSTfflcvPgT21IO9aLB6PHcv 6a7A== X-Gm-Message-State: AA+aEWa+YE5XoCyW5x91SspdvISuZndbR4nJ4MiBLS0rtQKGoE0N0pnY C3Z8O/zUe22UIcL2TjNlr9b5i5lH8rD62g== X-Received: by 2002:a1c:8089:: with SMTP id b131mr8709467wmd.141.1545253015892; Wed, 19 Dec 2018 12:56:55 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 12:56:55 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 19 Dec 2018 21:56:38 +0100 Message-Id: <20181219205640.4704-5-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: [edk2] [PATCH v2 4/6] 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 Reviewed-by: Laszlo Ersek --- 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: Leif Lindholm 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);