Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp348523rdh; Tue, 13 Feb 2024 20:52:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVsZnTxwyLdzRXYKUF2mficqVIOON8OH8VtLUBQOu589jSA5DnL9rfoOfrRNVGpwozHMrNpi3oY5jcI3sAeYrLXVmj9V2oxcXkcyBmsIg== X-Google-Smtp-Source: AGHT+IGOQYhRPMNnEjc6ZlSK6wzkSmtyFUxpmOTjSmcOQIv7NZlLVVkUcIacfI2ONz7U+FZ0ES2h X-Received: by 2002:a17:903:494:b0:1d8:ffbe:82d9 with SMTP id jj20-20020a170903049400b001d8ffbe82d9mr973872plb.14.1707886347757; Tue, 13 Feb 2024 20:52:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707886347; cv=pass; d=google.com; s=arc-20160816; b=bUTNZQSR/IjfcXYZDTD2BuGHA5Plm0ZYc3sF7c8FvOUvGUIjfcg4KxRBBH0EtNjvmE pq+H2FgD0CLmenKuBPw72AFhlRoT6+RDtN7/ICCtL8eG7aRQ6gurkf+eoRyISokOizdZ qVkAgLamxvNpv7a51G2FB1PqEKPkDJAe6nAiceHWiwi016Mv0oWPw7HId7amCLLZSjaM TC9JqwXQsGQDkpwQ9ibEcC8hcnOwTn8NeJVymAXqPc9xDXPYze6z7/LJTaXRV+CTgZH5 5w5xP+SSEB7BRwkfjDIfPZa1a59C2f3agwr3ulkaOMKq7RnheSk5Mzu8oznLhOEj/3SL WKOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:content-transfer-encoding:date :message-id:cc:to:from:sender:reply-to:subject:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:dkim-signature :dkim-filter; bh=nSvBImm0z35kzVe3ZgLeWjkV2Pt4Ri5HJ6q+F34gkW8=; fh=XDJ1am1Kaj1EELoLX5vq2APdRn3+wRh7KQtm1MM3RFs=; b=qNHEIgN3bDJwoEuVlhAUaehY/juf+pQwBAfBiHOUwE1wIXxO4Mrdc1m6HfErleQgY3 GE3Hk1JkA7mZqMOzT/pcue/pAWrwwxBSn3UKtx8p4YJ04YCzpEqOAsh6zoe+sMKQk/gA REgdXe0E+XNkrJLEVnbyHRlKpoZZwF1Y8uELX4A3chmhebQldeggvoknKNJXpWOz11G3 8zdPN7Y5ImiPqQC8gWuCQ1Y2jeeiNoeSdIRlQQG0O2CrqYjeylkJbfJSdDG3dyIQxP72 KcfkXOI8G2oPT78P3HN+MrT8lJzLIR+zgPdmZ1Uf8FPs097IOFAhtH+Oq9sA0JDTeONo 370w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Nu/CrzEj"; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-64735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64735-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com X-Forwarded-Encrypted: i=2; AJvYcCXrJH3E7ODLViBpbRHlmYbO36WGkXiUmy2pfCIL/bFlSE9Wo08TSfBJxwJBsHvXs7vo6Z3GQdtkYulEaKMsSM+NqS6QZpFvIGr5cVNgbA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l14-20020a170903244e00b001da1e83b94csi3039925pls.343.2024.02.13.20.52.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 20:52:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Nu/CrzEj"; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-64735-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64735-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6C8F328C2F7 for ; Wed, 14 Feb 2024 04:52:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADACDBE7F; Wed, 14 Feb 2024 04:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Nu/CrzEj" Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 D1D3710A0F for ; Wed, 14 Feb 2024 04:52:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707886340; cv=none; b=FEmJp3Ktp3Ya+QWqKS0kVQLoojO4mgj3FZ8JQKQm0msElLry76FyYb+u3dvLbOU95NRelmnhrys0cLoA3lQhmUkqrckZF9cavohrorDusDTOrUOTgPq+jNN+YZron06I1I0jldgodMuZnMYawwA2IvOUln6AvaPNArvmjOynO6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707886340; c=relaxed/simple; bh=PFUgXz8ct68KZJ5vFMzy6RkzeKCtmazpm9FVQ9KKOdk=; h=Mime-Version:Subject:From:To:CC:Message-ID:Date:Content-Type: References; b=c8ItOinif+imDhTtmaYvtuZKzk5tsucCr24vi4pVNdbTZ+DJI8YMyAUnch5T5unsEwaa8RakEH9ZC/0Pe47QFDb3Gxi0wZxLtStP9hA+OdL6Gw7sCudBpTj/gwF8APXQf65ot4WQHu7yF3QlLGRp/tV2DHY4jMlm0tfHzJk6Z14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=Nu/CrzEj; arc=none smtp.client-ip=203.254.224.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240214045215epoutp022d0250dd80ee487f3d19417a7d86fff0~zoZLRDaul1362713627epoutp02W for ; Wed, 14 Feb 2024 04:52:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240214045215epoutp022d0250dd80ee487f3d19417a7d86fff0~zoZLRDaul1362713627epoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1707886335; bh=nSvBImm0z35kzVe3ZgLeWjkV2Pt4Ri5HJ6q+F34gkW8=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=Nu/CrzEjQBSsP5ngoHzw41z2OH2uuAgsty4ZnhK2YXBfVGJMC/622/gQ+O+vBEohf vP/p/sNIKgvR2IgSolzdBUZTtQS6Lo50SN3FGxCDuner6r0fcrLet2D6vVu0ux7+6G RgBCU2wtL3XZWt2xfrzbz4iZFh6vqkExCwNMAO38= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240214045215epcas2p422724170d640ab4e1676ee1b485ae724~zoZKtilBu0418904189epcas2p4U; Wed, 14 Feb 2024 04:52:15 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.92]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4TZQly3JKQz4x9Px; Wed, 14 Feb 2024 04:52:14 +0000 (GMT) X-AuditID: b6c32a48-963ff70000002587-71-65cc46feebea Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 24.FF.09607.EF64CC56; Wed, 14 Feb 2024 13:52:14 +0900 (KST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Subject: [PATCH] perf: CXL: fix CPMU filter value mask length Reply-To: hj96.nam@samsung.com Sender: Hojin Nam From: Hojin Nam To: "linux-cxl@vger.kernel.org" , "jonathan.cameron@huawei.com" CC: Wonjae Lee , KyungSan Kim , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "will@kernel.org" , "mark.rutland@arm.com" X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20240214045214epcms2p81d2ea826483fb4aecf19930f2755d55b@epcms2p8> Date: Wed, 14 Feb 2024 13:52:14 +0900 X-CMS-MailID: 20240214045214epcms2p81d2ea826483fb4aecf19930f2755d55b Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupik+LIzCtJLcpLzFFi42LZdljTQ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6tG//PLoKhapsNi5 YYKlShyuTYJCRmp/bln08/z1t1fnNbtg+PF4u0bOtGk/ispiWk8Jr1tUNmuHnXrpLM/rB07H iS32n3NvdWGAEktxRqKhFnNRcSIAgqannR0EAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240214045214epcms2p81d2ea826483fb4aecf19930f2755d55b References: 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 --- 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