mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
In StandaloneMm, the allowed memory permission combinations are ROX, RO,
and RW.
At the initial stage, all regions are mapped as ROX.
When drivers are loaded for relocation, the image is first mapped as RW.
However, the current mechanism introduces significant overhead
when changing memory permissions. For example, when changing permissions
from ROX to RW, the process is performed in two steps:
1. Clear the execute (X) permission (ROX → RO)
2. Add the write (W) permission (RO → RW)
To execute step (1), the system first retrieves the permissions of
the target region. This may trigger multiple SMC calls,
depending on the permissions of the pages within that region.
This permission retrieval operation is redundant, as there is no need
to maintain an intermediate state. Nevertheless,
it can cause additional SMC calls and coherence operations
from the SPMC (e.g., TLB flushes).
Therefore, this redundant operation should be removed, and in most cases,
the memory permission should be updated with a single
“set memory permission” operation.
Note:
The ArmxxxMemoryRegionxxx() interfaces e.g. ArmSetMemoryRegionNoExec(),
etc. return success when the Length parameter is 0 as
the SectionHeader.Misc.VirtualSize could be 0 Length
like .reloc section:
UpdateMmFoundationPeCoffPermissions: Section 2 of image at 0x7004000
has 0x42000040 permissions
UpdateMmFoundationPeCoffPermissions: Section 2 of image at 0x7004000
has .reloc name
api_ffa_mem_perm_set page_count 0
ERROR: FFA_MEM_PERM_SET: page_count was zero
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
||
|---|---|---|
| .. | ||
| ArmGenericTimerCounterLib.h | ||
| ArmGicLib.h | ||
| ArmHvcLib.h | ||
| ArmMmHandlerContext.h | ||
| ArmMonitorLib.h | ||
| ArmMtlLib.h | ||
| ArmStandaloneMmCoreEntryPoint.h | ||
| ArmTransferListLib.h | ||
| OemMiscLib.h | ||
| OpteeLib.h | ||
| SemihostLib.h | ||
| StandaloneMmMmuLib.h | ||