From nobody Tue Dec 2 02:42:37 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 9AC75254AF5 for ; Tue, 18 Nov 2025 04:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763441590; cv=none; b=W/N0d7jFhOKdkVomN24Cfi5P8pRKI5KOUpJswCmR2SlWUlB7+FvvuOaWfmom4yHU+As+Yem/wxA2d1lYTevuB8Dh/BrZzUNFEHIUizGG7M0uCweIUCaDU6PUhBWLwWmpdsSEjWmLrTAe6TVmahSeHyA2IFXWQ8zv/xXFjMuBTQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763441590; c=relaxed/simple; bh=YAvSFC4o0bSFk+PG5vxrAOhLtpukQLhw33zpaKs17q4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=G+/B5jk9mI6zku3/E6JzEtq7D3NZ2WsdUwr3WLDf+tZTLI3kElmhQtgsHW9RuH/rlCCCPDdjyQiU8z26G0rM4FArs9z9lgW0XxnoElBbW/DF2DP0KziXffrh8CzszHg4TS8vqensw4q3wRezbAsHiYWz65eOPqHRErNRme06vZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KcykgEBx; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KcykgEBx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763441589; x=1794977589; h=from:date:subject:mime-version:content-transfer-encoding: message-id:to:cc; bh=YAvSFC4o0bSFk+PG5vxrAOhLtpukQLhw33zpaKs17q4=; b=KcykgEBxYmN0qGQDJLnuqV87xaLTw+LEsonfuqstr1c2ZvbEzD0ZtHpb L93YkU/UtGr+hiMMfVpK8S7SXItonHN3TaBdc20fRqdV4KsTdYQPYKJBv qcrAcu1xqeJ1Zf2yKRG8H2gsXawycqukfBcMhBg+ZJj+v2fOVUZ72aKhA 4PIPtV+8lZR5XUez060D2zhuWHinIlvmyDRQjxN6b1D6YpDJ/dFzK+xCv gHk4WQo6Uahvop/M5SSjd8Xbt/uS/6mieXg97OGSPGF60KySc6rZ5DzfZ jOwzJjPQB+GQg4TGphEHe1+2Uu4/kxwRK9H6c7Lfaz5LUP8ONXrG654KK A==; X-CSE-ConnectionGUID: nTmNZG5iS5CJORP7OY9NSg== X-CSE-MsgGUID: qWT8f8r2RnGmt/CI7TGRfg== X-IronPort-AV: E=McAfee;i="6800,10657,11616"; a="69321826" X-IronPort-AV: E=Sophos;i="6.19,313,1754982000"; d="scan'208";a="69321826" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2025 20:53:07 -0800 X-CSE-ConnectionGUID: 2pBipX9rSDK0HZbo/J0aTw== X-CSE-MsgGUID: w7J8m6HXQ72iinisGDFN5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,313,1754982000"; d="scan'208";a="227990071" Received: from unknown (HELO [172.25.112.21]) ([172.25.112.21]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2025 20:53:07 -0800 From: Ricardo Neri Date: Mon, 17 Nov 2025 20:50:50 -0800 Subject: [PATCH] x86/topology: Add missing declarations and attribute dependencies Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251117-rneri-topology-cpuinfo-bug-v1-1-a905bb5f91e2@linux.intel.com> X-B4-Tracking: v=1; b=H4sIACn7G2kC/x3MQQqDMBBA0avIrB1wbNTqVYqLqmMcKJmQNNIi3 t3g8i3+PyByEI4wFAcE3iWKugwqC5i3t7OMsmRDXdUNETUYXA7wq14/av84+yRuVZySxa4ypn+ Yvn0uBHngA6/yu+ev8TwvEZ2ElmwAAAA= To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Ricardo Neri X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763441545; l=2846; i=ricardo.neri-calderon@linux.intel.com; s=20250602; h=from:subject:message-id; bh=YAvSFC4o0bSFk+PG5vxrAOhLtpukQLhw33zpaKs17q4=; b=9v2TlILOpH5huBPt1uGjry5LXArOwGeUay/3HaEN/WDIBEUVGVMjbX3/fAba5Mob+NAIP6dvM 9Ov+9INChPuAWkkVJe/rvc2i0sACsmJCVHktupEIZNyrDoAnz04QHJV X-Developer-Key: i=ricardo.neri-calderon@linux.intel.com; a=ed25519; pk=NfZw5SyQ2lxVfmNMaMR6KUj3+0OhcwDPyRzFDH9gY2w= The prototypes for get_topology_cpu_type_name() and get_topology_cpu_type() take a pointer to struct cpuinfo_x86, but asm/topology.h does not include nor forward-declares the structure. A translation unit that includes asm/topology.h, directly or indirectly, without including asm/processor.h triggers a warning: ./arch/x86/include/asm/topology.h:159:47: error: =E2=80=98struct cpuin= fo_x86=E2=80=99 declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 159 | const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c); | ^~~~~~~~~~~ Since only a pointer is needed and no structure members are accessed, add a forward declaration of struct cpuinfo_x86. Similarly, sysctl_sched_itmt_enabled is declared in asm/topology.h with the __read_mostly attribute, but the header does not include linux/cache.h. This causes a build failure when a file includes asm/topology.h without including linux/cache.h: ./arch/x86/include/asm/topology.h:264:27: error: expected =E2=80=98=3D= =E2=80=99, =E2=80=98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__attribute__= =E2=80=99 before =E2=80=98sysctl_sched_itmt_enabled=E2=80=99 264 | extern bool __read_mostly sysctl_sched_itmt_enabled; | ^~~~~~~~~~~~~~~~~~~~~~~~~ Include the needed header. Signed-off-by: Ricardo Neri --- I found this issue while working on a patchset for Hyper-V support [1]. In that case, the file arch/x86/hyperv/hv_vtl.c would now include asm/acpi.h, which implicitly includes asm/topology.h but not asm/processor.h nor linux/ cache.h. [1]. https://lore.kernel.org/r/20251117-rneri-wakeup-mailbox-v7-0-4a8b82ab7= c2c@linux.intel.com --- arch/x86/include/asm/topology.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topolog= y.h index 1fadf0cf520c..630521a03982 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -156,6 +156,8 @@ extern unsigned int __max_threads_per_core; extern unsigned int __num_threads_per_package; extern unsigned int __num_cores_per_package; =20 +struct cpuinfo_x86; + const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c); enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c); =20 @@ -259,6 +261,7 @@ extern bool x86_topology_update; =20 #ifdef CONFIG_SCHED_MC_PRIO #include +#include =20 DECLARE_PER_CPU_READ_MOSTLY(int, sched_core_priority); extern bool __read_mostly sysctl_sched_itmt_enabled; --- base-commit: 6f85aad74a70d17919a64ecd93037aa51c08698d change-id: 20251115-rneri-topology-cpuinfo-bug-7044934968d1 Best regards, --=20 Ricardo Neri