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 56649C48BC3 for ; Wed, 14 Feb 2024 12:06:56 +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: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=p1FpwZ7GMs6WQAx//cwBmAabEbSFVcsqy1wHUpbfoxM=; b=jxszGBT7LOF4uT irIwnau2ZUbJshjV10MmoV+5LwTPkJuBUR0/ZRK2QGGyTWlI7pvpnjJEu7N+/J2oyMYfocoimWGVe 5Q0Ythdibq/i1c7Nnd8oyJ3edKoRbOxXYzjR9EWtjFZqpmrzJ4p7jtS9ifw7LzMwFTnFH4shxRI9o 2WhyHHNvqHcsol11JWJ5Vqcz4E7wABmKLAy6fOzxinpJHE56RRUeZvNDq9O7xR31ce26XC6ZAsrff Uofl1GIY750ieVXPAr1DZcVXrCdltsr9U7n5LRQ/CVataTxlubSvvsQnwfNsjF/7QhIWjvsXRuwQG U/lFrqLeOf0vMM/YtUhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raE2F-0000000Cl9I-2raR; Wed, 14 Feb 2024 12:06:43 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raE2B-0000000Cl8j-2WgS for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 12:06:41 +0000 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TZcJg0NPWz6D8X1; Wed, 14 Feb 2024 20:02:43 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 3591F1402CD; Wed, 14 Feb 2024 20:06:09 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 14 Feb 2024 12:06:08 +0000 Date: Wed, 14 Feb 2024 12:06:07 +0000 From: Jonathan Cameron To: Hojin Nam CC: "linux-cxl@vger.kernel.org" , Wonjae Lee , KyungSan Kim , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "will@kernel.org" , "mark.rutland@arm.com" Subject: Re: [PATCH] perf: CXL: fix CPMU filter value mask length Message-ID: <20240214120607.00002bdd@Huawei.com> In-Reply-To: <20240214045214epcms2p81d2ea826483fb4aecf19930f2755d55b@epcms2p8> References: <20240214045214epcms2p81d2ea826483fb4aecf19930f2755d55b@epcms2p8> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240214_040639_985785_CCEC97C6 X-CRM114-Status: GOOD ( 19.08 ) 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 Wed, 14 Feb 2024 13:52:14 +0900 Hojin Nam wrote: > CPMU filter value is described as 4B length in CXL r3.0 8.2.7.2.2. > However, it is used as 2B length in code and comments. > > Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver") > Signed-off-by: Hojin Nam Sign off broken. I have my suspicions about why this is the case (bit of history involved that I won't go into) but indeed this is wrong. So with SoB fixed. However, I think the driver only supports HDM filtering currently so you can't actually hit this. Hence not sure the fixes tag is appropriate. If you can hit this limitation please post the command. Worth noting that we still don't have a way to attach this to switch USPs or host bridges, so the increase in HDM decoders to 32 for those in r3.1 isn't yet relevant. Reviewed-by: Jonathan Cameron > --- > drivers/perf/cxl_pmu.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c > index 365d964b0f6a..ca5e92f28b4a 100644 > --- a/drivers/perf/cxl_pmu.c > +++ b/drivers/perf/cxl_pmu.c > @@ -59,7 +59,7 @@ > #define CXL_PMU_COUNTER_CFG_EVENT_GRP_ID_IDX_MSK GENMASK_ULL(63, 59) > > #define CXL_PMU_FILTER_CFG_REG(n, f) (0x400 + 4 * ((f) + (n) * 8)) > -#define CXL_PMU_FILTER_CFG_VALUE_MSK GENMASK(15, 0) > +#define CXL_PMU_FILTER_CFG_VALUE_MSK GENMASK(31, 0) > > #define CXL_PMU_COUNTER_REG(n) (0xc00 + 8 * (n)) > > @@ -314,9 +314,9 @@ static bool cxl_pmu_config1_get_edge(struct perf_event *event) > } > > /* > - * CPMU specification allows for 8 filters, each with a 16 bit value... > - * So we need to find 8x16bits to store it in. > - * As the value used for disable is 0xffff, a separate enable switch > + * CPMU specification allows for 8 filters, each with a 32 bit value... > + * So we need to find 8x32bits to store it in. > + * As the value used for disable is 0xffff_ffff, a separate enable switch > * is needed. > */ > > @@ -642,7 +642,7 @@ static void cxl_pmu_event_start(struct perf_event *event, int flags) > if (cxl_pmu_config1_hdm_filter_en(event)) > cfg = cxl_pmu_config2_get_hdm_decoder(event); > else > - cfg = GENMASK(15, 0); /* No filtering if 0xFFFF_FFFF */ > + cfg = GENMASK(31, 0); /* No filtering if 0xFFFF_FFFF */ > writeq(cfg, base + CXL_PMU_FILTER_CFG_REG(hwc->idx, 0)); > } > > -- > 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel