audk/StandaloneMmPkg/Core
Laszlo Ersek 2ddae5df31 StandaloneMmPkg/Core: Remove optimization for depex evaluation
The current dependency evaluator violates the memory access permission
when patching depex grammar directly in the read-only depex memory area.

Laszlo pointed out the optimization issue in the thread (1) "Memory
Attribute for depex section" and provided suggested patch to remove the
perf optimization.

In my testing, removing the optimization does not make significant perf
reduction. That makes sense that StandaloneMM dispatcher only searches
in MM protocol database and does not depend on UEFI/DXE protocol
database. Also, we don't have many protocols in StandaloneMM like
UEFI/DXE.

From Laszlo,

"The patch removes the EFI_DEP_REPLACE_TRUE handling altogether, plus it
CONST-ifies the Iterator pointer (which points into the DEPEX section),
so that the compiler catch any possible accesses at *build time* that
would write to the write-protected DEPEX memory area."

(1) https://edk2.groups.io/g/devel/message/113531

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Tested-by: levi.yun <yeoreum.yun@arm.com>
Reviewed-by: levi.yun <yeoreum.yun@arm.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2024-01-23 18:26:25 +00:00
..
Dependency.c StandaloneMmPkg/Core: Remove optimization for depex evaluation 2024-01-23 18:26:25 +00:00
Dispatcher.c StandaloneMmPkg/Core: Remove dead code 2023-12-25 06:15:54 +00:00
FwVol.c StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV 2023-12-19 09:29:07 +00:00
Handle.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
InstallConfigurationTable.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Locate.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Mmi.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Notify.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Page.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Pool.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
StandaloneMmCore.c StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion 2023-12-19 09:29:07 +00:00
StandaloneMmCore.h StandaloneMmPkg/Core: Remove dead code 2023-12-25 06:15:54 +00:00
StandaloneMmCore.inf StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion 2023-12-19 09:29:07 +00:00
StandaloneMmCorePrivateData.h StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00