powerpc/code-patching: Consolidate and cache per-cpu patching context
authorBenjamin Gray <bgray@linux.ibm.com>
Wed, 9 Nov 2022 04:51:12 +0000 (15:51 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 06:54:06 +0000 (17:54 +1100)
commit2f228ee1ade5d8d1f26cf94863a36c5693023c58
tree7edcbd23bd5797bd3bfcd8949a46da0897339744
parentc28c15b6d28a776538482101522cbcd9f906b15c
powerpc/code-patching: Consolidate and cache per-cpu patching context

With the temp mm context support, there are CPU local variables to hold
the patch address and pte. Use these in the non-temp mm path as well
instead of adding a level of indirection through the text_poke_area
vm_struct and pointer chasing the pte.

As both paths use these fields now, there is no need to let unreferenced
variables be dropped by the compiler, so it is cleaner to merge them
into a single context struct. This has the additional benefit of
removing a redundant CPU local pointer, as only one of cpu_patching_mm /
text_poke_area is ever used, while remaining well-typed. It also groups
each CPU's data into a single cacheline.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
[mpe: Shorten name to 'area' as suggested by Christophe]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221109045112.187069-10-bgray@linux.ibm.com
arch/powerpc/lib/code-patching.c