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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 61F42C388F9 for ; Tue, 27 Oct 2020 11:36:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DE1FC22263 for ; Tue, 27 Oct 2020 11:36:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zxMpbqbG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="K1k2/+ZS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="K1k2/+ZS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE1FC22263 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID: Subject: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=yxG87Y0uZgKLkXDtUipwY8qchbnG1WXIeGXzSrqG4MY=; b=zxMpbqbGGCAezGGyb/t6fC583 iNMZHYq3fOCUOW7Kvnh7VqmO0hI5iLDildj32byEvOyMJmU4OXpmz1ahqv9N6hpTL7hTiiaVNpfL3 f9Eb+psvxOkWnjEPoBjNEbUC+/pW8kQe2KYH6/rLTL7uDutEeAO8UWHz1/LUkjzKPEk8A5fnlyT4r oY4bXJm8c3wCEkKss+QGNiWZ48BooQ/5DcyJ5TekorZYuevGEXNHXLEe3CZSBKS0F+ySx+5COJp/Q YvyO8LMiQ/eJBIdOmnWZ8/Hvy6skbEaOLuUsRH/fnpZBpLKn71QcDeErZTfTk+WUOjujl4qbDYFdZ f9O5zXz3Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXNGz-0005KA-70; Tue, 27 Oct 2020 11:36:17 +0000 Received: from mail-eopbgr150079.outbound.protection.outlook.com ([40.107.15.79] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXNEl-0004D8-Iu for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 11:34:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v+h/4Vmnv/EfIpahd36tY+lQBAGHXyRUmvowxi73Pzs=; b=K1k2/+ZSugwVBvpxHe9nR5EKW0Klhdjckn7uyZlhNCUArdaJ1tsQjv+wi/TiJQS5FqiAidh+7gWIGpgPakIzTDVxJ2ki4fWs5XrchnGZeNvW9VXS1lL3ebsweu/qVrpYrWNK1JBrg6DxfE7lvXDZHJ8M6ja0ZyejrVjm6qEq2VM= Received: from DB6PR0601CA0034.eurprd06.prod.outlook.com (2603:10a6:4:17::20) by VI1PR0802MB2414.eurprd08.prod.outlook.com (2603:10a6:800:b2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.27; Tue, 27 Oct 2020 11:33:54 +0000 Received: from DB5EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:17:cafe::26) by DB6PR0601CA0034.outlook.office365.com (2603:10a6:4:17::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 27 Oct 2020 11:33:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.infradead.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.infradead.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT017.mail.protection.outlook.com (10.152.20.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 27 Oct 2020 11:33:54 +0000 Received: ("Tessian outbound c579d876a324:v64"); Tue, 27 Oct 2020 11:33:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 66aede7cccf066d7 X-CR-MTA-TID: 64aa7808 Received: from 0ecc9bd25a7b.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F6DBA209-2186-4A29-99FB-C895AE45F8CB.1; Tue, 27 Oct 2020 11:33:41 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0ecc9bd25a7b.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 27 Oct 2020 11:33:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nIQEh43HvcWynMm0yf5g4cm0v/ckBRHmbNpa3oVwFQsHO7ccodLk2nba6V3npLXC9XoxfwPyv+2auOewlVJWqqPX/i/F2jB0IVQOLxtPoP9D+7VWV7vcx6qkFCNWDtba9DgRZjZ9Rjh5SWiqRZwdr9S7mf001jB5LmtuvK8q/qla/l0n0DYnRNs4tFdp6vaOAHtN7dh1QAP95+SCXQAzXbDv2x+7vcd+INozog1FLgrlsrsAzwF/TMBn5HMXRb6nr4py7UOx14XNA9ZKlH0BqESQQsyyTTAFe7vdm5EDzRL8YKqOpGGVGFlsNAfShriJYwpq9DO8XTa/uzqgFipjeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v+h/4Vmnv/EfIpahd36tY+lQBAGHXyRUmvowxi73Pzs=; b=GJP0KbEbtA+6tapewmzxuL7YNV4AgOpkJ2rXXTidGSSPGKA01WvsSF85kIWSatzHOjmC4aDZ5Rt5llUhcwFQd5Y786YzuPLsEKYcn7iFAQc/7J58TpDG9vFldh6YwQxX6rsoO2YYH5tSPmK/ptY9sBU5UaKNInszRy0sVZjeR2ggwU3YEA8RoRyCyFKPsAdUAuHw9AUUaL9BRrpDo7DGVsjLIb1/wjwtoF5C1uaC8M0xHWZj6PwKIeLWT6xtLJZO2ipFlcG5OsePsh5qop9cj1xslAVPiwf7QRR/qqS5PDqGUKiEH5MoMS3Tq4v0RjozfRWvs89FF2Xh7/hASR90Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v+h/4Vmnv/EfIpahd36tY+lQBAGHXyRUmvowxi73Pzs=; b=K1k2/+ZSugwVBvpxHe9nR5EKW0Klhdjckn7uyZlhNCUArdaJ1tsQjv+wi/TiJQS5FqiAidh+7gWIGpgPakIzTDVxJ2ki4fWs5XrchnGZeNvW9VXS1lL3ebsweu/qVrpYrWNK1JBrg6DxfE7lvXDZHJ8M6ja0ZyejrVjm6qEq2VM= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from VE1PR08MB5566.eurprd08.prod.outlook.com (2603:10a6:800:1a9::7) by VI1PR08MB3055.eurprd08.prod.outlook.com (2603:10a6:803:4e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Tue, 27 Oct 2020 11:33:33 +0000 Received: from VE1PR08MB5566.eurprd08.prod.outlook.com ([fe80::479:8cf9:caa1:5477]) by VE1PR08MB5566.eurprd08.prod.outlook.com ([fe80::479:8cf9:caa1:5477%6]) with mapi id 15.20.3477.028; Tue, 27 Oct 2020 11:33:33 +0000 Date: Tue, 27 Oct 2020 11:33:24 +0000 From: Szabolcs Nagy To: Catalin Marinas Subject: Re: [PATCH] arm64: mte: Document that user PSTATE.TCO is ignored by kernel uaccess Message-ID: <20201027113324.GX3819@arm.com> References: <20201026121656.26096-1-catalin.marinas@arm.com> <20201026131414.GA24349@willie-the-truck> <20201026141759.GC3117@gaia> Content-Disposition: inline In-Reply-To: <20201026141759.GC3117@gaia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.54] X-ClientProxiedBy: DM6PR08CA0003.namprd08.prod.outlook.com (2603:10b6:5:80::16) To VE1PR08MB5566.eurprd08.prod.outlook.com (2603:10a6:800:1a9::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.54) by DM6PR08CA0003.namprd08.prod.outlook.com (2603:10b6:5:80::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 27 Oct 2020 11:33:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4115f8b5-706c-4284-8065-08d87a6c2f64 X-MS-TrafficTypeDiagnostic: VI1PR08MB3055:|VI1PR0802MB2414: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 2JuMoT0pdgp9mcegIxBfHdDQpZ0O7sZ7KcZzEHmhbYLiEGAPxcVpIlHw7M88/tU8f/v5hOo9tdSp8m3SSHqySeUp4H/W47WPGDNPi3ErSwxrh10iJGRZ5fdpVleYzWgfZTll4GGmqwnJqCWxg7oCsXWdBSXBXoreXJzRtCeRk4I8r4t0hwPxl8WOm9VKsOneiPqWt2GFrUTPiUlH4NSrKzwxkL8dDFFEN2MbhfiSVi39629k9iCnPl2JBBrMruAoAvkR8zV/RrnyEdfsF3Bk9tZ2Jl8IKImdKCyPG6WSZcRL4s+AD38lcBK0O80HvAlrTFyz1UNos1EgREG8t0JaNA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB5566.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(366004)(396003)(346002)(376002)(6636002)(1076003)(8936002)(6862004)(36756003)(8676002)(186003)(83380400001)(86362001)(33656002)(6666004)(956004)(26005)(16526019)(55016002)(2616005)(478600001)(44832011)(7696005)(8886007)(316002)(52116002)(54906003)(66476007)(4326008)(2906002)(66556008)(66946007)(5660300002)(37006003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wLvwzjq5xN8dd8KkABLB34J+/MCELJ/uHBdX4opQrnLiagnPjQy4Vj2zA088LXFZLF6ZzloKEF+8UOxkrVP6Ey+kdpWWyT+18jqxpVsZX++iR4T/c4AJFdhg2rpJe261js10jqS7fHQY3aA+1XoOsI5UuT7sqTqCKfh1Qeaen8HwVutRXukQQILHK7tPEdSJWvxGc9db7Neex10IV11RCpohOP9yqYd6b9FIPp6AB9SXpgJNbBl/CJOo/6i86pk/rw/Cd8lRbC2AcmPLXWZ6CEBNKwQT0h8eYBqRB18aaNPrg+hVUQOCww3NSoTm7NEqYv3NepvVAYb7M0LNpq1dLohnqCQGS8IURyllPZjEzlGETrvpCEAxapD0WA+6vNDa3eRp+9TjoSdMgavkqUsdgHg2bJBEXsdK5sbCfTB4QYVbEypk8c139ryam/Al1BCdTzx9yx4al0MLQk/RbPuK1AlHn3i9jw+qy/cyW5fJDJ23NObNRYUoeWH2jQhMwMX20YJxohm4zifaUlXsELXiZFbLCXQS7lzLfi3rpeW9s1bZQQCaQ4nvvYmtUfKCfGXhBMvWMk38Y/+AYC/LCkTNg+P8IQcQoLSeo3Wxz6OtOixhYWPJFiELiGPFhOE9tH4ZbsxO2yOjLVpUd5ZN2mdZAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3055 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 90119120-69cb-48f3-58d8-08d87a6c22df X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ItLsi6x8mm/weAXY6878LxIq9fP1s3F49x3x5IrGB6huP3t7GOQSRJoDx7qzl3UdaoW/TQjkDIdfLcSlZEfEGOtQP8vpdoiLANG060h3XMGP2OgccQl1Lk70pQwjpFwDuDCMV46YE8BXZLTRqDDazWed0HcQ0e2KoxK1yrFVLrsMK1wsO66P+mE6Z2HUW/vwszQZranKd/1v9kWuyU3rQkra/HZ/6S7aREpsxMmo0Z11a09ab702aZ3Dl8JLm4Kl9FQzFvQiSXZd3/u4t5GcNddisuLI7INXkjfXzi3Q1Pt9kjFzLLHFFdPkd2qFujZBQn9gVwLG4KNH1waRQpD11/lHqCuchFFMKt+4NPrdkdz3QY+tJRer2rfFf2ibPkccmxURsKzZ+cTA8aJcARIMFg== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(136003)(396003)(39860400002)(376002)(346002)(46966005)(54906003)(316002)(956004)(82310400003)(6636002)(6862004)(44832011)(8886007)(5660300002)(33656002)(478600001)(83380400001)(70206006)(186003)(7696005)(1076003)(81166007)(8936002)(47076004)(82740400003)(2616005)(55016002)(26005)(37006003)(8676002)(70586007)(16526019)(336012)(4326008)(356005)(36756003)(2906002)(6666004)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2020 11:33:54.3027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4115f8b5-706c-4284-8065-08d87a6c2f64 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2414 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_073359_819170_0C2B29B7 X-CRM114-Status: GOOD ( 25.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Branislav Rankov , nd@arm.com, Will Deacon , andreyknvl@google.com, Vincenzo Frascino , pcc@google.com, linux-arm-kernel@lists.infradead.org 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 The 10/26/2020 14:18, Catalin Marinas wrote: > On Mon, Oct 26, 2020 at 01:14:15PM +0000, Will Deacon wrote: > > On Mon, Oct 26, 2020 at 12:16:56PM +0000, Catalin Marinas wrote: > > > On exception entry, the kernel explicitly resets the PSTATE.TCO (tag > > > check override) so that any kernel memory accesses will be checked (the > > > bit is restored on exception return). This has the side-effect that the > > > uaccess routines will not honour the PSTATE.TCO that may have been set > > > by the user prior to a syscall. > > > > > > There is no issue in practice since PSTATE.TCO is expected to be used > > > only for brief periods in specific routines (e.g. garbage collection). > > > To control the tag checking mode of the uaccess routines, the user will > > > have to invoke a corresponding prctl() call. > > > > > > Document the kernel behaviour w.r.t. PSTATE.TCO accordingly. > > > > > > Signed-off-by: Catalin Marinas > > > Fixes: df9d7a22dd21 ("arm64: mte: Add Memory Tagging Extension documentation") > > > Cc: Will Deacon > > > Cc: Szabolcs Nagy > > > --- > > > Documentation/arm64/memory-tagging-extension.rst | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/arm64/memory-tagging-extension.rst b/Documentation/arm64/memory-tagging-extension.rst > > > index 034d37c605e8..648f8e8d480b 100644 > > > --- a/Documentation/arm64/memory-tagging-extension.rst > > > +++ b/Documentation/arm64/memory-tagging-extension.rst > > > @@ -102,7 +102,9 @@ applications. > > > system call) are not checked if the user thread tag checking mode is > > > ``PR_MTE_TCF_NONE`` or ``PR_MTE_TCF_ASYNC``. If the tag checking mode is > > > ``PR_MTE_TCF_SYNC``, the kernel makes a best effort to check its user > > > -address accesses, however it cannot always guarantee it. > > > +address accesses, however it cannot always guarantee it. The user > > > +``PSTATE.TCO`` bit is ignored by the kernel accesses to user addresses, > > > +its value assumed 0. > > > > nit, but the wording feels a bit odd to me here. How about: > > > > Kernel accesses to user addresses are always performed with an effective > > PSTATE.TCO value of zero, regardless of the user configuration. > > That's better. Thanks. looks good. i assume this means a signal handler will also have tco=0. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel