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::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-Google-Smtp-Source: AFSGD/UaXvjQ/2h8zTJ1nVBR+sXENdA9kZWVuo0gtJu0lvVDGnaB4GyfBkPtHsfF3gmSXwySzdp6Rg== 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 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: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: [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: , X-List-Received-Date: Wed, 19 Dec 2018 20:56:58 -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 Reviewed-by: Laszlo Ersek --- 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