Commit 6a0e2430 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

[ARM] 3352/1: DSB required for the completion of a TLB maintenance operation

Patch from Catalin Marinas

Chapter B2.7.3 in the latest ARM ARM (with v6 information) states that
the completion of a TLB maintenance operation is only guaranteed by
the execution of a DSB (Data Syncronization Barrier, formerly Data
Write Barrier or Drain Write Buffer).

Note that a DSB is only needed in the flush_tlb_kernel_* functions
since the completion is guaranteed by a mode change (i.e. switching
back to user mode) for the flush_tlb_user_* functions.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d11d9b2d
...@@ -78,7 +78,7 @@ menu "System Type" ...@@ -78,7 +78,7 @@ menu "System Type"
choice choice
prompt "ARM system type" prompt "ARM system type"
default ARCH_RPC default ARCH_VERSATILE
config ARCH_CLPS7500 config ARCH_CLPS7500
bool "Cirrus-CL-PS7500FE" bool "Cirrus-CL-PS7500FE"
......
...@@ -80,6 +80,7 @@ ENTRY(v6wbi_flush_kern_tlb_range) ...@@ -80,6 +80,7 @@ ENTRY(v6wbi_flush_kern_tlb_range)
add r0, r0, #PAGE_SZ add r0, r0, #PAGE_SZ
cmp r0, r1 cmp r0, r1
blo 1b blo 1b
mcr p15, 0, r2, c7, c10, 4 @ data synchronization barrier
mov pc, lr mov pc, lr
.section ".text.init", #alloc, #execinstr .section ".text.init", #alloc, #execinstr
......
...@@ -340,6 +340,12 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) ...@@ -340,6 +340,12 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr)); asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr));
if (tlb_flag(TLB_V6_I_PAGE)) if (tlb_flag(TLB_V6_I_PAGE))
asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr)); asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr));
/* The ARM ARM states that the completion of a TLB maintenance
* operation is only guaranteed by a DSB instruction
*/
if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE))
asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero));
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment