Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2198783pxy; Sat, 24 Apr 2021 08:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqyqJFJVqnZxMIlCYeTMfplGIzKpZ9NOdb9in3V+EAfXT8qbTWtejwsh7CtFAUvYEQ1YsG X-Received: by 2002:a17:902:e88e:b029:ec:8ebe:9ff with SMTP id w14-20020a170902e88eb02900ec8ebe09ffmr8920077plg.26.1619276733886; Sat, 24 Apr 2021 08:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619276733; cv=none; d=google.com; s=arc-20160816; b=x2rO2ixPtcxpjhZWO/Bi+pwXCN98Me87LTWHSSGHGc9Gt5jaRdvvqhjaMT0MpmLv6D YTjkr3h0jSlPSxl4oLK3rZvPyQmdtQ8WoOOV7zy3mvveDT4v6cZQfCAdONxq4VXsUeLu E1vGYy8Ya9oASQTpyRPuV202Wm4s9LKgBP+meKTyZqpeo30cLzfciv1Qja6ditc5q8OQ R9819muq+Z/8YoJ9RcwrMZuqAPisA0ZViol/4e90X4QFIqCM2ruWFAnWx61r3LllTZfl enA5YRpeHNI0m0eWDhb/z7mhxg2+t0KJYotOZoJnEyM52X1qRtPYNeowt1ID9PmfrpEP JwxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=e5zXrIh24iQ4ugZb66bg6RY4kP+n65U29qDZ7a+QQAg=; b=qwowxyW6LEKZlt41oJs90jaDr40VdS6CITUTRHYTvt9LXdsB4zV3+O+oS2tJnRXuXt QlUjEcwhTusZ/yoynugIp+LBz0rnTIFyyVIVro0iCNLHH2E2+AKyg8+dcEcNZWRGbiIj sPrFXO7ZrKNY7ysTPfvU+VxglUYukGw+Fgo1XNxtVm7VSuzfrev7YoareqqD5Fsvwc6/ P/Glz1qfSZBjrJ/di2NFS8SFKEFszSlfciI2jQg+OLbeDe418VFEYxjXmFkn3NsgvHK4 PDERI+WBuSb+zI6bCDffVKDC24nMC73dEra/SHcpkUu9KKIspJ9x3bBKOsXwPEp9HJ69 ES7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si12643858pfa.256.2021.04.24.08.05.05; Sat, 24 Apr 2021 08:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232434AbhDXPFA (ORCPT + 99 others); Sat, 24 Apr 2021 11:05:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:55842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231892AbhDXPE6 (ORCPT ); Sat, 24 Apr 2021 11:04:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 72D3261452; Sat, 24 Apr 2021 15:04:19 +0000 (UTC) From: Tom Zanussi To: vkoul@kernel.org Cc: peterz@infradead.org, acme@kernel.org, mingo@kernel.org, kan.liang@linux.intel.com, dave.jiang@intel.com, tony.luck@intel.com, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Subject: [PATCH v4 0/2] dmaengine: idxd: IDXD pmu support Date: Sat, 24 Apr 2021 10:04:14 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This is v4 of the IDXD pmu support patchset, which is the same as v3 but rebased to the latest dmaengine/next, no other changes. Thanks, Tom -- original v3 text -- Hi, This is v3 of the IDXD pmu support patch, which addresses the comments from Vinod: - Removed the default line for INTEL_IDXD_PERFMON making it default 'n' - Replaced #ifdef CONFIG_INTEL_IDXD_PERFMON with IS_ENABLED() - Split the patch into two separate patches, the perfmon implementation and the code that uses it in the IDXD driver. - Added a new file, Documentation/ABI/testing/sysfs-bus-event_source-devices-dsa that documents the new format and cpumask attributes, and added better comments for those in the code. - Changed 'dogrp' to 'do_group' in perfmon_collect_events() - Moved 'int idx' inside the loop in perfmon_validate_group() to the top of function. - In perfmon_pmu_read_counter(), return ioread64() directly and get rid of cntrdata. I also fixed some erroneous code in perfmon_counter_overflow() that because of my misreading of the spec caused unintended clearing of wrong bits. According to the spec you need to write 1 rather than 0 to an OVFSTATUS bit to clear it. Thanks, Tom -- original v2 text -- Hi, This is v2 of the IDXD pmu support patch, which is the same as v1 but removes a few assigned-but-unused variables reported by kernel test robot . -- original v1 text -- Hi, This patchset implements initial pmu support for the Intel DSA (Data Streaming Accelerator [1]), which I'm hoping can go into 5.13. I'm also hoping to supply a couple follow-on patches in the near future, but I'm not yet sure how much sense they make, so I thought I'd throw a couple ideas out there and maybe get some opinions before going forward with them: - The perf userspace interface for this isn't exactly user-friedly, in that you currently need to specify numeric values for field values: # perf stat -e dsa0/filter_wq=0x1,filter_tc=0x1,filter_sz=0x7, filter_eng=0x1,event=0x8,event_category=0x3/ It would be nicer to be able to specify those values symbolically instead, and the way to do that seems to be via some JSON files in perf userspace. - Some of the DSA pmu support is patterned after existing uncore code, and there seems to be at least some opportunity to consolidate some of the things they both do into common code, such as the cpumask device attributes and related cpu hotplug support. At this point I'm not sure how much sense it makes to put any effort into that, but would be willing to try if there would be some interest in it, especially considering there will probably be future pmu support added that could benefit from it. Thanks, Tom Tom Zanussi (2): dmaengine: idxd: Add IDXD performance monitor support dmaengine: idxd: Enable IDXD performance monitor support .../sysfs-bus-event_source-devices-dsa | 30 + drivers/dma/Kconfig | 12 + drivers/dma/idxd/Makefile | 2 + drivers/dma/idxd/idxd.h | 45 ++ drivers/dma/idxd/init.c | 9 + drivers/dma/idxd/irq.c | 5 +- drivers/dma/idxd/perfmon.c | 662 ++++++++++++++++++ drivers/dma/idxd/perfmon.h | 119 ++++ drivers/dma/idxd/registers.h | 108 +++ include/linux/cpuhotplug.h | 1 + 10 files changed, 989 insertions(+), 4 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-event_source-devices-dsa create mode 100644 drivers/dma/idxd/perfmon.c create mode 100644 drivers/dma/idxd/perfmon.h -- 2.17.1