[edk2-devel] [PATCH v3 0/4] ArmPkg,ArmVirtPkg: Add support EFI_MP_SERVICES_PROTOCOL on AARCH64

Rebecca Cran posted 4 patches 2 years, 3 months ago
Failed in applying to current master (apply log)
ArmPkg/ArmPkg.dec                                              |    4 +
ArmPkg/ArmPkg.dsc                                              |    4 +
ArmPkg/Drivers/CpuDxe/AArch64/Arch.c                           |   21 +
ArmPkg/Drivers/CpuDxe/Arm/Arch.c                               |   21 +
ArmPkg/Drivers/CpuDxe/CpuDxe.c                                 |    2 +
ArmPkg/Drivers/CpuDxe/CpuDxe.h                                 |   10 +
ArmPkg/Drivers/CpuDxe/CpuDxe.inf                               |    6 +
ArmPkg/Drivers/CpuDxe/CpuMpInit.c                              |  608 ++++++++
ArmPkg/Include/Guid/ArmMpCoreInfo.h                            |    3 +-
ArmPkg/Include/Library/ArmLib.h                                |    4 +
ArmPkg/Include/Library/MpInitLib.h                             |  362 +++++
ArmPkg/Library/MpInitLib/AArch64/MpFuncs.S                     |   65 +
ArmPkg/Library/MpInitLib/DxeMpInitLib.inf                      |   52 +
ArmPkg/Library/MpInitLib/DxeMpLib.c                            | 1477 ++++++++++++++++++++
ArmPkg/Library/MpInitLib/InternalMpInitLib.h                   |  357 +++++
ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c |    8 +-
ArmPlatformPkg/PrePeiCore/MainMPCore.c                         |    4 +-
ArmPlatformPkg/PrePi/MainMPCore.c                              |    4 +-
ArmVirtPkg/ArmVirt.dsc.inc                                     |    3 +
19 files changed, 3007 insertions(+), 8 deletions(-)
create mode 100644 ArmPkg/Drivers/CpuDxe/AArch64/Arch.c
create mode 100644 ArmPkg/Drivers/CpuDxe/Arm/Arch.c
create mode 100644 ArmPkg/Drivers/CpuDxe/CpuMpInit.c
create mode 100644 ArmPkg/Include/Library/MpInitLib.h
create mode 100644 ArmPkg/Library/MpInitLib/AArch64/MpFuncs.S
create mode 100644 ArmPkg/Library/MpInitLib/DxeMpInitLib.inf
create mode 100644 ArmPkg/Library/MpInitLib/DxeMpLib.c
create mode 100644 ArmPkg/Library/MpInitLib/InternalMpInitLib.h
[edk2-devel] [PATCH v3 0/4] ArmPkg,ArmVirtPkg: Add support EFI_MP_SERVICES_PROTOCOL on AARCH64
Posted by Rebecca Cran 2 years, 3 months ago
Patch 1/4 is the start of addressing the issue that the Aff0 field of
the MPIDR is no longer guaranteed to be the core, and should be referred
to in a more generic way: for example it could be the thread, with Aff1
being the core and Aff2 the cluster. Clearly much more work is needed 
to fully remove that assumption.

Patch 2/4 implements the EFI_MP_SERVICES_PROTOCOL for DXE in Library/MpInitLib.
Patch 4/4 updates CpuDxe to initialize MP support: as a result, it gains
a dependency on MpInitLib.
Patch 3/4 updates ArmVirt.dsc.inc to add the new MpInitLib library.

Cores are powered on and turned off using PSCI.

Note that minimal CPU setup is done: for example the MMU and caches are
left disabled.

--------

Changes from v2:

o Split patches up.
o Wrapped overly long lines.
o Fixed code formatting issues (Uncrustify).
o Fixed other formatting issues (ECC tool).

--------

Testing:

o Ran CI: https://github.com/tianocore/edk2/pull/2312
o Built packages in ArmVirtPkg at each revision for both ARM and AARCH64.

Rebecca Cran (4):
  ArmPkg: Replace CoreId and ClusterId with Mpidr in ARM_CORE_INFO
    struct
  ArmPkg: Add Library/MpInitLib to support EFI_MP_SERVICES_PROTOCOL
  ArmVirtPkg: Add MpInitLib, which is dependency for CpuDxe consumers
  ArmPkg: Update Drivers/CpuDxe to initialize MpInitLib

 ArmPkg/ArmPkg.dec                                              |    4 +
 ArmPkg/ArmPkg.dsc                                              |    4 +
 ArmPkg/Drivers/CpuDxe/AArch64/Arch.c                           |   21 +
 ArmPkg/Drivers/CpuDxe/Arm/Arch.c                               |   21 +
 ArmPkg/Drivers/CpuDxe/CpuDxe.c                                 |    2 +
 ArmPkg/Drivers/CpuDxe/CpuDxe.h                                 |   10 +
 ArmPkg/Drivers/CpuDxe/CpuDxe.inf                               |    6 +
 ArmPkg/Drivers/CpuDxe/CpuMpInit.c                              |  608 ++++++++
 ArmPkg/Include/Guid/ArmMpCoreInfo.h                            |    3 +-
 ArmPkg/Include/Library/ArmLib.h                                |    4 +
 ArmPkg/Include/Library/MpInitLib.h                             |  362 +++++
 ArmPkg/Library/MpInitLib/AArch64/MpFuncs.S                     |   65 +
 ArmPkg/Library/MpInitLib/DxeMpInitLib.inf                      |   52 +
 ArmPkg/Library/MpInitLib/DxeMpLib.c                            | 1477 ++++++++++++++++++++
 ArmPkg/Library/MpInitLib/InternalMpInitLib.h                   |  357 +++++
 ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c |    8 +-
 ArmPlatformPkg/PrePeiCore/MainMPCore.c                         |    4 +-
 ArmPlatformPkg/PrePi/MainMPCore.c                              |    4 +-
 ArmVirtPkg/ArmVirt.dsc.inc                                     |    3 +
 19 files changed, 3007 insertions(+), 8 deletions(-)
 create mode 100644 ArmPkg/Drivers/CpuDxe/AArch64/Arch.c
 create mode 100644 ArmPkg/Drivers/CpuDxe/Arm/Arch.c
 create mode 100644 ArmPkg/Drivers/CpuDxe/CpuMpInit.c
 create mode 100644 ArmPkg/Include/Library/MpInitLib.h
 create mode 100644 ArmPkg/Library/MpInitLib/AArch64/MpFuncs.S
 create mode 100644 ArmPkg/Library/MpInitLib/DxeMpInitLib.inf
 create mode 100644 ArmPkg/Library/MpInitLib/DxeMpLib.c
 create mode 100644 ArmPkg/Library/MpInitLib/InternalMpInitLib.h

-- 
2.31.1



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


Re: [edk2-devel] [PATCH v3 0/4] ArmPkg,ArmVirtPkg: Add support EFI_MP_SERVICES_PROTOCOL on AARCH64
Posted by Ard Biesheuvel 2 years, 3 months ago
On Thu, 16 Dec 2021 at 04:46, Rebecca Cran <rebecca@nuviainc.com> wrote:
>
> Patch 1/4 is the start of addressing the issue that the Aff0 field of
> the MPIDR is no longer guaranteed to be the core, and should be referred
> to in a more generic way: for example it could be the thread, with Aff1
> being the core and Aff2 the cluster. Clearly much more work is needed
> to fully remove that assumption.
>
> Patch 2/4 implements the EFI_MP_SERVICES_PROTOCOL for DXE in Library/MpInitLib.
> Patch 4/4 updates CpuDxe to initialize MP support: as a result, it gains
> a dependency on MpInitLib.
> Patch 3/4 updates ArmVirt.dsc.inc to add the new MpInitLib library.
>
> Cores are powered on and turned off using PSCI.
>
> Note that minimal CPU setup is done: for example the MMU and caches are
> left disabled.
>
> --------
>
> Changes from v2:
>
> o Split patches up.
> o Wrapped overly long lines.
> o Fixed code formatting issues (Uncrustify).
> o Fixed other formatting issues (ECC tool).
>
> --------
>
> Testing:
>
> o Ran CI: https://github.com/tianocore/edk2/pull/2312
> o Built packages in ArmVirtPkg at each revision for both ARM and AARCH64.
>
> Rebecca Cran (4):
>   ArmPkg: Replace CoreId and ClusterId with Mpidr in ARM_CORE_INFO
>     struct
>   ArmPkg: Add Library/MpInitLib to support EFI_MP_SERVICES_PROTOCOL
>   ArmVirtPkg: Add MpInitLib, which is dependency for CpuDxe consumers
>   ArmPkg: Update Drivers/CpuDxe to initialize MpInitLib
>

OK, this looks good to me in principe, and I am quite happy with the
implementation of the MpInitLib and the new ability to dispatch
execution to other cores.

However, looking at ArmPkg/Include/Guid/ArmMpCoreInfo.h, I was
seriously shocked at how much cruft has accumulated there:
- headers under Guid/ shouldn't carry that many vaguely related
definitions anyway
- the mailbox stuff is obsolete
- the pseudo-ACPI table (ACPI style header but published as a EFI
config table) is highly dubious as well, and should really just be
removed.

I don't want to derail this series further, so I''ll have a stab at
cleaning this up on top, unless there are any reasons for keeping this
stuff?


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


Re: [edk2-devel] [PATCH v3 0/4] ArmPkg,ArmVirtPkg: Add support EFI_MP_SERVICES_PROTOCOL on AARCH64
Posted by Rebecca Cran 2 years, 3 months ago
On 12/17/21 11:08 AM, Ard Biesheuvel wrote:
> OK, this looks good to me in principe, and I am quite happy with the
> implementation of the MpInitLib and the new ability to dispatch
> execution to other cores.
>
> However, looking at ArmPkg/Include/Guid/ArmMpCoreInfo.h, I was
> seriously shocked at how much cruft has accumulated there:
> - headers under Guid/ shouldn't carry that many vaguely related
> definitions anyway
> - the mailbox stuff is obsolete
> - the pseudo-ACPI table (ACPI style header but published as a EFI
> config table) is highly dubious as well, and should really just be
> removed.
>
> I don't want to derail this series further, so I''ll have a stab at
> cleaning this up on top, unless there are any reasons for keeping this
> stuff?

Thanks. I'm not familiar enough with it to know if it should be kept or 
not. But similarly, I have a task on my list to clean up ArmPlatformPkg 
- PrePeiCore, PrePi etc. since they have obsolete code to handle 
secondary cores from before TF-A.


-- 
Rebecca Cran



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