Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9911f2a authored by Will Deacon's avatar Will Deacon Committed by Isaac J. Manjarres
Browse files

UPSTREAM: arm64: pgtable: Fix pte_accessible()



pte_accessible() is used by ptep_clear_flush() to figure out whether TLB
invalidation is necessary when unmapping pages for reclaim. Although our
implementation is correct according to the architecture, returning true
only for valid, young ptes in the absence of racing page-table
modifications, this is in fact flawed due to lazy invalidation of old
ptes in ptep_clear_flush_young() where we elide the expensive DSB
instruction for completing the TLB invalidation.

Rather than penalise the aging path, adjust pte_accessible() to return
true for any valid pte, even if the access flag is cleared.

Bug: 176475096
Change-Id: Ifd7919b4e9b790a94802b0115f93a9a260757036
Cc: <stable@vger.kernel.org>
Fixes: 76c714be ("arm64: pgtable: implement pte_accessible()")
Reported-by: default avatarYu Zhao <yuzhao@google.com>
Acked-by: default avatarYu Zhao <yuzhao@google.com>
Reviewed-by: default avatarMinchan Kim <minchan@kernel.org>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20201120143557.6715-2-will@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
(cherry picked from commit 07509e10dcc77627f8b6a57381e878fe269958d3)
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 032e6438
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment