Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2249349rdb; Mon, 9 Oct 2023 19:27:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrUn9PkqUCQ790IwoHwfRLb72GE3p018QQEMBFuYo0UHKCc+bmfMMfHUFgvlyi9Ewu6B95 X-Received: by 2002:a05:6870:6488:b0:1d1:39d8:da1a with SMTP id cz8-20020a056870648800b001d139d8da1amr21193426oab.15.1696904876622; Mon, 09 Oct 2023 19:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696904876; cv=none; d=google.com; s=arc-20160816; b=mSl/ReLk+pTgXhNMmH51Y/eezXk8TR2raVyyjpB5j4wN/oJWZGHH48oYTNZqKKTGgd USfHljdpFNWjWPIWSI+kOyx6zZ5f7wiiWbVCBwciW5UM4+Lz3rwjUabzUU4G69DoXWNA vsbla/ZsFt0BRcH7Xh91Btxft3QbkJ3gX1d0rIGh+/6GoPQnKIIRzqoCK0KyNAFEQhZ2 1ei/xX2sEI/r1Q2jnwtjJHw1F57OOctOcZUQSH+Sva3spudT0CSPkXLqJHPDtptkBsCU GQvCSFoTr2/AXbrPGQQG6VlxZ67bIvwDd5piOFYfurLj4wQwtIyYwwJfJCX7nojm8etJ tXgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=a2x54Zxy1n/A1XRA1ucp/sZnEDo6XDf2H1cYytN7f/I=; fh=IWvFafu9e7QHftKcUJ/K2Eytupx3wIwUpWlxeX5Js9I=; b=ucg1wlcEud47pjjvY8kCevUcOpwngkM1HphbyhHPRazFn3wPgBjhBTG0KGPHHJ7lb8 rHpoCJlleZynsmQ3+Zc9oFzi3UbT2j1snhq9WJOWN4nyuNFSEvCRcGhctK9m535ARGcQ EaJLxY0nxEcGuVYQGycpQR2hz9qXXu/4rA22VGzn/1RAf7x2cbj210SODlHvd6jtbSWm MkPcUgUF3//aqyRQmlQZxJvj2MoU/+ADob8Uhjvnb4z8t+Ioa3f64HM9H7bDbQ076jne qq9OkmTug1vHolIedJH/ynBT9kGT/U/XLzq21r4E2IZ3qCO9u8hWeJsFn2Mb4IbbppEp w3Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h6-20020a056a001a4600b006910a45a234si8725174pfv.202.2023.10.09.19.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 19:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D06C98106825; Mon, 9 Oct 2023 19:27:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441848AbjJJC1x (ORCPT + 99 others); Mon, 9 Oct 2023 22:27:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379403AbjJJC1v (ORCPT ); Mon, 9 Oct 2023 22:27:51 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 62E31A4 for ; Mon, 9 Oct 2023 19:27:50 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D172B1FB; Mon, 9 Oct 2023 19:28:30 -0700 (PDT) Received: from [10.163.61.202] (unknown [10.163.61.202]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BEF673F7A6; Mon, 9 Oct 2023 19:27:47 -0700 (PDT) Message-ID: <09877594-7d03-4f30-aec8-a0573bf295b8@arm.com> Date: Tue, 10 Oct 2023 07:57:45 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] driver: perf: arm_pmuv3: Read PMMIR_EL1 unconditionally To: James Clark , linux-arm-kernel@lists.infradead.org, zhangshaokun@hisilicon.com Cc: Will Deacon , Mark Rutland , linux-kernel@vger.kernel.org References: <20231009075631.193208-1-anshuman.khandual@arm.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 09 Oct 2023 19:27:55 -0700 (PDT) Hi James, On 10/9/23 14:29, James Clark wrote: > > > On 09/10/2023 08:56, Anshuman Khandual wrote: >> PMMIR_EL1 needs to be captured in 'armpmu->reg_pmmir', for all appropriate >> PMU version implementations where the register is available and reading it >> is valid . Hence checking for bus slot event presence is redundant and can >> be dropped. >> >> Cc: Will Deacon >> Cc: Mark Rutland >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual >> --- >> This applies on v6.6-rc5. >> >> drivers/perf/arm_pmuv3.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c >> index 1e72b486c033..9fc1b6da5106 100644 >> --- a/drivers/perf/arm_pmuv3.c >> +++ b/drivers/perf/arm_pmuv3.c >> @@ -1129,7 +1129,7 @@ static void __armv8pmu_probe_pmu(void *info) >> pmceid, ARMV8_PMUV3_MAX_COMMON_EVENTS); >> >> /* store PMMIR register for sysfs */ >> - if (is_pmuv3p4(pmuver) && (pmceid_raw[1] & BIT(31))) >> + if (is_pmuv3p4(pmuver)) >> cpu_pmu->reg_pmmir = read_pmmir(); >> else >> cpu_pmu->reg_pmmir = 0; > > > This does have the side effect of showing non-zero values in caps/slots > even when the STALL_SLOT event isn't implemented. I think that's the > scenario that the original commit (f5be3a61fd) was trying to avoid: But the the sysfs interface is supposed to show all the PMMIR_EL1 based HW attributes as captured irrespective of bus slots event's presence as the register could be read on ARMv8.4-PMU without additional conditions imposed upon from the architecture. > > /sys/bus/event_source/devices/armv8_pmuv3_0/caps/slots is exposed > under sysfs. [If] Both ARMv8.4-PMU and STALL_SLOT event are > implemented, it returns the slots from PMMIR_EL1, otherwise it will > return 0. But that additional requirement of STALL_SLOT event is just SW mandated without any architectural backing. > > I can't really think of a scenario where that would be an issue, and the > availability of the STALL_SLOT event is already discoverable from > userspace through the events folder, so it's probably fine. Absolutely. > > Adding the original author just in case. But otherwise: > > Reviewed-by: James Clark Thanks !