]> Gentwo Git Trees - linux/.git/commit
ARM64: Base TLB functions
authorChristoph Lameter (Ampere) <cl@linux.com>
Thu, 7 Dec 2023 04:11:49 +0000 (20:11 -0800)
committerChristoph Lameter (Ampere) <cl@linux.com>
Wed, 20 Dec 2023 15:20:52 +0000 (07:20 -0800)
commit0dd5575294791922e28507c35a4fa12e64fab239
tree29ac79c15a2dfac57b8834c6c81268dc6a810634
parent699cfefdfd493bdb590232a1a20f14cb6b7f041b
ARM64: Base TLB functions

Add a series of TLB function that allow TLB flushing in a variety of
ways depending on the mode encoded in enum tlb_state:

TLB_BROADCOAST -> Use single TLBI propagated to all units via the mesh
TLB_LOCAL -> Use TLBI that only perform local flushes
TLB_IPI -> Use TLBIs that perform local flushes on multiple cpus
TLB_NONE -> Suppress TLBI because there are no users of the address space

The tlb mode is determined based on the cpus included in the cpumask
of an address space. A TLB entry can only be present in a cpus
TLB cache if code from the address space has been running on a
particular cpu.

The TLB operation modes can be controlled via

1. A tlb_mode kernel config option at boot time

Pass tlb_mode=XXX on the kernel command line.

2. /sys/kernel/debug/arm64/tlb_mode at run time

The lower 10 bits encode the weight of the cpumask. If the cpumask has more than
this weight then TLB_BROADCAST mode is selected. For lower weigths TLB_IPI is used.
A zero disables this functionality. The system will calculate a weight that depends
on the number of cpus in the system if not specified on the kernel command line.

Bit 10 enables TLB_LOCAL mode. TLB_LOCAL causes only local invalidates when the
address space has only been used by the local cpu.

Bit 11 enables TLBI range instructions

Bit 12 enables TLBI suppression if an address space does not record any use by a cpu.

Signed-off-by: Christoph Lameter (Ampere) <cl@linux.com>
arch/arm64/mm/context.c