From patchwork Fri Feb 16 01:45:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hojin Nam X-Patchwork-Id: 13559376 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 D4D23101CF for ; Fri, 16 Feb 2024 01:45:10 +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=1708047913; cv=none; b=H5qwzqL8IrXNp/o/AuRQx6kbifNT0v9L0vQYQx8mny1621fzX3Cvg8ZhofEt5gfuOefLBDbnTOT5MPXCkvOfU0yslO9qnKAs2rgIRtWGjBAurtQ2T30KvL5hmIOMv5N4x8j+yoWeMb4Zj4aYU5ZeeTd5ORxmdz3K2g2WJKEIVQA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708047913; c=relaxed/simple; bh=MIiy51TTSIUBzvWxt0QQOKklVlPZdMcdU3zIr/oxeNg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=Rlp2i10k3K5hi8TPx1fkLNioix6wAv+AJD7J6dSkZHr0fSyH1+P5Xil74bMUFEb2Th6ncOPGUfq0iJUnrSBDQGkp3GR5TQ8mbCzyzx2H1BNBODzHUZ7ehT4GCm5PEFkSshfZZ2+Ni/xgiOVqBUONyh/AmKKjVbt1KkJiY49O/qQ= 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=Ug6vs0DD; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Ug6vs0DD" Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240216014508epoutp024a97e4ca1b56479afcb82fa88671b698~0NIX60NeW0338803388epoutp02J for ; Fri, 16 Feb 2024 01:45:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240216014508epoutp024a97e4ca1b56479afcb82fa88671b698~0NIX60NeW0338803388epoutp02J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1708047908; bh=i/eLcapPImUQCaXtI1ampR61jKvG768azzE6vB6Rrcw=; h=From:To:Cc:Subject:Date:References:From; b=Ug6vs0DDxJSejvfOBDQaU1J2odjQT0dao+S2siuyFSboaHc2iWNID2TFm+Escp2Sk L9xeYknC7nTK4/M0ws4vQt0Vqm46FQbuhvSpgBMws2iIL2u5bnPF6VHxNZncXLhs3A /u/XcJyIuBdPe/FQy0+d1khMrnEZ9Og2caDbHQCY= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20240216014508epcas2p2c44ef3ec3a95eda1616c5d7e2d5e2a2c~0NIXjPvil0502405024epcas2p2x; Fri, 16 Feb 2024 01:45:08 +0000 (GMT) Received: from epsmgec2p1-new.samsung.com (unknown [182.195.36.68]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4TbZW754hJz4x9Q8; Fri, 16 Feb 2024 01:45:07 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmgec2p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id A9.64.18994.32EBEC56; Fri, 16 Feb 2024 10:45:07 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20240216014507epcas2p41686c0ccb1fa73715499e45bbbc7d7e9~0NIWmRfks0186401864epcas2p4p; Fri, 16 Feb 2024 01:45:07 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240216014507epsmtrp28ad494e93f9e855f90d19b1ed4aabc89~0NIWlcWTX2712327123epsmtrp2C; Fri, 16 Feb 2024 01:45:07 +0000 (GMT) X-AuditID: b6c32a4d-743ff70000004a32-d7-65cebe2348e5 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id A8.A5.08817.32EBEC56; Fri, 16 Feb 2024 10:45:07 +0900 (KST) Received: from calab-Precision-7920-Tower.dsn.sec.samsung.com (unknown [10.229.83.132]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240216014507epsmtip10a3e707447dbea74243dd2811e985a11~0NIWWcGkj1488314883epsmtip1P; Fri, 16 Feb 2024 01:45:07 +0000 (GMT) From: hj96.nam@samsung.com To: will@kernel.org Cc: linux-cxl@vger.kernel.org, jonathan.cameron@huawei.com, wj28.lee@samsung.com, ks0204.kim@samsung.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, Hojin Nam , Jonathan Cameron Subject: [PATCH v3] perf: CXL: fix CPMU filter value mask length Date: Fri, 16 Feb 2024 10:45:22 +0900 Message-Id: <20240216014522.32321-1-hj96.nam@samsung.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplk+LIzCtJLcpLzFFi42LZdljTXFd537lUg5sNGhYf3vxjsVi18Bqb xdE9HBabHl9jtTg/6xSLxeVdc9gsll6/yGTRcsfUYuP9d2wO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73715499e45bbbc7d7e9 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240216014507epcas2p41686c0ccb1fa73715499e45bbbc7d7e9 References: From: Hojin Nam 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. Reviewed-by: Jonathan Cameron Signed-off-by: Hojin Nam --- Hi Will, Sorry, I think whitespace-damage occurred while sending the patch. I returned space to tab in the code below line 642, thank you! Changes since v2: - Return damaged whitespace to tabs (Will) 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)); }