]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Implement page table free interfaces
authorChintan Pandya <cpandya@codeaurora.org>
Wed, 6 Jun 2018 07:01:21 +0000 (12:31 +0530)
committerWill Deacon <will.deacon@arm.com>
Fri, 6 Jul 2018 12:17:19 +0000 (13:17 +0100)
commit63b12f86ba9d1548e13c71a15a4f75ba10afc839
tree7aefb267ea3171c6fc3338ae6a94b50e2b5ce575
parentb94b3604ef859db7ef43b28beb508cb98172807d
arm64: Implement page table free interfaces

arm64 requires break-before-make. Originally, before
setting up new pmd/pud entry for huge mapping, in few
cases, the modifying pmd/pud entry was still valid
and pointing to next level page table as we only
clear off leaf PTE in unmap leg.

 a) This was resulting into stale entry in TLBs (as few
    TLBs also cache intermediate mapping for performance
    reasons)
 b) Also, modifying pmd/pud was the only reference to
    next level page table and it was getting lost without
    freeing it. So, page leaks were happening.

Implement pud_free_pmd_page() and pmd_free_pte_page() to
enforce BBM and also free the leaking page tables.

Implementation requires,
 1) Clearing off the current pud/pmd entry
 2) Invalidation of TLB
 3) Freeing of the un-used next level page tables

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/mmu.c