Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1224998lql; Tue, 12 Mar 2024 10:37:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXISOV50JUc+BAeShaGDkSF+bX792XdMQQhYWTES8qh8C06pm+IkDoqzOm1mDwfVOH1kWW6FEmCIkl1F6U+wROOqr+uiPBaZktMmO5i4A== X-Google-Smtp-Source: AGHT+IHCNpaCDRd2Bibbj4bxRKm2NTzp1Jy0vXfc1H3DDXakw+YVDY/ZWQQyKEdcTdeEBpwibzlb X-Received: by 2002:a05:6a00:1a8b:b0:6e6:7bcb:b886 with SMTP id e11-20020a056a001a8b00b006e67bcbb886mr110783pfv.30.1710265020528; Tue, 12 Mar 2024 10:37:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710265020; cv=pass; d=google.com; s=arc-20160816; b=IA71jfpxLmQxAWpVhwuNnFvoo1NTAeZTCkmmLlezG5o/PcOdsA0ZCqmSVmFi5p++uU tuSgOLmWdsQXIluKcKee90DVw3aK7IzWh6lxIgcSihaXwxBlRRtjOIMCyWq4pdrBaOQq N280soVCPmxIlNdqNYvWQO2d33bZ0V0oiAJhaWEoho9rS9XxhnuriZW4vl72kXR4cojq 51OTI8EilqJ344fgcyVJGVvU67PO+Hug2iX4W+xONOE/f8mpvsnjrAhwkZ03JbVWUv3C zZVAqpboW1bIGlCAG0K3ewb0GNwWqr5z16kl0UwcVMRomTlTW/IhkjR2+lbsGLzV7SBy R8Mw== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=l03oFMtTQfzHHa2cpdAHvttuBCAXmLnSIlzJVASZYGk=; fh=rYZJcCilbqhhRo2wioN2fZDeDTmx680xdlMRyRpDY5I=; b=RqhUnaIrdaRWfy1Y1INS8n/PTyTlJePKfJAhwd9rvoeVc2Wa8+CVhifNLSGmEZp8Zd Or4bW3WI62m40Ac0DZtm2Kz7lD1WKEmnsVKm62vMnfTy00m/pMu9RsWWfpDCoQUAV8ty ILLKdFHukaJDNTNErXkaSsF1kF6INCn1Eg6RsoQZnhi4X03pT5KEx+Cdn+bPLfb2RJaK f/dr/h5XqqVhQEsxDj86u2l5EnUx/SrtVF5kkYiGFMe4Q9tONuB9aAGt//JP/Hp/roZC xv9PGk5PVP4IyQZndvcSlaA+GgamyS5gzLYjieXxmBU4ae7m4OHiCM+Ox9TrewG0n+9k /EeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-100612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100612-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t7-20020a63b707000000b005dc42755280si7461970pgf.890.2024.03.12.10.37.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100612-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-100612-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100612-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 399BB2870E0 for ; Tue, 12 Mar 2024 17:37:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3074113C9EB; Tue, 12 Mar 2024 17:34:52 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21D6013C9C8; Tue, 12 Mar 2024 17:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710264891; cv=none; b=DSvq24/jWSoovBAazH0Kh7ja3yDdYRAN+k1IrOBQ5U886NQ5fct00ypMkFLTWkmwGhW2+iM35NpsYa1TKKvZw53Hos49Vs0RkVM9zlP3CTrbcTk/iS71a3CKfyJoVCdOHVZ2uJIsB2GWEYqYDXAuilxJV09+ZE/uESNZ9vgGyG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710264891; c=relaxed/simple; bh=Pk7t1v7Z0Gk895Rwp6txDZ/tZxG8qIP6U+5tr65qLPY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qylRY2WJAh+cowD7Sjvzzhm/kxX1lbzhLYvMrrPth1Rf8XHk+AmKKyAkNKdk5G0JkUXs7qWkCqnMZRTVN6y88nVstHcqO+KlPgXEnoWJkqm80kJtD3iAykIkfOgSrfeuiweanqwoRN4TPg23Tmh2LQVYLsk03mRNzmo0z5tepVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DB0D615BF; Tue, 12 Mar 2024 10:35:26 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4EB4D3F762; Tue, 12 Mar 2024 10:34:47 -0700 (PDT) From: Robin Murphy To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Will Deacon Cc: Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-perf-users@vger.kernel.org, jialong.yang@shingroup.cn, Russell King , Shawn Guo , Sascha Hauer Subject: [PATCH 10/10] ARM: Use common uncore PMU capabilities Date: Tue, 12 Mar 2024 17:34:12 +0000 Message-Id: X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Switch the ARM system PMU drivers over to the new common capabilities, allowing to remove all the checks that perf core now takes care of. CC: Russell King CC: Shawn Guo CC: Sascha Hauer Signed-off-by: Robin Murphy --- arch/arm/mach-imx/mmdc.c | 16 +--------------- arch/arm/mm/cache-l2x0-pmu.c | 12 +----------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 444a7eaa320c..806ab6675b37 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -280,20 +280,6 @@ static int mmdc_pmu_event_init(struct perf_event *event) struct mmdc_pmu *pmu_mmdc = to_mmdc_pmu(event->pmu); int cfg = event->attr.config; - if (event->attr.type != event->pmu->type) - return -ENOENT; - - if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) - return -EOPNOTSUPP; - - if (event->cpu < 0) { - dev_warn(pmu_mmdc->dev, "Can't provide per-task data!\n"); - return -EOPNOTSUPP; - } - - if (event->attr.sample_period) - return -EINVAL; - if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS) return -EINVAL; @@ -445,7 +431,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, .start = mmdc_pmu_event_start, .stop = mmdc_pmu_event_stop, .read = mmdc_pmu_event_update, - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, + .capabilities = PERF_PMU_UNCORE_CAPS, }, .mmdc_base = mmdc_base, .dev = dev, diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 993fefdc167a..a2567d953fdb 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -295,16 +295,6 @@ static int l2x0_pmu_event_init(struct perf_event *event) { struct hw_perf_event *hw = &event->hw; - if (event->attr.type != l2x0_pmu->type) - return -ENOENT; - - if (is_sampling_event(event) || - event->attach_state & PERF_ATTACH_TASK) - return -EINVAL; - - if (event->cpu < 0) - return -EINVAL; - if (event->attr.config & ~L2X0_EVENT_CNT_CFG_SRC_MASK) return -EINVAL; @@ -524,7 +514,7 @@ static __init int l2x0_pmu_init(void) .del = l2x0_pmu_event_del, .event_init = l2x0_pmu_event_init, .attr_groups = l2x0_pmu_attr_groups, - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, + .capabilities = PERF_PMU_UNCORE_CAPS, }; l2x0_pmu_reset(); -- 2.39.2.101.g768bb238c484.dirty