diff options
author | Ajan Zhong <ajan.zhong@newfw.com> | 2025-03-18 11:56:33 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-07-04 22:39:10 +0000 |
commit | 07fc968c8fd69d90d7015528cbaba6f1120e09fa (patch) | |
tree | 66c94ed2354ecd78dc744a7697f3b2652ccf31a8 | |
parent | 3ce9d3f45b1dc59e60156df9023620ecf63f9f30 (diff) | |
download | edk2-07fc968c8fd69d90d7015528cbaba6f1120e09fa.zip edk2-07fc968c8fd69d90d7015528cbaba6f1120e09fa.tar.gz edk2-07fc968c8fd69d90d7015528cbaba6f1120e09fa.tar.bz2 |
ArmPkg: Drop PcdNormalMemoryNonshareableOverride support
There are no upstream platforms sets this Pcd, this Pcd was
introduced by ArmVExpress-CTA15-A7.
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
-rw-r--r-- | ArmPkg/ArmPkg.dec | 6 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/ArmBaseLib.inf | 3 | ||||
-rw-r--r-- | ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 70 | ||||
-rw-r--r-- | ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 3 |
4 files changed, 10 insertions, 72 deletions
diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index b528bb4..04252da 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -115,12 +115,6 @@ # attributes initially, and can be disabled otherwise.
gArmTokenSpaceGuid.PcdRemapUnusedMemoryNx|TRUE|BOOLEAN|0x00000048
-[PcdsFeatureFlag.ARM]
- # Whether to map normal memory as non-shareable. FALSE is the safe choice, but
- # TRUE may be appropriate to fix performance problems if you don't care about
- # hardware coherency (i.e., no virtualization or cache coherent DMA)
- gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride|FALSE|BOOLEAN|0x00000043
-
[PcdsFixedAtBuild.common]
gArmTokenSpaceGuid.PcdTrustzoneSupport|FALSE|BOOLEAN|0x00000006
diff --git a/ArmPkg/Library/ArmLib/ArmBaseLib.inf b/ArmPkg/Library/ArmLib/ArmBaseLib.inf index e37d85b..6d1acd2 100644 --- a/ArmPkg/Library/ArmLib/ArmBaseLib.inf +++ b/ArmPkg/Library/ArmLib/ArmBaseLib.inf @@ -45,6 +45,3 @@ [Packages]
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
-
-[FeaturePcd.ARM]
- gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride
diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c index 60dc6c9..643541d 100644 --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c @@ -44,43 +44,6 @@ ArmHasMpExtensions ( );
STATIC
-BOOLEAN
-PreferNonshareableMemory (
- VOID
- )
-{
- UINTN Mmfr;
- UINTN Val;
-
- if (FeaturePcdGet (PcdNormalMemoryNonshareableOverride)) {
- return TRUE;
- }
-
- //
- // Check whether the innermost level of shareability (the level we will use
- // by default to map normal memory) is implemented with hardware coherency
- // support. Otherwise, revert to mapping as non-shareable.
- //
- Mmfr = ArmReadIdMmfr0 ();
- switch ((Mmfr >> ID_MMFR0_SHARELVL_SHIFT) & ID_MMFR0_SHARELVL_MASK) {
- case ID_MMFR0_SHARELVL_ONE:
- // one level of shareability
- Val = (Mmfr >> ID_MMFR0_OUTERSHR_SHIFT) & ID_MMFR0_OUTERSHR_MASK;
- break;
- case ID_MMFR0_SHARELVL_TWO:
- // two levels of shareability
- Val = (Mmfr >> ID_MMFR0_INNERSHR_SHIFT) & ID_MMFR0_INNERSHR_MASK;
- break;
- default:
- // unexpected value -> shareable is the safe option
- ASSERT (FALSE);
- return FALSE;
- }
-
- return Val != ID_MMFR0_SHR_IMP_HW_COHERENT;
-}
-
-STATIC
VOID
PopulateLevel2PageTable (
IN UINT32 *SectionEntry,
@@ -128,10 +91,6 @@ PopulateLevel2PageTable ( break;
}
- if (PreferNonshareableMemory ()) {
- PageAttributes &= ~TT_DESCRIPTOR_PAGE_S_SHARED;
- }
-
// Check if the Section Entry has already been populated. Otherwise attach a
// Level 2 Translation Table to it
if (*SectionEntry != 0) {
@@ -268,10 +227,6 @@ FillTranslationTable ( break;
}
- if (PreferNonshareableMemory ()) {
- Attributes &= ~TT_DESCRIPTOR_SECTION_S_SHARED;
- }
-
// Get the first section entry for this mapping
SectionEntry = TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS (TranslationTable, MemoryRegion->VirtualBase);
@@ -370,21 +325,16 @@ ArmConfigureMmu ( TTBRAttributes = ArmHasMpExtensions () ? TTBR_MP_WRITE_BACK_ALLOC
: TTBR_WRITE_BACK_ALLOC;
- if (TTBRAttributes & TTBR_SHAREABLE) {
- if (PreferNonshareableMemory ()) {
- TTBRAttributes ^= TTBR_SHAREABLE;
- } else {
- //
- // Unlike the S bit in the short descriptors, which implies inner shareable
- // on an implementation that supports two levels, the meaning of the S bit
- // in the TTBR depends on the NOS bit, which defaults to Outer Shareable.
- // However, we should only set this bit after we have confirmed that the
- // implementation supports multiple levels, or else the NOS bit is UNK/SBZP
- //
- if (((ArmReadIdMmfr0 () >> 12) & 0xf) != 0) {
- TTBRAttributes |= TTBR_NOT_OUTER_SHAREABLE;
- }
- }
+
+ //
+ // Unlike the S bit in the short descriptors, which implies inner shareable
+ // on an implementation that supports two levels, the meaning of the S bit
+ // in the TTBR depends on the NOS bit, which defaults to Outer Shareable.
+ // However, we should only set this bit after we have confirmed that the
+ // implementation supports multiple levels, or else the NOS bit is UNK/SBZP
+ //
+ if (((ArmReadIdMmfr0 () >> 12) & 0xf) != 0) {
+ TTBRAttributes |= TTBR_NOT_OUTER_SHAREABLE;
}
ArmSetTTBR0 ((VOID *)((UINTN)TranslationTable | TTBRAttributes));
diff --git a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf index 5ee4afa..1a9552b 100644 --- a/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf +++ b/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf @@ -44,6 +44,3 @@ [Guids]
gArmMmuReplaceLiveTranslationEntryFuncGuid
-
-[Pcd.ARM]
- gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride
|