From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 A02FD2248AC for ; Wed, 9 Jul 2025 17:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080761; cv=none; b=SYrBjS4CqdBUmKFqmZ+kV2zggCe6ZDdcjbScJzEOFUcbCbMkeMFpZaUB+elfMhgGS6SV2coJcgKla/cwVTWTCvELc2EuKw5dgpt2KCRLHQ/nDDgiYfN8uYKauXfpZzZUXreJQ3RxNKmI/spDFOhcTubkftzO4UQqXYrI6yRN6HQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080761; c=relaxed/simple; bh=6Pf/tXMZzJo5FfKHir7iP/T7zDvDoWdK5wp07Bj9XFo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oWT6IK9lm71X6rPTejR2yBHep1yJ6FJICjX2X2y47GcV5k/5G7FKOBsXwzUMaU6nHn13mGW4U4SjS0IotuUUKhd1IIguAJVeJJSqhVFtwUo74DGVngW90udWMQXVePQLn9omnchRP3aSTP7SzKW0ecM1zIxdNj1MYoNjkO8YiKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wHy3HkPp; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uMYjSaXY; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wHy3HkPp"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uMYjSaXY" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=moW3grsIEEkZ24nmNYOLsz6RTNF0J1cs4slM6upzMSY=; b=wHy3HkPpIZOqqCgrt9h7ps5aUl5JHTtwBsj6ZCQfhbBmQBZpVu3x7+kE2eMlHjpHfBopTK Dhgwr4DBGQCg2ZWO2bBGfirYTEw0S2xD7vuAdCp85b5lEHaJGjSYGTDcT76Xr1bpOw9uCl V1q5Cq6k8EhYEzLgf2P2SSf/nWYAGtgOBjlUAXyUFiCngRuJ9DaRYaVcCViswH5cL1y3gw i24/jlIW09PcPCDPh3anpI55ZGfwbSDsQOkbHqkQ/+d7hTltRx5cIZvgMqRyBZDypbWjb5 Ck3ZIZ0vpLfCEcwn60CVYC4Le1HcY37hDV/4t01y0K+6sjgpY7lmEHhTnIwDEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=moW3grsIEEkZ24nmNYOLsz6RTNF0J1cs4slM6upzMSY=; b=uMYjSaXYFYpwP3+k5ONdCr07onyydaFp4RdjrsYhbuO6/JVXRZlQpHBqrQ+5qg8r1V7xMs xFupdtmRHGdiSzAA== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 1/7] x86/cpuid: Remove transitional header Date: Wed, 9 Jul 2025 19:04:47 +0200 Message-ID: <20250709170454.74854-2-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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 CPUID call sites were updated at commit: 968e30006807 ("x86/cpuid: Set as the main CPUID heade= r") to include instead of . The header was still retained as a wrapper, just in case some new code in -next started using it. Now that everything is merged to Linus' tree, remove the header. Signed-off-by: Ahmed S. Darwish --- arch/x86/include/asm/cpuid.h | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 arch/x86/include/asm/cpuid.h diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h deleted file mode 100644 index d5749b25fa10..000000000000 --- a/arch/x86/include/asm/cpuid.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#ifndef _ASM_X86_CPUID_H -#define _ASM_X86_CPUID_H - -#include - -#endif /* _ASM_X86_CPUID_H */ --=20 2.49.0 From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 1692E222593 for ; Wed, 9 Jul 2025 17:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080764; cv=none; b=J7ZhYP+9zD8nplL3iI0AkraCYE1L83U2wpAewx+/7QgLllkvhlvncN3B7QPOOCQdILCINSRCScw0QqmLIEILsukPF6qbuYTbsHyBqbtU8SMN/+ts7sh7Odv/TTvTJbmtD3GCaNEjlelu7gmSVbqgDSASYg66iaAb9E8wklms4kU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080764; c=relaxed/simple; bh=FZ9H4/MGT0XYBHeY+H65v0m9KWcRSW93roPsQeAFDLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VvvlottikuEm4LWsp1R6HPnzzeo1LFJwm64NShXZYULuM1iCGDBkAEKLcoeik+U2FOSwQdEyn1reZPCJf1/e+cAaKbXfH14ViLdXVxW1EfBVSqZP1B++T7p/ZHojVF01xElxhvzRcyTfXkxKLpMp5xsxePHA7842fXOrn/yy8EU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=c2jlm0sl; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lpc9Wrzp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="c2jlm0sl"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lpc9Wrzp" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=av1RJLmDJc38MxsK1DauTEQVAq72KkzKxqMBwAWtSvk=; b=c2jlm0sl8GQnNqGTtZ2X+H1npMPv4r/WAwrS4zf1n/MjK69P/5CclK1UFG3P07KdKS5p9Y 5mwx58v7q4ugvT1p32ewxyTX6SC3P2LRhADLK9wbRGyIRtsQShlRCRTLZsGrXr6dKwhsWx 2QD3dnSH0gdEjGkOU8ateUsjaCDx0ITOp1B2RgBlTdi4G6fMZu37KFVwwyGjdzs5Bh5yoD 3Uedjg6ZkfazB36cVXiR5yWQqaXx2uLviqsBNfxvl1yDroapRrtsXZC/ppSGv6DGhvrIA4 8hmxms4AyPfMq7vBlOyoneTUBLxD0bIh3H3XDs0dSnm4a+7cg3xQBgXnm/71jA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=av1RJLmDJc38MxsK1DauTEQVAq72KkzKxqMBwAWtSvk=; b=lpc9Wrzp11SSZqjr600Hgl96Eoi6G+HEaYB1WljkqYPeku4uud0vbk0PhVMcuph/wWgq/D HXMqHn+3iJ1qyoCQ== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 2/7] ASoC: Intel: avs: Include CPUID header at file scope Date: Wed, 9 Jul 2025 19:04:48 +0200 Message-ID: <20250709170454.74854-3-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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" Commit cbe37a4d2b3c ("ASoC: Intel: avs: Configure basefw on TGL-based platform= s") includes the main CPUID header from within a C function. This works by luck and forbids valid refactorings inside the CPUID header. Include the CPUID header at file scope instead. Note, for the CPUID(0x15) leaf number, use CPUID_LEAF_TSC instead of defining a custom local macro for it. Signed-off-by: Ahmed S. Darwish Acked-by: Cezary Rojewski --- sound/soc/intel/avs/tgl.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/avs/tgl.c b/sound/soc/intel/avs/tgl.c index 9dbb3ad0954a..cf19d3a7ced2 100644 --- a/sound/soc/intel/avs/tgl.c +++ b/sound/soc/intel/avs/tgl.c @@ -10,8 +10,6 @@ #include "avs.h" #include "messages.h" =20 -#define CPUID_TSC_LEAF 0x15 - static int avs_tgl_dsp_core_power(struct avs_dev *adev, u32 core_mask, boo= l power) { core_mask &=3D AVS_MAIN_CORE_MASK; @@ -39,22 +37,31 @@ static int avs_tgl_dsp_core_stall(struct avs_dev *adev,= u32 core_mask, bool stal return avs_dsp_core_stall(adev, core_mask, stall); } =20 +#ifdef CONFIG_X86 +#include +static unsigned int intel_crystal_freq_hz(void) +{ + return cpuid_ecx(CPUID_LEAF_TSC); +} +#else +static unsigned int intel_crystal_freq_hz(void) +{ + return 0; +} +#endif /* !CONFIG_X86 */ + static int avs_tgl_config_basefw(struct avs_dev *adev) { + unsigned int freq =3D intel_crystal_freq_hz(); struct pci_dev *pci =3D adev->base.pci; struct avs_bus_hwid hwid; int ret; -#ifdef CONFIG_X86 - unsigned int ecx; =20 -#include - ecx =3D cpuid_ecx(CPUID_TSC_LEAF); - if (ecx) { - ret =3D avs_ipc_set_fw_config(adev, 1, AVS_FW_CFG_XTAL_FREQ_HZ, sizeof(e= cx), &ecx); + if (freq) { + ret =3D avs_ipc_set_fw_config(adev, 1, AVS_FW_CFG_XTAL_FREQ_HZ, sizeof(f= req), &freq); if (ret) return AVS_IPC_RET(ret); } -#endif =20 hwid.device =3D pci->device; hwid.subsystem =3D pci->subsystem_vendor | (pci->subsystem_device << 16); --=20 2.49.0 From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 2733E22D7A1 for ; Wed, 9 Jul 2025 17:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080769; cv=none; b=ZX9LunEaYgsukzgejS9MDeOcd3ETTKKmXivlNYOtrK7uOSzFdCIpW6pCRKUyTGtDxUA0enPitUuUTfYR06Z9h2TV34JQYM/PcM7ceqoFKwr5mh7YgJG/5/xi+rxGC3FRUr2Lh0/U6qA0+B+PbnzrvJVCLkS0JS0cOZ6riuBkDbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080769; c=relaxed/simple; bh=g+JKZAg/TiCH95nnSuM7T6vJeQVg+SeGa1eL3msI0Qs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eJSpvnFBE+vQf3dWdZh8cF9FwAvgpPPXpbTy/09WUfF0Q6BLZpGypxoSXAxXyBleuRiYtzJgfSpepzkqt9AVnjtp3V0mmkYXAlFe2I+59xQG4HFfK/GMlec1FNvP57zLcLQIjkOar6QBFdYmqU5029GogF1gTFtJreSXHKFXC20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eU+FXB0D; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5E7F68lx; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eU+FXB0D"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5E7F68lx" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pCZbBJqJSjCot6gOqD2i4qsn8fO/mwHQL/oAFr+hIVY=; b=eU+FXB0DGfOsBAzeZOM8vxkE3p6Sx65QZ4qyD0S+y986g5qedbxcCeuI8nFu74TF8PkRjc eYi2FY4LsUOZnhmH50AbVLs4Xt61t6UKKqw1D2BcmftEogWH72hw5OWdu9O67uYIgjz/6T CcNpFor9wxd57Lddm6WOGUOlf5HbdmQBqu+2R6gmpP1EPrJYQQETdmIYNN9VDMBwQ771v/ TUrywoTvN7GTKQfCRFkJqJEtqaQyz3DctFX30V5yDChqF0RQJiYxrIQhaL5Kp0cHaC95s1 XH6AEKdujlNc3lz11oD6tmbTYDTc8XwXffhzlJtnJui2nF+TjQ4i7BAwUDaK3w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pCZbBJqJSjCot6gOqD2i4qsn8fO/mwHQL/oAFr+hIVY=; b=5E7F68lxn8bjfNvPZ2uhUr9n/KRKuOpIWmIlkSeNQbirN9Esg8onpjmQ5mlHhaVgkL+BlC ujKhE2lzUnfIV4Aw== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 3/7] x86: Reorder headers alphabetically Date: Wed, 9 Jul 2025 19:04:49 +0200 Message-ID: <20250709170454.74854-4-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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" Multiple x86 source files use the cpuid_*() macros, but implicitly include the main CPUID API header through instead. Sort their include lines so that can be explicitly included next. Signed-off-by: Ahmed S. Darwish --- arch/x86/boot/startup/sme.c | 8 ++-- arch/x86/coco/tdx/tdx.c | 5 ++- arch/x86/events/amd/uncore.c | 14 +++--- arch/x86/events/zhaoxin/core.c | 11 +++-- arch/x86/kernel/cpu/amd.c | 25 +++++------ arch/x86/kernel/cpu/mce/core.c | 62 +++++++++++++-------------- arch/x86/kernel/cpu/microcode/core.c | 22 +++++----- arch/x86/kernel/cpu/microcode/intel.c | 11 ++--- arch/x86/kernel/cpu/mshyperv.c | 28 ++++++------ arch/x86/kernel/cpu/resctrl/core.c | 5 ++- arch/x86/kernel/cpu/scattered.c | 2 +- arch/x86/kernel/cpu/topology_common.c | 2 +- arch/x86/kernel/paravirt.c | 28 ++++++------ 13 files changed, 114 insertions(+), 109 deletions(-) diff --git a/arch/x86/boot/startup/sme.c b/arch/x86/boot/startup/sme.c index 70ea1748c0a7..922b236be02f 100644 --- a/arch/x86/boot/startup/sme.c +++ b/arch/x86/boot/startup/sme.c @@ -34,15 +34,15 @@ */ #define USE_EARLY_PGTABLE_L5 =20 +#include #include -#include #include -#include +#include =20 +#include #include -#include #include -#include +#include #include =20 #define PGD_FLAGS _KERNPG_TABLE_NOENC diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c index 7b2833705d47..7bc11836c46a 100644 --- a/arch/x86/coco/tdx/tdx.c +++ b/arch/x86/coco/tdx/tdx.c @@ -8,16 +8,17 @@ #include #include #include + #include -#include -#include #include #include #include #include #include #include +#include #include +#include =20 /* MMIO direction */ #define EPT_READ 0 diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index e8b6af199c73..c1483ef16c0b 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -5,18 +5,18 @@ * Author: Jacob Shin */ =20 -#include -#include -#include -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include +#include =20 -#include #include +#include =20 #define NUM_COUNTERS_NB 4 #define NUM_COUNTERS_L2 4 diff --git a/arch/x86/events/zhaoxin/core.c b/arch/x86/events/zhaoxin/core.c index 4bdfcf091200..d59992364880 100644 --- a/arch/x86/events/zhaoxin/core.c +++ b/arch/x86/events/zhaoxin/core.c @@ -5,16 +5,16 @@ =20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt =20 -#include -#include -#include -#include #include +#include #include +#include +#include +#include =20 +#include #include #include -#include #include =20 #include "../perf_event.h" @@ -616,4 +616,3 @@ __init int zhaoxin_pmu_init(void) =20 return 0; } - diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 655f44f89ded..6e2ee9ed76d2 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1,32 +1,33 @@ // SPDX-License-Identifier: GPL-2.0-only -#include + #include #include -#include - +#include #include +#include +#include +#include #include #include -#include #include -#include -#include + #include #include #include #include -#include -#include +#include +#include +#include #include #include -#include -#include +#include #include -#include #include +#include +#include =20 #ifdef CONFIG_X86_64 -# include +#include #endif =20 #include "cpu.h" diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 4da4eab56c81..5a11c522ea97 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -9,52 +9,52 @@ * Author: Andi Kleen */ =20 -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include -#include +#include +#include +#include #include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include +#include +#include +#include #include +#include +#include #include -#include -#include +#include +#include +#include =20 -#include #include -#include -#include -#include +#include #include #include +#include #include #include +#include +#include =20 #include "internal.h" =20 diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/mic= rocode/core.c index fe50eb5b7c4a..9243ed3ded85 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -17,27 +17,27 @@ =20 #define pr_fmt(fmt) "microcode: " fmt =20 -#include -#include -#include -#include #include -#include +#include #include -#include #include -#include -#include -#include +#include #include +#include +#include #include +#include +#include +#include +#include +#include =20 #include +#include #include +#include #include #include -#include -#include #include =20 #include "internal.h" diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/mi= crocode/intel.c index 371ca6eac00e..99fda8f7dba7 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -11,21 +11,22 @@ * H Peter Anvin" */ #define pr_fmt(fmt) "microcode: " fmt + +#include #include #include -#include #include #include +#include #include -#include +#include #include -#include =20 #include +#include #include -#include #include -#include +#include =20 #include "internal.h" =20 diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index c78f860419d6..d0491bba9e30 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -6,33 +6,35 @@ * Author : K. Y. Srinivasan */ =20 -#include -#include #include -#include +#include #include #include -#include +#include #include #include #include #include -#include -#include +#include +#include + +#include #include -#include + +#include #include +#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include #include +#include #include +#include +#include #include +#include =20 /* Is Linux running on nested Microsoft Hypervisor */ bool hv_nested; diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 187d527ef73b..35285567beec 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -17,13 +17,14 @@ #define pr_fmt(fmt) "resctrl: " fmt =20 #include -#include -#include #include +#include +#include =20 #include #include #include + #include "internal.h" =20 /* diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattere= d.c index dbf6d71bdf18..3d23b943f596 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -4,8 +4,8 @@ */ #include =20 -#include #include +#include #include =20 #include "cpu.h" diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/to= pology_common.c index b5a5e1411469..48c47d02d8a9 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -3,8 +3,8 @@ =20 #include =20 -#include #include +#include #include #include =20 diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index ab3e172dcc69..3d745cd25a43 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -6,34 +6,34 @@ 2007 - x86_64 support added by Glauber de Oliveira Costa, Red Hat Inc */ =20 +#include +#include #include -#include #include -#include -#include #include +#include #include #include #include =20 +#include #include -#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include #include +#include #include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include +#include =20 /* stub always returning 0. */ DEFINE_ASM_FUNC(paravirt_ret0, "xor %eax,%eax", .entry.text); --=20 2.49.0 From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 983B3226165 for ; Wed, 9 Jul 2025 17:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080771; cv=none; b=IBrSQw/9Wj3jVy4uRuNPmZEu3W1MjbUIwwOX+zZ8w0V7ofRECvcw9I05Yrm9KqDDNpCjPpLAtSTGiPmLfF/6dRiuIGnc9tY9d1GsxRu/4Nm+QsGqf3vZdVEyeCHBUZ0GaDVaX3ICEWna/JVIg2RyG8Nq0gcWjSdRJ6VB5y2zCrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080771; c=relaxed/simple; bh=vgm4wXz2ieJ8rei31RF9l8O4B5rpM6AEB8ZaDd0ziX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=frxUdsqDDCAgHTUy/Yqxj6oBgg2FFUVzwC+fwbmMdttObqgBkaYrVcuvgF4e6y3ntIo2jvWQaZaAqOqA0K75uhP/Bn1DGvze98iMYEKjLK2Zx4yWtC0pD6lMPTd40XJj9DGxobDtbmlOgX11HIwUVtTlVEb7YNCjaIlDLiY44rY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ko6X01fJ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tKpm4zML; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ko6X01fJ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tKpm4zML" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=29AMpEVvuGmbWizJhTW06iinuJuS98YZlAM+Vegl7tc=; b=ko6X01fJJsBPTahVukTjDVf1XKfKH2Dm44IkcHSJXedUChs/1y9EbvNhcTmwsZB3jvwKJA FvvP5veSQvdjq7IwWmWWkZSft4unhAgvMQMWVdjxe/36ft0ZHsEVNgHjuijXQaL4vVHhlB rmwjfTw+GB6GS3sCGCyZ+b03cisJydcXlt+NbaLLWOvCuMexyz8OlNB/3VGsJCLgOYBPHD oYsL2eVlLw+BPhZ4bVUNCMPDsSYx3c7c2anPuK91Xo+ohUYTtEA50bg0b89175kpB0rm/n +pHhnlePJnFMsmjU094/1wF1uPSnfc1Z4cWQWWrPRbYoilRVql6mIkGRi426gA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=29AMpEVvuGmbWizJhTW06iinuJuS98YZlAM+Vegl7tc=; b=tKpm4zMLmTkb0QI6VyIP45q41e/btse7YhKkYGV7qdLm7lHGcly0zVdfZKylcLL2JP4/a8 qiyySo3bw8yC+MCA== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 4/7] drivers: Reorder headers alphabetically Date: Wed, 9 Jul 2025 19:04:50 +0200 Message-ID: <20250709170454.74854-5-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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" Multiple drivers use the cpuid_*() macros, but implicitly include the main CPUID header through instead. Sort their include lines so that can be explicitly included next. Signed-off-by: Ahmed S. Darwish --- drivers/cpufreq/longrun.c | 6 +++--- drivers/cpufreq/powernow-k7.c | 13 ++++++------- drivers/cpufreq/powernow-k8.c | 16 ++++++++-------- drivers/cpufreq/speedstep-lib.c | 5 +++-- drivers/hwmon/fam15h_power.c | 13 +++++++------ drivers/hwmon/k8temp.c | 11 ++++++----- drivers/thermal/intel/x86_pkg_temp_thermal.c | 14 +++++++------- 7 files changed, 40 insertions(+), 38 deletions(-) diff --git a/drivers/cpufreq/longrun.c b/drivers/cpufreq/longrun.c index 1caaec7c280b..263c48b8f628 100644 --- a/drivers/cpufreq/longrun.c +++ b/drivers/cpufreq/longrun.c @@ -5,15 +5,15 @@ * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* */ =20 +#include +#include #include #include -#include -#include #include =20 +#include #include #include -#include =20 static struct cpufreq_driver longrun_driver; =20 diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 31039330a3ba..0608040fcd1e 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -15,20 +15,20 @@ =20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt =20 +#include +#include +#include +#include #include #include #include -#include -#include #include #include -#include #include -#include =20 -#include /* Needed for recalibrate_cpu_khz() */ -#include #include +#include +#include /* Needed for recalibrate_cpu_khz() */ =20 #ifdef CONFIG_X86_POWERNOW_K7_ACPI #include @@ -691,4 +691,3 @@ MODULE_LICENSE("GPL"); =20 late_initcall(powernow_init); module_exit(powernow_exit); - diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index f7512b4e923e..2b5cdd8f1c0a 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -26,22 +26,22 @@ =20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt =20 +#include +#include +#include +#include +#include +#include #include -#include #include -#include -#include +#include #include +#include #include -#include -#include -#include =20 #include #include =20 -#include -#include #include =20 #define VERSION "version 2.20.00" diff --git a/drivers/cpufreq/speedstep-lib.c b/drivers/cpufreq/speedstep-li= b.c index 0b66df4ed513..f08817331aec 100644 --- a/drivers/cpufreq/speedstep-lib.c +++ b/drivers/cpufreq/speedstep-lib.c @@ -9,14 +9,15 @@ =20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt =20 +#include +#include #include #include #include -#include -#include =20 #include #include + #include "speedstep-lib.h" =20 #define PFX "speedstep-lib: " diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 8ecebea53651..5a5674e85f63 100644 --- a/drivers/hwmon/fam15h_power.c +++ b/drivers/hwmon/fam15h_power.c @@ -6,20 +6,21 @@ * Author: Andreas Herrmann */ =20 +#include +#include +#include #include -#include #include +#include #include #include #include -#include -#include -#include -#include #include +#include #include -#include + #include +#include =20 MODULE_DESCRIPTION("AMD Family 15h CPU processor power monitor"); MODULE_AUTHOR("Andreas Herrmann "); diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index 2b80ac410cd1..8c1efce9a04b 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c @@ -7,13 +7,14 @@ * Inspired from the w83785 and amd756 drivers. */ =20 -#include -#include -#include -#include -#include #include +#include +#include +#include #include +#include +#include + #include =20 #define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000) diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal= /intel/x86_pkg_temp_thermal.c index 3fc679b6f11b..c843cb5fc5c3 100644 --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -5,19 +5,19 @@ */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt =20 -#include +#include +#include +#include +#include #include #include -#include +#include #include -#include #include -#include -#include -#include #include +#include +#include #include -#include =20 #include #include --=20 2.49.0 From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 F1244230D35 for ; Wed, 9 Jul 2025 17:06:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080775; cv=none; b=SKusNqeszGKcFuIYSHePdcba1OG06BToSf8RNv+NOxi78kY99Vo5BGHqxtUlwv3wRDSaMr4GJHdnqgKI9eovTlDTqAP1L5rxyKyl1l3WWlwr5m9cZtkdloQ7SrvxyJ//ii7O4dUJ1TcqJzwdTPDV8MCiWA/y2Fjcgx8qLauNVpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080775; c=relaxed/simple; bh=hAg06rz2uaGzfO1x65lXcZO6+N5ZVjSz8faCywlrAVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gewPQVz9qQWurdY+7YYZldMKQxtwUsVRFsYfMvqSW4ZK5B2xfDWe4oKajc1mA2a2kffLAYb01LgJMDkXE+nFEqsaZrydZ9Pp3I5a+RFVNr8lqlklFpk2XpFUjsZVQ3URLaDbAtvNw3pcFrkJ7HDfZ44lpj2JvPJe29Uou1gm0X0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LmuH8cr2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1TrLGkK2; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LmuH8cr2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1TrLGkK2" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t+j8GOdefAlJMlCeytWbjXU1Gs+U51Ma/grFFz3UA74=; b=LmuH8cr24lL7pgCqZVFE4FJPuLQEU2JsoD9gJWkOAnNGR0U3jbCMkTVlZJivhBBXWWOMdB GrCU+FmGOu8mJVSkfw31GXF0UKCCjkpMwmCZIpTaOIZBg+fg3CljTxw6sQt5ZTnQiq7FSR xuomkJ0rqzYbcXhbwxuBW2s3Ov6u5hYhoHknrXkA9NIAKnEyYOpr8ODO07s2fDxapi5oMB 6SMAOexQFVJzelNzLQUbt09LfJvTQvjhg8JriV18ElGDkPAxlQ1qjUbQzwg3fr96l/yCwG R7apFHuwJNOmhUywSDZ52P39X7cYSYfrZauZfWX767/gxO8y4q0GFrM9vaB+NA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t+j8GOdefAlJMlCeytWbjXU1Gs+U51Ma/grFFz3UA74=; b=1TrLGkK28P+EajOOfmLiNMi22FW9nvbBP+q2rlMaQkrGZ8EQDIRF7vXjBpuv1Lbt8ph7OO ke4gt85FE63mloAQ== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 5/7] treewide: Explicitly include Date: Wed, 9 Jul 2025 19:04:51 +0200 Message-ID: <20250709170454.74854-6-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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" To disentangle from , modify all CPUID call sites which implicitly include the main CPUID API header though to explicitly include it instead. Signed-off-by: Ahmed S. Darwish --- arch/x86/boot/compressed/pgtable_64.c | 1 + arch/x86/boot/startup/sme.c | 1 + arch/x86/coco/tdx/tdx.c | 1 + arch/x86/events/amd/core.c | 2 ++ arch/x86/events/amd/ibs.c | 1 + arch/x86/events/amd/lbr.c | 2 ++ arch/x86/events/amd/power.c | 3 +++ arch/x86/events/amd/uncore.c | 1 + arch/x86/events/intel/core.c | 1 + arch/x86/events/intel/lbr.c | 1 + arch/x86/events/zhaoxin/core.c | 1 + arch/x86/include/asm/acrn.h | 2 ++ arch/x86/include/asm/microcode.h | 1 + arch/x86/include/asm/xen/hypervisor.h | 1 + arch/x86/kernel/cpu/amd.c | 1 + arch/x86/kernel/cpu/centaur.c | 1 + arch/x86/kernel/cpu/hygon.c | 1 + arch/x86/kernel/cpu/mce/core.c | 1 + arch/x86/kernel/cpu/mce/inject.c | 1 + arch/x86/kernel/cpu/microcode/core.c | 1 + arch/x86/kernel/cpu/microcode/intel.c | 1 + arch/x86/kernel/cpu/mshyperv.c | 1 + arch/x86/kernel/cpu/resctrl/core.c | 1 + arch/x86/kernel/cpu/resctrl/monitor.c | 1 + arch/x86/kernel/cpu/scattered.c | 1 + arch/x86/kernel/cpu/sgx/main.c | 3 +++ arch/x86/kernel/cpu/topology_amd.c | 1 + arch/x86/kernel/cpu/topology_common.c | 1 + arch/x86/kernel/cpu/topology_ext.c | 1 + arch/x86/kernel/cpu/transmeta.c | 3 +++ arch/x86/kernel/cpu/zhaoxin.c | 1 + arch/x86/kernel/cpuid.c | 1 + arch/x86/kernel/paravirt.c | 1 + arch/x86/kvm/cpuid.h | 3 +++ arch/x86/kvm/mmu/spte.c | 1 + drivers/cpufreq/longrun.c | 1 + drivers/cpufreq/powernow-k7.c | 1 + drivers/cpufreq/powernow-k8.c | 1 + drivers/cpufreq/speedstep-lib.c | 1 + drivers/firmware/efi/libstub/x86-5lvl.c | 1 + drivers/hwmon/fam15h_power.c | 1 + drivers/hwmon/k10temp.c | 2 ++ drivers/hwmon/k8temp.c | 1 + drivers/thermal/intel/intel_hfi.c | 1 + drivers/thermal/intel/x86_pkg_temp_thermal.c | 1 + 45 files changed, 57 insertions(+) diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compress= ed/pgtable_64.c index bdd26050dff7..d94d98595780 100644 --- a/arch/x86/boot/compressed/pgtable_64.c +++ b/arch/x86/boot/compressed/pgtable_64.c @@ -2,6 +2,7 @@ #include "misc.h" #include #include +#include #include #include #include "../string.h" diff --git a/arch/x86/boot/startup/sme.c b/arch/x86/boot/startup/sme.c index 922b236be02f..6a58ab568390 100644 --- a/arch/x86/boot/startup/sme.c +++ b/arch/x86/boot/startup/sme.c @@ -40,6 +40,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c index 7bc11836c46a..4ed8ec642646 100644 --- a/arch/x86/coco/tdx/tdx.c +++ b/arch/x86/coco/tdx/tdx.c @@ -10,6 +10,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index b20661b8621d..d28d45ceb707 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -7,8 +7,10 @@ #include #include #include + #include #include +#include #include #include =20 diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c index 112f43b23ebf..0c7848e6149e 100644 --- a/arch/x86/events/amd/ibs.c +++ b/arch/x86/events/amd/ibs.c @@ -15,6 +15,7 @@ #include =20 #include +#include #include =20 #include "../perf_event.h" diff --git a/arch/x86/events/amd/lbr.c b/arch/x86/events/amd/lbr.c index d24da377df77..5b437dc8e4ce 100644 --- a/arch/x86/events/amd/lbr.c +++ b/arch/x86/events/amd/lbr.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include + +#include #include #include =20 diff --git a/arch/x86/events/amd/power.c b/arch/x86/events/amd/power.c index dad42790cf7d..744dffa42dee 100644 --- a/arch/x86/events/amd/power.c +++ b/arch/x86/events/amd/power.c @@ -10,8 +10,11 @@ #include #include #include + #include +#include #include + #include "../perf_event.h" =20 /* Event code: LSB 8 bits, passed in attr->config any other bit is reserve= d. */ diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index c1483ef16c0b..5261f12007df 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -15,6 +15,7 @@ #include #include =20 +#include #include #include =20 diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index c2fb729c270e..ebbcdf82b494 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -17,6 +17,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index 7aa59966e7c3..0d1ec3651735 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -3,6 +3,7 @@ #include =20 #include +#include #include #include =20 diff --git a/arch/x86/events/zhaoxin/core.c b/arch/x86/events/zhaoxin/core.c index d59992364880..15bb9c9c9358 100644 --- a/arch/x86/events/zhaoxin/core.c +++ b/arch/x86/events/zhaoxin/core.c @@ -14,6 +14,7 @@ =20 #include #include +#include #include #include =20 diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h index fab11192c60a..db42b477c41d 100644 --- a/arch/x86/include/asm/acrn.h +++ b/arch/x86/include/asm/acrn.h @@ -2,6 +2,8 @@ #ifndef _ASM_X86_ACRN_H #define _ASM_X86_ACRN_H =20 +#include + /* * This CPUID returns feature bitmaps in EAX. * Guest VM uses this to detect the appropriate feature bit. diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microc= ode.h index 8b41f26f003b..645e65ac1586 100644 --- a/arch/x86/include/asm/microcode.h +++ b/arch/x86/include/asm/microcode.h @@ -3,6 +3,7 @@ #define _ASM_X86_MICROCODE_H =20 #include +#include =20 struct cpu_signature { unsigned int sig; diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/x= en/hypervisor.h index c2fc7869b996..7c596cebfb78 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -37,6 +37,7 @@ extern struct shared_info *HYPERVISOR_shared_info; extern struct start_info *xen_start_info; =20 #include +#include #include =20 #define XEN_SIGNATURE "XenVMMXenVMM" diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 6e2ee9ed76d2..6bfe714c75dd 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index a3b55db35c96..cc5a390dcd07 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -5,6 +5,7 @@ =20 #include #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c index 2154f12766fb..75ad7eb1301a 100644 --- a/arch/x86/kernel/cpu/hygon.c +++ b/arch/x86/kernel/cpu/hygon.c @@ -10,6 +10,7 @@ =20 #include #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 5a11c522ea97..31ff1c578b40 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -47,6 +47,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inj= ect.c index d02c4f556cd0..42c82c14c48a 100644 --- a/arch/x86/kernel/cpu/mce/inject.c +++ b/arch/x86/kernel/cpu/mce/inject.c @@ -26,6 +26,7 @@ =20 #include #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/mic= rocode/core.c index 9243ed3ded85..eae9eaa455ba 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/mi= crocode/intel.c index 99fda8f7dba7..30d20f78f07d 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -23,6 +23,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index d0491bba9e30..771a65e6fefb 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -22,6 +22,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resct= rl/core.c index 35285567beec..52d3753ab020 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -22,6 +22,7 @@ #include =20 #include +#include #include #include =20 diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/re= sctrl/monitor.c index c261558276cd..5dffb9453d77 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -21,6 +21,7 @@ #include =20 #include +#include #include =20 #include "internal.h" diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattere= d.c index 3d23b943f596..15f8752d4132 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -5,6 +5,7 @@ #include =20 #include +#include #include #include =20 diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c index 2de01b379aa3..00bf42f4c536 100644 --- a/arch/x86/kernel/cpu/sgx/main.c +++ b/arch/x86/kernel/cpu/sgx/main.c @@ -14,8 +14,11 @@ #include #include #include + +#include #include #include + #include "driver.h" #include "encl.h" #include "encls.h" diff --git a/arch/x86/kernel/cpu/topology_amd.c b/arch/x86/kernel/cpu/topol= ogy_amd.c index 843b1655ab45..abc6f5a7a486 100644 --- a/arch/x86/kernel/cpu/topology_amd.c +++ b/arch/x86/kernel/cpu/topology_amd.c @@ -2,6 +2,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/to= pology_common.c index 48c47d02d8a9..38189e4fea0e 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -4,6 +4,7 @@ #include =20 #include +#include #include #include #include diff --git a/arch/x86/kernel/cpu/topology_ext.c b/arch/x86/kernel/cpu/topol= ogy_ext.c index 467b0326bf1a..eb915c73895f 100644 --- a/arch/x86/kernel/cpu/topology_ext.c +++ b/arch/x86/kernel/cpu/topology_ext.c @@ -2,6 +2,7 @@ #include =20 #include +#include #include #include =20 diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmet= a.c index 42c939827621..1fdcd69c625c 100644 --- a/arch/x86/kernel/cpu/transmeta.c +++ b/arch/x86/kernel/cpu/transmeta.c @@ -3,8 +3,11 @@ #include #include #include + #include +#include #include + #include "cpu.h" =20 static void early_init_transmeta(struct cpuinfo_x86 *c) diff --git a/arch/x86/kernel/cpu/zhaoxin.c b/arch/x86/kernel/cpu/zhaoxin.c index 89b1c8a70fe8..cfcfb6221e3f 100644 --- a/arch/x86/kernel/cpu/zhaoxin.c +++ b/arch/x86/kernel/cpu/zhaoxin.c @@ -4,6 +4,7 @@ =20 #include #include +#include #include =20 #include "cpu.h" diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index dae436253de4..cbd04b677fd1 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c @@ -37,6 +37,7 @@ #include #include =20 +#include #include #include =20 diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 3d745cd25a43..b7fc3b78086c 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -18,6 +18,7 @@ =20 #include #include +#include #include #include #include diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index d3f5ae15a7ca..89f8ed3fb37a 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h @@ -3,8 +3,11 @@ #define ARCH_X86_KVM_CPUID_H =20 #include "reverse_cpuid.h" + #include +#include #include + #include =20 extern u32 kvm_cpu_caps[NR_KVM_CPU_CAPS] __read_mostly; diff --git a/arch/x86/kvm/mmu/spte.c b/arch/x86/kvm/mmu/spte.c index cfce03d8f123..e7b69275ae50 100644 --- a/arch/x86/kvm/mmu/spte.c +++ b/arch/x86/kvm/mmu/spte.c @@ -15,6 +15,7 @@ #include "x86.h" #include "spte.h" =20 +#include #include #include #include diff --git a/drivers/cpufreq/longrun.c b/drivers/cpufreq/longrun.c index 263c48b8f628..3429857feb96 100644 --- a/drivers/cpufreq/longrun.c +++ b/drivers/cpufreq/longrun.c @@ -12,6 +12,7 @@ #include =20 #include +#include #include #include =20 diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 0608040fcd1e..7a324a829a43 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -27,6 +27,7 @@ #include =20 #include +#include #include #include /* Needed for recalibrate_cpu_khz() */ =20 diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 2b5cdd8f1c0a..e909eee30edd 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -41,6 +41,7 @@ =20 #include #include +#include =20 #include =20 diff --git a/drivers/cpufreq/speedstep-lib.c b/drivers/cpufreq/speedstep-li= b.c index f08817331aec..3c323cd8eede 100644 --- a/drivers/cpufreq/speedstep-lib.c +++ b/drivers/cpufreq/speedstep-lib.c @@ -15,6 +15,7 @@ #include #include =20 +#include #include #include =20 diff --git a/drivers/firmware/efi/libstub/x86-5lvl.c b/drivers/firmware/efi= /libstub/x86-5lvl.c index f1c5fb45d5f7..029ad80cf0b4 100644 --- a/drivers/firmware/efi/libstub/x86-5lvl.c +++ b/drivers/firmware/efi/libstub/x86-5lvl.c @@ -2,6 +2,7 @@ #include =20 #include +#include #include #include =20 diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 5a5674e85f63..1ecaef25f04e 100644 --- a/drivers/hwmon/fam15h_power.c +++ b/drivers/hwmon/fam15h_power.c @@ -19,6 +19,7 @@ #include #include =20 +#include #include #include =20 diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index babf2413d666..12115654689a 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c @@ -20,7 +20,9 @@ #include #include #include + #include +#include #include =20 MODULE_DESCRIPTION("AMD Family 10h+ CPU core temperature monitor"); diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index 8c1efce9a04b..eb167be245b9 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c @@ -15,6 +15,7 @@ #include #include =20 +#include #include =20 #define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/inte= l_hfi.c index bd2fca7dc017..c910cc563d9d 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -41,6 +41,7 @@ #include #include =20 +#include #include =20 #include "intel_hfi.h" diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal= /intel/x86_pkg_temp_thermal.c index c843cb5fc5c3..1b9e0b49856c 100644 --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -20,6 +20,7 @@ #include =20 #include +#include #include =20 #include "thermal_interrupt.h" --=20 2.49.0 From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 3BF36224AFC for ; Wed, 9 Jul 2025 17:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080777; cv=none; b=OExnDf0PNtO0brFy08BnerpgiLwno/I0jU7o2SMNrG97GB+ah6FeH+N38lx6oBYeoG2NNqB6SdMseG8s8L7kVW7KrvJ6lCRk3YJDZR+cUXd7fMlfHau6YQxvHEPkOI4x2BWr7Km5ltt0A/qBK+lhH3Vbgj6QXA+nLfspvxtpGT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080777; c=relaxed/simple; bh=9uy/g7L+3Cv4tJSN6mmhFqinMDgYIzSRDOpxmCmPnT0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lj6ZU/JAUGGZd+gEvavty6t20GIlx76Bkg9vgSXz/BJ4D76RlDJY6H5YAWsIEQozQhzK0OgJahojenzAc/CSIr4oyFHAX1zeS0JaMyqkPywadkGFTkzH/x9JijDkdKiFkHtnVTbVLTpxR7g+xsRRl/Pe9vHbvxF5uDoRDnrSRvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VfTyIShj; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=p+2xPt2E; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VfTyIShj"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="p+2xPt2E" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EQWs/yvwZcPLrNnawPJrh/g2JjW0m390/lOqwFLduNU=; b=VfTyIShjSoN2i/2/NsLseNnP7G6tU+ZSlb5hluvpBsu2uo89n74f7HhQ+LjVdK77baWdZ7 zP6bj+vFY11mSBM+6h526VycDCXGOueq6e/CzfDU0lcZODlnCrKzLPhonkT1DSNIkW1NAb muUUfSm3SKSBRRfi2kOYJoKmaP4bxHplJJyqlHxob1dA5GZRNuzjYFP0VpzcwaBNpOXFbJ ujdiC4ox6gJKPSBkeRMFvqfYI1/DPe9gYVHjLgjBpVft76xYGDYSqKfI4hor2wApYFJAgz /T7jIVSxT78U1sC+cTjHsxa2D5WF4sQAf5ULwPNWzpKurRQCLRxCyIV3jLosXw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EQWs/yvwZcPLrNnawPJrh/g2JjW0m390/lOqwFLduNU=; b=p+2xPt2E8Cw1EjALFJ9gtmyDcBTxcpqASJoIfOaspeBB/MWCvseRkYZv8FAHX0RUH8wrKl kkeQjPO24zbDC6Aw== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 6/7] x86/cpu: : Do not include CPUID API header Date: Wed, 9 Jul 2025 19:04:52 +0200 Message-ID: <20250709170454.74854-7-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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" includes the CPUID API header , but all what it needs are the data types from . Modify the header to include instead. Note, this allows the CPUID API header to include without introducing a circular dependency, which is needed for the upcoming CPUID model and parser. Signed-off-by: Ahmed S. Darwish --- arch/x86/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/proces= sor.h index bde58f6510ac..4d158ce3aaf8 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -16,7 +16,7 @@ struct vm86; #include #include #include -#include +#include #include #include #include --=20 2.49.0 From nobody Tue Oct 7 13:23:02 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 6CED2235056 for ; Wed, 9 Jul 2025 17:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080781; cv=none; b=gvKJgSX4iWKfbzanQH+8SkTT2UdoZnu1FRZDArmYfBA1e8OuSxckDjvW94GPJWmQE1wGP+sbAgd3Q++SPhyMrBHlFY0ButUrresR/ADRPZXTd7OcZlDtxam42Mj5lyoWvrwE0n/CEDmA9jjzfMJJMGQZZZJC1ecICnG5BAnu0TA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752080781; c=relaxed/simple; bh=boRgXFhKddB07Ao/wmCchsRdbdJXJsaKKBS8cjumbkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TtMaou69VDpk1FshsV71S3FuUKeeO4CaZlFUHkIor8YtZ0lZSI41almS7C0dZZBZ8pfDlMDyaIkgt//e6dO7pFModTXzZ8DvoQ04cR2ir9s5PxVZ7FdpvUrXx82slcUlJz6Ocr+r4R+6txRiD4q3l75X7l6ye/CEcq0Ri4vED/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rWjvuRPZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RpZHdvif; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rWjvuRPZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RpZHdvif" From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752080778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5OwVg3uk2MbXbIzloOALjinnMmaKuXJuiDJZknzR0Gg=; b=rWjvuRPZ6UQ/B2QNFU9SSkgW9uRvXkAPdmRduiRvpUuOgXusdgnAYXpbUy24xL6upZYw6P VFae9q13bmrpdzLJXG7hpJdLOoVbZfK+/h38QRhZFAjxMBTWY64Fqhzs0wxSDXAnlb/9aP YfsD/JB7Ag7Ly4VMouh6PF7C/mFXPk6r3VevQrKHzIVU0JD89cbun379lS203Nvszzo+gN gonS92s8KAQJwajF7C2hiEFu4KeAuqYXpOjdIZVT+lmscwJ0AGyw1mur9T6gBd3bR08VhN RDIPE40kKt8xlLYIrL2r8he877YZXiyeP6mdoBupCwMWNnMMX9ZUQoTtXlTIgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752080778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5OwVg3uk2MbXbIzloOALjinnMmaKuXJuiDJZknzR0Gg=; b=RpZHdvifupwHFp2UH9RHpC8LlxbdpPZjxahon9/pMDBWK7q9Ahx1MbK15PXoxk9p2Utdue OOaRcid2opmKABAA== To: Borislav Petkov , Ingo Molnar , Dave Hansen Cc: Thomas Gleixner , Andrew Cooper , John Ogness , x86@kernel.org, x86-cpuid@lists.linux.dev, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 7/7] x86/cpuid: Rename cpuid_leaf()/cpuid_subleaf() APIs Date: Wed, 9 Jul 2025 19:04:53 +0200 Message-ID: <20250709170454.74854-8-darwi@linutronix.de> In-Reply-To: <20250709170454.74854-1-darwi@linutronix.de> References: <20250709170454.74854-1-darwi@linutronix.de> 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" A new CPUID model will be added where its APIs will be designated as the "official" CPUID API. Free the cpuid_leaf() and cpuid_subleaf() function names for that model. Rename them accordingly to cpuid_read() and cpuid_read_subleaf(). Note, for kernel/cpuid.c, rename its local file operations read function from cpuid_read() to cpuid_read_f() so that it does not conflict with the new names. No functional change. Signed-off-by: Ahmed S. Darwish --- arch/x86/include/asm/cpuid/api.h | 6 +++--- arch/x86/kernel/cpu/topology_amd.c | 2 +- arch/x86/kernel/cpu/topology_ext.c | 2 +- arch/x86/kernel/cpuid.c | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/cpuid/api.h b/arch/x86/include/asm/cpuid/= api.h index 44fa82e1267c..2b9750cc8a75 100644 --- a/arch/x86/include/asm/cpuid/api.h +++ b/arch/x86/include/asm/cpuid/api.h @@ -131,12 +131,12 @@ static inline void __cpuid_read(u32 leaf, u32 subleaf= , u32 *regs) __cpuid(regs + CPUID_EAX, regs + CPUID_EBX, regs + CPUID_ECX, regs + CPUI= D_EDX); } =20 -#define cpuid_subleaf(leaf, subleaf, regs) { \ +#define cpuid_read_subleaf(leaf, subleaf, regs) { \ static_assert(sizeof(*(regs)) =3D=3D 16); \ __cpuid_read(leaf, subleaf, (u32 *)(regs)); \ } =20 -#define cpuid_leaf(leaf, regs) { \ +#define cpuid_read(leaf, regs) { \ static_assert(sizeof(*(regs)) =3D=3D 16); \ __cpuid_read(leaf, 0, (u32 *)(regs)); \ } @@ -228,7 +228,7 @@ static inline u32 cpuid_base_hypervisor(const char *sig= , u32 leaves) */ static inline void cpuid_leaf_0x2(union leaf_0x2_regs *regs) { - cpuid_leaf(0x2, regs); + cpuid_read(0x2, regs); =20 /* * All Intel CPUs must report an iteration count of 1. In case diff --git a/arch/x86/kernel/cpu/topology_amd.c b/arch/x86/kernel/cpu/topol= ogy_amd.c index abc6f5a7a486..c6bedae12a7e 100644 --- a/arch/x86/kernel/cpu/topology_amd.c +++ b/arch/x86/kernel/cpu/topology_amd.c @@ -80,7 +80,7 @@ static bool parse_8000_001e(struct topo_scan *tscan, bool= has_topoext) if (!boot_cpu_has(X86_FEATURE_TOPOEXT)) return false; =20 - cpuid_leaf(0x8000001e, &leaf); + cpuid_read(0x8000001e, &leaf); =20 tscan->c->topo.initial_apicid =3D leaf.ext_apic_id; =20 diff --git a/arch/x86/kernel/cpu/topology_ext.c b/arch/x86/kernel/cpu/topol= ogy_ext.c index eb915c73895f..60dfaa02ffd0 100644 --- a/arch/x86/kernel/cpu/topology_ext.c +++ b/arch/x86/kernel/cpu/topology_ext.c @@ -71,7 +71,7 @@ static inline bool topo_subleaf(struct topo_scan *tscan, = u32 leaf, u32 subleaf, default: return false; } =20 - cpuid_subleaf(leaf, subleaf, &sl); + cpuid_read_subleaf(leaf, subleaf, &sl); =20 if (!sl.num_processors || sl.type =3D=3D INVALID_TYPE) return false; diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index cbd04b677fd1..b55fe9c7359a 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c @@ -59,8 +59,7 @@ static void cpuid_smp_cpuid(void *cmd_block) complete(&cmd->done); } =20 -static ssize_t cpuid_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) +static ssize_t cpuid_read_f(struct file *file, char __user *buf, size_t co= unt, loff_t *ppos) { char __user *tmp =3D buf; struct cpuid_regs_done cmd; @@ -120,7 +119,7 @@ static int cpuid_open(struct inode *inode, struct file = *file) static const struct file_operations cpuid_fops =3D { .owner =3D THIS_MODULE, .llseek =3D no_seek_end_llseek, - .read =3D cpuid_read, + .read =3D cpuid_read_f, .open =3D cpuid_open, }; =20 --=20 2.49.0