Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp519096rdh; Wed, 14 Feb 2024 04:06:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbqIAoevCL9nhBTlsiMO0fDucwgeoSUWQScZ7s+UF91fTpQEH67s75Utk5ClItPbytAwgc5MWP0KHLAUxBD0RoGG8yxzNwa0NR6bKjZA== X-Google-Smtp-Source: AGHT+IHgE1aEM8rs1+yH+zkn0UQLrAw1BJhrWEFFjojst4pBJXFhSrsSbC8Z6/ZeK7ge54PlFfGe X-Received: by 2002:a05:620a:4d14:b0:787:17be:2999 with SMTP id wa20-20020a05620a4d1400b0078717be2999mr2531199qkn.15.1707912405393; Wed, 14 Feb 2024 04:06:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707912405; cv=pass; d=google.com; s=arc-20160816; b=ffCMb6fKZCMX9wEwBdqtPNdAaBtOm7nsxkqDZG8PEeQ9lhroiEx6RzZvRG7QFK6pM+ ncWbO67ScYeyvdg7R4a7Ck5AimZqwW+723AI3LZc2PaiF5pYBwZPD2rJcEopGAz+Vu+x 5JbhwqRvY2CJPJLSFnObCCwVidWSN9da0ZbInB7lhchY8WrNsPJPFhezvS/m37sXokS7 x+V+Zyq/T3ZCjHAsY2ZIvic8pl/UCSBoXV6y4qml8y9l0DxHJamxhuBQd0hRn1xeS9zv btblUv39GgNaJrWomb1eqWG2xmHXlMihDjTXp3DQGsKkj1ndeL/BD2I+VpQxgtvKVdF8 CTTA== 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=YBJt2fgzYj6b24mb7a16pm3y9kVQxwBvhw6IgX7nKPY=; fh=1CkaLPN6YsK+fXJoC+KRClAGxtGxbhiIWAfYI7IucLA=; b=eZHUCulWn7G06o6jNP5XHUp+NKlOoqWQMtnH/cykxyoukiTI3vwzKtMJQ+xkZQxSdm ZHSfWuEHv/NYmg6uaMaLBKewzQpyCejWD2eeRSIbYQpcrMAkmT60LFSWeOjt4c/8J0mo Bh3QBw0kO8LMoovVr45IsAIUkYBsuhLuy55cOa+IGohRbmuWigJjzK9zKtlT/H01/gc4 Du7xkb+f90TMzfbnIyVnFFwq+sFyxjVwvY/POup8F0nsXWjtRSKQjxKQ1BbLP9NJDCW+ XOnRkPBMeXvmDvHdXBVTQy7qymuLK9VtZx6EZOVRgZJiYBae70y/ey1fgVdT7VueF4+P WgFQ==; 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-65174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com X-Forwarded-Encrypted: i=2; AJvYcCX1iGZkgmMfedTgG01xVBV6BTss4K/rQsI9vgH50WtcUeWgND1lA02Tn/ksEMxlZW89eKz/PZRW38EzKgNWFTFnQxBzxrgKVzm6RgyBGw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w2-20020a05620a094200b00785da09de76si5661940qkw.72.2024.02.14.04.06.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 04:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-65174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65174-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 1743D1C23280 for ; Wed, 14 Feb 2024 12:06:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6BEC1B7EF; Wed, 14 Feb 2024 12:06:38 +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 142581AADC; Wed, 14 Feb 2024 12:06:34 +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=1707912398; cv=none; b=Jc36pbIybtP+yxlnU6NAhNtj7pAjMI7mj4+WvDqa05wH8Mq/18YyY0vidcfss/qdz0jZMz8qA7d5wnTxuyxjH9s5uD5u1RZb0fil43ROgyM09/w9iDhNHNK1vWUPmfXxrFl69lSH1WRuSb0C8R6fWkN6Yjp+Z599fpbcberwc3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707912398; c=relaxed/simple; bh=OpGJVKdC/fGBc82A/zCyqry22fkLQp5s0JfMov9Hylk=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SxeziULUw32uvUrMGONhPD4uZK+CyhzEqotbaQw4VY3h5Inakrx1vGp5Dcn6HQNY0ogPfMfI8ZAQG/NPoAnEjT9s5ISyMZLvZMY+MxQJea+j24UYrunB7wTatjmmsK/8IJA0FH+rsv5Whf5h95pK1Cz4Ug2wAEu26qRgFgXuwfU= 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.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) 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: lhrpeml500003.china.huawei.com (7.191.162.67) To lhrpeml500005.china.huawei.com (7.191.163.240) 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