Message ID | 20181207112304.19765-8-ard.biesheuvel@linaro.org |
---|---|
State | New |
Headers | show |
Series | introduce MAX_ALLOC_ADDRESS to limit boot time allocations | expand |
On 12/07/18 12:23, Ard Biesheuvel wrote: > Limit MAX_ALLOC_ADDRESS to 48 bits on AArch64 so that the memory > handling routines running at boot time take care not to allocate > memory that the CPU itself cannot access due to the fact that it > runs with 4 KB pages and thus an address space that is limited to > 256 TB. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> > --- > MdePkg/Include/AArch64/ProcessorBind.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/MdePkg/Include/AArch64/ProcessorBind.h b/MdePkg/Include/AArch64/ProcessorBind.h > index 968c18f915ae..a8c698484a1d 100644 > --- a/MdePkg/Include/AArch64/ProcessorBind.h > +++ b/MdePkg/Include/AArch64/ProcessorBind.h > @@ -142,6 +142,11 @@ typedef INT64 INTN; > /// > #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL > > +/// > +/// Maximum address usable at boot services time (48 bits for 4 KB pages) > +/// > +#define MAX_ALLOC_ADDRESS 0xFFFFFFFFFFFFULL > + > /// > /// Maximum legal AArch64 INTN and UINTN values. > /// > I think this patch is safer than the previous variant. If this series omits some replacements, from MAX_ADDRESS to MAX_ALLOC_ADDRESS, at various spots in the edk2 tree, we should be able to fix those up incrementally. Whereas changing MAX_ADDRESS was a heavy hammer that hit everything simultaneously. Reviewed-by: Laszlo Ersek <lersek@redhat.com> Thanks Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
diff --git a/MdePkg/Include/AArch64/ProcessorBind.h b/MdePkg/Include/AArch64/ProcessorBind.h index 968c18f915ae..a8c698484a1d 100644 --- a/MdePkg/Include/AArch64/ProcessorBind.h +++ b/MdePkg/Include/AArch64/ProcessorBind.h @@ -142,6 +142,11 @@ typedef INT64 INTN; /// #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL +/// +/// Maximum address usable at boot services time (48 bits for 4 KB pages) +/// +#define MAX_ALLOC_ADDRESS 0xFFFFFFFFFFFFULL + /// /// Maximum legal AArch64 INTN and UINTN values. ///
Limit MAX_ALLOC_ADDRESS to 48 bits on AArch64 so that the memory handling routines running at boot time take care not to allocate memory that the CPU itself cannot access due to the fact that it runs with 4 KB pages and thus an address space that is limited to 256 TB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- MdePkg/Include/AArch64/ProcessorBind.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.19.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel