public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: devel@edk2.groups.io
Subject: Re: [PATCH 0/9] ArmPkg: Start cleaning up ID register handling
Date: Fri, 18 Dec 2020 15:36:30 +0000	[thread overview]
Message-ID: <20201218153630.GU1664@vanye> (raw)
In-Reply-To: <63bfb26c-6e41-f35a-8fc7-1fd26604a82c@arm.com>

On Fri, Dec 18, 2020 at 16:02:07 +0100, Ard Biesheuvel wrote:
> On 12/18/20 3:16 PM, Leif Lindholm wrote:
> > As discussed in https://edk2.groups.io/g/devel/topic/78784065,
> > the ARM and AArch64 ports were using an unfortunate overloading
> > of accessor functions for the ID registers which describe the
> > presence and versions of features implemented in a CPU.
> > 
> > This makes no sense, since the layout, and indeed the names of
> > the registers for the different architectural states differ.
> > 
> > This set replaces the use of the current accessor functions
> > with some helper functions in ArmLib. It also moves the
> > accessor function prototypes into private headers so they
> > can no longer be called from outside ArmLib
> > 
> > As a pure side effect, we're able to throw away half of
> > ArmGicArchLib/ArmGicArchSecLib.
> > 
> > Note that some additional cleanup can also be done in the ARM
> > portion of ArmMmuLib (which implements its own direct accessor
> > for ID_MMFR0), and internally in ArmLib where some assembly
> > code does its own feature checks, which could be moved to C
> > helpers.
> > 
> > Furthermore, it might be useful to move the ID register field
> > definitions to a private header.
> > 
> > Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> > 
> > Leif Lindholm (9):
> >   ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function
> >   ArmPkg: use ID register helper for ArmGicArch(Sec)Lib
> >   ArmPkg: remove duplicated ARM/AArch64 ArmGicArchLib sources
> >   ArmPkg: remove duplicated ARM/AArch64 ArmGicArchSecLib sources
> >   ArmPkg: add ArmHasSecurityExtensions () helper function
> >   ArmPkg: use helper to check for Security extensions in ArmArchTimerLib
> >   ArmPkg/ArmLib: delete AArch64 version of ArmReadIdPfr1
> >   ArmPkg/ArmLib: rename AArch64 variant of ArmReadIdPfr0
> >   ArmPkg/ArmLib: move ArmReadIdPfr0/1 into private header ArmV7Lib.h
> > 
> 
> Thanks for getting started on this.
> 
> For the series,
> 
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>

Thanks!

Pushed as 6573ae8c8575..e2bfd172e4b9 (#1244).

> >  ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf                |  7 +--
> >  ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf          |  7 +--
> >  ArmPkg/Include/Library/ArmLib.h                               | 47 +++++++++++----
> >  ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h                    |  6 ++
> >  ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h                          | 12 ++++
> >  ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c              |  2 +-
> >  ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c              | 60 --------------------
> >  ArmPkg/Library/ArmGicArchLib/{AArch64 => }/ArmGicArchLib.c    |  2 +-
> >  ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c           | 45 ---------------
> >  ArmPkg/Library/ArmGicArchSecLib/{AArch64 => }/ArmGicArchLib.c |  2 +-
> >  ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c                    | 16 ++++++
> >  ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c                          | 31 ++++++++++
> >  ArmPkg/Library/ArmLib/AArch64/AArch64Support.S                | 13 +----
> >  13 files changed, 110 insertions(+), 140 deletions(-)
> >  delete mode 100644 ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c
> >  rename ArmPkg/Library/ArmGicArchLib/{AArch64 => }/ArmGicArchLib.c (94%)
> >  delete mode 100644 ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c
> >  rename ArmPkg/Library/ArmGicArchSecLib/{AArch64 => }/ArmGicArchLib.c (94%)
> > 
> 

      reply	other threads:[~2020-12-18 15:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 14:16 [PATCH 0/9] ArmPkg: Start cleaning up ID register handling Leif Lindholm
2020-12-18 14:16 ` [PATCH 1/9] ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function Leif Lindholm
2020-12-18 14:16 ` [PATCH 2/9] ArmPkg: use ID register helper for ArmGicArch(Sec)Lib Leif Lindholm
2020-12-18 14:16 ` [PATCH 3/9] ArmPkg: remove duplicated ARM/AArch64 ArmGicArchLib sources Leif Lindholm
2020-12-18 14:16 ` [PATCH 4/9] ArmPkg: remove duplicated ARM/AArch64 ArmGicArchSecLib sources Leif Lindholm
2020-12-18 14:16 ` [PATCH 5/9] ArmPkg: add ArmHasSecurityExtensions () helper function Leif Lindholm
2020-12-18 14:16 ` [PATCH 6/9] ArmPkg: use helper to check for Security extensions in ArmArchTimerLib Leif Lindholm
2020-12-18 14:16 ` [PATCH 7/9] ArmPkg/ArmLib: delete AArch64 version of ArmReadIdPfr1 Leif Lindholm
2020-12-18 14:16 ` [PATCH 8/9] ArmPkg/ArmLib: rename AArch64 variant of ArmReadIdPfr0 Leif Lindholm
2020-12-18 14:16 ` [PATCH 9/9] ArmPkg/ArmLib: move ArmReadIdPfr0/1 into private header ArmV7Lib.h Leif Lindholm
2020-12-18 15:02 ` [PATCH 0/9] ArmPkg: Start cleaning up ID register handling Ard Biesheuvel
2020-12-18 15:36   ` Leif Lindholm [this message]

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=20201218153630.GU1664@vanye \
    --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