From 6ecd4c80619f44ba68d7ced7649d999ed2d1566c Mon Sep 17 00:00:00 2001
From: Valentin Schneider <>
Date: Wed, 11 Aug 2021 21:13:54 +0100
Subject: [PATCH 003/166] arm64: mm: Make arch_faults_on_old_pte() check for

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 <>
Signed-off-by: Sebastian Andrzej Siewior <>
 arch/arm64/include/asm/pgtable.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-5.15.13-rt26/arch/arm64/include/asm/pgtable.h
@ linux-5.15.13-rt26/arch/arm64/include/asm/pgtable.h:1004 @ static inline void update_mmu_cache(stru
 static inline bool arch_faults_on_old_pte(void)
-	WARN_ON(preemptible());
+	WARN_ON(is_migratable());
 	return !cpu_has_hw_af();