From mboxrd@z Thu Jan 1 00:00:00 1970 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 CAE05C83F33 for ; Tue, 5 Sep 2023 14:51:42 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0Dgy6D56yzhDhBWCjZBWxsHjT37dUUywNAs1Patx8OU=; b=gjYktqt0z8p8f3 w/PwbdmBwcV0dcK/t/feVvhNGQmOxnHcZBC4yPfaAeyyLgcF/mwbcJFQHKqdMhLSOtytfLWOohvQa tcQ+WqT2QMI4VzT23HOnvRqfMCpwd9M+qt9ZpJ25ZG0KnkEPTcxgC9CaAhgov2HK82wxXoEaRba1b NdTO2Y2gRu91mro8puY1A4Bnd57BtLOLOzWWNhWQ5wqrw7khmZkrMT2w4o7mKXR7PBX9V0TTBkabU byeO/NGpScE72BJGWa1OKxz4ik6FOead2NnTXSUdtIVguuoNcmkBsxn/B1xlhIMjkMA/P9hFpVt7g NasgY56eY6B1yscumCLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdXOa-006DOX-1z; Tue, 05 Sep 2023 14:51:12 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdXOX-006DNs-1d for linux-arm-kernel@lists.infradead.org; Tue, 05 Sep 2023 14:51:11 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C81F1B81213; Tue, 5 Sep 2023 14:51:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8973CC433C8; Tue, 5 Sep 2023 14:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693925466; bh=SIFsFjVXa4EVY6ryyNMcawtByWDU+9xvsMPj0ugRqMc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c6gxkkVF4yp8Y29+wdlhNzoudKMaSUGL4gbpGm0UW4ROenvqguTu3PRRw8M8CCqQc Wq8Ut+Lyy5/G4v9hBR/G3bb/G4+xxb+e0HRgva5R0TohmdXmSKG7Og1zlMNPVsfIJN 5cYeuIRS4pzxVN5ojMdfa7z/bbiSJNKyfgitAhYLDpBOvvm+WrrBZ2HNTqOmgCoY9v qS5wu6XugvSR/DtYXpa/81p13IWKPqHe49TJGG4TVMIf2DZYGRBSMh5Ig+UpYdLE7N +9BE9cL1o0A8iNbFJyPNqtkpMzd0xco76M6rSHuIN0G0T3YSHeVyCCs0bCf3Fmhq48 gIXhb4BFEqIRw== Date: Tue, 5 Sep 2023 15:51:00 +0100 From: Will Deacon To: Jonathan Cameron Cc: Jeongtae Park , linux-cxl@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , Kyungsan Kim , Wonjae Lee , Hojin Nam , Junhyeok Im , Jehoon Park Subject: Re: [PATCH] perf: CXL: fix mismatched number of counters mask Message-ID: <20230905145100.GC3322@willie-the-truck> References: <20230905123309.775854-1-jtp.park@samsung.com> <20230905142854.GA3322@willie-the-truck> <20230905154634.000075c5@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230905154634.000075c5@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230905_075109_836969_0E0EE1D9 X-CRM114-Status: GOOD ( 28.39 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 05, 2023 at 03:46:34PM +0100, Jonathan Cameron wrote: > On Tue, 5 Sep 2023 15:28:54 +0100 > Will Deacon wrote: > > > On Tue, Sep 05, 2023 at 09:33:09PM +0900, Jeongtae Park wrote: > > > The number of Count Units field is described as 6 bits long > > > in the CXL 3.0 specification. However, its mask value was > > > only declared as 5 bits long. > > > > > > Signed-off-by: Jeongtae Park > > > --- > > > drivers/perf/cxl_pmu.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c > > > index 0a8f597e695b..365d964b0f6a 100644 > > > --- a/drivers/perf/cxl_pmu.c > > > +++ b/drivers/perf/cxl_pmu.c > > > @@ -25,7 +25,7 @@ > > > #include "../cxl/pmu.h" > > > > > > #define CXL_PMU_CAP_REG 0x0 > > > -#define CXL_PMU_CAP_NUM_COUNTERS_MSK GENMASK_ULL(4, 0) > > > +#define CXL_PMU_CAP_NUM_COUNTERS_MSK GENMASK_ULL(5, 0) > > > #define CXL_PMU_CAP_COUNTER_WIDTH_MSK GENMASK_ULL(15, 8) > > > #define CXL_PMU_CAP_NUM_EVN_CAP_REG_SUP_MSK GENMASK_ULL(24, 20) > > > #define CXL_PMU_CAP_FILTERS_SUP_MSK GENMASK_ULL(39, 32) > > > > I don't have access to the CXL spec, but widening this mask looks like > > it puts us out-of-whack with CXL_PMU_MAX_COUNTERS. > > > > Did v3.0 of the spec bump the number of counters? If so, can you please > > check that this is a backwards-compatible change? > > CXL Performance monitors were only introduced in CXL 3.0 so not that. Thanks for the information! > The max value that register can take is 0x3f (0 based, so 64 counters == > CXL_PMU_MAX_COUNTERS) > So it should be 6 bits wide. I did some history digging and this isn't > even a draft spec / final spec issue - simple typo I guess. Heh, I blame the heat as I thought this was extending to 7 bits for some reason. Sorry about that. > Fix seems correct to me. > > Acked-by: Jonathan Cameron I'll pick it up, thanks again! Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel