From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 9B0335478D for ; Fri, 27 Mar 2026 23:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652561; cv=none; b=opTLWcLxoDyMYuximpvlpf/d2+V/ru5RiO3k3l7l6uGdSL2Cxoi2QwLPHK51Jax1kfE+nAUnzV8ne2gI8DqPBLQofUZ9AtsELmtCs9XCI7QhUy4nEuQhaxVBfYi2du/nFbzXbDyemr+RpmfQ/3PvAsFwUY84vLcW6I6HGIYUNzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652561; c=relaxed/simple; bh=8zNQaI5+5hl82nEhqMvTbAX163F7y9T3+XZ35TcbybM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rq5RzqqzkopbutAmJJeTbXP77rsY6nVa/FcPNsZJTUesTxjT7tqKKciPVZEsEE1WjmjJN1scBRLgjhlh5w1E4/g4mt/WMlCKoy2KfBYCcfQXaR5BmUba9CM9WCygj242JxQ7jIXN65+faj1kFiYN9ia2JqTOwyMpoFJUvMf6jUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Nmi2f77d; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Nmi2f77d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652559; x=1806188559; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8zNQaI5+5hl82nEhqMvTbAX163F7y9T3+XZ35TcbybM=; b=Nmi2f77dOOfca7Q8cUmQmbuHHyQM6dqCZ6oW3hPR6x2PyLUYbLrwJZHi 5wq0mM8JF0U05Y0X31qcDtnEDJFYIAPrT4cvsbb1mKayqNL9VJSQ0t4sg Gm1Tyj6MdaMb3wGBnA64td7drG23CLTg4xZ7p3hl9D4TMvAOxic6WRRsM Iq8UXnvzxcsXUjtsEDmuL14d1DDXpqJAgjUfUn8JB5KcbvBIrRGhyWjrR jbasmoAlZUmvHWCny4U3kkcLxzoJ2pM3uAaQ2LcRmnRAiVVX8CYTEEVxg r3eeOgP8HxhAglAzf2zASXMb/yBBxI77oNgGM3l2rt+TWpd4f8ryp3Hw3 g==; X-CSE-ConnectionGUID: 6PdQio2LRLyExX+ZVMKP5A== X-CSE-MsgGUID: iT6xm+LaTpaI/7yOvWMVsg== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613251" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613251" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:38 -0700 X-CSE-ConnectionGUID: 0rknclz9TjWW7WWKNCQqfg== X-CSE-MsgGUID: pErcDJFBRgaZT9utZpKCfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816023" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:15 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 1/7] x86/resctrl: Drop setting of event_group::force_off when insufficient RMIDs Date: Fri, 27 Mar 2026 16:02:02 -0700 Message-ID: <20260327230208.18094-2-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Setting the force_off flag does not matter when AET features are only enumerated once (on first mount). In preparation for enumeration on every mount, drop this because it overrides user request with rdt=3D boot option to force enable a feature. Signed-off-by: Tony Luck --- arch/x86/kernel/cpu/resctrl/intel_aet.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/= resctrl/intel_aet.c index 89b8b619d5d5..015627401ed2 100644 --- a/arch/x86/kernel/cpu/resctrl/intel_aet.c +++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c @@ -214,10 +214,8 @@ static bool all_regions_have_sufficient_rmid(struct ev= ent_group *e, struct pmt_f if (!p->regions[i].addr) continue; tr =3D &p->regions[i]; - if (tr->num_rmids < e->num_rmid) { - e->force_off =3D true; + if (tr->num_rmids < e->num_rmid) return false; - } } =20 return true; --=20 2.53.0 From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 5D7F9330B38 for ; Fri, 27 Mar 2026 23:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652562; cv=none; b=Am9A19HUAnkS5a7HMLkVdgYxfq0ssZP807inccFBUo1OGWwqx3VI/LtwVy3aeGOdSsQvjLveS4Chvf1FpAMUFn7OIXEhBlUfcJGxnFVeqRiKLOti4i2o7XOxlcLNy83LoQGaPHCCwU0hksG7jxeL4n/WIYvUBzw0DpHNbhViMVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652562; c=relaxed/simple; bh=Km0j+Rqo4NuIEA773l2R+LZ+xd4ZDOhQuQfnLs2zeAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PUCyVvMbXJtiUN9iwKWbMTDfRKrXKAycWYhywC+854CgxwqVqmjsG7VokzvFAUk+jZ9m3xCtrxq0Uw+vXkdap7zkP+kQH7Ba4ZfcUdNzp6pkXJ4TsSRf0Gum+I3juvSPVe+drRMT1+Dm4AnjhuAfcHDDnubWHKHINpxnywa72Vs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LxZ/xmfO; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LxZ/xmfO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652561; x=1806188561; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Km0j+Rqo4NuIEA773l2R+LZ+xd4ZDOhQuQfnLs2zeAQ=; b=LxZ/xmfOfpRd/smzqvvcc/BGgB13DhnZJJZG+pRncjHB3yEyTiW17DGh br89ewNPzn/8f/FME+CWWOHdZ6tXithc2oymPGKZ3Wm4qY+RPbGxSR4Jx I15j6QT9T/ZTfJVoSLL1NTdNHQoKtICiRFc1jA52s09JoMXOlW0ipwbaV +R2/FRmfm602Uwq1llSLQqmc9uYVBFgmy9kVsl0tlwmDc7fLNvrOdN22f HJbqdnNovRd7pM8pOAi34l2PcSRLdPyX4Dke/hLMKPTAMNtu1SWHTu8GQ aB/a53RJVvrTdgdRH/VrTrw577V4qV1s/AoidsNypSqcCcTWkcDk6L/5/ A==; X-CSE-ConnectionGUID: SDEQpciqTdiTY/EAsisaNA== X-CSE-MsgGUID: KPDFcYgST6ux7mx6OAIcQw== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613274" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613274" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:39 -0700 X-CSE-ConnectionGUID: z++Qj9jUQMCSjGfWCBFVTQ== X-CSE-MsgGUID: ympgy13pT5WOCsibrfBmEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816025" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:15 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 2/7] fs/resctrl: Add interface to disable a monitor event Date: Fri, 27 Mar 2026 16:02:03 -0700 Message-ID: <20260327230208.18094-3-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Architecture code can ask file system code to enable events. But there is no way to clean up and disable events. Add resctrl_disable_mon_event(). Signed-off-by: Tony Luck --- include/linux/resctrl.h | 1 + fs/resctrl/monitor.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 006e57fd7ca5..b312aaf76974 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -416,6 +416,7 @@ int resctrl_arch_update_domains(struct rdt_resource *r,= u32 closid); =20 bool resctrl_enable_mon_event(enum resctrl_event_id eventid, bool any_cpu, unsigned int binary_bits, void *arch_priv); +void resctrl_disable_mon_event(enum resctrl_event_id eventid); =20 bool resctrl_is_mon_event_enabled(enum resctrl_event_id eventid); =20 diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c index 49f3f6b846b2..0def41c26edc 100644 --- a/fs/resctrl/monitor.c +++ b/fs/resctrl/monitor.c @@ -1010,6 +1010,18 @@ bool resctrl_enable_mon_event(enum resctrl_event_id = eventid, bool any_cpu, return true; } =20 +void resctrl_disable_mon_event(enum resctrl_event_id eventid) +{ + if (WARN_ON_ONCE(eventid < QOS_FIRST_EVENT || eventid >=3D QOS_NUM_EVENTS= )) + return; + if (!mon_event_all[eventid].enabled) { + pr_warn("Repeat disable for event %d\n", eventid); + return; + } + + mon_event_all[eventid].enabled =3D false; +} + bool resctrl_is_mon_event_enabled(enum resctrl_event_id eventid) { return eventid >=3D QOS_FIRST_EVENT && eventid < QOS_NUM_EVENTS && --=20 2.53.0 From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 0A5D136C5B6 for ; Fri, 27 Mar 2026 23:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652563; cv=none; b=ZGgXThUfuYYJtXhQerxMB3kDnChjp4ZfjmTC4pZBmBdymWgKb+0sG9Mt4GUDFD3GurxPCcVBSaIExbWZ7eYAaBXqG6fzGKz4xHp6ppAjLaoXD7V0Cjnhl3XiCJSeb6CtVL0CMayIq716evh28B9MVbQlkK+UktLXHCVbmDfsotQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652563; c=relaxed/simple; bh=sCP5yTMAKUxJUogvJ6h/yYpc8TdhsObTGUqn2bTxugE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oktMQUBUI+o6ktXeKxwsm/GmqN+tgsa55f3w3ZiSLPQ0C4x0hXmYCJURr9YVVbPeUMpw9Vg9cGJhj2u+gkkw6qIrOOa8hmoAdiLNkABGR+HiSkscO8O5dfMRp3twRM2j/Z/EnMpueg1ykYcpYf+zNibxZvGUJ7mipYiq/YugRJ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VUr53Z5u; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VUr53Z5u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652562; x=1806188562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sCP5yTMAKUxJUogvJ6h/yYpc8TdhsObTGUqn2bTxugE=; b=VUr53Z5uU5YFYmGvBtmK36as/DguCPq0g9V/nJMJ4o6oF3ApgcuBWEzg kxG/ZMv0pxGVVRDl129DvfuLLYobhoMDedZ6mIme7rRANE5rL49YJrYsS HMLegiKY9zDrnzCkY3TvWjLSxRoRonPt+4BVndFxJHrgkiLDzubC1ILIe QV10mnE/Ww1Va9mefrMKmulsKbjjcdCFLV7MsDmCSnnEVw+P6YzM5RuE7 C97KJMHZu9GT/rG8mHD6o3EZLzqZjLMZo7foZnyMaKohx/jUHd1aKqI28 LmoNLaXAnPfG0VXQyrJ7qhC0zXmchMi0roR8xT8z/+BQ5SYt1F49/HCZn g==; X-CSE-ConnectionGUID: BKtAwo/+QfqoSUvj7pExJg== X-CSE-MsgGUID: 9KhLeMqLTyGZGPt78ZMgaA== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613285" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613285" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:39 -0700 X-CSE-ConnectionGUID: csQUBVHNRHKBBRKY56RSXQ== X-CSE-MsgGUID: RtT59Z7WS7m3AG9n+aMdPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816028" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:15 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 3/7] fs,x86/resctrl: Add architecture hooks for every mount/unmount Date: Fri, 27 Mar 2026 16:02:04 -0700 Message-ID: <20260327230208.18094-4-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add hooks for every mount/unmount of the resctrl file system so that architecture code can allocate on mount and free on unmount. Signed-off-by: Tony Luck --- include/linux/resctrl.h | 11 +++++++++-- arch/x86/kernel/cpu/resctrl/internal.h | 8 ++++++-- arch/x86/kernel/cpu/resctrl/core.c | 14 +++++++++++++- arch/x86/kernel/cpu/resctrl/intel_aet.c | 13 +++++++++++++ fs/resctrl/rdtgroup.c | 20 ++++++++++++++++---- 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index b312aaf76974..fd16256d01a7 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -518,11 +518,18 @@ void resctrl_online_cpu(unsigned int cpu); void resctrl_offline_cpu(unsigned int cpu); =20 /* - * Architecture hook called at beginning of first file system mount attemp= t. - * No locks are held. + * Architecture hooks for resctrl mount/unmount. No locks are held. */ + +/* Called at beginning of each file system mount attempt. */ void resctrl_arch_pre_mount(void); =20 +/* Called to report success/failure of mount. */ +void resctrl_arch_mount_result(int ret); + +/* Called to report unmount. */ +void resctrl_arch_unmount(void); + /** * resctrl_arch_rmid_read() - Read the eventid counter corresponding to rm= id * for this resource and domain. diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/r= esctrl/internal.h index e3cfa0c10e92..6f322818a9e6 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -234,14 +234,18 @@ void rdt_domain_reconfigure_cdp(struct rdt_resource *= r); void resctrl_arch_mbm_cntr_assign_set_one(struct rdt_resource *r); =20 #ifdef CONFIG_X86_CPU_RESCTRL_INTEL_AET -bool intel_aet_get_events(void); +bool intel_aet_pre_mount(void); +void intel_aet_mount_result(int ret); +void intel_aet_unmount(void); void __exit intel_aet_exit(void); int intel_aet_read_event(int domid, u32 rmid, void *arch_priv, u64 *val); void intel_aet_mon_domain_setup(int cpu, int id, struct rdt_resource *r, struct list_head *add_pos); bool intel_handle_aet_option(bool force_off, char *tok); #else -static inline bool intel_aet_get_events(void) { return false; } +static inline bool intel_aet_pre_mount(void) { return false; } +static inline void intel_aet_mount_result(int ret) { } +static inline void intel_aet_unmount(void) { } static inline void __exit intel_aet_exit(void) { } static inline int intel_aet_read_event(int domid, u32 rmid, void *arch_pri= v, u64 *val) { diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 7667cf7c4e94..162eca2cfcdb 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -769,8 +769,10 @@ void resctrl_arch_pre_mount(void) struct rdt_resource *r =3D &rdt_resources_all[RDT_RESOURCE_PERF_PKG].r_re= sctrl; int cpu; =20 - if (!intel_aet_get_events()) + if (!intel_aet_pre_mount()) { + r->mon_capable =3D false; return; + } =20 /* * Late discovery of telemetry events means the domains for the @@ -786,6 +788,16 @@ void resctrl_arch_pre_mount(void) cpus_read_unlock(); } =20 +void resctrl_arch_mount_result(int ret) +{ + intel_aet_mount_result(ret); +} + +void resctrl_arch_unmount(void) +{ + intel_aet_unmount(); +} + enum { RDT_FLAG_CMT, RDT_FLAG_MBM_TOTAL, diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/= resctrl/intel_aet.c index 015627401ed2..743a1894fe9a 100644 --- a/arch/x86/kernel/cpu/resctrl/intel_aet.c +++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c @@ -335,6 +335,19 @@ void __exit intel_aet_exit(void) } } =20 +bool intel_aet_pre_mount(void) +{ + return false; // Temporary stub +} + +void intel_aet_mount_result(int ret) +{ +} + +void intel_aet_unmount(void) +{ +} + #define DATA_VALID BIT_ULL(63) #define DATA_BITS GENMASK_ULL(62, 0) =20 diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 5da305bd36c9..edcee79de424 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -2788,8 +2787,6 @@ static int rdt_get_tree(struct fs_context *fc) struct rdt_resource *r; int ret; =20 - DO_ONCE_SLEEPABLE(resctrl_arch_pre_mount); - cpus_read_lock(); mutex_lock(&rdtgroup_mutex); /* @@ -2900,6 +2897,19 @@ static int rdt_get_tree(struct fs_context *fc) return ret; } =20 +static int rdt_get_tree_wrapper(struct fs_context *fc) +{ + int ret; + + resctrl_arch_pre_mount(); + + ret =3D rdt_get_tree(fc); + + resctrl_arch_mount_result(ret); + + return ret; +} + enum rdt_param { Opt_cdp, Opt_cdpl2, @@ -2959,7 +2969,7 @@ static void rdt_fs_context_free(struct fs_context *fc) static const struct fs_context_operations rdt_fs_context_ops =3D { .free =3D rdt_fs_context_free, .parse_param =3D rdt_parse_param, - .get_tree =3D rdt_get_tree, + .get_tree =3D rdt_get_tree_wrapper, }; =20 static int rdt_init_fs_context(struct fs_context *fc) @@ -3187,6 +3197,8 @@ static void rdt_kill_sb(struct super_block *sb) kernfs_kill_sb(sb); mutex_unlock(&rdtgroup_mutex); cpus_read_unlock(); + + resctrl_arch_unmount(); } =20 static struct file_system_type rdt_fs_type =3D { --=20 2.53.0 From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 3207739B49D for ; Fri, 27 Mar 2026 23:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652565; cv=none; b=RM7F5VzV9OX3cng2zQiqOWWZQ2TcnZYyCciHjfxdKkqjV0RQyH8y61zGjc4pix6aPgDAhOfkaINIyEb7LWNM6bgNjreBDZwbhnp0IQlGERByg7Z4nKM+vHCCBeSbXRmRYTWzt0se4fw7uc9V7EvA10sfaBcrbsJWP8oxGLxDNUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652565; c=relaxed/simple; bh=xvwMYcVdCqzLdQ4ED+pIfDk1uzwQGWdHDFFqCqDUAy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mgv1hg94wLkkGoCTwyhUpdboXxnNnMhmInLNYQ/9UTVQyiQ/E3Ye7/Gfrh4G2OfHlQqqRxMODHzuy4gSJ3e5oPbWhFzWU4RG8h0JgOfwJdNqvldMU+TG/8h5lHcQ/kskjxZMMj5nLL2KH/wRA8HWHVy2LjOD1esqrB+GfUSU4po= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aPD4aqEs; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aPD4aqEs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652563; x=1806188563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xvwMYcVdCqzLdQ4ED+pIfDk1uzwQGWdHDFFqCqDUAy8=; b=aPD4aqEsAmZnh/gs+0Y+cu7tVWIDdZ7W8oUmoflgzKvxCR214OhuXSVm bC6Qf7y6fbqL24gB0HTymeyslibHj3B2yV9l//5xEr9xLzV0U1tL4g3Jn nTpoYAN9UidvuOk3yxO8gxQSw2IRtgubxmvfwh5o2qcd2RXPT8ZPRtKu/ 7GvrfoRVYsGHYypVyY/J8uSkUlqR8MKCTq7ecB6HW12RlWKoKeCpOTz4W l7iP3y9umYqZuZqOTO8hlT3drXuqVJ2r/5cZZtO3+8aMJfcMeVdLLFOfm BEeW3CWDeBpcfbsXZxsEzQ9hRVR6LnJ6VdIagG6Gqfw9B/DHjRN7VkVaF Q==; X-CSE-ConnectionGUID: 0qm4Pv/4SQa/s31MUv4ecw== X-CSE-MsgGUID: IPEwgPwPQcWYYiLy+WvB0A== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613293" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613293" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:40 -0700 X-CSE-ConnectionGUID: +kn42FCPQES1OKkISWfNow== X-CSE-MsgGUID: UNFlocXDRQGbo6wvWpuWdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816029" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:15 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 4/7] platform/x86/intel/pmt: Export PMT enumeration functions as GPL Date: Fri, 27 Mar 2026 16:02:05 -0700 Message-ID: <20260327230208.18094-5-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The symbol_get() function requires that objects be GPL licensed. Signed-off-by: Tony Luck --- drivers/platform/x86/intel/pmt/telemetry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/= x86/intel/pmt/telemetry.c index a52803bfe124..4504fb9fd83c 100644 --- a/drivers/platform/x86/intel/pmt/telemetry.c +++ b/drivers/platform/x86/intel/pmt/telemetry.c @@ -287,13 +287,13 @@ struct pmt_feature_group *intel_pmt_get_regions_by_fe= ature(enum pmt_feature_id i =20 return no_free_ptr(feature_group); } -EXPORT_SYMBOL(intel_pmt_get_regions_by_feature); +EXPORT_SYMBOL_GPL(intel_pmt_get_regions_by_feature); =20 void intel_pmt_put_feature_group(struct pmt_feature_group *feature_group) { kref_put(&feature_group->kref, pmt_feature_group_release); } -EXPORT_SYMBOL(intel_pmt_put_feature_group); +EXPORT_SYMBOL_GPL(intel_pmt_put_feature_group); =20 int pmt_telem_read(struct telem_endpoint *ep, u32 id, u64 *data, u32 count) { --=20 2.53.0 From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 95B583542F4 for ; Fri, 27 Mar 2026 23:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652563; cv=none; b=rIBKPCEgqV1eaHBRBTpWnnVKX25JVHYj9xwipMG0awRhfbbN6UUKrhgMllowDZ3S7WH+yRS2P+sisIxWORjWuWVy7yZ1htpPeH+mtsNEGWwlRMEXjdOnxDjBIxO8imcoagLiLxt8mzmvUCjAhIGtHpM/Vo4DoE8WpceSBjyff5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652563; c=relaxed/simple; bh=JeiQHXv+lAk/aEcbaYPKYv6PqQufxOxQZD0OfzAcX8U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=od3GyVKMAWBnE6RtzvFqDF+RiEnMfK9XRL2H+sgQKe6TqwYI+StkFNsB/Mr+ZQuCIE6xkHIBeiYzuL+TE5ymTpM1J9vXlsARHCCnqNSUT18NoJ9DKFE8Rt2AHL0kqgxrgJiOD33l/3x+yCCMHeC5Nv99/Ayl0Hbjj4kxs0McfK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ETzAVk5L; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ETzAVk5L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652562; x=1806188562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JeiQHXv+lAk/aEcbaYPKYv6PqQufxOxQZD0OfzAcX8U=; b=ETzAVk5LpB/So8b4+1QZtpMjdqm3I+gHY7GI0XVHnhyJN8niFpAXk1KH 3vp+ZY6PBQmuFk6geN4CoXOrAt7DDzt/HQ+x5NHVzqffc8nv7spPLI1U/ e0UsLmduJJtnx2Aoi7IqAbX2qyFs6nOh9mkmMcbxeO4cnrDtXGYBoB+/b hStPtoE696x6NWX+lvE6kmoCCeocfrJLmLbG4Ppwlgbe3K6Ny4IEeO0qn Vj3jeRoPEdA9eKPAh1jeOwHSMtMX670b1WeeVV30wnML+/HsMpEoruzwG j1M+mP/toPvC5mBgad2NY0Q72rCZeXstv16rxPaautRH5tPFAATBjUp4l g==; X-CSE-ConnectionGUID: 8elfZ8iKRv6PvvOQ6+lisQ== X-CSE-MsgGUID: vxhKvkvpQ1qzXRfBNZT6Og== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613287" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613287" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:39 -0700 X-CSE-ConnectionGUID: 7eOKjYShSAevpFLNV1i17g== X-CSE-MsgGUID: 0AuwQNDcRWCtmazjBCh6Mg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816031" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:15 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 5/7] x86/resctrl: Allow AET to use PMT/TPMI as loadable modules Date: Fri, 27 Mar 2026 16:02:06 -0700 Message-ID: <20260327230208.18094-6-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The resctrl subsystem is always built into the base kernel. Currently, enumerating Application Event Tracing (AET) features requires functions from INTEL_PMT_TELEMETRY and INTEL_TPMI. Because resctrl makes direct calls to these functions, it enforces a strict dependency requiring both PMT and TPMI to be built-in. This is overly restrictive. Use the symbol_get() mechanism to allow resctrl to resolve these symbols at runtime, whether they reside in the base kernel or in loadable modules. Use symbol_get() to obtain the addresses of intel_pmt_get_regions_by_featur= e() and intel_pmt_put_feature_group() and use indirect calls using function pointers. Change the pre-mount hook from once-only on first mount to call the hook every time. Add hooks for mount success/failure and unmount so that the hold on the INTEL_PMT_TELEMETRY module is only while the resctrl file system is mounted. Unmount now cleans up all AET structures and disables AET events. Signed-off-by: Tony Luck --- arch/x86/kernel/cpu/resctrl/intel_aet.c | 97 ++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/= resctrl/intel_aet.c index 743a1894fe9a..2d5766904fd8 100644 --- a/arch/x86/kernel/cpu/resctrl/intel_aet.c +++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -289,6 +291,9 @@ static enum pmt_feature_id lookup_pfid(const char *pfna= me) return FEATURE_INVALID; } =20 +static struct pmt_feature_group *(*get_feature)(enum pmt_feature_id id); +static void (*put_feature)(struct pmt_feature_group *p); + /* * Request a copy of struct pmt_feature_group for each event group. If the= re is * one, the returned structure has an array of telemetry_region structures, @@ -300,7 +305,7 @@ static enum pmt_feature_id lookup_pfid(const char *pfna= me) * struct pmt_feature_group to indicate that its events are successfully * enabled. */ -bool intel_aet_get_events(void) +static bool get_events(void) { struct pmt_feature_group *p; enum pmt_feature_id pfid; @@ -309,14 +314,14 @@ bool intel_aet_get_events(void) =20 for_each_event_group(peg) { pfid =3D lookup_pfid((*peg)->pfname); - p =3D intel_pmt_get_regions_by_feature(pfid); + p =3D get_feature(pfid); if (IS_ERR_OR_NULL(p)) continue; if (enable_events(*peg, p)) { (*peg)->pfg =3D p; ret =3D true; } else { - intel_pmt_put_feature_group(p); + put_feature(p); } } =20 @@ -325,27 +330,99 @@ bool intel_aet_get_events(void) =20 void __exit intel_aet_exit(void) { - struct event_group **peg; +} =20 - for_each_event_group(peg) { - if ((*peg)->pfg) { - intel_pmt_put_feature_group((*peg)->pfg); - (*peg)->pfg =3D NULL; - } +static bool get_pmt_references(void) +{ + get_feature =3D symbol_get(intel_pmt_get_regions_by_feature); + if (!get_feature) + return false; + put_feature =3D symbol_get(intel_pmt_put_feature_group); + if (!put_feature) { + symbol_put(intel_pmt_get_regions_by_feature); + get_feature =3D NULL; + return false; + } + + return true; +} + +static void put_pmt_references(void) +{ + if (get_feature) { + symbol_put(intel_pmt_get_regions_by_feature); + get_feature =3D NULL; + } + if (put_feature) { + symbol_put(intel_pmt_put_feature_group); + put_feature =3D NULL; } } =20 +static DEFINE_MUTEX(pmt_lock); + +static enum { + AET_UNINITIALIZED, + AET_PRESENT, + AET_NOT_PRESENT +} aet_state; + bool intel_aet_pre_mount(void) { - return false; // Temporary stub + bool ret; + + mutex_lock(&pmt_lock); + + if (aet_state =3D=3D AET_PRESENT) + return true; + + if (aet_state =3D=3D AET_NOT_PRESENT || !get_pmt_references()) + return false; + + ret =3D get_events(); + + if (ret) { + aet_state =3D AET_PRESENT; + } else { + aet_state =3D AET_NOT_PRESENT; + put_pmt_references(); + } + + return ret; +} + +static void aet_cleanup(void) +{ + struct event_group **peg; + + if (aet_state =3D=3D AET_PRESENT) { + for_each_event_group(peg) { + if ((*peg)->pfg) { + struct event_group *e =3D *peg; + + for (int j =3D 0; j < e->num_events; j++) + resctrl_disable_mon_event(e->evts[j].id); + put_feature((*peg)->pfg); + (*peg)->pfg =3D NULL; + } + } + put_pmt_references(); + aet_state =3D AET_UNINITIALIZED; + } } =20 void intel_aet_mount_result(int ret) { + if (ret && ret !=3D -EBUSY) + aet_cleanup(); + mutex_unlock(&pmt_lock); } =20 void intel_aet_unmount(void) { + mutex_lock(&pmt_lock); + aet_cleanup(); + mutex_unlock(&pmt_lock); } =20 #define DATA_VALID BIT_ULL(63) --=20 2.53.0 From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 980D831A062 for ; Fri, 27 Mar 2026 23:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652563; cv=none; b=W7GyZ/hvtqHJ0xyd4qX7spmOB5eiE9wlZL1cvMPPH62zud/eELWfoXaw2k4QHJn22isNGJqVGMf0f8zig9Oa5w6NJB0tn07LYZRscxSnOhbpjK6Cg4UECq9T+lnu6BLNDGHQaq/6axL2VB+a98X98ugZYnnSpOgXR5YGwNX8hzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652563; c=relaxed/simple; bh=dB3lGaNS4U1dLL4aMG+UkqrJsLJ7iKlcbiBKiDYPHCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YS9xnyaomaejt6zaakXwSBNSafUryARBjTE0OweUITWf4CyWM9eEpIrB4ALorPqTjHwi8GEpciOEFwabcxppzySxZzWPjL8qFJTltBrUcn3N6R7TDpr4II9hEJ7flySkKewpABORrxLZWJkF0qvkfsVtkGEgEEDx1O/xljsZ8FE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GZD+4Jag; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GZD+4Jag" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652563; x=1806188563; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dB3lGaNS4U1dLL4aMG+UkqrJsLJ7iKlcbiBKiDYPHCA=; b=GZD+4JagBOcVItsrlV2vPZz8IqycPJNn34ddvD9LeognyEytsi+V6zJo 7tX1xRRRG4Q2uPSBVpAnnlbXL9u2CkYALbQQCUa2t37V8jlp+yo1Wc9j+ kyCk4ct5+jJ0l4DbHJX0+tfgeLzmHvSDw56kGKNTvE1FhX1JeWHGBoxMI Ezy49Fc2oGdhOTuYMA0L31dttAi/jxpqHDK6ZxtSDMI4m8zvv6sMRBG+H 8QgDae6pi751ZEUZ1IChE87z2iR9E0ehL6vhKWZyug3TgF++kxdHJht9q vYwaQ/1VcWRegavxe4HfnN7vZOTUnBQR9DoHfL3qrIpoXNgKSwDGXiQik A==; X-CSE-ConnectionGUID: cfXrdEcMTjeG5GAHgTIZiw== X-CSE-MsgGUID: Nb/cJq2iSV+jUhhXQPQErA== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613294" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613294" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:40 -0700 X-CSE-ConnectionGUID: fzDIn5lSRzqMw6SSGQKh2w== X-CSE-MsgGUID: I0EV8/UQQD6hd1eZePt80w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816034" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:15 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 6/7] x86/resctrl: Delete intel_aet_exit() Date: Fri, 27 Mar 2026 16:02:07 -0700 Message-ID: <20260327230208.18094-7-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" All cleanup for AET is now handled during file system unmount. Drop intel_aet_exit(). Signed-off-by: Tony Luck --- arch/x86/kernel/cpu/resctrl/internal.h | 2 -- arch/x86/kernel/cpu/resctrl/core.c | 2 -- arch/x86/kernel/cpu/resctrl/intel_aet.c | 4 ---- 3 files changed, 8 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/r= esctrl/internal.h index 6f322818a9e6..2230b64fa2ba 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -237,7 +237,6 @@ void resctrl_arch_mbm_cntr_assign_set_one(struct rdt_re= source *r); bool intel_aet_pre_mount(void); void intel_aet_mount_result(int ret); void intel_aet_unmount(void); -void __exit intel_aet_exit(void); int intel_aet_read_event(int domid, u32 rmid, void *arch_priv, u64 *val); void intel_aet_mon_domain_setup(int cpu, int id, struct rdt_resource *r, struct list_head *add_pos); @@ -246,7 +245,6 @@ bool intel_handle_aet_option(bool force_off, char *tok); static inline bool intel_aet_pre_mount(void) { return false; } static inline void intel_aet_mount_result(int ret) { } static inline void intel_aet_unmount(void) { } -static inline void __exit intel_aet_exit(void) { } static inline int intel_aet_read_event(int domid, u32 rmid, void *arch_pri= v, u64 *val) { return -EINVAL; diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 162eca2cfcdb..1951df519dea 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -1172,8 +1172,6 @@ late_initcall(resctrl_arch_late_init); =20 static void __exit resctrl_arch_exit(void) { - intel_aet_exit(); - cpuhp_remove_state(rdt_online); =20 resctrl_exit(); diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/= resctrl/intel_aet.c index 2d5766904fd8..c6c213d28275 100644 --- a/arch/x86/kernel/cpu/resctrl/intel_aet.c +++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c @@ -328,10 +328,6 @@ static bool get_events(void) return ret; } =20 -void __exit intel_aet_exit(void) -{ -} - static bool get_pmt_references(void) { get_feature =3D symbol_get(intel_pmt_get_regions_by_feature); --=20 2.53.0 From nobody Thu Apr 2 14:06:37 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 E7ADA39F174 for ; Fri, 27 Mar 2026 23:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652565; cv=none; b=mS9MHyZ2IkIkwZFpe+pQeoLyRGcw1Wiq6qnJNAUOwnv9lz3OWLp6ef/BwBSy6E2qxVwtd8yne5f5CfGXOIX9mJ5m9A7CGIIFmGcppsvBiDYu5dZ570l0Pf3n7gbNpo/pYC+ELtmUguqsGfvWPFOTtZahocpkWEvwe5yzkLVgYJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774652565; c=relaxed/simple; bh=p1P+ZN8u2jBEwcuU+cz9O1GwBYuc8jFJvKjGneOz9qA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JjRceSZWHgPxovnC43gve6w/7KKHCZhoybnEBSUJ2dr4rgjI5JAyIoaRU4mL5WNHvdwo3v3lB9Ii9RnVxiOGsAmDSo5A+qaGwQmuHVCAIhk88A+UJki8l3O7wSyBY5FkZ9rakqtB4jFch0Iwj6/EvcekboSotWKhbavF9jIRrh4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jsjCGhbl; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jsjCGhbl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774652564; x=1806188564; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p1P+ZN8u2jBEwcuU+cz9O1GwBYuc8jFJvKjGneOz9qA=; b=jsjCGhblRNGXtSJ2me4YySfIfuMMNGrgPZ3uz0gmnrMVj4m0HYu5tgly rO1SzR92R4UAm/Zydg95k4T6CuGIg78AuT/bTQQd/Oa19sy/JRuLVyyRe FzjIzbBdUES2T7XB8b1Sqkgp7tIKfj6+Iy3VmiJRYv7s52z9c8/Vd5v+J KbMzJ4Wj544N1gtfHTBm46ctU/m8s9gFAqxKZ906AWJuZvdoQOwdU9nDM xhQ7WOlWpcBXNj8wI4ybjAABdDh9LXNpZTl0/T/eYYaQIji754gK5j3yD WZV1nEWLka05YZ3B93HiiP2oTaJ15TXQWFQUa2wil+iZDcVeTioST5smK Q==; X-CSE-ConnectionGUID: BFQ/JP7xTCSR8ngmNouikA== X-CSE-MsgGUID: V8HvgLKtQyKWPTXV8JQzSQ== X-IronPort-AV: E=McAfee;i="6800,10657,11742"; a="75613299" X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="75613299" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:40 -0700 X-CSE-ConnectionGUID: 6S36lz5hRoyoLURNGnme9Q== X-CSE-MsgGUID: E4wXtDk6QUmFWlLOYSaYVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,145,1770624000"; d="scan'208";a="218816035" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.83]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2026 16:02:16 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v3 7/7] x86/resctrl: Downgrade dependency of AET on INTEL_PMT Date: Fri, 27 Mar 2026 16:02:08 -0700 Message-ID: <20260327230208.18094-8-tony.luck@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260327230208.18094-1-tony.luck@intel.com> References: <20260323163452.25044-1-tony.luck@intel.com> <20260327230208.18094-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The INTEL_AET code now using symbol_get() to access the INTEL_PMT enumeration functions so no requirement that they be built-in to the base kernel. Update the Kconfig dependencies. Signed-off-by: Tony Luck --- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e2df1b147184..1a60da62da33 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -542,7 +542,7 @@ config X86_CPU_RESCTRL =20 config X86_CPU_RESCTRL_INTEL_AET bool "Intel Application Energy Telemetry" - depends on X86_64 && X86_CPU_RESCTRL && CPU_SUP_INTEL && INTEL_PMT_TELEME= TRY=3Dy && INTEL_TPMI=3Dy + depends on X86_64 && X86_CPU_RESCTRL && CPU_SUP_INTEL && INTEL_PMT_TELEME= TRY !=3D n && INTEL_TPMI !=3D n help Enable per-RMID telemetry events in resctrl. =20 --=20 2.53.0