Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1860859rwp; Thu, 13 Jul 2023 18:38:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlExmRqXw5CmeqpNzx73JQS2p+ghCJOuK4whmEjOcDdT0z8zc06QyTpuflW3dWfcjrz2cxIK X-Received: by 2002:a17:906:6b87:b0:98e:1c4b:10bb with SMTP id l7-20020a1709066b8700b0098e1c4b10bbmr3110152ejr.35.1689298734137; Thu, 13 Jul 2023 18:38:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689298734; cv=pass; d=google.com; s=arc-20160816; b=j71RaBq3qAHegki9PCxb/eHkXUMc004nGq2lDOOiagWhBh5nQCl0m9JOvaiiTlzqxo foNrb8RlglbP3yMpb5qWdmlMPAMdAtNo3nd/A8Y/+9VVvdsqC27p0XD+Pchbof+QqG8X QeTv6PbEn+1/EQCZYD9CzuMFIEJQkdfZxsQbR7L2kP+4UFMrvA94w8OPMYHqpRFLUUx/ X3uF5OPAvAwNZqAboDCMA0pobkvLhjrIT8KTrccAHzC3angTr4iIL0Wv4mwJCqawcjqT pKG3KzOZSb4a5sMdtnWWWioocHiWOycgt/uMcw6cftWLlokESMArCyJRYzFiSTNbfpKT F4bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UyYUQQp9yBc4hP0w+WM6rga4/CQa0V5X5PZ+PPakvrs=; fh=26GyE49KjSE4+CIbBX0WsKdZgEMElM+fJ8Bjkxk50VU=; b=t6dWy6kI6y0xlgVxW331EVZEj2y8CGihNz0Nd8JDfU3lbMmb5sQPMb9OZyVeD5thB8 3b7hT1vfQJG3nrU2pCzh2GTg/7jGJhJh59EeJSh1FPvdf4I9PV725pcVieyb9q9R8DiK 21/0vAheg9L/+aXSgzZQX90hQCgu6GxFYHDaVPWfFq/uINJ9bKAcw4Ve89TVH1MEbviw lCh7l5T+h2G0aLxuz080OavZG4rKtPYgag2CJujSwxTUTVzfdblfPBezcEmmWB3Mb0GN IOtVEbsTO2Yf5QNVRdodFs+xoU8CD1EqhGoOzuNMo45qPTGVUd5HCEBGrMfhmsFB3sjX Ai3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b="g/d+4zTX"; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i22-20020a17090639d600b00988c76f9d4bsi7505198eje.347.2023.07.13.18.38.30; Thu, 13 Jul 2023 18:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b="g/d+4zTX"; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234597AbjGNBCi (ORCPT + 99 others); Thu, 13 Jul 2023 21:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234609AbjGNBCg (ORCPT ); Thu, 13 Jul 2023 21:02:36 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1902D73; Thu, 13 Jul 2023 18:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgN0HferY5jf21gGY+3Cq4XL0myk3K4p82RORmPmwHRMz9nosUSTbRigq5xMFsuvs50fKmRY3WjLJO3vNYvJLH4LLpMezX99dQVa0mqB2rbOlb1luRl/Ai6M2tTduW2D0jiCIfP9MXomaRw0UTjdxywF5YvF+VhLVdipH94Ha9eT0zVLGZZQLSSO5JaGDv2ujMNGQaS4ZmqFo75uMwBQJtVB4ZMUdWsRkLLXhTVFj0mgiHvQDfNz5iCmzTiJSf8F6COTC7/KDyXwQPm+0pTNEZdxwmN7oYMw0OiKln5jUEWtwlcj+eOQX2C865II/lRGaTaHFYbH0gSv9CXfpA7/Rg== 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=UyYUQQp9yBc4hP0w+WM6rga4/CQa0V5X5PZ+PPakvrs=; b=OgDDkzNGpUTtLBijQWfFIB7xQX9oX1Tj58YUMKHeDHTB+A+QI9MTiD+wDv1LlWvpB7llpms66iPInjVtEksJd2FLUuj6tqNi2CsrPeksNsY2Es357TJEukpMmPpPOFEJIjpXBQi+KOpzT7FHrWg7Z6q4NDiFebG3NY2gDxpY2G8kMcpS4cHluhPLOCtwRA1W9njm+MpCA8EeW/qoRhalmwiJ/tc5XOtskXeKrzn79o6qacPi6d0p73I1tDVkma7KTd6PPG969pqsK5N2FOEfkEiPGV8kuk0sG63vCIj6GeJSbIXkqVi3gpdSYyimfKqeraoy6HI16VyKVbwFyKYOlw== 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=UyYUQQp9yBc4hP0w+WM6rga4/CQa0V5X5PZ+PPakvrs=; b=g/d+4zTXQh4OoDbHKvnOS6uGKb2OF5TnOHGU4D+bjVkryi1uplC/q+DFOgqMv4c7R84isfs67MiSq6BMAa4sq/NINGvJts/z3F3elZSdIm1N4tVSrpu/ylu7CLupAZD81lyGvMChiZkY8rUg9ANHNcmOVVM0cWzI9uuUSAbof4M= 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 BY3PR01MB6611.prod.exchangelabs.com (2603:10b6:a03:36a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27; Fri, 14 Jul 2023 01:02:25 +0000 Received: from DM5PR0102MB3590.prod.exchangelabs.com ([fe80::235a:622:9239:3963]) by DM5PR0102MB3590.prod.exchangelabs.com ([fe80::235a:622:9239:3963%7]) with mapi id 15.20.6588.017; Fri, 14 Jul 2023 01:02:25 +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 v5 1/4] perf: arm_cspmu: Split 64-bit write to 32-bit writes Date: Thu, 13 Jul 2023 18:01:38 -0700 Message-Id: <20230714010141.824226-2-ilkka@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714010141.824226-1-ilkka@os.amperecomputing.com> References: <20230714010141.824226-1-ilkka@os.amperecomputing.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: CH0P223CA0013.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:116::30) To DM5PR0102MB3590.prod.exchangelabs.com (2603:10b6:4:a4::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3590:EE_|BY3PR01MB6611:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e29187d-a754-43b8-178c-08db8405fc93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kd5LZAYiQ6Lgo7MVla34/8WlwTAEnrsf/WbGyOaXmwUkhnq2iXVb4lMn5v2GTgOE+5799l5sCoWZNXl9DIDgzxGD4adq3nt7po66+2U+h1am6rO9l0uYFysVBywf1lUWCH8LHUoWEUdny8XWdJSdGXWRd0i7r1H5fsA4txHn/b7XGpwEkG66Rw/U4pcAAt2yNAFGSoaU+59kuUwh+t8pYzWb/vhaVtTq/UUYg5hPQ/kgcOO87lwSiNV3yJXnTJVvf6IcmCRV8tbEMifkg/jW7dggak4FQpnre60MfVZcKZOQkGBvRuEAF+HBmuFgNgpirWJXJo8tDRTwfQLaD8t9yVhOPu5iGY7SrXk2/q/jUQSOgyO3dxziJQnv1z/xbaro+7QIW5Wvi3/yzokrRYG4e8SRxziyR4Cz12z7uVwfbmkBVr1BQTdyPfxx8zxNA/jnQJb5Vxbz4pkirlzJy8CMXftoiH92YC6z+C6rh1karT+aPZCrEvYJUvOnxEJjpYhlNcaCwuyEeUN0bkCvbEktltCIHpBzofA2iUt4Zgb7rNY/cGDW9ydJaYrMaUJPNR6c+xW8VV0oaJTFGnxTdaXXDoOFqUvurDhk7bqhglthNsKmHcHFl05jZnNxv1DRM3sY 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)(396003)(366004)(346002)(136003)(39850400004)(376002)(451199021)(2906002)(38100700002)(38350700002)(6512007)(83380400001)(186003)(2616005)(26005)(1076003)(86362001)(6506007)(5660300002)(8676002)(8936002)(4744005)(7416002)(110136005)(478600001)(6486002)(52116002)(6666004)(41300700001)(66946007)(66556008)(66476007)(316002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BGzk/j4u/X1AVOBZPe682S2I8XmnbqEWAGbkcIEkENyMU9qx81XvM2i1q8NQ?= =?us-ascii?Q?b5MIuVl3iXG0stII0B+U+KRfrkvb8ZVo6i17NWesZdbJN8YGGYPxhZT+jnJi?= =?us-ascii?Q?0jOZYP8+2pb6Z6hY4477jVIQ43M7oEk2Uy7e369BHb1A4mRtT3yfFuJKUOky?= =?us-ascii?Q?gikAKg3DkmQtfZB8oyLWZpPFQg5mp912cFe4xbNp/Y6JiiWGegoU8vR6wTTL?= =?us-ascii?Q?5G1FABWPnQDWKJiSkHqt+71Xd5XW18+gZzS8M4LBiQ+99/ou9jOvVDA+lEb+?= =?us-ascii?Q?68U0Xgvr56uGnbMt5gYzFhpo+69tWaS6A8+nyZVVGgvqoY2QxQx4W6/8/8S8?= =?us-ascii?Q?vlvWYBXYUu5kYVApaj1MBf9a/hh65Q2qLBRUtjrKNbIw9Q0WC967q9EvkP7P?= =?us-ascii?Q?ywifZkTrZywgkxcBroRdrUja+NYNtUvMEfACO5kiaxC+pVmOwJAAcJzpLQn9?= =?us-ascii?Q?x1SKk6MHvXToWEtyhM+J/QpYhVw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B+uX6?= =?us-ascii?Q?mHCZB9i1RmvJFScgjYuVYX0z+fD0QFI+BDL4l8KvvxGtmtwSNU/kw80hcGW2?= =?us-ascii?Q?k6sXA9qn2dEcCMFQmZUWSY7IDZ8oMYkhnjRgbEILbKWr9fUtZOJaK1S4Mk29?= =?us-ascii?Q?EBnIqtlZI0F7vLOn5CCQjsrol+ZsY+AbukLpP2lJvlY0XK9VgcUvpqJ5C9FK?= =?us-ascii?Q?UixQrurHwtEKoEcJTd6VdluwGZjNBa9ORrOQtQjPdrjVTIij/jvFYkSZENAP?= =?us-ascii?Q?a9q6TC2mTzM0wHleLNxhG04=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e29187d-a754-43b8-178c-08db8405fc93 X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3590.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 01:02:25.1959 (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: m+wi/Wgs2LAVthooEQ1PuD0IBFpKqx6zJsutQXPFymyxLjccluSphvHHrvnTIfeF7CB6DVia/1xeFCh8YGzFxMX+XvEFeyYs2lfLhAgEzv01ILAaJRY4NC2VKY5H3aoB X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR01MB6611 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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 e2b7827c4563..0f517152cb4e 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -696,7 +696,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); -- 2.40.1