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 DD9EFC433F5 for ; Thu, 27 Jan 2022 20:06:51 +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=hhb6pm1vOOC8n0FJJMtdBHXKamhA6dOJUXPJYqhJ7Es=; b=svSXJiCW/LsvcN nPY07rb4Y/Cy1U/UmOpG2PRTb+ZZcyLWJnexv5Ra8EDsLTcytcLXT6W186WWLXm/zlUC114P6SJlH vbAZ6s1hbbPHWBB5pvqu/GcP5p/NYSnJXxVN6DKgfZGjH1X+ehCKDYEPY1iWysOE8QmMbpNIBhzLR RY3lDvmbTPM8tfrTG+x8msd9dZ9tkfY9mRMSSzP9GZ7vzhlLmUYXIOEFH9EqEcK6kWMuTV8WsKK77 pIk+lSOX6/ihVcyKjd4MWK1bYOEGMLt/KvpKUec9mwymcbZVoYqtJBRoqDgy/HksJf6Qn4yqcYR5g rqJgPf7p3W1sa4GiGghQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDB1S-00H20y-Gu; Thu, 27 Jan 2022 20:05:34 +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 1nDB1D-00H1xh-7D for linux-arm-kernel@lists.infradead.org; Thu, 27 Jan 2022 20:05:21 +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 E925CB82355; Thu, 27 Jan 2022 20:05:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BDF4C340E8; Thu, 27 Jan 2022 20:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643313916; bh=E6+bTYuZuh+X4fO+HrVLF8sAHC5idET8b5P1DaDdS8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eSPYug8G5HuhTFtyEcjai/6Rv9pBhYuji5oFATyIcSP4aDt9BxbQrdaxouYcramx2 D0SLtEtGT0THVcf15zUll+wYQ96k4+nh/fGXViHZ5Rlk/IWFt6jfbV6NA0Qte23fLa 1aXY+AKSqPX54u4Ox44aYFJmR0AapSvtPcat26MhpTmRX+DGW0b2iDd3Cblh+Mgen4 ju1hk3Tz9dbqXIXTq3pw+nB0oKCJr38r9dEKDDqU2vHF/yPd83cOirmb5umMGjFceH d5FH933PpOWp7AjVbbIF7nYpQgEeWPeaNn/jQXou3lAXaXlCcqSlsDUjfAo00DrY3k cOFSvL088L7wA== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Joey Gouly , Branislav Rankov , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v1 1/4] arm64/mte: Document ABI for asymmetric mode Date: Thu, 27 Jan 2022 19:57:09 +0000 Message-Id: <20220127195712.748150-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220127195712.748150-1-broonie@kernel.org> References: <20220127195712.748150-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2733; h=from:subject; bh=E6+bTYuZuh+X4fO+HrVLF8sAHC5idET8b5P1DaDdS8Y=; b=owGbwMvMwMWocq27KDak/QLjabUkhsRPP0U4nR/mJyoWGcjdZju4J7WreMVb7vgt2pMiatnEToZv zF/YyWjMwsDIxSArpsiy9lnGqvRwia3zH81/BTOIlQlkCgMXpwBMJN6G/a/Y2hdlf/ZFdohoBeSLpP F2+fLG3l8aePw/owXrjRMTdtirvhFh3LuruqLg/dQrVo8NZJW2a5j4N7+UOhtwqnVOSNBBpuwDujmR F47tET/FMLtr5Wn5bXPWT+dTnSj5f92nNqkvVebMXGePBX4uuh/SU/7zgZvNhgnru6vWK35xXhXZX8 b47M9eExZGx0nz/vksub58qXF7my9HxPl8HZ7KrO+u0VMFvqwrNUuXjnZq+VOkF9RRn8l9/8gj5Suy lt22+e+uJtUzam7M7p5qcP8z38zAG9nbDQVcwlyzbaMNku/P8p7bsk2rUX7z/XdhFq9MI2V1Hq1mWZ fazhne9TaF1c7ra7XKj5WFiT3TAA== 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-20220127_120519_584784_A5D3F76C X-CRM114-Status: GOOD ( 17.40 ) 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 writes but asynchronous for reads. 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 --- Documentation/arm64/memory-tagging-extension.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/arm64/memory-tagging-extension.rst b/Documentation/arm64/memory-tagging-extension.rst index 7b99c8f428eb..5218b838d062 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,16 +143,14 @@ 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. -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel