Memory aliasing and mismatched memory types
When a given location in the physical address space has multiple virtual addresses, this is described as aliasing.
Attributes are based on virtual addresses because attributes come from the translation tables. When there are multiple aliases of a physical location, it is important that all the virtual aliases have compatible attributes. By compatible we mean:
- Same memory type, and for Device the same sub-type.
- For Normal locations, the same cacheability and shareability.
- If the attributes are not compatible, the memory accesses might not behave as you expect, and this can impact performance.
This diagram shows two examples of aliasing. The two aliases of location A have compatible attributes, this is the recommended approach. The two aliases of location B have incompatible attributes (Normal and Device), and this can negatively affect coherency and performance:
Arm strongly recommends that software does not assign incompatible attributes to different aliases of the same location.