]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kpti-ng: simplify page table traversal logic
authorArd Biesheuvel <ardb@kernel.org>
Thu, 9 Jun 2022 17:43:19 +0000 (19:43 +0200)
committerWill Deacon <will@kernel.org>
Thu, 23 Jun 2022 17:26:13 +0000 (18:26 +0100)
commitec9bee64eddc4e0ede708d3bcf9bc5999f0c6390
tree36a49cb36092aaf46b1f6c7b2dde8ac652fab926
parent08aafa0d475a08e31a13403e9df41c7179f4bdcd
arm64: kpti-ng: simplify page table traversal logic

Simplify the KPTI G-to-nG asm helper code by:
- pulling the 'table bit' test into the get/put macros so we can combine
  them and incorporate the entire loop;
- moving the 'table bit' test after the update of bit #11 so we no
  longer need separate next_xxx and skip_xxx labels;
- redefining the pmd/pud register aliases and the next_pmd/next_pud
  labels instead of branching to them if the number of configured page
  table levels is less than 3 or 4, respectively.

No functional change intended, except for the fact that we now descend
into a next level table after setting bit #11 on its descriptor but this
should make no difference in practice.

While at it, switch to .L prefixed local labels so they don't clutter up
the symbol tables, kallsyms, etc, and clean up the indentation for
legibility.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20220609174320.4035379-2-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/mm/proc.S