arch/powerpc/include/asm/mmu.h | 5 ----- arch/powerpc/include/asm/nohash/mmu-e500.h | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-)
asm/percpu.h includes asm/paca.h which needs struct tlb_core_data
which is defined in mmu-e500.h
asm/percpu.h is included from asm/mmu.h in a #ifdef CONFIG_E500
before the inclusion of mmu-e500.h
To fix that, move the inclusion of asm/percpu.h into mmu-e500.h
after the definition of struct tlb_core_data
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308220708.nRf5AUAe-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202308220857.uFq2oAxM-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202308221055.lw3UzJIL-lkp@intel.com/
Fixes: 3a24ea0df83e ("powerpc/kuap: Use ASM feature fixups instead of static branches")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/include/asm/mmu.h | 5 -----
arch/powerpc/include/asm/nohash/mmu-e500.h | 3 +++
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 82af2e2c5eca..52cc25864a1b 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -144,11 +144,6 @@
typedef pte_t *pgtable_t;
-#ifdef CONFIG_PPC_E500
-#include <asm/percpu.h>
-DECLARE_PER_CPU(int, next_tlbcam_idx);
-#endif
-
enum {
MMU_FTRS_POSSIBLE =
#if defined(CONFIG_PPC_BOOK3S_604)
diff --git a/arch/powerpc/include/asm/nohash/mmu-e500.h b/arch/powerpc/include/asm/nohash/mmu-e500.h
index e43a418d3ccd..6ddced0415cb 100644
--- a/arch/powerpc/include/asm/nohash/mmu-e500.h
+++ b/arch/powerpc/include/asm/nohash/mmu-e500.h
@@ -319,6 +319,9 @@ extern int book3e_htw_mode;
#endif
+#include <asm/percpu.h>
+DECLARE_PER_CPU(int, next_tlbcam_idx);
+
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_POWERPC_MMU_BOOK3E_H_ */
--
2.41.0
On Tue, 22 Aug 2023 08:07:50 +0200, Christophe Leroy wrote:
> asm/percpu.h includes asm/paca.h which needs struct tlb_core_data
> which is defined in mmu-e500.h
>
> asm/percpu.h is included from asm/mmu.h in a #ifdef CONFIG_E500
> before the inclusion of mmu-e500.h
>
> To fix that, move the inclusion of asm/percpu.h into mmu-e500.h
> after the definition of struct tlb_core_data
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/64e: Fix circular dependency with CONFIG_SMP disabled
https://git.kernel.org/powerpc/c/0e2a34c467a0de2b0309d033e2700ce608e3fbf4
cheers
© 2016 - 2025 Red Hat, Inc.