From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 C87982AE76 for ; Sun, 2 Aug 2026 16:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785687137; cv=none; b=ev/QAFM97Ie852JdPXRYJRCd9JPu+mOqU/Cj3Zuyw95rg9aphkfJdwrdaVDC6saGxN6j7rf/dUszPYOtzT71r2NAsJnoViR7cb21qEnyZvWJw51gpW0lRjgFRy7+FIuPMZnuXsixIDpGZYua9T5enqWw98r4AwVHYV8uT1bjsNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785687137; c=relaxed/simple; bh=g00qydFaPLS+d6NzizKEM8uOpceBtx+/tc7BHloiAkI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X4xmMhbxsJFfBwHqq/l3Y6xUF+GHMcXFPFN9jGGlqgJMe/paalAN48TPz1KqkqM9wlVbpAGIG6fod8losKujOlCxk4t+Pya9MqJsCDk0Uq5RCBIfqWNKY3CrGgxUln0AIu1OUMogPrfL6q0sgX4uNpHDiAvhDHYhTBlV5Y+x3+I= 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=lgItUuSy; arc=none smtp.client-ip=198.175.65.17 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="lgItUuSy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785687134; x=1817223134; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g00qydFaPLS+d6NzizKEM8uOpceBtx+/tc7BHloiAkI=; b=lgItUuSyG50jVkcducjZJ+fwc/A7Eg7qBWYlfNj7NwNbhPm5zPhSd4Vd FAgsoBpJXOHrvl70Sr33ePHI1b1zQcvrlduoQDbYkZDoETBjwNlIUcRsT 46nrjdvHOpKOCTREtcwhWxSC5OZ2+dXySzCLTz6mJ888yuN2ywv5MGTzp h0/+DxpSDu0240sqKKW1s7jO63NjHjY/DWbH5y5KBGrJY+JJXVBpSLpP4 5BikG/XzeSw4j9QJXfGTCVjDuqit8ExPY9pRr+BB8mKhfTqv8CA7OkE0R wkaDQDNro5VcvXmJIUkHYFz86N6fF3lqY85IGoesIYYi1gfZoYHhFB0ev g==; X-CSE-ConnectionGUID: DcPbXrrMRlqIVdAaLpVskg== X-CSE-MsgGUID: Oo7Tq/M+SDCyisysXNExCw== X-IronPort-AV: E=McAfee;i="6800,10657,11863"; a="86257755" X-IronPort-AV: E=Sophos;i="6.25,200,1779174000"; d="scan'208";a="86257755" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2026 09:12:14 -0700 X-CSE-ConnectionGUID: u27YCCVnS5mps2oQrLoomg== X-CSE-MsgGUID: 83KA2KGsSBuvC75sqnshCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,200,1779174000"; d="scan'208";a="290949561" Received: from chenyu-dev.sh.intel.com ([10.239.62.107]) by orviesa002.jf.intel.com with ESMTP; 02 Aug 2026 09:12:12 -0700 From: Chen Yu To: Reinette Chatre , Tony Luck Cc: Ben Horgan , "James Morse" , Dave Martin , Babu Moger , Fenghua Yu , Borislav Petkov , Thomas Gleixner , "Dave Hansen" , Peter Newman , chen.yu@linux.dev, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 01/31] x86/topology: Export topo_lookup_cpuid() for resctrl use Date: Mon, 3 Aug 2026 00:02:30 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 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 Enhanced RDT (ERDT) enumerates its monitoring and control resources through ACPI tables that identify each CPU by its x2APIC ID. To associate this firmware-provided data with the kernel's per-CPU structures, ERDT must translate those x2APIC IDs into logical CPU numbers. topo_lookup_cpuid() already performs this translation, but it is static to topology.c and therefore not reachable from resctrl. Export topo_lookup_cpuid() and add its declaration to asm/apic.h so that ERDT can resolve x2APIC IDs from ACPI tables to logical CPU numbers. No functional change intended. Tested-by: Hongyu Ning Signed-off-by: Chen Yu --- arch/x86/include/asm/apic.h | 1 + arch/x86/kernel/cpu/topology.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 9cd493d467d4..bb84651b14bd 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -54,6 +54,7 @@ static inline void x86_32_probe_apic(void) { } #endif extern u32 cpuid_to_apicid[]; +int topo_lookup_cpuid(u32 apic_id); #define CPU_ACPIID_INVALID U32_MAX diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index 4913b64ec592..bcee70fb9277 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -92,7 +92,7 @@ static inline u32 topo_apicid(u32 apicid, enum x86_topology_domains dom) return apicid & (UINT_MAX << x86_topo_system.dom_shifts[dom - 1]); } -static int topo_lookup_cpuid(u32 apic_id) +int topo_lookup_cpuid(u32 apic_id) { int i; -- 2.43.0