Skip to contentSkip to conversation

xen/arm64: Add missing synchronization barrier in invalidate_cache

PATCH In review Julien Grall 3 participants 3 messages Sep 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm64: Add missing synchronization barrier in invalidate_cache

The invalidation of the instructions cache requires barriers to ensure the completion of the invalidation before continuing (see B2.3.4 in ARM DDI 0487A.j).

This was overlooked in commit fb9d877 "xen/arm64: Add an helper to invalidate all instruction caches".

---
 xen/include/asm-arm/arm64/page.h | 2 ++
 1 file changed, 2 insertions(+)
xen/include/asm-arm/arm64/page.h +2 -0
index 79ef7bd..23d7781 100644
@@ -33,6 +33,8 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 static inline void invalidate_icache(void)
 {
     asm volatile ("ic ialluis");
+    dsb(ish);               /* Ensure completion of the flush I-cache */
+    isb();
 }
 
 /*
Signature · 7 lines
1.9.1


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

The invalidation of the instructions cache requires barriers to ensure the completion of the invalidation before continuing (see B2.3.4 in ARM DDI 0487A.j).

This was overlooked in commit fb9d877 "xen/arm64: Add an helper to invalidate all instruction caches".

[by reading the docs]

Quoted 20 lines
---
 xen/include/asm-arm/arm64/page.h | 2 ++
 1 file changed, 2 insertions(+)
xen/include/asm-arm/arm64/page.h +2 -0
index 79ef7bd..23d7781 100644
@@ -33,6 +33,8 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 static inline void invalidate_icache(void)
 {
     asm volatile ("ic ialluis");
+    dsb(ish);               /* Ensure completion of the flush I-cache */
+    isb();
 }
 
 /*
Signature · 1 line
1.9.1

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

Reviewed-by
#2 lore raw
Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 8 lines · Julien Grall

The invalidation of the instructions cache requires barriers to ensure the completion of the invalidation before continuing (see B2.3.4 in ARM DDI 0487A.j).

This was overlooked in commit fb9d877 "xen/arm64: Add an helper to invalidate all instruction caches".

and committed

Quoted 17 lines
Quoted 17 lines
---
 xen/include/asm-arm/arm64/page.h | 2 ++
 1 file changed, 2 insertions(+)
xen/include/asm-arm/arm64/page.h +2 -0
index 79ef7bd..23d7781 100644
@@ -33,6 +33,8 @@ static inline void write_pte(lpae_t *p, lpae_t pte)
 static inline void invalidate_icache(void)
 {
     asm volatile ("ic ialluis");
+    dsb(ish);               /* Ensure completion of the flush I-cache */
+    isb();
 }
 
Quoted 5 lines
Quoted 4 lines
xen/include/asm-arm/arm64/page.h +0 -0
 /*
Signature · 1 line
1.9.1

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