From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 743FC327C0D for ; Mon, 24 Nov 2025 18:55:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764010515; cv=none; b=UDF5hjSPOoshwVi8Kbov+YOapKO2sO0gz3EQVdl7xezcBWbRPI+X01J+b4sVrhih0dp1zdirLpsDmLR4qw1TaB9Gmv6uVsQ1uP+ixFFF97FXSujIbIMSc/421UE7bmMAFC3t35Np6KKTYI6g67PeHasBNZGF2lJjuy6rS0ZhyXU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764010515; c=relaxed/simple; bh=ktuSk2wMgmJMK50ZK4GLeGxWbH7w+Yr81xrVxNRhnWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gku0cmLeWd6q1nARsz+P/DO+Xb9zLJgG7YOy3J7tPcJMgI8pmOJyoYsN5JtmtcyGWzoi47/V9FZvpZt4uoYLLzLV0BS/IwSnzFxZp16zsrE8l2oTp6ZtEzTaw503lGO+a9TUfSk4/7RjnfviwSC3jpFbI9dMLmwmQbHtmyYYEKU= 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=IAcnS23q; arc=none smtp.client-ip=192.198.163.11 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="IAcnS23q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1764010513; x=1795546513; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ktuSk2wMgmJMK50ZK4GLeGxWbH7w+Yr81xrVxNRhnWs=; b=IAcnS23qsi1V2PXSR2d5EmTv1zBjpgFVnPAzo8axRTXWbrTYC55U2wBO ueOVY+xTZgA99ejW7HfFJt3pEifluQnaAGtlyehMbjjsRXO06vLGa7209 NdMfIcrjugfActWSkCt2I00RQdXUhPa66xcRj1+e4lGVQjopy+WgoFdv1 Y6+L7sSq4PWNsUwqG80Sq2UskGjZMa1z7+PsGznGTY5zLLI/PhqrXLmXg cZwjWZdK86crCnSxLSg5JKubKX3X1MlMMCuSUqmq7/BfLFIPHvUM7ldvL Bjn43xdWJA11yTEFvFmyNv/z5hn8AOAhoPS59e5Js/CdPwZf5sU1F9wQe Q==; X-CSE-ConnectionGUID: idfUhOb9QCaw9NBWE8EhiA== X-CSE-MsgGUID: GvIZvy2HTxuWlk+joUMItw== X-IronPort-AV: E=McAfee;i="6800,10657,11623"; a="76636939" X-IronPort-AV: E=Sophos;i="6.20,223,1758610800"; d="scan'208";a="76636939" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2025 10:54:32 -0800 X-CSE-ConnectionGUID: KQ9Pgc8XTwWqTDBrc5q1RA== X-CSE-MsgGUID: KOBCkZbVRamLT94qatBzsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,223,1758610800"; d="scan'208";a="192225041" Received: from rfrazer-mobl3.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.222.153]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2025 10:54:32 -0800 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v14 29/32] x86/resctrl: Enable RDT_RESOURCE_PERF_PKG Date: Mon, 24 Nov 2025 10:54:06 -0800 Message-ID: <20251124185412.24155-30-tony.luck@intel.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251124185412.24155-1-tony.luck@intel.com> References: <20251124185412.24155-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: 8bit Since telemetry events are enumerated on resctrl mount the RDT_RESOURCE_PERF_PKG resource is not considered "monitoring capable" during early resctrl initialization. This means that the domain list for RDT_RESOURCE_PERF_PKG is not built when the CPU hot plug notifiers are registered and run for the first time right after resctrl initialization. Mark the RDT_RESOURCE_PERF_PKG as "monitoring capable" upon successful telemetry event enumeration to ensure future CPU hotplug events include this resource and initialize its domain list for CPUs that are already online. Print to console log announcing the name of the telemetry feature detected. Signed-off-by: Tony Luck Reviewed-by: Reinette Chatre --- arch/x86/kernel/cpu/resctrl/core.c | 16 +++++++++++++++- arch/x86/kernel/cpu/resctrl/intel_aet.c | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index bca65851d592..829633bc54e5 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -766,14 +766,28 @@ static int resctrl_arch_offline_cpu(unsigned int cpu) void resctrl_arch_pre_mount(void) { + struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_PERF_PKG].r_resctrl; static atomic_t only_once = ATOMIC_INIT(0); - int old = 0; + int cpu, old = 0; if (!atomic_try_cmpxchg(&only_once, &old, 1)) return; if (!intel_aet_get_events()) return; + + /* + * Late discovery of telemetry events means the domains for the + * resource were not built. Do that now. + */ + cpus_read_lock(); + mutex_lock(&domain_list_lock); + r->mon_capable = true; + rdt_mon_capable = true; + for_each_online_cpu(cpu) + domain_add_cpu_mon(cpu, r); + mutex_unlock(&domain_list_lock); + cpus_read_unlock(); } enum { diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/resctrl/intel_aet.c index 6eff606541ad..83d0bab4d6f5 100644 --- a/arch/x86/kernel/cpu/resctrl/intel_aet.c +++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c @@ -280,6 +280,12 @@ static bool enable_events(struct event_group *e, struct pmt_feature_group *p) else r->mon.num_rmid = e->num_rmid; + if (skipped_events) + pr_info("%s %s:0x%x monitoring detected (skipped %d events)\n", r->name, + e->name, e->guid, skipped_events); + else + pr_info("%s %s:0x%x monitoring detected\n", r->name, e->name, e->guid); + return true; } -- 2.51.1