diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-03-11 21:43:53 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2013-04-22 15:15:53 -0400 |
commit | 28b306a1d2ec1848f0107a05b765c76c82eb5804 (patch) | |
tree | 6ed58f4744c1f50f70f9be25a28fe56d9e1f2a3c | |
parent | 140d249ed8a1aee197370904f934a4905076f619 (diff) |
arm/highmem: close race between clear/set pte
This patch aims to close the same race in kmap_atomic() /
kunmap_atomic() vs switch_kmaps() as on x86. In contrast to x86 the
warning has not been seen and the fix has only been compile tested. The
pattern is same so the bug should present here as well.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r-- | arch/arm/mm/highmem.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index c8d6d9a50b3c..bd41dd8cc561 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c @@ -97,6 +97,9 @@ void __kunmap_atomic(void *kvaddr) if (cache_is_vivt()) __cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE); +#ifdef CONFIG_PREEMPT_RT_FULL + current->kmap_pte[type] = __pte(0); +#endif #ifdef CONFIG_DEBUG_HIGHMEM BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx)); #else @@ -163,8 +166,9 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) for (i = 0; i < next_p->kmap_idx; i++) { int idx = i + KM_TYPE_NR * smp_processor_id(); - set_top_pte(__fix_to_virt(FIX_KMAP_BEGIN + idx), - next_p->kmap_pte[i]); + if (!pte_none(next_p->kmap_pte[i])) + set_top_pte(__fix_to_virt(FIX_KMAP_BEGIN + idx), + next_p->kmap_pte[i]); } } #endif |