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=leif.lindholm@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 53F5A2119BBDC for ; Wed, 19 Dec 2018 13:03:16 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id m1so7441580wml.2 for ; Wed, 19 Dec 2018 13:03:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=opa8p8uXydyZF8Qh/sY0hskd/YOopGEAiB65nUya4sQ=; b=evt6Y32TyMpVDwmbHpLVOULSy3DfU5i+JxoLyNOwFJH2CRUwR/YBllXVOgdCBgCwKg NrhEk5MqFUy6nanPLSjsxQqeySOoLxUxlvqLqeVnN3/UnTEjGj7dJhmy+HDxL9uz+f3w 809ITaU/0d2y0yf0eMKEgBX3cEnu+z2P/kkAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=opa8p8uXydyZF8Qh/sY0hskd/YOopGEAiB65nUya4sQ=; b=XmBOFcBNzUL6AZq8IzVIvA05Oo0uIXxWFKBobcUeMFNMo1sLbRjEpDcENhc2ZBcQLM xz9niRBkiMAxthvdILTq8sKYp0fTZvRoo0x4wMi+GmnhPFxY1K0+nYpaFKQATPXj1bl6 jUJ4YZ9xzmbVQcCxQvh5R5zfRz2bOVAF1UptvxuS3DO7xlhIPLWJi3rVqPTmrtXedQ7o yZZOBQUqAnfk8YX7BezGhiDhTstccwWxZQEHCWDNaUyGSIa4J8wephfoeUR7z0QrgjSf ro5SWpt1qUy/WaO0UXfTaPn7GjXSN/+ZqhMt/gz+aIjw6em66toOLffKOYzM6AksMx76 GX/Q== X-Gm-Message-State: AA+aEWYXkOvVNhnprOIhSB+KKwXtk4dY+Q3lLMwYpa8kV1C3W4h6A3MA cS/52rO7aoyr4reFrUxQbbDhqQ== X-Google-Smtp-Source: AFSGD/X4HiPuxluIsHW/O+21l4dH8oF3TFS76b2YFnoBWgLpV7qH3sqOTzUMVxD0KSEwm3SvQTVpAg== X-Received: by 2002:a1c:630a:: with SMTP id x10mr8729187wmb.63.1545253394496; Wed, 19 Dec 2018 13:03:14 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o82sm6084989wmo.29.2018.12.19.13.03.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Dec 2018 13:03:13 -0800 (PST) Date: Wed, 19 Dec 2018 21:03:11 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, Michael D Kinney , Liming Gao , Jian J Wang , Hao Wu , Laszlo Ersek , Eric Auger , Andrew Jones , Philippe Mathieu-Daude Message-ID: <20181219210311.sjedrc6s3s42wuax@bivouac.eciton.net> References: <20181219205640.4704-1-ard.biesheuvel@linaro.org> <20181219205640.4704-5-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20181219205640.4704-5-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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 21:03:16 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 19, 2018 at 09:56:38PM +0100, Ard Biesheuvel wrote: > 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 Reviewed-by: Leif Lindholm > --- > 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 >