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 42EE7C433EF for ; Wed, 16 Feb 2022 17:34:44 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nbQ80OSNcW2iTYEHZskJMHtrn7TPiLuC6cz7skasIAQ=; b=dk8DNa144CmGK4 ncbKc+xvTweES2HLAv+Xd2K2Wqw3owyjyt9CCYAjXjJud8jw1aPqazf6ZutzNfodUvPc0qHA+6aMr enUK8hwO1dld9VxvkMv1IIqvK3nla3dDn+IKegN2+NHwlh8Ai9QG0b4ZEah/wAW9Gi68HuGIq+yFq xub6aaldOO0SkWHetsdZ7h8DaE3zz6r/O2ikR4tXBruxK3lOXKtA3EAVM4XAZdBctp9SuqFsHTysk DILJzgT4uuMuxcSsrR/aN9HjptvV6yM/nAG5SK3i3jIGGBp3lfk/2roB1ynTvPExQMynTOyqQFi0I WB8jyK0IXdNqbD5iV6dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nKOBE-007y4S-Cp; Wed, 16 Feb 2022 17:33:28 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nKOAx-007xzc-RF for linux-arm-kernel@lists.infradead.org; Wed, 16 Feb 2022 17:33:13 +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 B391AB8112D; Wed, 16 Feb 2022 17:33:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 623A6C340F4; Wed, 16 Feb 2022 17:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645032788; bh=voJvq4Rmou7fyLLxjFArNEQHwBmwBB0Z6suNEBXdy+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YdwBB4/4Aw68ube9Dx04EGGMipIeEgnWWYhsxewAp3nQC/d2g6UPZjPFZX48wbpFC X/SRVGMGMfR5zUfo3UYUQZqqzSCNezC1+jx5lp9FCKSLrSo9/0DRPxxWv9TVO/qHoA 7DvzDb9gLP9U3jITM6eV/4pXuGBZ3gcZDSA5jwGaqG5prmmZCaXez5HH+uZ2q1bG49 b1OeAN+hhE3uUbHj4EqNDrvscNCEXilk9BfHLDglvNmuGxBUz0gRn2GK08Ddi1/a6h XDNMwAOu8rQUNEPvwnMklYbRZgFy7cnGnqAwye8EcTQPXiQFf0eD/Sxq5KnapQk983 FM4xpRaB5OyDA== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Joey Gouly , Branislav Rankov , Vincenzo Frascino , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v2 1/4] arm64/mte: Document ABI for asymmetric mode Date: Wed, 16 Feb 2022 17:32:21 +0000 Message-Id: <20220216173224.2342152-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220216173224.2342152-1-broonie@kernel.org> References: <20220216173224.2342152-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3035; h=from:subject; bh=voJvq4Rmou7fyLLxjFArNEQHwBmwBB0Z6suNEBXdy+o=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiDTUkK8+YUw8BGDqTdE5NReygx0c8Y23Gnmi8L2gO xxynCKKJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYg01JAAKCRAk1otyXVSH0JF8B/ 9fw4hpmMlIeHnr4HoqQLE/fymQPiRGxP/vKaH8NnX4Rm5w2n1VL0UMVYSdH6IEsWqaYDjJ1s2rOM6y ThL/rarcU7FHvFAVi8d1OA/5XNG+LY5qA6FAsEbL81Ery/HfWJowqfnEnehQJVKRtajqHdM1bxdF0X ErJ5GxlBovehLmAderffMscoIJ9XOEB36MxZ5h/i+9GiA5bZYerE4241f7aXj0+WXFlk1FoSFAg0aD vtanjgDzkP4y/5d28CxqOgDiFC5ZynxRHBMJMdGQ0nWeLwFKrrfTuAERddSYWl32HNIC60qgRD275P e9X0px5ed3RAPAwa/9grF6XjkYkpyf X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220216_093312_231901_2472D794 X-CRM114-Status: GOOD ( 19.39 ) 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 MTE3 adds a new mode which is synchronous for reads but asynchronous for writes. Document the userspace ABI for this feature, we call the new mode ASYMM and add a new prctl flag and mte_tcf_preferred value for it. Signed-off-by: Mark Brown --- .../arm64/memory-tagging-extension.rst | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Documentation/arm64/memory-tagging-extension.rst b/Documentation/arm64/memory-tagging-extension.rst index 7b99c8f428eb..42677d48a114 100644 --- a/Documentation/arm64/memory-tagging-extension.rst +++ b/Documentation/arm64/memory-tagging-extension.rst @@ -76,6 +76,9 @@ configurable behaviours: with ``.si_code = SEGV_MTEAERR`` and ``.si_addr = 0`` (the faulting address is unknown). +- *Asymmetric* - Reads are handled as for synchronous mode while writes + are handled as for asynchronous mode. + The user can select the above modes, per thread, using the ``prctl(PR_SET_TAGGED_ADDR_CTRL, flags, 0, 0, 0)`` system call where ``flags`` contains any number of the following values in the ``PR_MTE_TCF_MASK`` @@ -85,6 +88,7 @@ bit-field: (ignored if combined with other options) - ``PR_MTE_TCF_SYNC`` - *Synchronous* tag check fault mode - ``PR_MTE_TCF_ASYNC`` - *Asynchronous* tag check fault mode +- ``PR_MTE_TCF_ASYMM`` - *Asymmetric* tag check fault mode If no modes are specified, tag check faults are ignored. If a single mode is specified, the program will run in that mode. If multiple @@ -139,18 +143,23 @@ 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``. +privileged user may write the value ``async``, ``sync`` or ``asymm``. 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 is in the task's set of provided tag checking 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. +selected by the kernel using the preference order: + + 1. Asynchronous + 2. Asymmetric + 3. Synchronous + +If asymmetric mode is specified by the program but not supported by +either the system or the kernel then an error will be returned. Initial process state --------------------- -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel