]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: Remove useless UAO IPI and describe how this gets enabled
authorJames Morse <james.morse@arm.com>
Wed, 6 Apr 2022 16:45:05 +0000 (17:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2022 05:52:13 +0000 (07:52 +0200)
commit7f319f30e417373dd865a54a8748a87e2e0d6ec2
tree7dea4bbeea12590ae8a5f4b65b81bb6f7222ee35
parent6e1ad7a49b2e6fe5c6932e84145dd5bfd08ae937
arm64: Remove useless UAO IPI and describe how this gets enabled

commit c8b06e3fddddaae1a87ed479edcb8b3d85caecc7 upstream.

Since its introduction, the UAO enable call was broken, and useless.
commit 2a6dcb2b5f3e ("arm64: cpufeature: Schedule enable() calls instead
of calling them via IPI"), fixed the framework so that these calls
are scheduled, so that they can modify PSTATE.

Now it is just useless. Remove it. UAO is enabled by the code patching
which causes get_user() and friends to use the 'ldtr' family of
instructions. This relies on the PSTATE.UAO bit being set to match
addr_limit, which we do in uao_thread_switch() called via __switch_to().

All that is needed to enable UAO is patch the code, and call schedule().
__apply_alternatives_multi_stop() calls stop_machine() when it modifies
the kernel text to enable the alternatives, (including the UAO code in
uao_thread_switch()). Once stop_machine() has finished __switch_to() is
called to reschedule the original task, this causes PSTATE.UAO to be set
appropriately. An explicit enable() call is not needed.

Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/processor.h
arch/arm64/kernel/cpufeature.c
arch/arm64/mm/fault.c