mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
arm64: Move PSTATE.TCO setting to separate functions
For consistency with __uaccess_{disable,enable}_hw_pan(), move the
PSTATE.TCO setting into dedicated __uaccess_{disable,enable}_tco()
functions.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
This commit is contained in:
parent
f34d93f30d
commit
83b5bd628f
|
|
@ -176,10 +176,21 @@ static inline void __uaccess_enable_hw_pan(void)
|
|||
* The Tag check override (TCO) bit disables temporarily the tag checking
|
||||
* preventing the issue.
|
||||
*/
|
||||
static inline void uaccess_disable_privileged(void)
|
||||
static inline void __uaccess_disable_tco(void)
|
||||
{
|
||||
asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(0),
|
||||
ARM64_MTE, CONFIG_KASAN_HW_TAGS));
|
||||
}
|
||||
|
||||
static inline void __uaccess_enable_tco(void)
|
||||
{
|
||||
asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
|
||||
ARM64_MTE, CONFIG_KASAN_HW_TAGS));
|
||||
}
|
||||
|
||||
static inline void uaccess_disable_privileged(void)
|
||||
{
|
||||
__uaccess_disable_tco();
|
||||
|
||||
if (uaccess_ttbr0_disable())
|
||||
return;
|
||||
|
|
@ -189,8 +200,7 @@ static inline void uaccess_disable_privileged(void)
|
|||
|
||||
static inline void uaccess_enable_privileged(void)
|
||||
{
|
||||
asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
|
||||
ARM64_MTE, CONFIG_KASAN_HW_TAGS));
|
||||
__uaccess_enable_tco();
|
||||
|
||||
if (uaccess_ttbr0_enable())
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user