]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: hugetlb: Restore TLB invalidation for BBM on contiguous ptes
authorWill Deacon <will@kernel.org>
Wed, 29 Jun 2022 09:53:49 +0000 (10:53 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 1 Jul 2022 17:29:26 +0000 (18:29 +0100)
commitf85d2c104f167023736b0b06a79ddf06e3dc5a63
treeb5ece703f4811290655a3556d7c3d5c7167796b2
parent6ada6b38bf6113418b1ee1857e9c21bba96a38db
arm64: hugetlb: Restore TLB invalidation for BBM on contiguous ptes

Commit 42dbb8dc8f17 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")
removed TLB invalidation from get_clear_flush() [now get_clear_contig()]
on the basis that the core TLB invalidation code is aware of hugetlb
mappings backed by contiguous page-table entries and will cover the
correct virtual address range.

However, this change also resulted in the TLB invalidation being removed
from the "break" step in the break-before-make (BBM) sequence used
internally by huge_ptep_set_{access_flags,wrprotect}(), therefore
making the BBM sequence unsafe irrespective of later invalidation.

Although the architecture is desperately unclear about how exactly
contiguous ptes should be updated in a live page-table, restore TLB
invalidation to our BBM sequence under the assumption that BBM is the
right thing to be doing in the first place.

Fixes: 42dbb8dc8f17 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()")
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Steve Capper <steve.capper@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20220629095349.25748-1-will@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/hugetlbpage.c