mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
UPSTREAM: 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>
Bug: 170327579
Bug: 172318110
(cherry picked from commit 83b5bd628f)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ib7374b4f2ae8353afd062f740a355248507efa01
This commit is contained in:
committed by
Alexander Potapenko
parent
9a928af2cc
commit
c7d0729a2c
@@ -219,18 +219,28 @@ do { \
|
|||||||
* The Tag check override (TCO) bit disables temporarily the tag checking
|
* The Tag check override (TCO) bit disables temporarily the tag checking
|
||||||
* preventing the issue.
|
* 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),
|
asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(0),
|
||||||
ARM64_MTE, CONFIG_KASAN_HW_TAGS));
|
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();
|
||||||
|
|
||||||
__uaccess_disable(ARM64_HAS_PAN);
|
__uaccess_disable(ARM64_HAS_PAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void uaccess_enable_privileged(void)
|
static inline void uaccess_enable_privileged(void)
|
||||||
{
|
{
|
||||||
asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
|
__uaccess_enable_tco();
|
||||||
ARM64_MTE, CONFIG_KASAN_HW_TAGS));
|
|
||||||
|
|
||||||
__uaccess_enable(ARM64_HAS_PAN);
|
__uaccess_enable(ARM64_HAS_PAN);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user