From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36E8CC433E9 for ; Tue, 9 Feb 2021 11:58:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D972C64E3B for ; Tue, 9 Feb 2021 11:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230126AbhBIL6b (ORCPT ); Tue, 9 Feb 2021 06:58:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:51646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbhBIL4T (ORCPT ); Tue, 9 Feb 2021 06:56:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB61664E3B; Tue, 9 Feb 2021 11:55:35 +0000 (UTC) Date: Tue, 9 Feb 2021 11:55:33 +0000 From: Catalin Marinas To: Vincenzo Frascino Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Andrew Morton , Will Deacon , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Andrey Konovalov , Lorenzo Pieralisi Subject: Re: [PATCH v12 6/7] arm64: mte: Save/Restore TFSR_EL1 during suspend Message-ID: <20210209115533.GE1435@arm.com> References: <20210208165617.9977-1-vincenzo.frascino@arm.com> <20210208165617.9977-7-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210208165617.9977-7-vincenzo.frascino@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 04:56:16PM +0000, 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 of the register resulting in > a spurious tag check fault report. > > Save/restore the state of the TFSR_EL1 register during the > suspend/resume operations to prevent this to happen. 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). If that's the case, it would make more sense to store the TFSR* regs in the thread_struct alongside sctlr_tcf0. If we did that, we'd not need the per-cpu mte_suspend_tfsr_el1 variable. -- Catalin