Skip to content

Commit

Permalink
arm64: Execute DSB during thread switching for TLB/cache maintenance
Browse files Browse the repository at this point in the history
The DSB following TLB or cache maintenance ops must be run on the same
CPU. With kernel preemption enabled or for user-space cache maintenance
this may not be the case. This patch adds an explicit DSB in the
__switch_to() function.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Catalin Marinas committed Apr 25, 2013
1 parent 4b3ea2e commit 5108c67
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ struct task_struct *__switch_to(struct task_struct *prev,
hw_breakpoint_thread_switch(next);
contextidr_thread_switch(next);

/*
* Complete any pending TLB or cache maintenance on this CPU in case
* the thread migrates to a different CPU.
*/
dsb();

/* the actual thread switch */
last = cpu_switch_to(prev, next);

Expand Down

0 comments on commit 5108c67

Please sign in to comment.