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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 841ACC11F64 for ; Thu, 1 Jul 2021 17:06:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5700261369 for ; Thu, 1 Jul 2021 17:06:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5700261369 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qxTB8GKe64Mkd8E+jiKYFRdbh+FefHurVlDvzqTuXcA=; b=auCZ6Q6964s/if nybZwY8D2jY5Gq+8OarJqVOhnqJlUfnxXCXXfLQSWc/7/+eE/8J/HwhbkJv3x9WRZBYatAiXoQ4Yp wDdxTVXudN84ABUu0ZPjfT9tsg6LF2Hfo/YuIorfflSmJODIyMFUlOZ0K2JC5P3Pd5tWKDj8QCHZg KYUq5QqwUJZBaPmlmkdnMpi0/GqfH+lFqXGV2Rg6q6i9DhEBEP9xF0PG8Pgqu3KbLMuuOje/Zy6BR UGn3Hq3RNYbERkx+fYir1ro5HmXlErH6jp54nLewvEh9nUHx4XFkNIJQ7bfjy3cNrtyyrAw0o/Ouq gbDWE7syr/Rl4cc5RagQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lz07X-000WvZ-A2; Thu, 01 Jul 2021 17:04:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lz07T-000Wur-L1 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jul 2021 17:04:57 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8912461400; Thu, 1 Jul 2021 17:04:53 +0000 (UTC) Date: Thu, 1 Jul 2021 18:04:50 +0100 From: Catalin Marinas To: Peter Collingbourne Cc: Vincenzo Frascino , Will Deacon , Evgenii Stepanov , Szabolcs Nagy , Tejas Belagod , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v8 4/4] Documentation: document the preferred tag checking mode feature Message-ID: <20210701170450.GC12484@arm.com> References: <20210630231509.3773172-1-pcc@google.com> <20210630231509.3773172-5-pcc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210630231509.3773172-5-pcc@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210701_100455_755451_69F79891 X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 30, 2021 at 04:15:09PM -0700, Peter Collingbourne wrote: > +Per-CPU preferred tag checking mode > +----------------------------------- > + > +On some CPUs the performance of MTE in stricter tag checking modes > +is similar to that of less strict tag checking modes. This makes it > +worthwhile to enable stricter checks on those CPUs when a less strict > +checking mode is requested, in order to gain the error detection > +benefits of the stricter checks without the performance downsides. To > +support this scenario, a privileged user may configure a stricter > +tag checking mode as the CPU's preferred tag checking mode. > + > +The preferred tag checking mode for each CPU is controlled by > +``/sys/devices/system/cpu/cpu/mte_tcf_preferred``, to which a > +privileged user may write the value ``async`` or ``sync``. The default > +preferred mode for each CPU is ``async``. > + > +To allow a program to potentially run in the CPU's preferred tag > +checking mode, the user program may set multiple tag check fault mode > +bits in the ``flags`` argument to the ``prctl(PR_SET_TAGGED_ADDR_CTRL, > +flags, 0, 0, 0)`` system call. If the CPU's preferred tag checking > +mode is in the task's set of provided tag checking modes (this will > +always be the case at present because the kernel only supports two > +tag checking modes, but future kernels may support more modes), that > +mode will be selected. Otherwise, one of the modes in the task's mode > +set will be selected in a currently unspecified manner. I'm ok with leaving this undefined (it's in the spirit of many architecture features ;)). In practice we may choose async or asym over sync but the user shouldn't care if it passed multiple flags. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel