From patchwork Tue Aug 15 06:35:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilkka Koskinen X-Patchwork-Id: 13353611 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 DE675C001DE for ; Tue, 15 Aug 2023 06:36:50 +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=D2LGNBhnw2wq/KYeqqrvfbZ5OEZr+0+r7K7usTKFgCQ=; b=VKay3zwuud16/T sYCFr4tIc7hmDgNKeR/gFD1VLjSuyRNG/+MZFQ348zIpJNXWrCzLEBV/uHcTurZqTXvkyrbUJzpTn e+31JWiBtizCUElWQkWdLQbVlFHM/hXuFtz5hmuej9XSVoYXC4FRf6o4R8xtsuygJEbU6JWiC/+f5 +Ll3m1Ta/jgKrcJalWCFbWkkeZVKXIuFuxuJcYf4dI2krnd9/WLeE+qC+wGQm3U0C+huggebyCWBd QuG90DcPPjmQwsoz9ViXd7yKuVZRkHB4pvchh/BabjObmYJiwxBqpwxKj+Zkno7Ry97emKRGnGjRz UScrCgku5vkfc0G5HMzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVnf9-0010ip-26; Tue, 15 Aug 2023 06:36:19 +0000 Received: from mail-dm6nam11on20714.outbound.protection.outlook.com ([2a01:111:f400:7eaa::714] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVnf2-0010gF-2d for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 06:36:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W0vzfAvAnsB+3hmAyY0STPXCJNDWOyv9bqMsR+DhL4a97qGryJgqulbI333lavNP2BYvWsZ1lpo5ddblOlWEkaRoFMjQTSoiFgCH7cgaTxY4qPZmxVKlQZCcHM73/eoGDh8B9A8syhdtySfn4vZa8aejAb+qH+pg2r+aLbXRGKT6fVR+IELcTgaEXNezqay5TQzZsGCjB9msgtlxlVklWEe27/Lh7SuZo6Ez6cEdS6fNF0Gek7wz3jRYVx96QE/bvZMx4axR2qCcAgT/Jd3M0bBJVj7xrfGbt5HuD6EqUWGwOO1aViR4b0pCW8ZYxzyVItMYhdIviEAmEgeeBN8eYw== 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=9eW9dlQjCg89VMBbjMfF2DkVyX/nPvTG2uODoCvqBSI=; b=gxr6WupCZGuCUh56LUBo3NNBqNkcfUsuRLd8T0oCKi7FyItoda3gAMLy0BpZoNByYx4MYaV94Wee6ecyDUsGHe3oLWVYQeXbpNDF5UnfX6EsRLN60rlI66JOnFDaYesV3NIOFXRSisiUj9DUqJVR+0cXmW3eAtbFv26H9g48umpgIMKljQ7taLnPHQD4/NJukTLnQXu3iacWjgBN9HAJo0805BfKZvO+VSq6A7Trk7fJhSCMOI3zfk1uYTuFFFvvT7/aV3AUdjHKaKZ+PQ5q/EPXXEqDQBdcR/DsXscU/yBlWYwfYz3CKJTYAdHBHxsJLFhiJFjlQ8sWyVpCRJ27MA== 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=9eW9dlQjCg89VMBbjMfF2DkVyX/nPvTG2uODoCvqBSI=; b=Tq3XqUhFcREmN+94HC9nSyj+6j86OaOBbZ0F4+MVzklgAuW/x6l1ZD7uesVIAXxTOk+TH//GBOGHIWDrMBaNH8txY0d9Wyo2DwLOlZRj5T6GuTqFxxTzsmxfgB0/ci8Iqu7D05FcH45FU6G82asOmjam1rKiBOkeTMYsQJQ16Ms= 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 PH0PR01MB6117.prod.exchangelabs.com (2603:10b6:510:9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.26; Tue, 15 Aug 2023 06:36:05 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::ed8c:18b8:dac:2331]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::ed8c:18b8:dac:2331%4]) with mapi id 15.20.6678.025; Tue, 15 Aug 2023 06:36:05 +0000 From: Ilkka Koskinen To: Will Deacon , Robin Murphy , Besar Wicaksono , Jonathan Cameron , Suzuki K Poulose , Mark Rutland , Jonathan Corbet Cc: Ilkka Koskinen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v6 1/4] perf: arm_cspmu: Split 64-bit write to 32-bit writes Date: Mon, 14 Aug 2023 23:35:23 -0700 Message-ID: <20230815063526.9022-2-ilkka@os.amperecomputing.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230815063526.9022-1-ilkka@os.amperecomputing.com> References: <20230815063526.9022-1-ilkka@os.amperecomputing.com> X-ClientProxiedBy: CH0PR03CA0359.namprd03.prod.outlook.com (2603:10b6:610:11a::19) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3590:EE_|PH0PR01MB6117:EE_ X-MS-Office365-Filtering-Correlation-Id: d067b9c2-821e-4f55-e6ef-08db9d59e6f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PbkwjCJDLHdJZBTtfzkBmZltA351DpKUCW8zLZXWgsYaC1PpN3yR8B4gndfZSEV/AioFv4sNjNxehjxp5+ORMJUgj09x4ZxORmVJ8AW4ZauWx2J1XwqiWGenxAt/4D4hy0sgohXoMybr+hxtzE224QU48ACs76BX//uEvT+Re/3flnha3FfMKGTbR/+ET8IcxtL50TezI0BFkIcK7KQzMdJeYgcCOzB2tTlFxZ++iX3pD2rkxuv4pf5fhCVpLqDWv28ppcs5VQQ8LsA0faxASBio9MbwwdEulJuzm+bsGD1hFBDh+G10y6nj8E0weD6Ix6ACCKt5l64KyshEU3QOUtCian2AOJKqZ1UfTHH8pTqg4goONFZARFZWG1En7/SXc70jXy2oOMnUz7Ae2KS+V1cORENTUqWZbBR7o2MKyJh3MaHxJjA0YkbJeh68zOPPUBcmyrz7CPKf8eIMSSJGzxkInC17Xq8hcS9CgLFwlBKEeduP13kREf7NiHWbJyJIPqT7vjMxw/e8Oa3qoQg7EXBzD60Q5XpaHqgXQ1hGnLLXB9t18v3gB8leKVCrZtKVVpZEUD9cEhYYfHhiekjxa4QghLw7QooSurzySsb3M1vY6ahYglzDX3obGaH9k70O 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)(366004)(376002)(136003)(346002)(396003)(39850400004)(451199021)(186006)(1800799006)(110136005)(86362001)(478600001)(52116002)(6486002)(6512007)(6666004)(41300700001)(5660300002)(4326008)(66556008)(38350700002)(316002)(38100700002)(66946007)(4744005)(66476007)(2906002)(8676002)(8936002)(7416002)(1076003)(26005)(6506007)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /BeCrSvHlu8PSmmr6q2wZnarwB4lTpMIL0rX2oecd3jHRLBAaj0qCYGxdeWL0e5TcWhysm3k91nvVUXoaLI/8BWjz1zgT1fBc75oFEYU0VyLflmQRMr1/swgmJeXJzXOKAlUULzkiM9ptjZtBd8b3R5DPwcaNebqvgmdLYYOMqJ34NFzBcZyW0lYEiVu5x8qrE4D8BA2BsN4CqzGTl/95SJGW+AtrqyY3pQjKXAVyzp3AxyTIYG+URxwClnGTKonQ9g2TPpfSt2y8Bkyi7YaBkRkw43V2cPqox4zUEE7RFOx3TzgD0GqvZo7TlygmmidlsktA8AyhrTljc6/SuH1/klJvKaqvRej2n2HYS937VPAM/wEpzBS9wVqO84rWUKhLmrrjYMN+u1c1XgC7mglPRZW2zodZ3a8M5fud8o8tJTmq04MG/56ifQOUGD0uppQzrVsYSqBGF3o5zKyUfLkto4lgzC90O1mCI5zyjXyoG1M+Eo57YFbl74U1v9TddeI5xiyGHT5qJnsCoK33Oo67lVMJrTsZwK1mQ6lCOHCHXRjIdqEBSt9MjegSOrmPeLdSCg27wS/rRtrh1I9zigufPxBiKEYXwE23GdKUIwC+vLeD5qe4oxAzK8TiqKRAc8dUz0P5hkTuOcCxuDqyaKn0bk+NgKqlhlqp1b9BAKiEuPoUYc0wK/ZuuwzoHYmd+1+v+0brdhO9vu7f7Cm0gJDUggjlDk07HBfI46t2gQIepEe1ZSUloVqoI8POIXfh/02pd4+0dCBSz+SufEPq5cQWWLvJXbsZk1NeaFa1lGJjq62um05aSX//Kqp0f6n6MZgSIvRuBFulOr65GaX4WiviA131j+EbmqBKGLFgplhcS9A1iHbZqxBrGTkxATxFJC59Lf5x/F78rhofkWz41DOL9TapKkaNO6Uj1nCg2LvHGpcgcm61nK8mUKh5i8I6xvIOADhaz851sF5xHZdqfGYIOREZlA9LbSweJDK0808HOW4rKQucP5xuHV202/ciVDZPKMVS76OsOhMtSVk3y/QoklqnzSzx5AgYUM7U4fINWbO1tvRKGPAj7+liS4nTNWeMkZAF2W6nZ6ARc4jCAHI3uVJvlySUG9OfgJGawDyHUPRYGDnC+IDgjd/MgqeVPuQcmym9Y0/TqruoUTzYG9q1TPeBNJCvfWGpJS1UmV0rA3SI+M53NGQCb4lw9GMnZYuu30Yv4jIwwy72CO9NutkHksQlGqRhAZ8nsjK6zUADh0NtMC9/hP5nOmPByiCQEHCfh59KbyskvaaxMiUQLRwA6uC53a/uYk2hoMcoZE9FGks1gARf7c2bDmzoct3V2TviwVxHW2IlVw4/Glee1ed1nimbUXKskSGnzH/kDHgrEwU0DSSOhGIXOIxPIXmccqMtsNmED0P+ynZJCqATb0nqLMjSYBoedrCGMAAoX65qadWM5QFPkKrhI1RIvkux8qoWzsQ5WZQaWN3yPcVUcxRKNiDPMv5vAaYJu1Q+7ADA9cziRo0hgQ10hZItdYLa3vzz4AvFkVBBHadsf02n+RK4ptrvOoGJrML+s8ENjhKkfIq/QZdF8NvUIC61s90/stx/BKYWPalKJaOEkovMiwI37FWOtyArj+Xjchk1V+5bio= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: d067b9c2-821e-4f55-e6ef-08db9d59e6f8 X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2023 06:36:05.7020 (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: fdZhj6xOwDsB7DCPhhguDJxbezec8qj0fAVyjeIlUOJ0w+y/w0eFc387rx/a6dcchEEvvKyqPcPC2xI2xo0p7HbQrps2GJugtgy5gIfiVPqYq2F/3Er9Ms84yg8efjLP X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230814_233612_854164_02D95C99 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 Split the 64-bit register accesses if 64-bit access is not supported by the PMU. Signed-off-by: Ilkka Koskinen Reviewed-by: Besar Wicaksono Reviewed-by: Suzuki K Poulose --- 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 04be94b4aa48..6387cbad7a7d 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -715,7 +715,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 (cspmu->has_atomic_dword) + writeq(val, cspmu->base1 + offset); + else + lo_hi_writeq(val, cspmu->base1 + offset); } else { offset = counter_offset(sizeof(u32), event->hw.idx);