Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-09 Thread Vincenzo Frascino
On 2/9/21 5:28 PM, Catalin Marinas wrote: >> I don't think though you can "check" with IRQs disabled so I suspect >> that TFSR_EL1 has to be saved/restored (which means that there is a >> black out period where we run kernel code without being able to detect >> faults but there is no solution to th

Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-09 Thread Catalin Marinas
On Tue, Feb 09, 2021 at 02:33:28PM +, Lorenzo Pieralisi wrote: > On Tue, Feb 09, 2021 at 11:55:33AM +, Catalin Marinas wrote: > > On Mon, Feb 08, 2021 at 04:56:16PM +, Vincenzo Frascino wrote: > > > When MTE async mode is enabled TFSR_EL1 contains the accumulative > > > asynchronous tag

Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-09 Thread Vincenzo Frascino
On 2/9/21 2:33 PM, Lorenzo Pieralisi wrote: >> Do we need a similar fix for TFSRE0_EL1? We get away with this if >> suspend is only entered on the idle (kernel) thread but I recall we >> could also enter suspend on behalf of a user process (I may be wrong >> though). > Yes, when we suspend the m

Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-09 Thread Lorenzo Pieralisi
On Tue, Feb 09, 2021 at 11:55:33AM +, Catalin Marinas wrote: > On Mon, Feb 08, 2021 at 04:56:16PM +, Vincenzo Frascino wrote: > > When MTE async mode is enabled TFSR_EL1 contains the accumulative > > asynchronous tag check faults for EL1 and EL0. > > > > During the suspend/resume operation

Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-09 Thread Catalin Marinas
On Mon, Feb 08, 2021 at 04:56:16PM +, Vincenzo Frascino wrote: > When MTE async mode is enabled TFSR_EL1 contains the accumulative > asynchronous tag check faults for EL1 and EL0. > > During the suspend/resume operations the firmware might perform some > operations that could change the state

Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-09 Thread Vincenzo Frascino
Hi Lorenzo, thank you for your review. On 2/8/21 6:56 PM, Lorenzo Pieralisi wrote: >> u64 gcr_kernel_excl __ro_after_init; >> >> +static u64 mte_suspend_tfsr_el1; > IIUC you need this per-CPU (core loses context on suspend-to-RAM but also > CPUidle, S2R is single threaded but CPUidle runs on e

Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-08 Thread Lorenzo Pieralisi
On Mon, Feb 08, 2021 at 04:56:16PM +, Vincenzo Frascino wrote: > When MTE async mode is enabled TFSR_EL1 contains the accumulative > asynchronous tag check faults for EL1 and EL0. > > During the suspend/resume operations the firmware might perform some > operations that could change the state

[PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend

2021-02-08 Thread Vincenzo Frascino
When MTE async mode is enabled TFSR_EL1 contains the accumulative asynchronous tag check faults for EL1 and EL0. During the suspend/resume operations the firmware might perform some operations that could change the state of the register resulting in a spurious tag check fault report. Save/restore