Skip to contentSkip to conversation

flush icache if VM_EXEC in flush_cache_page

PATCH anfei 2 participants 2 messages Mar 25, 2010 Arm (32-bit)

lore
Share & tools
lore

anfei

author
#0 lore raw

Hi,

There is a little difference of flushing icache between flush_cache_page and flush_cache_range, why not make them the same? I think they have the very similar semantic except the range. If the vma is VM_EXEC, we should flush the icache no matter what cache type, and if it's not, then it's not necessary. Is it right?

---
 arch/arm/mm/flush.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/mm/flush.c +2 -4
index e34f095..48a756a 100644
@@ -80,12 +80,10 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig
 		return;
 	}
 
-	if (cache_is_vipt_aliasing()) {
+	if (cache_is_vipt_aliasing())
 		flush_pfn_alias(pfn, user_addr);
-		__flush_icache_all();
-	}
 
-	if (vma->vm_flags & VM_EXEC && icache_is_vivt_asid_tagged())
+	if (vma->vm_flags & VM_EXEC)
 		__flush_icache_all();
 }
 #else
Signature · 1 line
1.6.4.rc1
#1 lore raw
Quoted 5 lines · anfei

There is a little difference of flushing icache between flush_cache_page and flush_cache_range, why not make them the same? I think they have the very similar semantic except the range. If the vma is VM_EXEC, we should flush the icache no matter what cache type, and if it's not, then it's not necessary. Is it right?

Are you seeing a problem which is fixed by this patch, or is this just theory?