]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0020-sparc-cpu-Switch-to-arch_cpu_finalize_init.patch
add fixes for downfall
[pve-kernel.git] / patches / kernel / 0020-sparc-cpu-Switch-to-arch_cpu_finalize_init.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Wed, 14 Jun 2023 01:39:35 +0200
4 Subject: [PATCH] sparc/cpu: Switch to arch_cpu_finalize_init()
5
6 check_bugs() is about to be phased out. Switch over to the new
7 arch_cpu_finalize_init() implementation.
8
9 No functional change.
10
11 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
12 Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
13 Link: https://lore.kernel.org/r/20230613224545.431995857@linutronix.de
14
15 (cherry picked from commit 44ade508e3bfac45ae97864587de29eb1a881ec0)
16 CVE-2022-40982
17 Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
18 Acked-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
19 Acked-by: Stefan Bader <stefan.bader@canonical.com>
20 Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
21 (cherry picked from commit 5f02f99c6d6fd4f2c7b77f6d01bac14cc6fae2f6)
22 Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
23 ---
24 arch/sparc/Kconfig | 1 +
25 arch/sparc/include/asm/bugs.h | 18 ------------------
26 arch/sparc/kernel/setup_32.c | 7 +++++++
27 3 files changed, 8 insertions(+), 18 deletions(-)
28 delete mode 100644 arch/sparc/include/asm/bugs.h
29
30 diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
31 index dbb1760cbe8c..b67d96e3392e 100644
32 --- a/arch/sparc/Kconfig
33 +++ b/arch/sparc/Kconfig
34 @@ -51,6 +51,7 @@ config SPARC
35 config SPARC32
36 def_bool !64BIT
37 select ARCH_32BIT_OFF_T
38 + select ARCH_HAS_CPU_FINALIZE_INIT if !SMP
39 select ARCH_HAS_SYNC_DMA_FOR_CPU
40 select CLZ_TAB
41 select DMA_DIRECT_REMAP
42 diff --git a/arch/sparc/include/asm/bugs.h b/arch/sparc/include/asm/bugs.h
43 deleted file mode 100644
44 index 02fa369b9c21..000000000000
45 --- a/arch/sparc/include/asm/bugs.h
46 +++ /dev/null
47 @@ -1,18 +0,0 @@
48 -/* SPDX-License-Identifier: GPL-2.0 */
49 -/* include/asm/bugs.h: Sparc probes for various bugs.
50 - *
51 - * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
52 - */
53 -
54 -#ifdef CONFIG_SPARC32
55 -#include <asm/cpudata.h>
56 -#endif
57 -
58 -extern unsigned long loops_per_jiffy;
59 -
60 -static void __init check_bugs(void)
61 -{
62 -#if defined(CONFIG_SPARC32) && !defined(CONFIG_SMP)
63 - cpu_data(0).udelay_val = loops_per_jiffy;
64 -#endif
65 -}
66 diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
67 index c8e0dd99f370..c9d1ba4f311b 100644
68 --- a/arch/sparc/kernel/setup_32.c
69 +++ b/arch/sparc/kernel/setup_32.c
70 @@ -412,3 +412,10 @@ static int __init topology_init(void)
71 }
72
73 subsys_initcall(topology_init);
74 +
75 +#if defined(CONFIG_SPARC32) && !defined(CONFIG_SMP)
76 +void __init arch_cpu_finalize_init(void)
77 +{
78 + cpu_data(0).udelay_val = loops_per_jiffy;
79 +}
80 +#endif