[PATCH v2 03/10] arm64: mm: Permit contiguous descriptors to be rewritten
Ard Biesheuvel
ardb+git at google.com
Mon Jan 26 01:26:34 PST 2026
From: Ard Biesheuvel <ardb at kernel.org>
Currently, pgattr_change_is_safe() is overly pedantic when it comes to
descriptors with the contiguous hint attribute set, as it rejects
assignments even if the old and the new value are the same.
So relax the check to allow that.
Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
---
arch/arm64/mm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index c36422a3fae2..9d39de3cfe67 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -141,7 +141,7 @@ bool pgattr_change_is_safe(pteval_t old, pteval_t new)
return false;
/* live contiguous mappings may not be manipulated at all */
- if ((old | new) & PTE_CONT)
+ if ((old | new) & PTE_CONT && old != new)
return false;
/* Transitioning from Non-Global to Global is unsafe */
--
2.52.0.457.g6b5491de43-goog
More information about the linux-arm-kernel
mailing list