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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 84CF6C433EF for ; Fri, 28 Jan 2022 17:16:33 +0000 (UTC) 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=M/bxBqQ0bD/j4/HKPIzE0Ou3M8yl1QClB5gXca2D56Y=; b=JW+PJv7KhuBsyY vv3QaLxLl1supBHIFDlq4X5rCgvxqdCnG7GK+cYf3SsxLn4XeuVx3LE0FGrd3euXRDYLuKs+xqpSt jxQ2VxoV7Y7tBc387gKwDU6XeIHmjvsvsl2PNDXAib3OIxzNwNBkw9IgkTI+QGxZcIZoWFyULVZqI +qbGkMktXTcsfGScXQsBVwPL2yZIHJbt71x320c9w1IN9m07NEqH3/FUiqjGWLateCYZ4YWorKzqe 0U36CzGtsyjukrL2//pkCVLfMNK4Uo+SCyQ4XgdFG+8Tw8pWkTpjBtws0U4v+RS+RKQ79hvrJJRrp IrlH07ZOo0c+kGjCpzGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDUqL-003A8S-Ab; Fri, 28 Jan 2022 17:15:25 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDUqH-003A7e-5y for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 17:15:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CEDC7B82683; Fri, 28 Jan 2022 17:15:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F315C340E7; Fri, 28 Jan 2022 17:15:17 +0000 (UTC) Date: Fri, 28 Jan 2022 17:15:14 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Joey Gouly , Branislav Rankov , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 4/4] arm64/mte: Add userspace interface for enabling asymmetric mode Message-ID: References: <20220127195712.748150-1-broonie@kernel.org> <20220127195712.748150-5-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220127195712.748150-5-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_091521_391545_FA496B8F X-CRM114-Status: GOOD ( 27.13 ) 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 Thu, Jan 27, 2022 at 07:57:12PM +0000, Mark Brown wrote: > The architecture provides an asymmetric mode for MTE where tag mismatches > are checked asynchronously for reads but synchronously for loads. Allow > userspace processes to select this and make it available as a default mode > via the existing per-CPU sysfs interface. > > Since there PR_MTE_TCF_ values are a bitmask (allowing the kernel to choose > between the multiple modes) and there are no free bits adjacent to the > existing PR_MTE_TCF_ bits the set of bits used to specify the mode becomes > disjoint. Programs using the new interface should be aware of this and > programs that do not use it will not see any change in behaviour. > > When userspace requests two possible modes but the system default for the > CPU is the third mode (eg, default is synchronous but userspace requests > either asynchronous or asymmetric) the preference order is: > > ASYMM > ASYNC > SYNC > > This situation is not currently possible since there are only two modes and > it is mandatory to have a system default so there could be no ambiguity and > there is no ABI change. The chosen order is basically arbitrary as we do not > have a clear metric for what is better here. > > If userspace requests specifically asymmetric mode via the prctl() and the > system does not support it then we will return an error, this mirrors > how we handle the case where userspace enables MTE on a system that does > not support MTE at all and the behaviour that will be seen if running on > an older kernel that does not support userspace use of asymmetric mode. > > Attempts to set asymmetric mode as the default mode will result in an error > if the system does not support it. > > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel