Commit 4109823
arm64: hugetlb: Restore TLB invalidation for BBM on contiguous ptes
Commit fb396bb ("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: fb396bb ("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>1 parent c50f11c commit 4109823
1 file changed
Lines changed: 21 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
217 | 230 | | |
218 | 231 | | |
219 | 232 | | |
| |||
447 | 460 | | |
448 | 461 | | |
449 | 462 | | |
| 463 | + | |
450 | 464 | | |
451 | 465 | | |
452 | 466 | | |
453 | 467 | | |
454 | 468 | | |
455 | 469 | | |
456 | | - | |
| 470 | + | |
457 | 471 | | |
458 | 472 | | |
459 | 473 | | |
460 | 474 | | |
461 | 475 | | |
462 | | - | |
| 476 | + | |
463 | 477 | | |
464 | 478 | | |
465 | 479 | | |
| |||
470 | 484 | | |
471 | 485 | | |
472 | 486 | | |
473 | | - | |
| 487 | + | |
474 | 488 | | |
475 | 489 | | |
476 | 490 | | |
| |||
492 | 506 | | |
493 | 507 | | |
494 | 508 | | |
495 | | - | |
| 509 | + | |
496 | 510 | | |
497 | 511 | | |
498 | 512 | | |
| |||
505 | 519 | | |
506 | 520 | | |
507 | 521 | | |
| 522 | + | |
508 | 523 | | |
509 | 524 | | |
510 | | - | |
511 | 525 | | |
512 | 526 | | |
513 | 527 | | |
514 | 528 | | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
| 529 | + | |
| 530 | + | |
519 | 531 | | |
520 | 532 | | |
521 | 533 | | |
| |||
0 commit comments