From nobody Sat Feb 7 07:44:06 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 B72302EAB72 for ; Thu, 8 Jan 2026 17:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767894177; cv=none; b=fcEHOwtIMMp/Cb5WOxUuo7UjbBRMqV4dbnfURxIERZk3yQTgHBZP5LPsG64t/8fSAna4d1zOqGQmT9X7TgICxxSn+Fs/1lrIsxmvUVx7eLRlue32THNmFlfRvQRSo8gz2LOaxvl2spfHfFDgwr+yHkUyGZKpLkwuFOYg6acreVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767894177; c=relaxed/simple; bh=mVon3QCCgN8CAIK2Kn9VD/59thFGAyRpr8gdLUq4cmw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ToHSwqS5DsmctSXHic9z20KaQMWsHPB4CWRQ0VwoR00pHRsyG+I8sXDRlMx1NA2OfUN3gjllQMf90H0bK/u+4uNOz/gmhn+kZ/rg5UkoMxcQ0P52D0wsmcfg5etxH1jKkaW0rQ0QRBWkUDdiiXaWhrbRnQEU/LiESyE9E12yBLA= 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=RdjycsWu; arc=none smtp.client-ip=192.198.163.9 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="RdjycsWu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767894173; x=1799430173; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mVon3QCCgN8CAIK2Kn9VD/59thFGAyRpr8gdLUq4cmw=; b=RdjycsWusv0Qwd9YRa73IGGmBoFvFzuHncZFvf7pW9Frj5iR5aRYEtHK lxdb5TyWUYIiqc2zV+wmN/hmsWY++DYxZ/ilSZY57UBwvsFuEu4IcnJOt khYORMy7A452TtrxKaN9vgidsrTBIZpnZ8UrwaNEfG04HNVGQj+EvA17k HiwWuiKqKieQOtlropb0H6VA2r0z/uzzVCuHQyYh2qPOIT5Jk2d84e2vk 5XCGnwU/GNByTfMCu1tDmiY/IH525yf6bvXvgcK6XtC4BvRQr5lT2aRD5 ShJifi9Uwk4xnasD8iz25OGVnUkol9QfyssfGcqmphZ/KVHU70vGzsjn0 Q==; X-CSE-ConnectionGUID: r3B2H3rHRxqgNDlUIehZ0Q== X-CSE-MsgGUID: 7/UVuqa/SnCv+GyRjj+mXg== X-IronPort-AV: E=McAfee;i="6800,10657,11665"; a="79998993" X-IronPort-AV: E=Sophos;i="6.21,211,1763452800"; d="scan'208";a="79998993" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2026 09:42:47 -0800 X-CSE-ConnectionGUID: DSplI35gRiKLdjkOtzL0sA== X-CSE-MsgGUID: t/KsbgHwQiSZVLnaLqYzuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,211,1763452800"; d="scan'208";a="240751109" Received: from khuang2-desk.gar.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.223.16]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2026 09:42:48 -0800 From: Tony Luck To: Borislav Petkov Cc: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH 13/32] x86,fs/resctrl: Add an architectural hook called for first mount Date: Thu, 8 Jan 2026 09:42:25 -0800 Message-ID: <20260108174227.11307-2-tony.luck@intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260108174227.11307-1-tony.luck@intel.com> References: <20260108174227.11307-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" Enumeration of Intel telemetry events is an asynchronous process involving several mutually dependent drivers added as auxiliary devices during the device_initcall() phase of Linux boot. The process finishes after the probe functions of these drivers completes. But this happens after resctrl_arch_late_init() is executed. Tracing the enumeration process shows that it does complete a full seven seconds before the earliest possible mount of the resctrl file system (when included in /etc/fstab for automatic mount by systemd). Add a hook at the beginning of the mount code that will be used to check for telemetry events and initialize if any are found. The hook is only called on the first mount of the resctrl file system as that is all that is needed for telemetry enumeration. resctrl filesystem calls the hook with no locks held. Architecture code is responsible for any required locking. Signed-off-by: Tony Luck --- include/linux/resctrl.h | 6 ++++++ arch/x86/kernel/cpu/resctrl/core.c | 4 ++++ fs/resctrl/rdtgroup.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index c43526cdf304..2f938a5a16f8 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -514,6 +514,12 @@ void resctrl_offline_mon_domain(struct rdt_resource *r= , struct rdt_domain_hdr *h 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. + */ +void resctrl_arch_pre_mount(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/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 9222eee7ce07..a2b7f869b4b0 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -726,6 +726,10 @@ static int resctrl_arch_offline_cpu(unsigned int cpu) return 0; } =20 +void resctrl_arch_pre_mount(void) +{ +} + enum { RDT_FLAG_CMT, RDT_FLAG_MBM_TOTAL, diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 771e40f02ba6..0e3b8bcf4e53 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -2785,6 +2786,8 @@ 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); /* --=20 2.52.0