On 29 March 2016 at 18:06, Leo Duran <leo.du...@amd.com> wrote:
> Signed-off-by: Leo Duran <leo.du...@amd.com>

Hi Leo,

This particular instance was also discussed in the context of the
patch that introduces the AcpiExposedTableVersions PCD.

The problem with this particular allocation is that it is not located
below 4 GB because it needs to be addressable by a legacy ACPI table,
but because it needs to be accessible from PEI, which is typically
32-bit on a X64 system. Fortunately, we don't have that table on
arm64, so this particular instance does not matter.

In general, however, there are numerous instances in the EDK2 code
base where an allocation is hardcoded to be limited to 4 GB so that
PEI is guaranteed to be able to access it. As it turns out, there are
even platforms that do run PEI in 64-bit mode, but only map the lowest
4 GB of memory simply because all DXE code that performs allocations
that need to be accessible from PEI is already capped to 4 GB.

This is something I brought up with the UEFI forum, and is going to be
addressed in the PI spec (hopefully). This should allow us to describe
in PEI the range it can access, so that DXE can take this information
into account, rather than guess that below 4 GB is okay.

As far as this patch is concerned, I think we should just drop it, and
perhaps revisit it once we know how to proceed with these PEI
accessible allocations. Unless you do expose a FACS table in your
firmware?

Regards,
Ard.



> ---
>  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c 
> b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> index 7f95b9d..e1fd928 100644
> --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> @@ -518,7 +518,7 @@ AddTableToList (
>      //
>      ASSERT ((EFI_PAGE_SIZE % 64) == 0);
>      Status = gBS->AllocatePages (
> -                    AllocateMaxAddress,
> +                    mAcpiTableAllocType,
>                      EfiACPIMemoryNVS,
>                      CurrentTableList->NumberOfPages,
>                      &CurrentTableList->PageAddress
> --
> 1.9.1
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to