public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, edk2-devel@lists.01.org
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Eric Auger <eric.auger@redhat.com>,
	Andrew Jones <drjones@redhat.com>,
	Philippe Mathieu-Daude <philmd@redhat.com>
Subject: Re: [RFC PATCH 1/7] MdePkg/Base: introduce MAX_ALLOC_ADDRESS
Date: Fri, 7 Dec 2018 13:53:54 +0100	[thread overview]
Message-ID: <191094c5-2ccf-a298-b67f-df366775efee@redhat.com> (raw)
In-Reply-To: <20181207112304.19765-2-ard.biesheuvel@linaro.org>

On 12/07/18 12:22, Ard Biesheuvel wrote:
> On some architectures, the maximum representable address deviates from
> the virtual address range that is accessible by the firmware at boot
> time. For instance, on AArch64, UEFI mandates a 4 KB page size, which
> limits the address space to 48 bits, while more than that may be
> populated on a particular platform, for use by the OS.
> 
> So introduce a new macro MAX_ALLOC_ADDRESS, which represent the maximum
> address the firmware should take into account when allocating memory
> ranges that need to be accessible by the CPU at boot time. Initially,
> it just defaults to MAX_ADDRESS, but later on, architectures may elect
> to override it to a smaller number.
> 
> This means that all replacements of MAX_ADDRESS with MAX_ALLOC_ADDRESS
> are functional no-ops unless an architecture sets a value for the latter.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  MdePkg/Include/Base.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index bc877d8125a5..618f8ea85ce7 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -404,6 +404,10 @@ struct _LIST_ENTRY {
>  #define MIN_INT32  (((INT32) -2147483647) - 1)
>  #define MIN_INT64  (((INT64) -9223372036854775807LL) - 1)
>  
> +#ifndef MAX_ALLOC_ADDRESS
> +#define MAX_ALLOC_ADDRESS   MAX_ADDRESS
> +#endif
> +
>  #define  BIT0     0x00000001
>  #define  BIT1     0x00000002
>  #define  BIT2     0x00000004
> 

Given that the page size is dictated by the spec, I think adding
MAX_ALLOC_ADDRESS as a macro, and doing it here, is appropriate.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>



  reply	other threads:[~2018-12-07 12:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07 11:22 [RFC PATCH 0/7] introduce MAX_ALLOC_ADDRESS to limit boot time allocations Ard Biesheuvel
2018-12-07 11:22 ` [RFC PATCH 1/7] MdePkg/Base: introduce MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 12:53   ` Laszlo Ersek [this message]
2018-12-07 11:22 ` [RFC PATCH 2/7] MdeModulePkg/Dxe/Gcd: disregard memory above MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 11:23 ` [RFC PATCH 3/7] MdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account Ard Biesheuvel
2018-12-10  2:04   ` Wang, Jian J
2018-12-10  7:22     ` Ard Biesheuvel
2018-12-10 14:52       ` Gao, Liming
2018-12-10 14:53         ` Ard Biesheuvel
2018-12-10 14:57           ` Gao, Liming
2018-12-07 11:23 ` [RFC PATCH 4/7] ArmPkg/ArmMmuLib: " Ard Biesheuvel
2018-12-07 12:42   ` Laszlo Ersek
2018-12-07 11:23 ` [RFC PATCH 5/7] ArmPlatformPkg/MemoryInitPeim: " Ard Biesheuvel
2018-12-07 12:46   ` Laszlo Ersek
2018-12-07 12:47     ` Ard Biesheuvel
2018-12-07 12:48       ` Ard Biesheuvel
2018-12-07 11:23 ` [RFC PATCH 6/7] ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS Ard Biesheuvel
2018-12-07 12:47   ` Laszlo Ersek
2018-12-07 11:23 ` [RFC PATCH 7/7] MdePkg/ProcessorBind AARCH64: limit MAX_ALLOC_ADDRESS to 48 bits Ard Biesheuvel
2018-12-07 12:51   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=191094c5-2ccf-a298-b67f-df366775efee@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox