Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp421486pxb; Tue, 9 Feb 2021 04:00:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKh/gZlWxnmKeMKX9HPwtloAJ7WwYIh8AHunxOck+2XHGuJg+FwFnUzTYNDGBnaDzcuDoK X-Received: by 2002:a05:6402:b0f:: with SMTP id bm15mr8162776edb.133.1612872035198; Tue, 09 Feb 2021 04:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612872035; cv=none; d=google.com; s=arc-20160816; b=1JLN8+32ZfMNp/0GK9mnlbyI54+NUjqT+sw0rn0ZUStriBVrIQApfC3nb0dMJT4Sz+ CklKkJjFBLHNjeAYvETCgdC1THvhqRY7OpFfjIuc8UULlt8nrVgD7xfBxnHqWkmXtDCc 8zwQoD/aN8tFnp8zEMkYJhDYxDisMCnye6Re02hcjOe7JcOqmZbnfwUcTbW3TDAFK4wS FcSRLC7glMsJH8WYmaI0OA7vctyUXNQIvQ59A6CxJBHJspWl/78kHfHUJhk2eOkT+mO7 EU49eEEfBP66jX5HvfLLHkCH8Z5h4TY9CY3lxnxI73Bg7v4joZsL3PTHb1HNEcoOJ4XD 714g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mUnFdkhqe/qPdJcfAo6ak44ehFoo34zv3JZN221m6u4=; b=ernXzpsIhog9+hgxd+RK8COdySTzu9xEnqyuSo7J6fL4jImN1GcN1hQQ873AKgcxhM F76t8JeKWjDmMD5vpBFuRbnDs2ZO0vOPe9/tPmFNMospntArpPz0PayV4SQkoAg877Xm wbRIu+S6sUxSE5SFY7hkRN6tOluPvaddMxFgB8cjLbm6VvcARQQXY9nWADF0iGinnkYA g6Oo+NQAo1WdbNZs8AUjctDwRZrFPA5xjJwXoZazafHPqHHBcwrIQP7U9xOMWTaeYn6d H9aSuTn6Mt5JilYLGXtL39HL3fhoQNZcCZIIMfJh7nK1CI2sF61PnngAohYffa4M2J1U GH3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu8si4646877edb.349.2021.02.09.04.00.10; Tue, 09 Feb 2021 04:00:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbhBIL62 (ORCPT + 99 others); Tue, 9 Feb 2021 06:58:28 -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