[PATCH] arm64: hugetlb: Restore TLB invalidation for BBM on contiguous ptes
Catalin Marinas
catalin.marinas at arm.com
Wed Jun 29 14:30:56 PDT 2022
On Wed, Jun 29, 2022 at 10:53:49AM +0100, Will Deacon wrote:
> Commit fb396bb459c1 ("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.
>
> Cc: Ard Biesheuvel <ardb at kernel.org>
> Cc: Steve Capper <steve.capper at arm.com>
> Cc: Anshuman Khandual <anshuman.khandual at arm.com>
> Cc: Mike Kravetz <mike.kravetz at oracle.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Marc Zyngier <maz at kernel.org>
> Signed-off-by: Will Deacon <will at kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>
I'll queue it for -rc5 but waiting until Friday to see if there are
other comments.
More information about the linux-arm-kernel
mailing list