From patchwork Mon Mar 6 05:54:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13160499 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 738AFC61DA4 for ; Mon, 6 Mar 2023 05:55:46 +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=/kK+Hmk3EynTUgwLpfFEg7Kes4IMPJI9QkhUv4d6t+c=; b=H8C3/ZHtU1uO2U 34DCpUj4vV5z5GpJ6/uvMvaWfDjjENsaeiJP9a+v7AliGFiMJDt0dbTeJfGIW/4WqjiyBUALt/Zyv H6W59JcUZhE5mSUh2r2yV8Zk5WMns1W5PoaVkIaV7jqLRgn9bllMUNq8V2ExragW3x3BDK7HaBpcT gT7iiAVnma/SnwJ0XiD8L9smeER/BaM1QuC+k5+P+7OKbSYE03/IRI7gGNdIo/Wa4lpOja9oPbLsI J5OddJMGRqcdHvg8n5oUYqs5jyG/71DbpUIW+dl5Zt70JtfecuqZ/CqaMoSftA5mg1Jc4oOyG+aF+ RQNATb7Ocgft7MjJmaAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ3o6-00BR1A-0u; Mon, 06 Mar 2023 05:54:46 +0000 Received: from mail-dm6nam11on2071f.outbound.protection.outlook.com ([2a01:111:f400:7eaa::71f] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ3nu-00BQyF-G0 for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2023 05:54:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGmJ+LwRHQKDIUmokQE8mMB9ZWeWSTAiUGUhKl3plwnTJX7ebt1+oZqfPGsQHSwt3bRiQdB9uW8GPgOIsKOSVa0U7hCil3Qkq80MlzsA9Q9h6LFTblosNsXC0Q4/GGlkXTnwzPPeQxMTdN7+Kk8USNUtWyfTJudqkCNlgqAORPvvXQ4/dIB/dDshLAKifYIuOd/aCrLDw11+iQnJBrEadlW8z48LIzpl+HkC+6LN5gz25NdadHl50Zvzfkjh3UlnKgAKx3d8lqJIijh3+7rFsmaNAgvG3L/cnMdszCHvcXZYQs5AsCN9FhzRFlsL4+1koAxKBObAh3xCj4LXEsH39w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XWi1YKctGw/VXVlXWOPgbrKgjMGwV1SICAsJVgxHykg=; b=Hq2VVKAIiePyRi04hIuM2t2JZlUg7eMZyTLH8sISR+ly8EfhLIDpFe17cvHdJf1iNJ9jgeMS3RA6Z8nkIcY+aik2ucWZ3LiLSKXHRDXsSCs54ALPKDsHjTqRhYlv79l+qNYKTu/JTXq/5xvoxhktbqEBUIbL9APRwcvf6XgGyVa48iFodtv8oIsrENCG1HSgyws5yb7b6E6yI2CqTCO5h5IOMUEEmm+yWWMjsAt2dH2A/JzslIVDzyP3tlytsR73giFVDEBr/uCLPCi/KgeVFDoCp/Worsm+cMh75gqzcFFfrEvPO162vDxnXKAXc8TaRNFC/juo9Vkv5tzOE5bfDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XWi1YKctGw/VXVlXWOPgbrKgjMGwV1SICAsJVgxHykg=; b=KHOU9ftRBK+dKZNeBXAdznz0URnPaqsq0d6wPgiBZax5cPxti0NqGAzjaZseUkwoYoUBWyqn7wgLiYqBXIRf1ehFo4gi8zU0q8cMxwIBmFOh4TnxxReLuBDvIAJrXetpWgjIlpVkKXHKy/dRmYTpqZ98Sntd0pfoFxRgvfYvn9M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA1PR01MB8062.prod.exchangelabs.com (2603:10b6:806:335::13) by SA0PR01MB6460.prod.exchangelabs.com (2603:10b6:806:e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15; Mon, 6 Mar 2023 05:54:26 +0000 Received: from SA1PR01MB8062.prod.exchangelabs.com ([fe80::fb0b:d681:8228:bd50]) by SA1PR01MB8062.prod.exchangelabs.com ([fe80::fb0b:d681:8228:bd50%6]) with mapi id 15.20.6178.013; Mon, 6 Mar 2023 05:54:26 +0000 From: Steve Clevenger To: mathieu.poirier@linaro.org, suzuki.poulose@arm.com Cc: mike.leach@linaro.org, leo.yan@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] Add known list of Ampere ETMv4 errata Date: Sun, 5 Mar 2023 22:54:06 -0700 Message-Id: <54c98e4eb9cae60c61576564c84f272785fa0da7.1677881753.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR12CA0003.namprd12.prod.outlook.com (2603:10b6:610:57::13) To SA1PR01MB8062.prod.exchangelabs.com (2603:10b6:806:335::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR01MB8062:EE_|SA0PR01MB6460:EE_ X-MS-Office365-Filtering-Correlation-Id: 7fe28fa7-576b-4e86-bbd4-08db1e073e6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7wWjtFBSEefIfeC/9qmA8R1sZyvFcfkgz8miEmw6VDlGGLdBMYla34e+ERI5LrjFT2dmTgo0JB+Q1OE9n3pV4/bI0r7G8cpFmag0kzVMm/zW0kILMwAFenjN5+YoeRIpXgD8sXJdJELKH59AXfKZGGSWGbWDBRj2wSJRS08KCORFsYkMnuKT+W/ayVNKZXHdTmJX23NyY99hAqq4wW6FHj7MAV0g3xHgGQfDdNDCQwSUR5k4ZOV9nY6CFROdkdklfFi0wlDe7gBG0sJCyJFmjZmAyBTHN+odUrXL403maS+GttOB/fvGWi3RhRwm0UTYvHt0f1etDGtbplxTEEO2y/vxU3wZxDh04ktxWz0n0cmiqZB+N3A74eZu9bAFNFWlmKwAaI0a66aGS53ytfHbM00hA0W00P+uSerr7CthahQmdQ+jRjcg/+1Fg+oJMQsAml6eS3eHn/pynqAUiPWG0mIfobVcnCSyGf0vbLGDD4J/QWNCN56KDnp75u3CZS1THXRjuURTVboF8EwlyhH5TlFOqIHGmR9nH3QlKIwRpr1CYFApJfHXzqsW/nshVs6yWbWr99Ykwh6bFlXCttdc4Q+TG2lhaLchs4/hPwxMQx0rzK8i1BL4nlyefqEITNAK6SDF9gL/KGPExNJTVApyZgkmRaHSsFdvYj8I2CXGsOw6Xwb8/I8+W3v2/21CzAlk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR01MB8062.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(366004)(346002)(39850400004)(376002)(451199018)(6512007)(6506007)(6486002)(966005)(6666004)(83380400001)(86362001)(38100700002)(38350700002)(186003)(26005)(2616005)(41300700001)(66476007)(66946007)(66556008)(4326008)(8676002)(2906002)(8936002)(5660300002)(478600001)(52116002)(316002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: njNJDvrevEXYyYs/BZxV/TgGvHO/NKEiZVcG470Zf5HPH42fR+ZrXBLYbQzN32eX5qMr7VbkHOv+iPGybVjgUFRzJ6ku3ux646ILIjcDw4lo31BXs/6mdeIyxVu4ZzKEqs80jD7NwCBQjieVlcz6oQSJCsx+I0k8YxJqjLTDCBFQI8MDtu9iMwB+oeEw3x1DeRHO7Zq7n97/P6nd6xV/LWhhlkiGT78PUqjA8lQBB6FtuF7hvAMU+z9HX/zRWtoqvLOoLyYrYIi35EhWLcixAOtmsVn2GQUOngzGdruGELtaa289mcIhh9h79JL/gTAU31zPUaJSNpQH0gw5PIzgs4dGkgmOAVPgP4KJypU0ZwNYn4sthFTT7YJMSBgy06o0NmvXAIsXBNWi7lOBaeKQJTrzSNtDyO/Cjw8B8QRAuOKZylGNY5VbrtQiezSGab7m2J1t6MVmt8ujmKpOv3OBFuOGZfzgrR9ei7GyHzBZUjKr4f9OIxRKEGTjJNTdPkqxe+H495MEU8dNYnDLRZoSuVnSx1YNOgqE4CyqMD6x2EPGcf4wiF8WDrPb4qSai6yBm3+Rie87yLPdZOg/fpd5YdMAcMboW0P04qEq7K+yVhemeHAABLndbW+tuEgLys2dZGW41NdN/nJ3LjDO6Q/PiA1QE4NFH3eHA6g1nSrJLfyJbnAFfjPFFEanvyI/YWSQAmvI3/RnECvPg46pRMC/6IMd6I+3yO5cqVu0mtsEqxIunVAnflb4fPZWZAZ9Oblo8BqgNOnh8cSlaX9CqTvkklok1YgpayTXFUXf9Yz9vgNPkGbT5D1iAh49colq3Hhp8uhcS6kouej5FpwS0tqJLRxo3yDtdLS6e6Wys9kI/1vxSDitctbZ/3l1WXBpHpwPLcsye1bNQQfhKM9v1blTgaAcsV5eSSOlOtXe/gpjv2n5KxP5znsAyYxGSUZfrvOO58mLY0yALceqPvbVGUXXgJ4VlLlQEtUc5EdESlOM7CTBu1zDWNV7t4Gj3xC16QLO/JRrtb9Mc0RIIxufdv21NMRxINPlAjJUKjSZUK8DwKxNzcIllOOAIrbWyhl+gutX+qYg1DF8Vczvg9OtKF810fNqBiHFV8V81YcQf7N+m9f3v6Z1xR5vo7LItMnwYRCSNWLB6n5M/3IRAlXcQadgtjy+Lt6Vr8NdYlizYk/cXQ5hLhsEZxJwc5Ex5XyR7e1OJlrQs1n1lKYFmtyG007Qt0sYZHWSc/1l47C8C/iN8xX6vBgx5tLCJ/zUIMZMileQQP5dg2gNFultKpQjCPXlKdc+53y5dN1Omf79inx+ui+46KUrdXcypRA4czYsItkB9/2bmUrP1zFJg2ROzNiwSz/cIBgAczU26ZPp3kLf4Fg4z3HfdlX3TbHZfAYZPo4/4OOpSl53YJ/c2hh1HtaZqbvQwvPQ4qG7TnyxCBGguniARdRxTJKqJBb8QyFarsmwTrafyr4ha7nT3c3ZSzr0IK4fE7X/wdAwOrzRX5zHspa/I8doota+3NlWnDnzzsHY7ZIKb1ajfSeD98r6EFiAHrK4Hmb4MfSgHdbJxZMhRuLFttFwwlC1reEmGf+RhDElXugkeD3t79Xwxp5JNQIqFlQQxri3QXxvgBWdXMiWbn5RGxWzHvewPufhum5Di4+6 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fe28fa7-576b-4e86-bbd4-08db1e073e6e X-MS-Exchange-CrossTenant-AuthSource: SA1PR01MB8062.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 05:54:26.5355 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YtTQ/K2W07RzSndL+JMh5ZZ04vWWRXbb95bFUqhUpfJvFS/OoBVIHpynZJkdOZPhVmwNlJUxY+O8ZTPKLZ/uvWMX4UaeVS21MAh5M1QJCAkRGMO+sEjeOh2vG/Pg0awO X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR01MB6460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230305_215434_997166_2AC32614 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org An Ampere Computing design decision is MMIO reads are considered the same as an external debug access. If TRCOSLAR.OSLK is left set, a TRCIDR1 access results in a bus fault followed by a kernel panic. A TRCIDR1 read should be valid regardless of TRCOSLAR.OSLK provided MMIO access (now deprecated) is supported. The Ampere work around is to early clear ETM TRCOSLAR.OSLK prior to TRCIDR1 access. Do not distinguish between manufacturers. AC03_DEBUG_06 is described in the AmpereOne Developer Errata document. An Ampere Computing design decision to not support 64-bit read/write access in the ETMv4.6 implementation. The Ampere work around is to split ETMv4.6 64-bit register access into 2 ea. 32-bit read/write accesses. AC03_DEBUG_10 is described in the AmpereOne Developer Errata document: https://solutions.amperecomputing.com/customer-connect/products/AmpereOne-device-documentation Signed-off-by: Steve Clevenger --- Documentation/arm64/silicon-errata.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst index ec5f889d7681..a4de304a8bd8 100644 --- a/Documentation/arm64/silicon-errata.rst +++ b/Documentation/arm64/silicon-errata.rst @@ -205,7 +205,11 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1286807 | +----------------+-----------------+-----------------+-----------------------------+ - +----------------+-----------------+-----------------+-----------------------------+ | Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 | +----------------+-----------------+-----------------+-----------------------------+ ++----------------+-----------------+-----------------+-----------------------------+ +| Ampere | AmpereOne | AC03_DEBUG_06 | N/A | ++----------------+-----------------+-----------------+-----------------------------+ +| Ampere | AmpereOne | AC03_DEBUG_10 | N/A | ++----------------+-----------------+-----------------+-----------------------------+ From patchwork Mon Mar 6 05:54:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13160500 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 BCF05C61DA3 for ; Mon, 6 Mar 2023 05:55:58 +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=1v2DLPOpNl/FV6hjP4/9O3+JvQ8CYudDRHL4MFvnEGo=; b=WIuT7dExu1DEmY JyS7DtXzuEa8AIw7BrX6BXyHt7DJxzPsbTGg76Tupa7wEQO9OKF0uEFjoNsTfitLM1SCmR8ob3AE7 5s7ROQHsrVqbzcK5l4ESWzTCtKwoQfL6JBdXS9q5+BT4XiTjmAf54Dc2w0+IQO+ZBedxKCUE7KAGj F43AV595uHZVfhEN6B0kXG0rJihZaKsM0tCeB8W6nFAnXoHfQgxzsNzZ/iP8qNhQBcGtnKmej8QcB nXuQPtg57ESnJzYKH4bBEUFqXqFHsE2H2M67jI36vg/Eg/lRNpa1Wvoy4VIAB8RluO27xW6OprvCg oaSA3IRN7qzOojjunmAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ3oE-00BR20-7f; Mon, 06 Mar 2023 05:54:54 +0000 Received: from mail-dm6nam11on2071f.outbound.protection.outlook.com ([2a01:111:f400:7eaa::71f] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ3nw-00BQyF-Jy for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2023 05:54:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xx7bUYPVk/Q5mYNsLU/NMaIRUAZSAtAX5jPFMJJwsmlcu4EJtn2exg3RPxdzTad0GXSxXerfUBuxB7ReWgTMuewxcC/dhYRpKm1N+sVK625o/ECvgMZj4r4an8SEvDAJ3/otTpQimJN76ciNMKDRFZZ/1QUPvirCf7w3BjYXhlp37NMcr+NntftQQxJKs9uTeyoGBuSsuguPf/FzVbd1XQNS4G8kcW56PfQrT28WfsNX1ZY7iSQEgksLV2ph+VYBQA4Vhl2WrJoUb6eibtA4Q8ni5O1FcKg4R+NSoeLRqkkzev3e+SxAlCTHGuPpBOJx7OvnFqU5AFvGqbE16uaJlw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I6o5RPOu1t37Yj8xS5G6Fhj2Vd3z25AsPdZEegdsRgM=; b=MCxe/lmqtGtXqKmdNcVH4MT9yP/UgiF9DpcA2cAZgIJ9krsDIKHqNlup24iddd7p4Jzsx+czzb04ZQBUNFv5Dzznkvgvi2J45wxu3Pxf+3bsoILf7K0DfLzTiJm67JGG2JwFu2mxACROnZ0TPbOG2QaGstUNYodgues7c1tLWsXaQo7jHeQKRcD2HSgaMHyLx8QavIPT5DSazRVCOm33OiggBBEG3tUU2XziEAzdaGfwpJdulbJOSulvFaJygcKPGFyvZ9s/ThT5X3EWci9n6jsmRiXAKsfoB8zCWCPo61fU8EOYLVk3rH62KcS0juPA3NtMrFj+UsvOwherhlF9IQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I6o5RPOu1t37Yj8xS5G6Fhj2Vd3z25AsPdZEegdsRgM=; b=NBb61RuVnuLZD2n+FTACP5e+TT3g01hW0trwaq8kXXagPswpUUbQl0RLrMNpBbMpSV6y9qK6Ga07uekX6v8oZixg2K5/rVoSG0UxsdbhfuX3nznByg/m34wK/TdogSKNGuuFdCxhnVmq6OvNP4Chzgk/1SK1pMvvEkdPyam1hZw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA1PR01MB8062.prod.exchangelabs.com (2603:10b6:806:335::13) by SA0PR01MB6460.prod.exchangelabs.com (2603:10b6:806:e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15; Mon, 6 Mar 2023 05:54:28 +0000 Received: from SA1PR01MB8062.prod.exchangelabs.com ([fe80::fb0b:d681:8228:bd50]) by SA1PR01MB8062.prod.exchangelabs.com ([fe80::fb0b:d681:8228:bd50%6]) with mapi id 15.20.6178.013; Mon, 6 Mar 2023 05:54:28 +0000 From: Steve Clevenger To: mathieu.poirier@linaro.org, suzuki.poulose@arm.com Cc: mike.leach@linaro.org, leo.yan@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] coresight etm4x: Early clear TRCOSLAR.OSLK prior to TRCIDR1 read Date: Sun, 5 Mar 2023 22:54:07 -0700 Message-Id: <143540e5623d4c7393d24833f2b80600d8d745d2.1677881753.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR12CA0003.namprd12.prod.outlook.com (2603:10b6:610:57::13) To SA1PR01MB8062.prod.exchangelabs.com (2603:10b6:806:335::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR01MB8062:EE_|SA0PR01MB6460:EE_ X-MS-Office365-Filtering-Correlation-Id: 96671d58-d628-43f2-34de-08db1e073f88 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lpgv6W4cGeL/8+9UffPZAWcBMZ0WSl2I2w5pOG1w39tI7Y3vIZA0JVhfSX26FPvTR7vBGxs6JdPo2RI0LBkRk1dYtOI22lFGdZ9dXzRxI2IahY324M3x2Jj3YRbHwJYKOQlBHbMdy0Dzj4oF4C4VZthwskB8jlQY+t2nYPwqiBnwFxUvvEvaVtoh1wp1jnwWUnMEEucvQVeG8byaadNhRQup6U8M8aDyBosIJwsrZmCJGZ5dCVNb8xcfPugKDrT8/Zv5TweocVsZ9vBdCFhxGqYbI/sHtriHuQZZXVnGCgpCNce/etiZGqf265ca5T7rrGI0YPmuJwshhUW9o22h/ah+d1AHvTac0ZC4fD0MHwCm56VRlh975VBhVdcS9o+UEK/X1nkAV3HtJcBrYyD5UPsHNPMjBrOqs/KIfOYi2LlOy89IYWTpgLgb1+PsOW+iEs7cQm+/CMRl9uR7MK1VxT/HR/gWufEv95Q54UHsCUFj7Q653UA2oFK/LEoaKccEzIGXRNgcZSsIG/V823Wy396jHLJAvbeOxuK3Z/xpuZEgdk2jOvvi/ZmAlYADqn3WGWTwAcgfmVQ6Xlq2yohb95EkN2R/IhWPgXQU1eBAhmzWdYzuMZ25yS52MJ93bCmsXmJWedXJng5r47QfD5RkMyHqKnSrE6LoSWp5wMAAa9HYT9jOaQxgWERNWTNQw8Jd1lcRj1yJ3iehtGp+T0b8Lg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR01MB8062.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(366004)(346002)(39850400004)(376002)(451199018)(6512007)(6506007)(6486002)(966005)(6666004)(83380400001)(86362001)(38100700002)(38350700002)(186003)(26005)(2616005)(41300700001)(66476007)(66946007)(66556008)(4326008)(8676002)(2906002)(8936002)(5660300002)(478600001)(52116002)(316002)(32563001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w6BTyMZlkYGqRscha3JJls14I1KO97BOvb+ds02n/pQLOXcUiVde+/cutB+CTe3yN7xvQ6/3mRdmCmVHhy1H6YRQVp7EpXy9pRSMd7lc7SLabksesP0NBTKbwi12rQiW//OHyV3KQF0Z+4aNHC8Ng9/Cm1NAnZKqWFw1W0F1p3TRAFHxkoaXoWZ0SDZjQBPLA5BeHfLjw+KFWB/3e5vofyUYLpQBGJa8QnFQbnPZkhD57w8J2WRll5BEVxapPLukJ9UK8nehhWfFfwAmkR+dz8AfHEZbb8idAWJMqQDWarnT4VzDMHzC2Uiirt+1ywOd4/zj0VesmL1zujrxNl6JB2ATZVW9pbqlXstDTlVHST28bUc+Ind0slOSPW+Fa5SiSiVIBnS3yl8jhBTh4N50zfIKZKHG30Ub+RgaCoiE4trDbtLz/ZIv01wZaTS5kdlOnYWlAIocJzmA/gP3JBEA2565a1geOsJZ5Gb6iDIvSGHB6CJkdpr/5jHL7hKmSxBjUAPfT73xIouGMHgrINXPOtuDeAUPnfesizwH8ZigIQ/SKqvMdkCwSPbeoyASP9jywQuKtn2/JViMR/WNcE9hGEdyTrHVjgAx9bLX/db6Y/PCTyecC+P0Vd7VTtOR3PbbvOtGJ1leSr4ZuAG9zuI9jfZHtG6UrHXCwJD2Lm0E40O8P1AUR+6mAT8XjtFZuzC0lGakdq1vViT5jIWu2sOPGLV2R7QTgZT1EmyhY2XzbP0pxj67lOV+bOSTMjRw0wEkZeMn0c5KrGb7LJG+UzUCE8Z49Z+cS8kM5xQUGO9veMCeZ/yq16X43ai1xw5DIrXjzXoLdxIgz4xu9+E/LVpng+O8w51jaJHJZ2b5aUcWbxIvoLJnlYt5KlBfLmOTRHiz3c6D1ZgGe+Qdfd/zMw8FsT4vrPlfhCkf4lsPwUKrJtdrWyZWzxQbo3EP4+PFxH4FJBnEyIsTjZ+PWR/g3BQ1qRX7dYu8kUbj50kLZU6n+hwsqBRKH2rT8aBKiqa9kpf0ySo7Ntxx44fEq8XT5CiaPQDxWMObw0RgbERPB7CmecDYvVQ4NiC4CQ0g7cDH/9DEvVHsxTOLE5fMq0JOgfCD3TTbdmxeyTQjRgM7da6FXzRTnUd/6vzVRWxtFQE+7zd3EeTW5MI6qniw/ccia3UKoxGqcYBkrbXCC0/LDTdQTUaR7AmeLzOClEDudDQ32hJ3u9OR19zhdcY64ccYoWcppxG318M99oFoyVpLp2GvnHVIZLH0zfDNYxcJTwCf4AQrXvpEhFA1WxMuzl8zsbt1R4NceN9bZ6TYxyhHfp9O3AN8NWIQhcwkX6PSOIdZR5t7XSEmA1bHP0lMMNQIgqd085Dm5Xm8b3eQ5Zqputv1iU6rB0fQmjOkQ7S0BfG+CNgsZRTYsAVpSUXS6v6pEANcsbF5H0z83i6NyAs5JV1wDWY0VOA8gPJyITzF5qzXB2g2uiVWuED7aj0Q8oLLut03u1ofx7LG21HenP1ObrvgG5pSkOUcTKrd75JDzq4eXVCCXfHNQB8bS9zZ+UBhjoBMJO27NWKTBghijMKTGGAqZEfn4Dq1q1TAK6HxF71uZ2Ih1f4csVGHsg7GhjummkHHzrKZmEqqZz419gbfUv09BYpv67i18eYLCwmIZYCijvk2 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96671d58-d628-43f2-34de-08db1e073f88 X-MS-Exchange-CrossTenant-AuthSource: SA1PR01MB8062.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 05:54:28.3802 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NqtMFMH2JqxYO+u4/Mg4t1BPi4MN0N/xm+E7a6tEg/shxsRug0n5sJfGQnp57gWqKIc5aqrfBc5v1Uz5XMHDesPqqLC1/IUjt4f0ZEKjEoN/01GLoshpONyJPw/TgLMm X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR01MB6460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230305_215436_750524_9A864BA2 X-CRM114-Status: GOOD ( 20.74 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org An Ampere Computing design decision is MMIO reads are considered the same as an external debug access. If TRCOSLAR.OSLK is left set, the TRCIDR1 access results in a bus fault followed by a kernel panic. A TRCIDR1 read should be valid regardless of TRCOSLAR.OSLK provided MMIO access (now deprecated) is supported. The Ampere work around is to early clear ETM TRCOSLAR.OSLK prior to TRCIDR1 access. Do not distinguish between manufacturers. AC03_DEBUG_06 is described in the AmpereOne Developer Errata: Add Ampere ETM PID required for Coresight ETM driver support. https://solutions.amperecomputing.com/customer-connect/products/AmpereOne-device-documentation Signed-off-by: Steve Clevenger --- .../coresight/coresight-etm4x-core.c | 50 ++++++++++++++----- include/linux/coresight.h | 3 ++ 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 104333c2c8a3..6f7a14c4c78c 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -1047,6 +1047,7 @@ static bool etm4_init_sysreg_access(struct etmv4_drvdata *drvdata, case ETM_DEVARCH_ETMv4x_ARCH: *csa = (struct csdev_access) { .io_mem = false, + .no_quad_mmio = false, .read = etm4x_sysreg_read, .write = etm4x_sysreg_write, }; @@ -1054,6 +1055,7 @@ static bool etm4_init_sysreg_access(struct etmv4_drvdata *drvdata, case ETM_DEVARCH_ETE_ARCH: *csa = (struct csdev_access) { .io_mem = false, + .no_quad_mmio = false, .read = ete_sysreg_read, .write = ete_sysreg_write, }; @@ -1069,8 +1071,20 @@ static bool etm4_init_sysreg_access(struct etmv4_drvdata *drvdata, static bool etm4_init_iomem_access(struct etmv4_drvdata *drvdata, struct csdev_access *csa) { - u32 devarch = readl_relaxed(drvdata->base + TRCDEVARCH); - u32 idr1 = readl_relaxed(drvdata->base + TRCIDR1); + u32 devarch; + u32 idr1; + + /* Detect the support for OS Lock before we actually use it */ + etm_detect_os_lock(drvdata, csa); + + /* + * An ETM implementation may consider memory mapped I/O + * an external debug access so clear TRCOSLAR.OSLK early. + */ + etm4_os_unlock_csa(drvdata, csa); + + devarch = readl_relaxed(drvdata->base + TRCDEVARCH); + idr1 = readl_relaxed(drvdata->base + TRCIDR1); /* * All ETMs must implement TRCDEVARCH to indicate that @@ -1089,7 +1103,10 @@ static bool etm4_init_iomem_access(struct etmv4_drvdata *drvdata, drvdata->arch = etm_trcidr_to_arch(idr1); } - *csa = CSDEV_ACCESS_IOMEM(drvdata->base); + /* preserve pre-initialized fields */ + csa->io_mem = true; + csa->base = drvdata->base; + return true; } @@ -1151,18 +1168,13 @@ static void etm4_init_arch_data(void *info) csa = init_arg->csa; /* - * If we are unable to detect the access mechanism, - * or unable to detect the trace unit type, fail - * early. + * Make sure all registers are accessible. If we are unable + * to detect the access mechanism, or unable to detect the + * trace unit type, fail early. */ - if (!etm4_init_csdev_access(drvdata, csa)) - return; - - /* Detect the support for OS Lock before we actually use it */ - etm_detect_os_lock(drvdata, csa); + if (!etm4_init_csdev_access(drvdata, csa)) + return; - /* Make sure all registers are accessible */ - etm4_os_unlock_csa(drvdata, csa); etm4_cs_unlock(drvdata, csa); etm4_check_arch_features(drvdata, init_arg->pid); @@ -2084,6 +2096,17 @@ static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid) init_arg.csa = &access; init_arg.pid = etm_pid; + /* + * Ampere ETM v4.6 does not suport 64-bit MMIO access. + * This mask isolates the manufacturer JEP106 ID in the PID. + * TRCPIDR2 (JEDC|DES_1) << 16 | TRCPIDR1 (DES_0) << 8). + * Ampere does not currently use the implementation defined + * TRCIDR0 PART_0 and/or TRCIDR1 PART_1 fields to further + * describe the ETMv4 parts. + */ + if ((init_arg.pid & 0x000FF000) == 0x00096000) + init_arg.csa->no_quad_mmio = true; + /* * Serialize against CPUHP callbacks to avoid race condition * between the smp call and saving the delayed probe. @@ -2249,6 +2272,7 @@ static const struct amba_id etm4_ids[] = { CS_AMBA_ID(0x000bb95e), /* Cortex-A57 */ CS_AMBA_ID(0x000bb95a), /* Cortex-A72 */ CS_AMBA_ID(0x000bb959), /* Cortex-A73 */ + CS_AMBA_UCI_ID(0x00096000, uci_id_etm4),/* Ampere ARMv8 */ CS_AMBA_UCI_ID(0x000bb9da, uci_id_etm4),/* Cortex-A35 */ CS_AMBA_UCI_ID(0x000bbd05, uci_id_etm4),/* Cortex-A55 */ CS_AMBA_UCI_ID(0x000bbd0a, uci_id_etm4),/* Cortex-A75 */ diff --git a/include/linux/coresight.h b/include/linux/coresight.h index f19a47b9bb5a..285d7aad6ef4 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -116,12 +116,14 @@ struct coresight_platform_data { * struct csdev_access - Abstraction of a CoreSight device access. * * @io_mem : True if the device has memory mapped I/O + * @no_quad_mmio: True if 64-bit register access is not suported * @base : When io_mem == true, base address of the component * @read : Read from the given "offset" of the given instance. * @write : Write "val" to the given "offset". */ struct csdev_access { bool io_mem; + bool no_quad_mmio; union { void __iomem *base; struct { @@ -135,6 +137,7 @@ struct csdev_access { #define CSDEV_ACCESS_IOMEM(_addr) \ ((struct csdev_access) { \ .io_mem = true, \ + .no_quad_mmio = false, \ .base = (_addr), \ }) From patchwork Mon Mar 6 05:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13160501 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 EAB07C61DA3 for ; Mon, 6 Mar 2023 05:56:03 +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=4NzMj5kfeMhKbRjXMuHKvtaOv3OZ5R1H3ZMp+Eet26Y=; b=4Fb2OOG1JsXO14 /0dUYGpUPM/ppQva/qXsrV5tgmOfi4Rtug7W1G5v/9Ht1N2VJB/A2PjlBbcGDu55Jjk6IVZ8Saey7 hIAF0zDXVcaGBk4m14HgGPhNtc+4lm6JINlbJSdizHinxETBmIyiY1uTA7xwPZZGz9HAl6+r+3MHO 4LVejaNFMskupQnJSCHWsgoFsmtAi4dF2yGPVVDCjFdNqlXSwic1ViBepICQdwzYwCQ0yi9tyrpLS TdcrVHXawYkhUpNL6FQCIpInydhXOTrvh9lIfGYm5HwypZuYpzooI2MCXrnAz68d2+NFxu9/ijRhD EOSXE1J359zqZTN4tAHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ3oO-00BR47-GB; Mon, 06 Mar 2023 05:55:04 +0000 Received: from mail-dm6nam11on2071f.outbound.protection.outlook.com ([2a01:111:f400:7eaa::71f] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ3nz-00BQyF-CA for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2023 05:54:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFgw6c7cqbbvoWhFvC9maZAZEv0Lqfygx/TrIuLgb5H02pBBZRBuzGOFzoiSuEl3GcDx0Y19N3njS/tjkvp9Xx7pexHY6WnZyIJwZTPXKgBdFwKTptiTkdDmO2+2xxpO1rZvaVA3VgY6r2uL+MPVaAcyDVhnK/iGPBJpgSTP95UFOPcAU5AHLNIMCjRfdFhK0uTa23jZrxgUnd5Klka7916Aecj49n7ijUFpwgh2/g3eezlB4ohHcL8A3gVOE0IpR2zi1vBCpr0tRijg8Q6LF1k3jt8xq4xLJkqvC4lH+140h/UgjrHYEhmcZAlid538gACRLTG+EguDVhQlOot2ww== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UDnGPb8k7J7tF4P95kvy93aYxagmeOsStxce6TmD1V0=; b=Awvb2Vkr07usMmReETkYRexbT3Y68wmewyJ1x9xzizk9orss7VDzwdqxIi1oMJbM8ho06ZOUS3q3aymVzhZUh36C0EKp+jQA1WMUt4OrMSZI+QOdwq3OH7WZg2hsWRnIODUujn1+LcbBauggW0EmmpQgNspLPS8IA093/O9XiN7jBzGQ/NhypELg1KlN74V0fg3QoPeUdQ1SI9/NzXeZjYt3WHbYpAGGEFcRMWJ7zMgcvJErAhcm3uomv54kBCwiwDhM1rXPx1lpmoeFCEpExnHLhBQPzASxyqyGAISSH+F3C4Lwm237mxEpRzP3CGOm6BiA5cqYUqf4Wfx1MCP4qA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UDnGPb8k7J7tF4P95kvy93aYxagmeOsStxce6TmD1V0=; b=KDKwnODXwx6usxOFZbB42+00skMAPm7GK7cLD5+i79d1bk4fmYMx/KhNmO2kbWU1ek5zuTIA7MQn9F7FOw9xdejxH4TS6r4Ob+RrqlXTATY0SuscmvPvfSIyvKGVRVM1zhgV1x5FVhecB+Ei9nm/62Zm9zGM3qT0UcorN4YwLuQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA1PR01MB8062.prod.exchangelabs.com (2603:10b6:806:335::13) by SA0PR01MB6460.prod.exchangelabs.com (2603:10b6:806:e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15; Mon, 6 Mar 2023 05:54:30 +0000 Received: from SA1PR01MB8062.prod.exchangelabs.com ([fe80::fb0b:d681:8228:bd50]) by SA1PR01MB8062.prod.exchangelabs.com ([fe80::fb0b:d681:8228:bd50%6]) with mapi id 15.20.6178.013; Mon, 6 Mar 2023 05:54:30 +0000 From: Steve Clevenger To: mathieu.poirier@linaro.org, suzuki.poulose@arm.com Cc: mike.leach@linaro.org, leo.yan@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] coresight etm4x: Add 32-bit read/write option to split 64-bit words Date: Sun, 5 Mar 2023 22:54:08 -0700 Message-Id: <4e74e75a6e489403aa2cc108ac31639c57973fce.1677881753.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: CH2PR12CA0003.namprd12.prod.outlook.com (2603:10b6:610:57::13) To SA1PR01MB8062.prod.exchangelabs.com (2603:10b6:806:335::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR01MB8062:EE_|SA0PR01MB6460:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aae7947-98f3-4f1e-b9fa-08db1e074088 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xIB17LMf8En+pHLOWU+rnzZQg6ge/Ly9CGVRBA9lB0m5fNyvftQmUqlleqUzNahZcPWVQ/jUWNX7KwP3IL8TRtfBbhZngGImssqScN1wNbWTTzAPy2SrJk771xe8OoNJ7Jsq49dCkecGsra5TfPxWvqp7kmSOtRzC5rQXXUGukKPX2kLLmkb3BsMTgeQvVabnEWuwZyBNu04shUA3d57S99heJCr1niKOhVkU3Nv0ftWkiMkoEX+/fREvximA5F/gWZrFHqt4+DXiVaPlBiJncU00fmAL0owKiwr4NmrwE4w0L9Y+kDoTY+MbXGAi+iCBBzJrzt9tSQ6Zuf908n4IW1JIDa/ntykr2xF02QPOUJcUb1hY08MIw50e5BylPL3LOr+4kMby42/4A5F3J/iC989FrLHnW45LAC5WYqoNkPl+vLmlOsw/f6PrI6deb8MA7MPF5X7Dy9OwQlzxe0KYE+XpGEC2vHv/rCTMgQecD4wJlL5EclX6k6Ec0AFHfSg1TKG4UqLZCJZAbc6UNdUG98g9AI8D/fDviUBjhxavuo6QkslfJeL2uKm74zlaiemLMJNDpKz/LnxCMO54vjfsMy6jM6/LsYZjbR6GfcGpWTRk60PWTDx6mK8Ryt3DF/fRCbrS7mrX+3aADd/iSW7onhy+3EEhZjnPx6aYdTp4vtKsPuvSVfhz8Y+69M+4RyoB97NZFy722ZmvXcxJQhlzQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR01MB8062.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(366004)(346002)(39850400004)(376002)(451199018)(6512007)(6506007)(6486002)(966005)(6666004)(83380400001)(86362001)(38100700002)(38350700002)(186003)(26005)(2616005)(41300700001)(66476007)(66946007)(66556008)(4326008)(8676002)(2906002)(8936002)(5660300002)(478600001)(52116002)(316002)(32563001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ooCmZuvrf2Gm4bICFFXYpnG/ykOljhI+a/Wvr3/YrU31TqNEcJswU4/eeeHK+MVYect1TQdbfYR+el9X/h9H3socayLF93iXdeSQygy9fCHc2E/Ki8u2sGgh05TTz5gV3oGhqWrVNuLBK2OmFjHv2mbqBfvtEkRTgm/eHzN9ieFKWLuElW8chjVBPylEB5u17CTwWiJLzQzWGfkcLvX1TeI1fE0hu2P/P/U9kwKm4R3rfEo+pwXJisA4A8tWu4woUa1TEWbhL/ly1FpKmEZkMe0/0aerAjXZ8kDDN1LxpiTp/8vQil6YaEs3j4K0BP8klR7jlyl8ojXdlOiaV5rugzMn2voX40bxlWS3SeJoarSg7PNwFCJB2NohX2ebdDBHORzgWybfEMrDHDPkleZuHDIRffylLutQRYzavgUvUL7gA87Li21J7Ty6DdP/hwtwmpkfKo27jdalk4GKa1oFvKp73UkU2hu4QU6w6bFdiZ/0lYVlaqHu3BEo5ipD+VToEoTVelIZEZL12V6b1CrQqSpIOihZNK3mDdXYbQZufzWzzrzgLxVlTRn2JiiGmHenmuifjIfl6oXevDcYu6nc1meimJr9pszGo2r41FvojAN7y0e4bCI/F7EDNgVj2hxIePgIpri1nenVAo0i1o+ofgcVH3o/m520jPWgspWY7NbY0ysYryYQ6TTxBz1wqkSlQexlo1rzUbP40G16Qnl0loZO0hvruVpZFxIzfpy0HQe+B5TnUIiLmME5+BYWPMa4gNB5IkuHIoe0sxR0ekLrGIqgivVvPDZb3Bq5XpgMDujeSGrvEXEKDrRunmFAtHSRwPwNbewrTh87NG86oF58Nfjh5c3Mt3bvC7Qz2xCm16yNOIhrnq8avp05Z72G2wTAtMD/8lWCAA9YmqD1iRq288CCsxgBBf9g3f/V3PSUnaPyyPxMCoLzUorAhQx9FADolND51q8Sy8F7cH6LF2x5Rq7rDLfMDt5b12UUzStc71tX5wR2lzliIdInjSXOlzhFihjHNBjv4ti2PX6z2MzReO+HcCoyr7K/Lx7o8DmbVIXpxUOvUXx4vF3grFfru+V+hHfyTIErItZfXYRjbgerj6h1wFeglzZBD0RCZlU0INBaDTkDK7SNn9Egyl7X/iM7klF5SkoxWp5RRZTX5BBhSjZC1tXAGWHxpLL9bdJ58QeUc2SxI7tgAbxxIwZuQwKy/EfCHF44u4Sev95BnkabtAM1sBbStzXH4ae3kB0BThIYsT16J9equ7ZS83YVqfRDKvlTu+yh3H/8OQl7gMx+SQVSAt/SXLvfr70N8C3bPnzunXxPmbc2c0z02qmFyo9Wkis2KQsOB95ug+RE566lK8TstOQ3LsgrOgnL9z4sc6HS6KrUhuuiPHMXshDKpQQFYUIpd6SKCf0lR6qnxvA2cwDlDvDYqk6CuAUK15ZpAb0SakXF4xgvVhEFtEq0BPlGslVA7JYHR3aa7NgC4Jbnv0cEfyIxzJfYqTvbTfqM3C5cVFB3z0UKCCPGD5k6ckj5ETtbqNHNC70PmYbM3Xww2MYgVk2uzHofNxdjuWACPNSa9LpjLGmHHdKmH47Z94Csw9zuRN1RZcbnLKAt4SdxhIcjlII6wGCq6Hoog1WnAOxZPowyIGFd4pxllyi75hm5 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8aae7947-98f3-4f1e-b9fa-08db1e074088 X-MS-Exchange-CrossTenant-AuthSource: SA1PR01MB8062.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2023 05:54:30.0457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GKX2PRustEDNR2xAi+IXYF7Y7J+mP1NImmvlPm8bm/I6HcmyQBmdedUrTzdJ2gXeyCRhBmZIi8/1rWbDkpMYFpfzVJ4FzF/TZepiLWxBdr8spbTPw+cLncfiEQPB9I/B X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR01MB6460 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230305_215440_108945_DE369967 X-CRM114-Status: GOOD ( 12.28 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org An Ampere Computing design decision to not support 64-bit read/write access in the ETMv4.6 implementation. The Ampere work around is to split ETMv4.6 64-bit register access into 2 ea. 32-bit read/write accesses. AC03_DEBUG_10 is described in the AmpereOne Developer Errata document: https://solutions.amperecomputing.com/customer-connect/products/AmpereOne-device-documentation Signed-off-by: Steve Clevenger --- drivers/hwtracing/coresight/coresight-etm4x.h | 58 ++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 434f4e95ee17..17457ec71876 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -539,11 +539,6 @@ readl_relaxed((csa)->base + (offset)) : \ read_etm4x_sysreg_offset((offset), false))) -#define etm4x_relaxed_read64(csa, offset) \ - ((u64)((csa)->io_mem ? \ - readq_relaxed((csa)->base + (offset)) : \ - read_etm4x_sysreg_offset((offset), true))) - #define etm4x_read32(csa, offset) \ ({ \ u32 __val = etm4x_relaxed_read32((csa), (offset)); \ @@ -567,15 +562,6 @@ false); \ } while (0) -#define etm4x_relaxed_write64(csa, val, offset) \ - do { \ - if ((csa)->io_mem) \ - writeq_relaxed((val), (csa)->base + (offset)); \ - else \ - write_etm4x_sysreg_offset((val), (offset), \ - true); \ - } while (0) - #define etm4x_write32(csa, val, offset) \ do { \ __io_bw(); \ @@ -1091,6 +1077,50 @@ void etm4_config_trace_mode(struct etmv4_config *config); u64 etm4x_sysreg_read(u32 offset, bool _relaxed, bool _64bit); void etm4x_sysreg_write(u64 val, u32 offset, bool _relaxed, bool _64bit); +/* 64-bit aligned to convert 64-bit access to 2 ea. 32-bit access */ +#pragma pack(push, 8) + +struct etm_quad_split { + u32 lsw; + u32 msw; +}; + +#pragma pack(pop) + +static inline u64 etm4x_relaxed_read64(struct csdev_access *csa, unsigned int offset) +{ + if (csa->io_mem) { + if (csa->no_quad_mmio) { + /* split 64-bit reads into 2 consecutive 32-bit reads */ + struct etm_quad_split container; + + container.lsw = etm4x_read32(csa, offset); + container.msw = etm4x_read32(csa, offset + sizeof(u32)); + + return *(u64 *) &container; + } else + return readq_relaxed(csa->base + offset); + } else + return read_etm4x_sysreg_offset(offset, true); +} + +static inline void etm4x_relaxed_write64(struct csdev_access *csa, u64 quad, unsigned int offset) +{ + if (csa->io_mem) { + /* split 64-bit writes into 2 consecutive 32-bit writes */ + if (csa->no_quad_mmio) { + struct etm_quad_split container; + + *(u64 *) &container = quad; + + etm4x_relaxed_write32(csa, container.lsw, offset); + etm4x_relaxed_write32(csa, container.msw, offset + sizeof(u32)); + } else + writeq_relaxed(quad, csa->base + offset); + } else + write_etm4x_sysreg_offset(quad, offset, true); \ +} + static inline bool etm4x_is_ete(struct etmv4_drvdata *drvdata) { return drvdata->arch >= ETM_ARCH_ETE;