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-Tag: v4.14.20~145 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ee28fed5ccc66fbdef4119451aa6754501705a7e;p=users%2Fjedix%2Flinux-maple.git arm64: mm: Permit transitioning from Global to Non-Global without BBM Commit 4e6020565596 upstream. 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 Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 606c3654186f..fa20124c19d5 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -117,6 +117,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; }