summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Schneider <valentin.schneider@arm.com>2021-08-11 23:13:54 +0300
committerMinda Chen <minda.chen@starfivetech.com>2023-11-06 14:24:37 +0300
commitf4c6f41ea4e7a39b05da24f487f02fa41cfdf131 (patch)
tree26131eaf4d1f946b8b088464990ed0a95335fd73
parent1cf350e52a4e7220b9ab5e09f546b9ce05295bea (diff)
downloadlinux-f4c6f41ea4e7a39b05da24f487f02fa41cfdf131.tar.xz
arm64: mm: Make arch_faults_on_old_pte() check for migratability
arch_faults_on_old_pte() relies on the calling context being non-preemptible. CONFIG_PREEMPT_RT turns the PTE lock into a sleepable spinlock, which doesn't disable preemption once acquired, triggering the warning in arch_faults_on_old_pte(). It does however disable migration, ensuring the task remains on the same CPU during the entirety of the critical section, making the read of cpu_has_hw_af() safe and stable. Make arch_faults_on_old_pte() check migratable() instead of preemptible(). Signed-off-by: Valentin Schneider <valentin.schneider@arm.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lore.kernel.org/r/20210811201354.1976839-5-valentin.schneider@arm.com
-rw-r--r--arch/arm64/include/asm/pgtable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index dfa76afa0ccf..421156d9de47 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -995,7 +995,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
*/
static inline bool arch_faults_on_old_pte(void)
{
- WARN_ON(preemptible());
+ WARN_ON(is_migratable());
return !cpu_has_hw_af();
}