From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d43; helo=mail-io1-xd43.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 78D7B21196812 for ; Fri, 7 Dec 2018 03:26:20 -0800 (PST) Received: by mail-io1-xd43.google.com with SMTP id k7so2967754iob.6 for ; Fri, 07 Dec 2018 03:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U0cKT63w6uPMmiV9OJ6UgUrFMkpDDFGInK5irS18kkc=; b=PARhzD0wnZeopxtU7NbLuJcONdNmcL8bylwhZfHg3dYTwZy9ycXaorxyP/wwD6/KhL r+IKWIg5VY3b6B4zRWPv3VjFt4GFU8Wh9pCHK3Js7BioI5AMo/f3q//SrcnYK5ZS2zsr Cw1fgax8uqAW/aD84aaEICjecrlJ1ueFt+Gyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U0cKT63w6uPMmiV9OJ6UgUrFMkpDDFGInK5irS18kkc=; b=jE6rbimlEpiQZlcXBVskV1lHvqOxqvKonsmdgDYUOcaFmFzfs6QkfVBNP7Wvi2Zn2O Od05s/CT6WjdqoW8Ise9HFg+lugjRioao3y4l9w4V67Ck7ZsL/F+CoS+GQb50FinaRtG PQMPub5ZlI8mcH5Lwitb7qAVWiMut6d7Typ453FPNtAATk2H+z8UeVMZupfc44vNio5X lpH0W/S4PqopHcrPWRj7vL4ONv5M9slWwUF6uhNPXCKRVshfHD08DNCmPmDViRebbfpZ jmlq3A0PVv6y0DnuGk9E/KsfD8MM733SMZLmbz3fMI0tyNZLUYBpyyd7NYIfyg5H/Q4j BnaA== X-Gm-Message-State: AA+aEWYjb7+lDy2XEOaEhMFDowJ9PJTcO6Gry3XKppbv85ZgRAj0hIUJ 4YQabgqb3zNg0h65+8USm6MdTIW/VJTMVDdpBFWzXg== X-Google-Smtp-Source: AFSGD/Xmr5S6Kh6fjSAJ8wrKiT4iWz2NY9CmFGuG/hIfYv9YgDfqO9VVBRVru9Hyd0akXh5CtZbf0wLtjOfJzSl855g= X-Received: by 2002:a5e:cb42:: with SMTP id h2mr1345337iok.60.1544181979606; Fri, 07 Dec 2018 03:26:19 -0800 (PST) MIME-Version: 1.0 References: <20181206213722.7597-1-ard.biesheuvel@linaro.org> <14bc84c4-9b86-51b0-3b09-152e8877950c@redhat.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 7 Dec 2018 12:26:08 +0100 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Leif Lindholm , "Gao, Liming" , Auger Eric , Andrew Jones , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Subject: Re: [PATCH] Revert "MdePkg/ProcessorBind.h AARCH64: limit MAX_ADDRESS to 48 bits" 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:26:20 -0000 Content-Type: text/plain; charset="UTF-8" On Fri, 7 Dec 2018 at 11:43, Ard Biesheuvel wrote: > > On Fri, 7 Dec 2018 at 11:41, Laszlo Ersek wrote: > > > > On 12/06/18 22:37, Ard Biesheuvel wrote: > > > This reverts commit 82379bf6603274e81604d5a6f6bb14bdde616286. > > > > > > On AArch64, we can only use 48 address bits while running in UEFI, > > > while the GCD and UEFI memory maps may describe up to 52 bits of > > > physical address space. For this reason, MAX_ADDRESS was reduced > > > to 48 bits, to ensure that the firmware does not inadvertently > > > attempt to allocate memory that we cannot access. > > > > > > However, MAX_ADDRESS is used in runtime drivers as well, and > > > runtime drivers may deal with kernel virtual addresses, which have > > > bits [63:48] set. In fact, the OS may be running with 64 KB pages > > > and pass addresses into the runtime services that use up to 52 > > > bits of address space, either with the top bits set or cleared, > > > even if the physical address space does not extend beyond 48 bits. > > > > > > In summary, changing MAX_ADDRESS is a mistake, and needs to be > > > reverted. > > > > > > Cc: Leif Lindholm > > > Cc: Liming Gao > > > Cc: Laszlo Ersek > > > Cc: Eric Auger > > > Cc: Andrew Jones > > > Cc: Philippe Mathieu-Daude > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > Signed-off-by: Ard Biesheuvel > > > --- > > > MdePkg/Include/AArch64/ProcessorBind.h | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/MdePkg/Include/AArch64/ProcessorBind.h b/MdePkg/Include/AArch64/ProcessorBind.h > > > index dad75df1c579..968c18f915ae 100644 > > > --- a/MdePkg/Include/AArch64/ProcessorBind.h > > > +++ b/MdePkg/Include/AArch64/ProcessorBind.h > > > @@ -138,9 +138,9 @@ typedef INT64 INTN; > > > #define MAX_2_BITS 0xC000000000000000ULL > > > > > > /// > > > -/// Maximum legal AARCH64 address (48 bits for 4 KB page size) > > > +/// Maximum legal AARCH64 address > > > /// > > > -#define MAX_ADDRESS 0xFFFFFFFFFFFFULL > > > +#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL > > > > > > /// > > > /// Maximum legal AArch64 INTN and UINTN values. > > > > > > > I was worried the patch could regress some things, but unfortunately, I > > couldn't name any specific area of concern. Sorry about that. > > > > Sometimes a hunch should be taken more seriously, I suppose :-) > > > For this change: > > > > Reviewed-by: Laszlo Ersek > > > Pushed as 9601046bf459..a5274cdc87d9 Thanks all