From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6CC5022F74A; Fri, 10 Apr 2026 12:18:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775823521; cv=none; b=rqDXxwY3QsOmPxBqBxDSsmhaXwcybcXv/3KOpb/6EIz2tuKNLb4AWC5MsAFvGRMc3DmKLvXua4qll058VjQtjbXjBsckGEggreaz7GySGURrrtDu1efcZpD3BFkUsj8N719z3W40UJ31h5HFouj8iazoTDUi/mzmhvobvrrzonI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775823521; c=relaxed/simple; bh=jM+JreNQ/pvWEKCuy6rQc5u1kgCA5N5UN7yUgNovu14=; h=Date:Message-ID:From:To:Subject:References:MIME-Version: Content-Type:cc; b=HMORE5MdVT7OUsMYXeSSOHyQyRGbVAkusslY/N2X6eNYxnSlcZ9E2C/zyzGJC0KiLhwLaVUIyJZDZLGzNurhPeyXlkclrFbMGa2T3VwVLlPxs+wYOC2K5ot7lbmbHodkrkhaKZf7pX5pKeBn4HZIFGl66vzqwQz31Z8Z1+cXx+g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nWtTU/8b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nWtTU/8b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34709C2BC87; Fri, 10 Apr 2026 12:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775823521; bh=jM+JreNQ/pvWEKCuy6rQc5u1kgCA5N5UN7yUgNovu14=; h=Date:From:To:Subject:References:cc:From; b=nWtTU/8bYflAI0sVDZCcTSRoMHHBafK4f8aE8OQUIADFXrWn3gkAS6D8iyeDcGytD IkAJ7wfDdphIDTv0/p2VgJLmG6txpPJj7VHjB28F0wfKCyzE07p6hHvScSQ/hPg40n m5UonCXCWoABi9Y1P5pL07/VfBtvxj5IX/qtz/8nDDpNNssj+hm09ux1rli9d/5Kp7 u2W39VabHnp7xFO01m/Vf4vbZzsQaYVQbm/v4/bBGJXSthxziJGUNQp6cLMMBeBrVY Rxdzr0TBEmAzR1XxM10SdBatX0CJ8cwLuQKU2F/sGImGk9kogedHCPTsKBS8t/RjVc cuRhduaM+Iuqw== Date: Fri, 10 Apr 2026 14:18:37 +0200 Message-ID: <20260410120317.709923681@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Subject: [patch 02/38] x86: Cleanup include recursion hell References: <20260410120044.031381086@kernel.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 cc: Arnd Bergmann , x86@kernel.org, Lu Baolu , iommu@lists.linux.dev, Michael Grzeschik , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Herbert Xu , linux-crypto@vger.kernel.org, Vlastimil Babka , linux-mm@kvack.org, David Woodhouse , Bernie Thompson , linux-fbdev@vger.kernel.org, "Theodore Tso" , linux-ext4@vger.kernel.org, Andrew Morton , Uladzislau Rezki , Marco Elver , Dmitry Vyukov , kasan-dev@googlegroups.com, Andrey Ryabinin , Thomas Sailer , linux-hams@vger.kernel.org, "Jason A. Donenfeld" , Richard Henderson , linux-alpha@vger.kernel.org, Russell King , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Huacai Chen , loongarch@lists.linux.dev, Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Dinh Nguyen , Jonas Bonn , linux-openrisc@vger.kernel.org, Helge Deller , linux-parisc@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Paul Walmsley , linux-riscv@lists.infradead.org, Heiko Carstens , linux-s390@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org Including a random architecture specific header which requires global headers just to avoid including that header at the two usage sites is really beyond lazy and tasteless. Including global headers just to get the __percpu macro from linux/compiler_types.h falls into the same category. Remove the linux/percpu.h and asm/cpumask.h includes from msr.h and smp.h and fix the resulting fallout by a simple forward struct declaration and by including the x86 specific asm/cpumask.h header where it is actually required. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/msr.h | 5 +++-- arch/x86/include/asm/pvclock.h | 1 + arch/x86/include/asm/smp.h | 2 -- arch/x86/include/asm/vdso/gettimeofday.h | 5 ++--- arch/x86/kernel/cpu/mce/core.c | 1 + arch/x86/kernel/nmi.c | 1 + arch/x86/kernel/smpboot.c | 1 + 7 files changed, 9 insertions(+), 7 deletions(-) --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -8,12 +8,11 @@ #include #include -#include #include #include +#include #include -#include struct msr_info { u32 msr_no; @@ -256,6 +255,8 @@ int msr_set_bit(u32 msr, u8 bit); int msr_clear_bit(u32 msr, u8 bit); #ifdef CONFIG_SMP +struct cpumask; + int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); int rdmsrq_on_cpu(unsigned int cpu, u32 msr_no, u64 *q); --- a/arch/x86/include/asm/pvclock.h +++ b/arch/x86/include/asm/pvclock.h @@ -2,6 +2,7 @@ #ifndef _ASM_X86_PVCLOCK_H #define _ASM_X86_PVCLOCK_H +#include #include #include --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -5,8 +5,6 @@ #include #include -#include - DECLARE_PER_CPU_CACHE_HOT(int, cpu_number); DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); --- a/arch/x86/include/asm/vdso/gettimeofday.h +++ b/arch/x86/include/asm/vdso/gettimeofday.h @@ -11,13 +11,12 @@ #define __ASM_VDSO_GETTIMEOFDAY_H #ifndef __ASSEMBLER__ - +#include #include + #include #include -#include #include -#include #include #define VDSO_HAS_TIME 1 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include