From: Will Deacon Date: Mon, 29 Jan 2018 11:59:54 +0000 (+0000) Subject: arm64: mm: Permit transitioning from Global to Non-Global without BBM X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4e602056559633303d7e5bb2ff624778ca248f68;p=linux.git arm64: mm: Permit transitioning from Global to Non-Global without BBM Break-before-make is not needed when transitioning from Global to Non-Global mappings, provided that the contiguous hint is not being used. Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index b44992ec9643e..fc7902bda02bc 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -118,6 +118,10 @@ static bool pgattr_change_is_safe(u64 old, u64 new) if ((old | new) & PTE_CONT) return false; + /* Transitioning from Global to Non-Global is safe */ + if (((old ^ new) == PTE_NG) && (new & PTE_NG)) + return true; + return ((old ^ new) & ~mask) == 0; }