On Thu, 16 Mar 2023 at 14:27, Leif Lindholm <quic_llind...@quicinc.com> wrote: > > On Mon, Mar 13, 2023 at 18:16:57 +0100, Ard Biesheuvel wrote: > > Implement the ARM version of a NULL class library that can be overlaid > > on top of the DXE core to equip it right from its launch with an > > implementation of the CPU arch protocol member that sets type and > > permission attributes on memory regions. > > > > This bridges the gap between dispatch of DXE core and dispatch of the > > DXE driver that implements the CPU arch protocol, removing the need to > > rely on memory mappings that are writable and executable at the same > > time. > > > > Signed-off-by: Ard Biesheuvel <a...@kernel.org> > > --- > > ArmPkg/ArmPkg.dsc | 1 + > > ArmPkg/Library/ArmSetMemoryOverrideLib/ArmSetMemoryOverrideLib.c | 78 > > ++++++++++++++++++++ > > ArmPkg/Library/ArmSetMemoryOverrideLib/ArmSetMemoryOverrideLib.inf | 28 > > +++++++ > > 3 files changed, 107 insertions(+) > > > > diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc > > index 3fb95d1951a9..43eb0f4f463e 100644 > > --- a/ArmPkg/ArmPkg.dsc > > +++ b/ArmPkg/ArmPkg.dsc > > @@ -119,6 +119,7 @@ [Components.common] > > ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf > > ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.inf > > ArmPkg/Library/ArmExceptionLib/ArmRelocateExceptionLib.inf > > + ArmPkg/Library/ArmSetMemoryOverrideLib/ArmSetMemoryOverrideLib.inf > > > > ArmPkg/Drivers/CpuDxe/CpuDxe.inf > > ArmPkg/Drivers/CpuPei/CpuPei.inf > > diff --git > > a/ArmPkg/Library/ArmSetMemoryOverrideLib/ArmSetMemoryOverrideLib.c > > b/ArmPkg/Library/ArmSetMemoryOverrideLib/ArmSetMemoryOverrideLib.c > > new file mode 100644 > > index 000000000000..866dbbdaa7d5 > > --- /dev/null > > +++ b/ArmPkg/Library/ArmSetMemoryOverrideLib/ArmSetMemoryOverrideLib.c > > @@ -0,0 +1,78 @@ > > +/** @file > > + Overlay implementation of DXE core gCpuSetMemoryAttributes for ARM. > > + > > + Copyright (c) 2023, Google LLC. All rights reserved. > > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > +**/ > > + > > +#include <PiDxe.h> > > + > > +#include <Library/ArmMmuLib.h> > > +#include <Library/DebugLib.h> > > +#include <Protocol/Cpu.h> > > + > > +extern EFI_CPU_SET_MEMORY_ATTRIBUTES gCpuSetMemoryAttributes; > > Could this declaration live in a global include? >
Yes, In fact, instead of modeling this as a NULL library class, we could actually define a library class for this, whose include file only has this extern declaration and nothing else (and a big fat comment, obviously, describing the point of that) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101277): https://edk2.groups.io/g/devel/message/101277 Mute This Topic: https://groups.io/mt/97586026/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-