From: Mark Rutland <mark.rutland@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: Move PSTATE.TCO setting to separate functions
Date: Thu, 7 Jan 2021 11:37:31 +0000 [thread overview]
Message-ID: <20210107113731.GC7523@C02TD0UTHF1T.local> (raw)
In-Reply-To: <20210104124715.12826-1-catalin.marinas@arm.com>
On Mon, Jan 04, 2021 at 12:47:15PM +0000, Catalin Marinas wrote:
> 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>
> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Mark.
> ---
> arch/arm64/include/asm/uaccess.h | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
> index 6f986e09a781..534a7d33b12f 100644
> --- a/arch/arm64/include/asm/uaccess.h
> +++ b/arch/arm64/include/asm/uaccess.h
> @@ -159,6 +159,18 @@ static inline void __uaccess_enable_hw_pan(void)
> CONFIG_ARM64_PAN));
> }
>
> +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));
> +}
> +
> /*
> * The Tag Check Flag (TCF) mode for MTE is per EL, hence TCF0
> * affects EL0 and TCF affects EL1 irrespective of which TTBR is
> @@ -178,8 +190,7 @@ static inline void __uaccess_enable_hw_pan(void)
> */
> static inline void uaccess_disable_privileged(void)
> {
> - asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(0),
> - ARM64_MTE, CONFIG_KASAN_HW_TAGS));
> + __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;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2021-01-07 11:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 12:47 [PATCH] arm64: Move PSTATE.TCO setting to separate functions Catalin Marinas
2021-01-04 14:06 ` Vincenzo Frascino
2021-01-07 11:37 ` Mark Rutland [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210107113731.GC7523@C02TD0UTHF1T.local \
--to=mark.rutland@arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox