Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp339510rdb; Thu, 15 Feb 2024 01:28:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1dXZBXtTTO0av3oYZ3lqBypCP1H88qVNOIHSl0cIkaLb5n+kMKnE8qLn+A2FQtZw6SsiWvGB88f8jsqJX6xdbrKULhgXZmvnTlqBYwg== X-Google-Smtp-Source: AGHT+IF8EfBSfY8n02WPmiiXyNfzlmrmF0Of1b0ZG/s1k0WaOKseH+gQxY+pg3n9Xgly2mMceUmx X-Received: by 2002:a05:620a:15a2:b0:785:ca45:8264 with SMTP id f2-20020a05620a15a200b00785ca458264mr1018879qkk.28.1707989300902; Thu, 15 Feb 2024 01:28:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989300; cv=pass; d=google.com; s=arc-20160816; b=0ZuvFC6xejctWEKtz7wp71DJvFizCBU/Gabnz60xCpoG6MAFL0e0j//iqkuTaYxpw0 p/zaaD2fn4VIf2iPGr0thgTsrqal9TkGTt96Jx5GwOo6zvURKwQPX8kUmaYNozJyGA0s cnIZd48CL8X68aovmoAesYd0Ak4+dQqflntgzUENHsimmxAeUz7P5foCOy4+I00pU2V1 ib+yNcL6L0Q3m9BNkc7tDsIL0ksfuE3M3BT2bMCIbkqTxYN63PmsqQOPrTRYZUvuJ99d N0kjSi99naJW7B8nxkn2qeWbpKzNYckv+pG45vWsdqq2/ufjVEmvD3LnJN7IvxVaocDK z9VA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=9u5lD65sAzLl+8/ioyzBBp5pJV/MiEUHBIJK+2KyN7g=; fh=sZwyWYrFNMFy9lIXyplLmiTbE+yUbfTUsqeI3rJGUIw=; b=gxoamz/zXAdw6dKlGGlE8iuKKq8EKmRuX7rrjTj3WPKd+Wl7JnvUnSOope6IAMUgeJ 59v18IXwB0aIjjNYyI9HP2yh/2b4MRu0q2ZKwA5vXZ4xXq1YBL0QDTd1vGRry5CVa3Yf qPbS6RsIjn/qiq6/JRs+ZtjS4lbACk8/+962B6TeKmvzKN7jXHzaRozxdcT3qk1LRrgx 7s7WWzU/7fnDvwtgjR8Zf+7RLNo0K8mrJk+6y4Ib9BmsCrL4jAlYinykRLk06VPfG8MY K606nAot5wUFxqmlzaWHLxtBJHCg32Xul09i9XAi4H+RhoAo6idxwaNYiwYrUglze5TA fhvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-66536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v7-20020a05620a440700b0078735bbfbc2si1004253qkp.722.2024.02.15.01.28.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:28:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-66536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A449D1C2223D for ; Thu, 15 Feb 2024 09:28:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8539917592; Thu, 15 Feb 2024 09:27:18 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0ACF1BC26; Thu, 15 Feb 2024 09:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989238; cv=none; b=iHjkZZsj1SryQP5sLm0HiWTrV12rIbquNwYs3zly83z3esQ7Z08Mkle95krydRjNdxPNayFV6xrMqk8TSxjlmTVX+KTFzjY5KXn+w7Dl2z1GX9iaJMT6NGD8Pnl9jzYCqBe7CRxTQ10k9X4eKVvEOdjsGfLZinvr44W3eF3MH0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989238; c=relaxed/simple; bh=JdUXTgfRhqmsxEasxutphA+qDVTuj0FX7QgjojjkOfI=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q4nWIfeD0fAZDv+xiGt6jzC4FuvIX3ZtA+zgsu9pHsZxRQ/Pis27AInj0hvDUh/2eVFHrbPI2PnrnzWLhzJPnj+2wuqIwI9V5WfW5yTcwf8OY+ntHgejcjF7zavJz30KqtjSn2teJ44737K949PkT95OqpHGHcCmM95j05tMyh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Tb8k74NXPz6J9hM; Thu, 15 Feb 2024 17:23:11 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 8FAD91400D4; Thu, 15 Feb 2024 17:27:13 +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; Thu, 15 Feb 2024 09:27:13 +0000 Date: Thu, 15 Feb 2024 09:27:12 +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 v2] perf: CXL: fix CPMU filter value mask length Message-ID: <20240215092712.000048cd@Huawei.com> In-Reply-To: <20240215080906epcms2p2c49c6b9bfe271e1d089ad35ab527b958@epcms2p2> References: <20240215080906epcms2p2c49c6b9bfe271e1d089ad35ab527b958@epcms2p2> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) On Thu, 15 Feb 2024 17:09:06 +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. > > Signed-off-by: Hojin Nam Reviewed-by: Jonathan Cameron Thanks for tidying this up. > --- > > Hi Jonathan, > as you said, I didn't actually hit this. I just found it by simply > comparing the code to the CXL Spec. I removed Fixes tag and > repaired broken sign off, Thank you! > > Changes since v1: > - Remove Fixes tag (Jonathan) > - Repair broken sign off (Jonathan) > > 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