]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mips/cpu: Switch to arch_cpu_finalize_init()
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Jun 2023 23:39:32 +0000 (01:39 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 10:02:12 +0000 (12:02 +0200)
check_bugs() is about to be phased out. Switch over to the new
arch_cpu_finalize_init() implementation.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230613224545.312438573@linutronix.de
(backported from commit 7f066a22fe353a827a402ee2835e81f045b1574d)
[cascardo: only removed check_bugs from arch/mips/include/asm/bugs.h]
CVE-2022-40982
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/mips/Kconfig
arch/mips/include/asm/bugs.h
arch/mips/kernel/setup.c

index f11dda15aa54cace3fc048e1bdfccb061a165338..fcf59a375c5b2b5b1b66f63e7b36821b48eb1d92 100644 (file)
@@ -4,6 +4,7 @@ config MIPS
        default y
        select ARCH_32BIT_OFF_T if !64BIT
        select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
+       select ARCH_HAS_CPU_FINALIZE_INIT
        select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
        select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
        select ARCH_HAS_FORTIFY_SOURCE
index d72dc6e1cf3cd2b8d204de076b40a09f90ac1d93..8d4cf29861b871a4f2a6d5077aa18f7d6b348eb3 100644 (file)
@@ -1,17 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * This is included by init/main.c to check for architecture-dependent bugs.
- *
  * Copyright (C) 2007  Maciej W. Rozycki
- *
- * Needs:
- *     void check_bugs(void);
  */
 #ifndef _ASM_BUGS_H
 #define _ASM_BUGS_H
 
 #include <linux/bug.h>
-#include <linux/delay.h>
 #include <linux/smp.h>
 
 #include <asm/cpu.h>
@@ -30,17 +24,6 @@ static inline void check_bugs_early(void)
                check_bugs64_early();
 }
 
-static inline void check_bugs(void)
-{
-       unsigned int cpu = smp_processor_id();
-
-       cpu_data[cpu].udelay_val = loops_per_jiffy;
-       check_bugs32();
-
-       if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
-               check_bugs64();
-}
-
 static inline int r4k_daddiu_bug(void)
 {
        if (!IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
index f1c88f8a1dc512e7b7a837f8f1ac62048c69e573..4d950f666ef66ebb9b598414d9f3c4841c4b2158 100644 (file)
@@ -11,6 +11,8 @@
  * Copyright (C) 2000, 2001, 2002, 2007         Maciej W. Rozycki
  */
 #include <linux/init.h>
+#include <linux/cpu.h>
+#include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/export.h>
 #include <linux/screen_info.h>
@@ -839,3 +841,14 @@ static int __init setnocoherentio(char *str)
 }
 early_param("nocoherentio", setnocoherentio);
 #endif
+
+void __init arch_cpu_finalize_init(void)
+{
+       unsigned int cpu = smp_processor_id();
+
+       cpu_data[cpu].udelay_val = loops_per_jiffy;
+       check_bugs32();
+
+       if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+               check_bugs64();
+}