summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cc8de57)
Some memory attributes are implied by the memory type, e.g., device memory
is always mapped non-executable and cached memory should have the inner
shareable attribute.
In order to prevent unnecessary memory attribute updates of mappings
created early on, make EfiAttributeToArmAttribute() return these implied
attributes in the same way as ArmMmuLib does already. This avoids false
positives when looking for differences between current and desired mapping
attributes.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
\r
switch (EfiAttributes & EFI_MEMORY_CACHETYPE_MASK) {\r
case EFI_MEMORY_UC:\r
\r
switch (EfiAttributes & EFI_MEMORY_CACHETYPE_MASK) {\r
case EFI_MEMORY_UC:\r
- ArmAttributes = TT_ATTR_INDX_DEVICE_MEMORY;\r
+ if (ArmReadCurrentEL () == AARCH64_EL2) {\r
+ ArmAttributes = TT_ATTR_INDX_DEVICE_MEMORY | TT_XN_MASK;\r
+ } else {\r
+ ArmAttributes = TT_ATTR_INDX_DEVICE_MEMORY | TT_UXN_MASK | TT_PXN_MASK;\r
+ }\r
break;\r
case EFI_MEMORY_WC:\r
ArmAttributes = TT_ATTR_INDX_MEMORY_NON_CACHEABLE;\r
break;\r
case EFI_MEMORY_WT:\r
break;\r
case EFI_MEMORY_WC:\r
ArmAttributes = TT_ATTR_INDX_MEMORY_NON_CACHEABLE;\r
break;\r
case EFI_MEMORY_WT:\r
- ArmAttributes = TT_ATTR_INDX_MEMORY_WRITE_THROUGH;\r
+ ArmAttributes = TT_ATTR_INDX_MEMORY_WRITE_THROUGH | TT_SH_INNER_SHAREABLE;\r
break;\r
case EFI_MEMORY_WB:\r
break;\r
case EFI_MEMORY_WB:\r
- ArmAttributes = TT_ATTR_INDX_MEMORY_WRITE_BACK;\r
+ ArmAttributes = TT_ATTR_INDX_MEMORY_WRITE_BACK | TT_SH_INNER_SHAREABLE;\r
break;\r
default:\r
ArmAttributes = TT_ATTR_INDX_MASK;\r
break;\r
default:\r
ArmAttributes = TT_ATTR_INDX_MASK;\r