[edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for ACPI tables

Ard Biesheuvel posted 3 patches 3 years, 6 months ago
Failed in applying to current master (apply log)
.../Universal/Acpi/AcpiTableDxe/AcpiTable.h   |  11 +-
.../Universal/Acpi/AcpiTableDxe/AcpiSdt.c     |   4 +-
.../Acpi/AcpiTableDxe/AcpiTableProtocol.c     | 230 ++++++++++++------
3 files changed, 162 insertions(+), 83 deletions(-)
[edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for ACPI tables
Posted by Ard Biesheuvel 3 years, 6 months ago
Currently, the AcpiTableDxe memory allocator uses page based allocations,
for which the only reason seems to be that it permits the use of a memory
limit, which is necessary for ACPI 1.0 tables that need to reside in the
first 4 GB of memory.

That requirement does not exist on AArch64, and since page based allocations
are rounded up to 64 KB multiples, this wastes some memory in a way that
can easily be avoided. So let's use the existing 'mAcpiTableAllocType'
policy variable, and switch to pool allocations if it is set to
'AllocateAnyPages'

Changes since v1:
- incorporate Laszlo's review feedback
  . update description of EFI_ACPI_TABLE_LIST struct
  . avoid EFI_PHYSICAL_ADDRESS to VOID* conversion in case AllocatePages()
    returns an error
  . put closing ) on a line by itself when using the non-condensed format
    for passing function call arguments.
  . fix error in comment text

Example output from Linux booting on ArmVirtQemu:

Before:
 ACPI: RSDP 0x0000000078510000 000024 (v02 BOCHS )
 ACPI: XSDT 0x0000000078500000 00004C (v01 BOCHS  BXPCFACP 00000001      01000013)
 ACPI: FACP 0x00000000784C0000 00010C (v05 BOCHS  BXPCFACP 00000001 BXPC 00000001)
 ACPI: DSDT 0x00000000784D0000 0014BB (v02 BOCHS  BXPCDSDT 00000001 BXPC 00000001)
 ACPI: APIC 0x00000000784B0000 0000A8 (v03 BOCHS  BXPCAPIC 00000001 BXPC 00000001)
 ACPI: GTDT 0x00000000784A0000 000060 (v02 BOCHS  BXPCGTDT 00000001 BXPC 00000001)
 ACPI: MCFG 0x0000000078490000 00003C (v01 BOCHS  BXPCMCFG 00000001 BXPC 00000001)
 ACPI: SPCR 0x0000000078480000 000050 (v02 BOCHS  BXPCSPCR 00000001 BXPC 00000001)

After:
 ACPI: RSDP 0x000000007C030018 000024 (v02 BOCHS )
 ACPI: XSDT 0x000000007C03FE98 00004C (v01 BOCHS  BXPCFACP 00000001      01000013)
 ACPI: FACP 0x000000007C03FA98 00010C (v05 BOCHS  BXPCFACP 00000001 BXPC 00000001)
 ACPI: DSDT 0x000000007C037518 0014BB (v02 BOCHS  BXPCDSDT 00000001 BXPC 00000001)
 ACPI: APIC 0x000000007C03FC18 0000A8 (v03 BOCHS  BXPCAPIC 00000001 BXPC 00000001)
 ACPI: GTDT 0x000000007C03FD18 000060 (v02 BOCHS  BXPCGTDT 00000001 BXPC 00000001)
 ACPI: MCFG 0x000000007C03FE18 00003C (v01 BOCHS  BXPCMCFG 00000001 BXPC 00000001)
 ACPI: SPCR 0x000000007C03FF98 000050 (v02 BOCHS  BXPCSPCR 00000001 BXPC 00000001)

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif@nuviainc.com>

Ard Biesheuvel (3):
  MdeModulePkg/AcpiTableDxe: use pool allocations when possible
  MdeModulePkg/AcpiTableDxe: use pool allocation for RSDT/XSDT if
    possible
  MdeModulePkg/AcpiTableDxe: use pool allocation for RSDP if possible

 .../Universal/Acpi/AcpiTableDxe/AcpiTable.h   |  11 +-
 .../Universal/Acpi/AcpiTableDxe/AcpiSdt.c     |   4 +-
 .../Acpi/AcpiTableDxe/AcpiTableProtocol.c     | 230 ++++++++++++------
 3 files changed, 162 insertions(+), 83 deletions(-)

-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66710): https://edk2.groups.io/g/devel/message/66710
Mute This Topic: https://groups.io/mt/77871641/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for ACPI tables
Posted by gaoliming 3 years, 6 months ago
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: bounce+27952+66710+4905953+8761045@groups.io
> <bounce+27952+66710+4905953+8761045@groups.io> 代表 Ard
> Biesheuvel
> 发送时间: 2020年10月29日 3:42
> 收件人: devel@edk2.groups.io
> 抄送: Ard Biesheuvel <ard.biesheuvel@arm.com>; Dandan Bi
> <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Jian J
> Wang <jian.j.wang@intel.com>; Hao A Wu <hao.a.wu@intel.com>; Sami
> Mujawar <sami.mujawar@arm.com>; Laszlo Ersek <lersek@redhat.com>;
> Leif Lindholm <leif@nuviainc.com>
> 主题: [edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for
> ACPI tables
> 
> Currently, the AcpiTableDxe memory allocator uses page based allocations,
> for which the only reason seems to be that it permits the use of a memory
> limit, which is necessary for ACPI 1.0 tables that need to reside in the
> first 4 GB of memory.
> 
> That requirement does not exist on AArch64, and since page based
allocations
> are rounded up to 64 KB multiples, this wastes some memory in a way that
> can easily be avoided. So let's use the existing 'mAcpiTableAllocType'
> policy variable, and switch to pool allocations if it is set to
> 'AllocateAnyPages'
> 
> Changes since v1:
> - incorporate Laszlo's review feedback
>   . update description of EFI_ACPI_TABLE_LIST struct
>   . avoid EFI_PHYSICAL_ADDRESS to VOID* conversion in case
> AllocatePages()
>     returns an error
>   . put closing ) on a line by itself when using the non-condensed format
>     for passing function call arguments.
>   . fix error in comment text
> 
> Example output from Linux booting on ArmVirtQemu:
> 
> Before:
>  ACPI: RSDP 0x0000000078510000 000024 (v02 BOCHS )
>  ACPI: XSDT 0x0000000078500000 00004C (v01 BOCHS  BXPCFACP
> 00000001      01000013)
>  ACPI: FACP 0x00000000784C0000 00010C (v05 BOCHS  BXPCFACP
> 00000001 BXPC 00000001)
>  ACPI: DSDT 0x00000000784D0000 0014BB (v02 BOCHS  BXPCDSDT
> 00000001 BXPC 00000001)
>  ACPI: APIC 0x00000000784B0000 0000A8 (v03 BOCHS  BXPCAPIC
> 00000001 BXPC 00000001)
>  ACPI: GTDT 0x00000000784A0000 000060 (v02 BOCHS  BXPCGTDT
> 00000001 BXPC 00000001)
>  ACPI: MCFG 0x0000000078490000 00003C (v01 BOCHS  BXPCMCFG
> 00000001 BXPC 00000001)
>  ACPI: SPCR 0x0000000078480000 000050 (v02 BOCHS  BXPCSPCR
> 00000001 BXPC 00000001)
> 
> After:
>  ACPI: RSDP 0x000000007C030018 000024 (v02 BOCHS )
>  ACPI: XSDT 0x000000007C03FE98 00004C (v01 BOCHS  BXPCFACP
> 00000001      01000013)
>  ACPI: FACP 0x000000007C03FA98 00010C (v05 BOCHS  BXPCFACP
> 00000001 BXPC 00000001)
>  ACPI: DSDT 0x000000007C037518 0014BB (v02 BOCHS  BXPCDSDT
> 00000001 BXPC 00000001)
>  ACPI: APIC 0x000000007C03FC18 0000A8 (v03 BOCHS  BXPCAPIC
> 00000001 BXPC 00000001)
>  ACPI: GTDT 0x000000007C03FD18 000060 (v02 BOCHS  BXPCGTDT
> 00000001 BXPC 00000001)
>  ACPI: MCFG 0x000000007C03FE18 00003C (v01 BOCHS  BXPCMCFG
> 00000001 BXPC 00000001)
>  ACPI: SPCR 0x000000007C03FF98 000050 (v02 BOCHS  BXPCSPCR
> 00000001 BXPC 00000001)
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> 
> Ard Biesheuvel (3):
>   MdeModulePkg/AcpiTableDxe: use pool allocations when possible
>   MdeModulePkg/AcpiTableDxe: use pool allocation for RSDT/XSDT if
>     possible
>   MdeModulePkg/AcpiTableDxe: use pool allocation for RSDP if possible
> 
>  .../Universal/Acpi/AcpiTableDxe/AcpiTable.h   |  11 +-
>  .../Universal/Acpi/AcpiTableDxe/AcpiSdt.c     |   4 +-
>  .../Acpi/AcpiTableDxe/AcpiTableProtocol.c     | 230 ++++++++++++------
>  3 files changed, 162 insertions(+), 83 deletions(-)
> 
> --
> 2.17.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66777): https://edk2.groups.io/g/devel/message/66777
Mute This Topic: https://groups.io/mt/77902197/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: 回复: [edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for ACPI tables
Posted by Ard Biesheuvel 3 years, 6 months ago
On 10/30/20 2:01 AM, gaoliming wrote:
> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
> 

Merged #1062 into master.

Thanks all,

>> -----邮件原件-----
>> 发件人: bounce+27952+66710+4905953+8761045@groups.io
>> <bounce+27952+66710+4905953+8761045@groups.io> 代表 Ard
>> Biesheuvel
>> 发送时间: 2020年10月29日 3:42
>> 收件人: devel@edk2.groups.io
>> 抄送: Ard Biesheuvel <ard.biesheuvel@arm.com>; Dandan Bi
>> <dandan.bi@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Jian J
>> Wang <jian.j.wang@intel.com>; Hao A Wu <hao.a.wu@intel.com>; Sami
>> Mujawar <sami.mujawar@arm.com>; Laszlo Ersek <lersek@redhat.com>;
>> Leif Lindholm <leif@nuviainc.com>
>> 主题: [edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for
>> ACPI tables
>>
>> Currently, the AcpiTableDxe memory allocator uses page based allocations,
>> for which the only reason seems to be that it permits the use of a memory
>> limit, which is necessary for ACPI 1.0 tables that need to reside in the
>> first 4 GB of memory.
>>
>> That requirement does not exist on AArch64, and since page based
> allocations
>> are rounded up to 64 KB multiples, this wastes some memory in a way that
>> can easily be avoided. So let's use the existing 'mAcpiTableAllocType'
>> policy variable, and switch to pool allocations if it is set to
>> 'AllocateAnyPages'
>>
>> Changes since v1:
>> - incorporate Laszlo's review feedback
>>    . update description of EFI_ACPI_TABLE_LIST struct
>>    . avoid EFI_PHYSICAL_ADDRESS to VOID* conversion in case
>> AllocatePages()
>>      returns an error
>>    . put closing ) on a line by itself when using the non-condensed format
>>      for passing function call arguments.
>>    . fix error in comment text
>>
>> Example output from Linux booting on ArmVirtQemu:
>>
>> Before:
>>   ACPI: RSDP 0x0000000078510000 000024 (v02 BOCHS )
>>   ACPI: XSDT 0x0000000078500000 00004C (v01 BOCHS  BXPCFACP
>> 00000001      01000013)
>>   ACPI: FACP 0x00000000784C0000 00010C (v05 BOCHS  BXPCFACP
>> 00000001 BXPC 00000001)
>>   ACPI: DSDT 0x00000000784D0000 0014BB (v02 BOCHS  BXPCDSDT
>> 00000001 BXPC 00000001)
>>   ACPI: APIC 0x00000000784B0000 0000A8 (v03 BOCHS  BXPCAPIC
>> 00000001 BXPC 00000001)
>>   ACPI: GTDT 0x00000000784A0000 000060 (v02 BOCHS  BXPCGTDT
>> 00000001 BXPC 00000001)
>>   ACPI: MCFG 0x0000000078490000 00003C (v01 BOCHS  BXPCMCFG
>> 00000001 BXPC 00000001)
>>   ACPI: SPCR 0x0000000078480000 000050 (v02 BOCHS  BXPCSPCR
>> 00000001 BXPC 00000001)
>>
>> After:
>>   ACPI: RSDP 0x000000007C030018 000024 (v02 BOCHS )
>>   ACPI: XSDT 0x000000007C03FE98 00004C (v01 BOCHS  BXPCFACP
>> 00000001      01000013)
>>   ACPI: FACP 0x000000007C03FA98 00010C (v05 BOCHS  BXPCFACP
>> 00000001 BXPC 00000001)
>>   ACPI: DSDT 0x000000007C037518 0014BB (v02 BOCHS  BXPCDSDT
>> 00000001 BXPC 00000001)
>>   ACPI: APIC 0x000000007C03FC18 0000A8 (v03 BOCHS  BXPCAPIC
>> 00000001 BXPC 00000001)
>>   ACPI: GTDT 0x000000007C03FD18 000060 (v02 BOCHS  BXPCGTDT
>> 00000001 BXPC 00000001)
>>   ACPI: MCFG 0x000000007C03FE18 00003C (v01 BOCHS  BXPCMCFG
>> 00000001 BXPC 00000001)
>>   ACPI: SPCR 0x000000007C03FF98 000050 (v02 BOCHS  BXPCSPCR
>> 00000001 BXPC 00000001)
>>
>> Cc: Dandan Bi <dandan.bi@intel.com>
>> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>> Cc: Jian J Wang <jian.j.wang@intel.com>
>> Cc: Hao A Wu <hao.a.wu@intel.com>
>> Cc: Sami Mujawar <sami.mujawar@arm.com>
>> Cc: Laszlo Ersek <lersek@redhat.com>
>> Cc: Leif Lindholm <leif@nuviainc.com>
>>
>> Ard Biesheuvel (3):
>>    MdeModulePkg/AcpiTableDxe: use pool allocations when possible
>>    MdeModulePkg/AcpiTableDxe: use pool allocation for RSDT/XSDT if
>>      possible
>>    MdeModulePkg/AcpiTableDxe: use pool allocation for RSDP if possible
>>
>>   .../Universal/Acpi/AcpiTableDxe/AcpiTable.h   |  11 +-
>>   .../Universal/Acpi/AcpiTableDxe/AcpiSdt.c     |   4 +-
>>   .../Acpi/AcpiTableDxe/AcpiTableProtocol.c     | 230 ++++++++++++------
>>   3 files changed, 162 insertions(+), 83 deletions(-)
>>
>> --
>> 2.17.1
>>
>>
>>
>> 
>>
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66822): https://edk2.groups.io/g/devel/message/66822
Mute This Topic: https://groups.io/mt/77902197/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: 回复: [edk2-devel] [PATCH v2 0/3] MdeModulePkg: use pool allocations for ACPI tables
Posted by Laszlo Ersek 3 years, 5 months ago
On 10/30/20 15:51, Ard Biesheuvel wrote:
> On 10/30/20 2:01 AM, gaoliming wrote:
>> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
>>
> 
> Merged #1062 into master.

Sorry for not reacting to this v2 series, I've been away. (I hope that
my automated out-of-office response worked and let you know.) I'm glad
that the patches are now merged.

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66869): https://edk2.groups.io/g/devel/message/66869
Mute This Topic: https://groups.io/mt/77902197/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-