From patchwork Wed Jun 7 08:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilkka Koskinen X-Patchwork-Id: 13270163 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 162B4C8300C for ; Wed, 7 Jun 2023 08:33:16 +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=OcJHDuprvhkN4yVJWmDava5C43rcr9sYpI1GaXAfctY=; b=Jo6pXVDTUgibyq AmE/jmxkHLWALMxAC7zNXh0C/cFm6EsSvnYVGJdghKrElA7SWblhTcgADlifqrxicgzMwq0Ao1wCK YEw11IZ5gUtmB7dMB7kW8zTWdCfDLzMZbqwXg4mnZl/IN9WUBoMwdwYPD8ytOLLsI7n+q4vQQl3tq Xs7OnC0VHatQ8b6p3tamRRO9HkEiX6zgUzN9ApPNbro3SkrrrQ4g59GwnbWxji33qV+IxpJBHB7Fy etRTbcU4MydQclEhJHo4ab0a/aPc2JTvNWUy//Sa83FmCcoXKkBQmaO1GO+c5bUIXHIqxKTvFiYYE og2acqQqEbcaSnq/eliQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6ob4-004yl3-0Y; Wed, 07 Jun 2023 08:32:50 +0000 Received: from mail-dm6nam12on20720.outbound.protection.outlook.com ([2a01:111:f400:fe59::720] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6ob0-004yiq-0v for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 08:32:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLWXgikKLtuRonol6spYzSaenBmzB0an3gPpZcgP5IZLnTFZtbhLArXIQNMxkp+M6V74QVJt8Jhy+wb3udgd1kUTDDNgDGPqPDpOr+D4wWWKqVFeGscQBeQCOrO/wkxmOM+eJgf043SEgd+a9arK5p/GdafGlPrZFazx3xTXHpIvoHZjhnievrv/3WDB62wH4/NtB9zuugoIvRI88Z4WwpeFVom//raw/9C3kMhk0WeXJ8AHQ633MlyhYe/IggZMJ7WclObnUffQL0HJ9B4Wqo+5k0mSdwHZV5Nh4Y/nvh86IPdwgq5hOFQ+9nB+5Mw7TlBx/WAh139H0/UaTQZFeQ== 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=qRZxhGQrvCK/OKIHPpTr118yEW8wCmUFrDRdcojm2Gg=; b=ZLTa4MyxcppcH04rDyfE7/qmzZ2VMo42ScYlNO+8Wi+Nx+Jc3SBfc5EHs0qm3krKNwEdgcG5FuhXcS7dMZCb6BZ1yJ/i3+5lXNT6/ckbFASRs194M0pk8GYYS/f9UlLZ4S8S0IOVmmg2bh6d9FjJrTr3+FSSR+sQnncgCp/nezis6bEJviBwqyL5rYO6bOx2pjnsRfg/cwgjjdU4NffyUkrJeRajUqgvK2Nv2sn4T4NAm3qLneXIQQJQJbAy/NlKRxBtrw5Rqi0UVlb2bGTuPfMsERmDP/c09y0+Jz6eRyZoUTpgSjlP/u4HhuCyMSkwy+kJPQchFSO8DXpstH6jwQ== 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=qRZxhGQrvCK/OKIHPpTr118yEW8wCmUFrDRdcojm2Gg=; b=ZhnG+3T9rLLg0mlIAQKOdpfFtE1JoefF1cM1DWvjbsF4vDDUDinIZ1YHL3PX5rX8iXmOjstI5uplAdkfPRhkbJIXM4TZbWYamjrNjj74FavbXqfIg4VzFM5nUzSl/7g2zteeMT1hBxVhV32TaylSslwG1u4EDysHW4d6jpBymBU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) by SJ0PR01MB6304.prod.exchangelabs.com (2603:10b6:a03:297::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Wed, 7 Jun 2023 08:32:43 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::5aae:2a5e:15f5:8196]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::5aae:2a5e:15f5:8196%2]) with mapi id 15.20.6455.030; Wed, 7 Jun 2023 08:32:43 +0000 From: Ilkka Koskinen To: Jonathan Corbet , Will Deacon , Mark Rutland , Besar Wicaksono , Suzuki K Poulose , Robin Murphy Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ilkka Koskinen Subject: [PATCH v3 1/4] perf: arm_cspmu: Split 64-bit write to 32-bit writes Date: Wed, 7 Jun 2023 01:31:36 -0700 Message-Id: <20230607083139.3498788-2-ilkka@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230607083139.3498788-1-ilkka@os.amperecomputing.com> References: <20230607083139.3498788-1-ilkka@os.amperecomputing.com> X-ClientProxiedBy: CH2PR19CA0009.namprd19.prod.outlook.com (2603:10b6:610:4d::19) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3590:EE_|SJ0PR01MB6304:EE_ X-MS-Office365-Filtering-Correlation-Id: 377a1352-ecfb-440e-a4e9-08db6731c33c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4wB8M7nkXrsw/zPVL7RaFOj+qSoo1GmryHXnmSr8QDIqfbI4kq6DeEhluW7yTpfzawXMEdlOLQkqaf/Sx2lfX6YQByfTmj6Ge00+5OYXOVUwGLyG+rRDu4o59Md8hNlBnWiZaS6ufX0n4maar03HHgJJkpFFWIi4xdWsdWv/G6/Zo+P2DkX3Y/mSzfvLl9Q7yyhmBPVRqCpRCA5d5RLk7yYS5QIA0v6OLMWW2FQ11GBC5n5MwDIMQikfDHuVdcZ5hn355Ltv+v+PqBk65w8he0ceCMEs4gEvwLSyBOm0eZ+ZnwVC9jbaiShJxJLkIouUQEdBCsGxkcyFoInNH68vumni6wAZ8Nx0WoqLamWduhKEf0t80XU1C3JQjyyllj1/e+0SGkGDEg5D0jckLmxSTjEjwxRcwRhK2Zwj4IDxbRMa5g7SUeLutldLbxGKRoUUj0fRo51s7K8t9joZQk2BOGcNhKwBmP/5cut6iEKzAByVPojr219zKLuRE/pwBskBNyslK/RGIy0HeyosdYMVutlYVmRSxrBei4MeRASlD0y78IE5OPpyo57amMU9yiLUGwbaxJ8KZJakzejrE20n5o5g1e+AvbuqLkp8iN/Z/YKlnCFlJnY5Qwf9UvZHITDJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3590.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(366004)(376002)(396003)(451199021)(107886003)(6506007)(1076003)(186003)(26005)(6512007)(2616005)(83380400001)(52116002)(6486002)(6666004)(4744005)(2906002)(8676002)(8936002)(110136005)(478600001)(41300700001)(5660300002)(316002)(38350700002)(86362001)(38100700002)(4326008)(66476007)(66556008)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /NyPUTRQifks3ng3fY3UyWvMrde3UKKjDnf4UIjRafhMDuOxQYHYw6kjiVWigdVYqieb+Nce3wF3ZMWhWXoh3V29LNClCLGZBkDRwSPPU6EqGeJMtvOVIbno0aTnEwy29nkfwg+Hk2PU1gMzJ/xzxPNmN/guUIP4wQj5DIqcG8kQOZ/fTcximX5YQToXuJ0LzcpPhcqAS2l666Vg5/P8PvYmBTI+XflmuWeSbivQ0V/ptW250DpDT67aPQh8wUjISz24jqv1JKJk9QgJId2AFmbjFfsbTCvCShBZzZRazs8b2aMVE61YnwKs4IEFcE/9fA4BTnm7UvAdLPxJ2BH7+qQnrmln7nMUKs5gpuwYUr6uzzM/ee6SyRJ2EFBSvDH0yBIH+ZTsiZ95A2PcqZ0MSpAdFKQFvZ6quWAa9SST+oFiy2n+5PUHy5mZNJ/5JcHq10Ysym1JQCo9/Z11qcVGH+rauunqKNFaqv5IUgbHEI1dwaAxkqL4u4BPW2qGURmyRtLBzkAbMzhjpygSjK6lpeGclZP2YK7bzOMSf6UOio5VippeW+qhIi+5XpcIi8NXepYL8J5CXEFgPJREPNzuv+j+92z3TxcvJEhAP1LNG1BNK0x+9SIwfoEv95lB9TXBZVSoiZa/4iaiX2w92trp2o4gCRF8h7dvareQ1M7aux8J+UGph6ThWqq2gVZfSQpUhD+BNeqig3lB4JEaWvN9BKzxT0/pQHYiS7xZa6HGcNPMN7WDrVyeVzRPf3cAhaOwSP1QA0ZCE9bGy4tT0Lc47vWyQPm7GGdXInQ3r4sfJwQuwI2lVSw9jOmsDhCvLsHqeCoXVM98okKK70Zn0fSJLJdvhNjC+nZvURWaHHisEGhgBcIZgJxQJrhdukCZ9rdwOQES5uHo5OiHEpJvz45DhoxWTM6LXS4U5mADowFyr9BbFCR95LQeWtOOrGgcz7G+PhvrcO5O12thpyZs5YQP/g2G9ZIbu45Ew4v7gMWJMELBnDeA4EArlNdlOKiNxLulDQgqm053e0Ell7Epz++DM5WBDT1oCPpTE6luCjycu2aQaPS0PgOYNpWe68WKbRXLJw3JXiV7uiTPieTSIJDO1a3jDAFv16PP+9Jf86cqBocWpxNizMRkbhSWfUELTHrs2hFEAye9QcJWBrk6b89FfDstb3Rz98xt0MdDaNAosWhUw+AQRWzmRIvQG2WfAyGiNKqMahVoYJuXa4zd3CLZVr5gmwycooPqs6XhUxkkfrt/knlzDbEFhj2m+/YTvyk4AGgPipHhPzRAPY1zESSx1orGAqp6blAUabhYwcNqKow9sXbEWXe/3MxbBfQmosGMHMkBuhXQ7XyMBX1o2Nt3XpMCDKVsMRVSwlq+aZBcRpcnmGYnvCw39Y7VuLeKea8zDqQMPiLMDUwUuezGqsr3sVQ6rokY1bjELXqquzTjLlEZTjWxpXGV1EjBkda/h3H7dCp+Ouzn/DRXobvfxqdnUkxb6efuQJe+58R+HsRP6GQq4rTrR6+4DnoewvkcP94DOkeLGu3bR5/mXegMWv/DHkFCtJEgIz72wMNS90umgGwaifi4Etp2heAZ6Mw3whxGGy76O82gA9FtkAYdoMZ2Uw== X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 377a1352-ecfb-440e-a4e9-08db6731c33c X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2023 08:32:43.1132 (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: DH00x18ptTWAQoPpvPNhCBu1vwb7i5syYSjB9SW2DFaY1MDktKkPjInxOYO/kb1scBjT4qDmlCarnwawPA6YLZW1KnqCTsqc1NNoWtrMAH6kqN+su6fE1LvX4L7VWMqE X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6304 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_013246_329184_CAFC8337 X-CRM114-Status: GOOD ( 12.84 ) 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 Split the 64-bit register accesses if 64-bit access is not supported by the PMU. Signed-off-by: Ilkka Koskinen --- drivers/perf/arm_cspmu/arm_cspmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c index a3f1c410b417..f8b4a149eb88 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -702,7 +702,10 @@ static void arm_cspmu_write_counter(struct perf_event *event, u64 val) if (use_64b_counter_reg(cspmu)) { offset = counter_offset(sizeof(u64), event->hw.idx); - writeq(val, cspmu->base1 + offset); + if (supports_64bit_atomics(cspmu)) + writeq(val, cspmu->base1 + offset); + else + lo_hi_writeq(val, cspmu->base1 + offset); } else { offset = counter_offset(sizeof(u32), event->hw.idx);