Re: [PATCH v3] arm64: mte: Move MTE TCF0 check in entry-common

2021-04-09 Thread Catalin Marinas
On Fri, Apr 09, 2021 at 05:18:45PM +0100, Mark Rutland wrote: > On Fri, Apr 09, 2021 at 03:32:47PM +0100, Mark Rutland wrote: > > Hi Vincenzo, > > > > On Fri, Apr 09, 2021 at 02:24:19PM +0100, Vincenzo Frascino wrote: > > > The check_mte_async_tcf macro sets the TIF flag non-atomically. This can >

Re: [PATCH v3] arm64: mte: Move MTE TCF0 check in entry-common

2021-04-09 Thread Mark Rutland
On Fri, Apr 09, 2021 at 03:32:47PM +0100, Mark Rutland wrote: > Hi Vincenzo, > > On Fri, Apr 09, 2021 at 02:24:19PM +0100, Vincenzo Frascino wrote: > > The check_mte_async_tcf macro sets the TIF flag non-atomically. This can > > race with another CPU doing a set_tsk_thread_flag() and all the other

Re: [PATCH v3] arm64: mte: Move MTE TCF0 check in entry-common

2021-04-09 Thread Catalin Marinas
On Fri, Apr 09, 2021 at 02:24:19PM +0100, Vincenzo Frascino wrote: > diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c > index b3c70a612c7a..84a942c25870 100644 > --- a/arch/arm64/kernel/mte.c > +++ b/arch/arm64/kernel/mte.c > @@ -166,14 +166,43 @@ static void set_gcr_el1_excl(u64 excl

Re: [PATCH v3] arm64: mte: Move MTE TCF0 check in entry-common

2021-04-09 Thread Mark Rutland
Hi Vincenzo, On Fri, Apr 09, 2021 at 02:24:19PM +0100, Vincenzo Frascino wrote: > The check_mte_async_tcf macro sets the TIF flag non-atomically. This can > race with another CPU doing a set_tsk_thread_flag() and all the other flags > can be lost in the process. > > Move the tcf0 check to enter_f