Skip to contentSkip to conversation

xen/arm: Tighten memory attribute requirement for memory shared

PATCH In review Julien Grall 2 participants 2 messages Aug 8, 2017 – Aug 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Tighten memory attribute requirement for memory shared

Xen allows shared mapping to be Normal inner-cacheable with any inner cache allocation strategy and no restriction of the outer-cacheability.

However, Xen is always mapping those region Normal Inner Write-Back Outer Write-Back Inner-shareable. Per B2.8 "Mismatched memory attributes" in ARM DDI 0487B.a, if the guest is not using the exact same memory attributes (excluding any cache allocation hints) for the shared region then the region will be accessed with mismatched attributes.

This will result to potential loss of coherency, and may impact the performance.

Given that the ARM ARM strongly recommends to avoid using mismatched attributes, we should impose shared region to be Normal Inner Write-Back Outer Write-Back Inner-shareable.

---
 xen/include/public/arch-arm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
xen/include/public/arch-arm.h +3 -3
index bd974fb13d..8f9d06ef7f 100644
@@ -61,15 +61,15 @@
  *
  * All memory which is shared with other entities in the system
  * (including the hypervisor and other guests) must reside in memory
- * which is mapped as Normal Inner-cacheable. This applies to:
+ * which is mapped as Normal Inner Write-Back Outer Write-Back Inner-Shareable.
+ * This applies to:
  *  - hypercall arguments passed via a pointer to guest memory.
  *  - memory shared via the grant table mechanism (including PV I/O
  *    rings etc).
  *  - memory shared with the hypervisor (struct shared_info, struct
  *    vcpu_info, the grant table, etc).
  *
- * Any Inner cache allocation strategy (Write-Back, Write-Through etc)
- * is acceptable. There is no restriction on the Outer-cacheability.
+ * Any cache allocation hints are acceptable.
  */
 
 /*
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Julien Grall

Xen allows shared mapping to be Normal inner-cacheable with any inner cache allocation strategy and no restriction of the outer-cacheability.

However, Xen is always mapping those region Normal Inner Write-Back Outer Write-Back Inner-shareable. Per B2.8 "Mismatched memory attributes" in ARM DDI 0487B.a, if the guest is not using the exact same memory attributes (excluding any cache allocation hints) for the shared region then the region will be accessed with mismatched attributes.

Quoted 8 lines

This will result to potential loss of coherency, and may impact the performance.

Given that the ARM ARM strongly recommends to avoid using mismatched attributes, we should impose shared region to be Normal Inner Write-Back Outer Write-Back Inner-shareable.

Quoted 17 lines
---
 xen/include/public/arch-arm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
xen/include/public/arch-arm.h +2 -1
index bd974fb13d..8f9d06ef7f 100644
@@ -61,15 +61,15 @@
  *
  * All memory which is shared with other entities in the system
  * (including the hypervisor and other guests) must reside in memory
- * which is mapped as Normal Inner-cacheable. This applies to:
+ * which is mapped as Normal Inner Write-Back Outer Write-Back Inner-Shareable.
+ * This applies to:
  *  - hypercall arguments passed via a pointer to guest memory.
  *  - memory shared via the grant table mechanism (including PV I/O

xen/include/public/arch-arm.h line 75

Quoted 10 lines
xen/include/public/arch-arm.h +1 -2
  *    rings etc).
  *  - memory shared with the hypervisor (struct shared_info, struct
  *    vcpu_info, the grant table, etc).
  *
- * Any Inner cache allocation strategy (Write-Back, Write-Through etc)
- * is acceptable. There is no restriction on the Outer-cacheability.
+ * Any cache allocation hints are acceptable.
  */
 
 /*

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel