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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,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 4CFE2C4338F for ; Tue, 3 Aug 2021 12:00:57 +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 1248D6052B for ; Tue, 3 Aug 2021 12:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1248D6052B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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:MIME-Version:In-Reply-To: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=zF6BF65cet0t6CnC17CV3LuXLqUuOeHlcsXVrzrtB+w=; b=SAHpvo39f+aceV lkePyThMnnfsIStxZfQQKcjAzrekrE+REmmj+m7cLo9x3r4WJJZsTAyR6mOeomtLXXAS4moEgFBZw Yjo878FJqZ5wpkUl761xFKuYArqnkpM8ygwbBJZov2tL374eN91no07S7YAkIKzIrPin+9mfRBgVK qFYoMN8IYnoptUqBWojHV8Ap8qWktybOwCdLH+xyQnMWaIzz6u06lFVdaC7NY+eweTlm27XJdD2g7 hNfUWBv43TyHxLazZVAZa+Bq7j1G5pGPogV8pVGNjUTZSoqMSK3NN6VbY9E0oA7oi3SbeROmyobEK mhwy+KYZzy5nL+hZbP5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAt31-002RMJ-Ui; Tue, 03 Aug 2021 11:57:30 +0000 Received: from mail-am6eur05on2069.outbound.protection.outlook.com ([40.107.22.69] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAszq-002Q9j-4u for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 11:54:12 +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=HhKnJLhCXGjQXWp3uixuQaVzgH2mBSqMe9nE0HN+ZTk=; b=w01lNrhX+pXsdD/1woE8E6PXdo9plS0DWj2X9adBXR9z4cylhutBHP14Z3dKICIxnDm9Hujk3CU0lYWyjY4Ti2KaTSAiPfDRpm7EljSxRgiq97jPnMN3d9ViJklvFDZv+0aeauwO/rN4pdYjbKmm2rTDqeyO4pMEuuODpNaHptY= Received: from FR0P281CA0006.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::11) by DB7PR08MB3755.eurprd08.prod.outlook.com (2603:10a6:10:77::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Tue, 3 Aug 2021 11:54:04 +0000 Received: from VE1EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:15:cafe::fb) by FR0P281CA0006.outlook.office365.com (2603:10a6:d10:15::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.8 via Frontend Transport; Tue, 3 Aug 2021 11:54:04 +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 VE1EUR03FT018.mail.protection.outlook.com (10.152.18.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Tue, 3 Aug 2021 11:54:03 +0000 Received: ("Tessian outbound 8529ae990a93:v101"); Tue, 03 Aug 2021 11:54:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 609af553ba7fb1b0 X-CR-MTA-TID: 64aa7808 Received: from f92982716f1f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E038D510-6F39-4439-A157-76F396EF6C04.1; Tue, 03 Aug 2021 11:53:54 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f92982716f1f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 03 Aug 2021 11:53:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NMDKj/gak+5p+gq8oetnOwyUjPd0WTrCEMicx3u5WX7iTKGZ/HSMA7AY5SCeHQCWkJPBUOOKBYn4nxXoJhLaLZ3e8CmJN/VtvhmygsbQinlXc1o6d91+uhdbyTGzWrFXcT/lR5WIhg4vXkWA2P41Qp8yFPweMrfUfozAhr2AqzDApSsKlZMihNzYyLvXCQrJZC5T+BK81BAPmFfxV9r9/1UCklj3UJ+1pQ+HuXGvJULr8ubmK7ujYwMZCKYfZ0wGvwS/CWblUFNl/RYbqEmAENdmLET6LtZeXSQpcOCGnVPofLDe7rJhLfYNw/ctT/z0ZAeUJl4PtncPKJvtikFHGw== 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=HhKnJLhCXGjQXWp3uixuQaVzgH2mBSqMe9nE0HN+ZTk=; b=ipK1UTaYzlCpy1KlJ8s7iYM+bn/YGUY2k9elk0QbFYdCxbJAoYF/7ebgG0jkpwwycke91QXuUvUEJ87IwhwnMiT4yDBzVt2HyYiSR52MBmr320T8kcyEHQ2Gl/n+B9Z7GqjqlFqiUHnLtSlN+ZmiUf6gm0d3TS2D/fPaK2aT2sWVCIPiVrZW2kKs4bC+qEpD70tlkEGd2B82uVTqIPP7aUL7IB9JG3yysvQMU2m42l7I2WE8yKC+7lmkpe73QA0TwX54k2n6Coj3k088qvFjHtn/1ikdTESqV1+xqEqZp8XrZTqWGbwgtylk6y2SuROUWmc87S0oUyXFq+WNLpSwpA== 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=HhKnJLhCXGjQXWp3uixuQaVzgH2mBSqMe9nE0HN+ZTk=; b=w01lNrhX+pXsdD/1woE8E6PXdo9plS0DWj2X9adBXR9z4cylhutBHP14Z3dKICIxnDm9Hujk3CU0lYWyjY4Ti2KaTSAiPfDRpm7EljSxRgiq97jPnMN3d9ViJklvFDZv+0aeauwO/rN4pdYjbKmm2rTDqeyO4pMEuuODpNaHptY= 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 DB8PR08MB5433.eurprd08.prod.outlook.com (2603:10a6:10:118::13) by DB9PR08MB6524.eurprd08.prod.outlook.com (2603:10a6:10:251::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Tue, 3 Aug 2021 11:53:53 +0000 Received: from DB8PR08MB5433.eurprd08.prod.outlook.com ([fe80::193c:9c05:ddf2:db0c]) by DB8PR08MB5433.eurprd08.prod.outlook.com ([fe80::193c:9c05:ddf2:db0c%3]) with mapi id 15.20.4394.015; Tue, 3 Aug 2021 11:53:53 +0000 Date: Tue, 3 Aug 2021 12:53:50 +0100 From: Joey Gouly To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, james.morse@arm.com, maz@kernel.org, will@kernel.org Subject: Re: [PATCH 2/4] arm64: entry: clarify entry/exit helpers Message-ID: <20210803115350.GA52119@e124191.cambridge.arm.com> References: <20210802140733.52716-1-mark.rutland@arm.com> <20210802140733.52716-3-mark.rutland@arm.com> Content-Disposition: inline In-Reply-To: <20210802140733.52716-3-mark.rutland@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO2P265CA0501.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13b::8) To DB8PR08MB5433.eurprd08.prod.outlook.com (2603:10a6:10:118::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from e124191.cambridge.arm.com (217.140.106.54) by LO2P265CA0501.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Tue, 3 Aug 2021 11:53:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3049c9a6-7aab-4969-6046-08d956756402 X-MS-TrafficTypeDiagnostic: DB9PR08MB6524:|DB7PR08MB3755: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: mCAZpE3P/J/C+4icUp59QLOv/n/M4DCj2AhhS6ss0IV/sbDD05D5bu0RRSN/car3j13GySNGXWr2zzD+kxfRlc6+I718kedaFJb5Oz4SbUEFdDh9iPKBQHY0o/ko4D8O72d21FKKRfCawgwq6PhZuhqQ3uUGuyPzf6mE+JWBz7zPHJOSC+VwANXYgQaSFDQDXZWvPBToPgY+y+g4RCg5WcMnSt6LdnBDdfTgxKdqBkEzo53bF/OiISbqP9LBqiyDVmg7Tg2hsIEUeoLr0RetqgeVxqP6EWKDBOUmY0/8cfkUw4tnM1fUrmJd3wtHSJ5YBShTVQsWweYTW46iw5tfdq3fxiw6Q6rsqrNYjGEBvZQESyyYpqwKNwTX3k1patwOt6podjx5+PBVHap09oF/93woW/tRaJSZvHl1EHnELEUyqLJfR/tnfobPldsOStoFo3aD7r8kFrM5P5kAGtehq3B4JclGqGhG/lqd33Z9GG6enYrRSg5QbQ9q1nQxNFpeJcTh5fiq1finE8++VFsFolNcvUAEl8lrDDIGYWVB1jET6838tMoB7XzzC0sg8B7+zamlw/SofTf3LP2bLlS7AGYFnAOpnAup1hKC/pdZMe2zNID73b8p9/WMvnlFqNMziqDc7I8Vzk3hnujll8pFDUAXJWRh8wO6RABemUZZd6md9YYblIU7sSYLTK9z7t2XMAiH8sd3QOlZhLfq1pDbIA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR08MB5433.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(136003)(39860400002)(396003)(346002)(55016002)(44832011)(2906002)(8936002)(186003)(52116002)(478600001)(7696005)(5660300002)(956004)(316002)(83380400001)(66476007)(66556008)(86362001)(66946007)(38350700002)(38100700002)(1076003)(4326008)(6862004)(6636002)(26005)(8676002)(33656002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3crms0W6O9a7Xl29yauAVZ260omHTS+CqnoVq3wK3pANiqnYxvCw0Q3fzSFF?= =?us-ascii?Q?IYW4gUF04ohsCdZk1k2vgk2fR3pIeDDzSuzfkJF4/EhqAXZ0Mm/6JR5FOGRT?= =?us-ascii?Q?Thhdz7FL78qtKUVnq+DplR0AMmf+rJTAkc1gqTcv2+6JPAj1CZzHuKjM1MT1?= =?us-ascii?Q?upo0fBBYiVcK7xHZAvCf3zL+hGR5E3hFrkuZfF12IY+pcaoVoESPbezizyZt?= =?us-ascii?Q?6473Kr11qQM/Vp73mwERiZucpOW9xYKACuB+rzRamdwgPvsP1grO6QmsGpAu?= =?us-ascii?Q?aL/9hVxdnTtzoSXciyFGsOHxEq5tDisJDf7IJEjX0SH7KmHthurH6VhfaXXx?= =?us-ascii?Q?2iD8H4UwxM4K4VnKM1vaVS52gy57wRXX1iIEl7oom0Qn5iESI/5OJiQGWoUX?= =?us-ascii?Q?rlx4f0BNHEi2CeXeuFxsqK2Jhg9upKSYs7s4tj8yKg3Y5QO9EvFOwDGdPwb6?= =?us-ascii?Q?s1K1n6aO5Df+XnCtVKHSkqk2b5ocIx0iWKEkqXaLu1aSk+4TQ68IfADBgCmj?= =?us-ascii?Q?ayT1Ps8cHcQ6CS+gjx4vY2JMfpEOIgKJlhEB5df4owAqOoe8VmA7Oi1U5JwG?= =?us-ascii?Q?C6Lnj8rO22HA7NXSoA3yC9sJXw4Ye1EsMChQlS2fP7nEyvCmtAYxaVboDlX+?= =?us-ascii?Q?bLnJuckf5vEKe/8KaP/tJ+CNrAuQOrpoVDm+NjkWOLx+0IjYBuLojtH5W/fR?= =?us-ascii?Q?M70evyTcMebFs7IdL/leFF582qzlKe0IoA/aBo4SNNXcg+FF7sXC3b+Gcfyi?= =?us-ascii?Q?qxl1Xde6IKU/0sI7rl9R5Fw7g0bdjK9HqFYqFrfk9LMOITdLGc5rIKJTisfs?= =?us-ascii?Q?L5IkqUjRGJ7Gjo2C0z3n0I61gFcRwhOidVIZjhHgM+qkcvKmaGWCys7iBvB3?= =?us-ascii?Q?VyqD81nai2r0prvTptAbXQPySPTHET5e1cttdwnQhZrl1RDsKaDnKZ+oLm4f?= =?us-ascii?Q?+TN1mePeoGXF1izuCpRbPbB3NWa/clPHcCT5QOp9E9tVEmglKtcL/PhW6C2p?= =?us-ascii?Q?uQkJt1CwosRRyP4UUO+4ZUGQl50dqb36482E2KkPgslkevSQFRuu9CfRAlb2?= =?us-ascii?Q?AvAHyyUePVsGazstHukqL6rtamNgWz91uNxf6YCPVdE4+0Y21RLg85G1s9G5?= =?us-ascii?Q?7s7DudLQcBUr38ohE4mC6Ly8/XZX1KOoRp2FZyRZbohIE4nyQDTU0kzVpyMa?= =?us-ascii?Q?GZ+Ca4q3gq+n+uQWxvjqo2hMTtKn09G1biLT+n0G64PTQvG22RteFpqkPKXu?= =?us-ascii?Q?J738rIWOwTr8Tv+ZFFwgy6oz8/aayPZmFwo3JFXwKxY2ZnDtzkd0+yOeEtyy?= =?us-ascii?Q?XgpmvWkCGn4jmkTEI+lKg3Xi?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6524 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: VE1EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 704dea2f-167f-4459-1225-08d956755d4c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m+HslzCFxloRo2VhCZK/vaofEGfYf6pxhY0ipcLo/jc0dDlhzjuVFLJFOGtpKkLK/jNVPGmD6CnU98vVVkhzXUNXN6J07l0bJQwJwOEdYyMNg6CCB1eUzEQmNaGxHHp6AkMBgCncPHoHWUSgtypkgeobcU1oD87q1zwFlmdXVcSKUfTut162o/NPKiJwXVHby6qwBfSXxvKSEC1YBHiDxMH3+/9BdA4QZPOrvdqwqiYwCXgJRgcpBs5rrQRuUzzHOg6xx5ua2n+izvxVogy0xcQs29/AD3Ct/o8WjCNihKwJ1v3+72xp1hla3yPytuSOrJY7+FsQwK2kvjNDSFaj/BxeZz7CidIylGQ73DXpPzdm/knN+BmjxkTMy+GXFs3yiwuq9u8R+aa2MwvXuMtCe1MalBFhOVOysIS557SBPgKZIAP2bmE5GLixv6XKRs7A4fP9m4fQlESypiO6uRzmPuqd1dGJkL/p+tiPsPSa/9ehDlsrNDUR7H3D3k15HiGu8LfmjQbfkZgSVf8x2gtXT3RItqt7QHdaZPKziFMTWi2hgGGKNIngCcwbOEDpI7mXkKBPi+Lhd2+Ww42UjxXHGp/AmHv8Xlj22+27LPuaxwkCID9YFVpLeKSrActsUXnPQj6Y+h6peBUH2v7wUWz8JZRusncrER6A7pmR3uJjzxHyOY2PGrhrNInnYMdxXXAPGUtxcR3tVK1sjXQCwQueGA== 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)(346002)(376002)(396003)(39860400002)(136003)(36840700001)(46966006)(82740400003)(83380400001)(36860700001)(8676002)(82310400003)(336012)(5660300002)(6636002)(8936002)(26005)(356005)(186003)(86362001)(107886003)(6862004)(70586007)(70206006)(55016002)(33656002)(81166007)(4326008)(316002)(2906002)(1076003)(44832011)(7696005)(47076005)(478600001)(956004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2021 11:54:03.7446 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3049c9a6-7aab-4969-6046-08d956756402 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: VE1EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3755 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_045410_465214_65FF2656 X-CRM114-Status: GOOD ( 25.88 ) 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 Mon, Aug 02, 2021 at 03:07:31PM +0100, Mark Rutland wrote: > When entering an exception, we must perform irq/context state management > before we can use instrumentable C code. Similary, when exiting an typo: Similarily > exception we cannot use instrumentable C code after we perform > irq/context state management. > > Originally, we'd intended that the enter_from_*() and exit_to_*() > helpers would enforce this by virtue of being the first and last > functions called, respectively, in an exception handler. However, as > they now call instrumentable code themselves, this is not as clearly > true. > > To make this more robust, this patch splits the irq/context state > management into separate helpers, with all the helpers commented to make > their intended purpose more obvious. > > In exit_to_kernel_mode() we'll now check TFSR_EL1 before we assert that > IRQs are disabled, but this ordering is not important, and other than > this there should be no functional change as a result of this patch. > > Signed-off-by: Mark Rutland > Cc: Catalin Marinas > Cc: James Morse > Cc: Joey Gouly > Cc: Marc Zyngier > Cc: Will Deacon > --- > arch/arm64/kernel/entry-common.c | 70 ++++++++++++++++++++++++++++++++++++---- > 1 file changed, 63 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c > index 6f7a98d8d60f..6dc64f99f185 100644 > --- a/arch/arm64/kernel/entry-common.c > +++ b/arch/arm64/kernel/entry-common.c > @@ -26,10 +26,14 @@ > #include > > /* > + * Handle IRQ/context state management when entering from kernel mode. > + * Before this function is called it is not safe to call regular kernel code, > + * intrumentable code, or any code which may trigger an exception. > + * > * This is intended to match the logic in irqentry_enter(), handling the kernel > * mode transitions only. > */ > -static void noinstr enter_from_kernel_mode(struct pt_regs *regs) > +static __always_inline void __enter_from_kernel_mode(struct pt_regs *regs) > { > regs->exit_rcu = false; > > @@ -45,20 +49,26 @@ static void noinstr enter_from_kernel_mode(struct pt_regs *regs) > lockdep_hardirqs_off(CALLER_ADDR0); > rcu_irq_enter_check_tick(); > trace_hardirqs_off_finish(); > +} > > +static void noinstr enter_from_kernel_mode(struct pt_regs *regs) > +{ > + __enter_from_kernel_mode(regs); > mte_check_tfsr_entry(); > } > > /* > + * Handle irq/context state management when exiting to kernel mode. Uppercase IRQ to match the other comments. > + * after this function returns it is not safe to call regular kernel code, 'After' to match the other comments. > + * intrumentable code, or any code which may trigger an exception. > + * > * This is intended to match the logic in irqentry_exit(), handling the kernel > * mode transitions only, and with preemption handled elsewhere. > */ > -static void noinstr exit_to_kernel_mode(struct pt_regs *regs) > +static __always_inline void __exit_to_kernel_mode(struct pt_regs *regs) > { > lockdep_assert_irqs_disabled(); > > - mte_check_tfsr_exit(); > - > if (interrupts_enabled(regs)) { > if (regs->exit_rcu) { > trace_hardirqs_on_prepare(); > @@ -75,7 +85,18 @@ static void noinstr exit_to_kernel_mode(struct pt_regs *regs) Reviewed-by: Joey Gouly _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel