From: Greg Kroah-Hartman Date: Mon, 15 Mar 2021 09:20:37 +0000 (+0100) Subject: drop mips patch from 5.4 and 5.10 X-Git-Tag: v4.4.262~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e9b968a6fa24c064286496aae78c2f7b1139b528;p=thirdparty%2Fkernel%2Fstable-queue.git drop mips patch from 5.4 and 5.10 --- diff --git a/queue-5.10/mips-kernel-reserve-exception-base-early-to-prevent-.patch b/queue-5.10/mips-kernel-reserve-exception-base-early-to-prevent-.patch deleted file mode 100644 index 8c9f8e77f3b..00000000000 --- a/queue-5.10/mips-kernel-reserve-exception-base-early-to-prevent-.patch +++ /dev/null @@ -1,163 +0,0 @@ -From 50eae04e8a832e98e0f281eedc80769c52c8475f Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 8 Mar 2021 10:24:47 +0100 -Subject: MIPS: kernel: Reserve exception base early to prevent corruption - -From: Thomas Bogendoerfer - -[ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] - -BMIPS is one of the few platforms that do change the exception base. -After commit 2dcb39645441 ("memblock: do not start bottom-up allocations -with kernel_end") we started seeing BMIPS boards fail to boot with the -built-in FDT being corrupted. - -Before the cited commit, early allocations would be in the [kernel_end, -RAM_END] range, but after commit they would be within [RAM_START + -PAGE_SIZE, RAM_END]. - -The custom exception base handler that is installed by -bmips_ebase_setup() done for BMIPS5000 CPUs ends-up trampling on the -memory region allocated by unflatten_and_copy_device_tree() thus -corrupting the FDT used by the kernel. - -To fix this, we need to perform an early reservation of the custom -exception space. Additional we reserve the first 4k (1k for R3k) for -either normal exception vector space (legacy CPUs) or special vectors -like cache exceptions. - -Huge thanks to Serge for analysing and proposing a solution to this -issue. - -Fixes: 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") -Reported-by: Kamal Dasu -Debugged-by: Serge Semin -Acked-by: Mike Rapoport -Tested-by: Florian Fainelli -Reviewed-by: Serge Semin -Signed-off-by: Thomas Bogendoerfer -Signed-off-by: Sasha Levin ---- - arch/mips/include/asm/traps.h | 3 +++ - arch/mips/kernel/cpu-probe.c | 6 ++++++ - arch/mips/kernel/cpu-r3k-probe.c | 3 +++ - arch/mips/kernel/traps.c | 10 +++++----- - 4 files changed, 17 insertions(+), 5 deletions(-) - -diff --git a/arch/mips/include/asm/traps.h b/arch/mips/include/asm/traps.h -index 6a0864bb604d..9038b91e2d8c 100644 ---- a/arch/mips/include/asm/traps.h -+++ b/arch/mips/include/asm/traps.h -@@ -24,6 +24,9 @@ extern void (*board_ebase_setup)(void); - extern void (*board_cache_error_setup)(void); - - extern int register_nmi_notifier(struct notifier_block *nb); -+extern void reserve_exception_space(phys_addr_t addr, unsigned long size); -+ -+#define VECTORSPACING 0x100 /* for EI/VI mode */ - - #define nmi_notifier(fn, pri) \ - ({ \ -diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c -index 31cb9199197c..21794db53c05 100644 ---- a/arch/mips/kernel/cpu-probe.c -+++ b/arch/mips/kernel/cpu-probe.c -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include - - #include "fpu-probe.h" -@@ -1619,6 +1620,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - c->cputype = CPU_BMIPS3300; - __cpu_name[cpu] = "Broadcom BMIPS3300"; - set_elf_platform(cpu, "bmips3300"); -+ reserve_exception_space(0x400, VECTORSPACING * 64); - break; - case PRID_IMP_BMIPS43XX: { - int rev = c->processor_id & PRID_REV_MASK; -@@ -1629,6 +1631,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - __cpu_name[cpu] = "Broadcom BMIPS4380"; - set_elf_platform(cpu, "bmips4380"); - c->options |= MIPS_CPU_RIXI; -+ reserve_exception_space(0x400, VECTORSPACING * 64); - } else { - c->cputype = CPU_BMIPS4350; - __cpu_name[cpu] = "Broadcom BMIPS4350"; -@@ -1645,6 +1648,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - __cpu_name[cpu] = "Broadcom BMIPS5000"; - set_elf_platform(cpu, "bmips5000"); - c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; -+ reserve_exception_space(0x1000, VECTORSPACING * 64); - break; - } - } -@@ -2124,6 +2128,8 @@ void cpu_probe(void) - if (cpu == 0) - __ua_limit = ~((1ull << cpu_vmbits) - 1); - #endif -+ -+ reserve_exception_space(0, 0x1000); - } - - void cpu_report(void) -diff --git a/arch/mips/kernel/cpu-r3k-probe.c b/arch/mips/kernel/cpu-r3k-probe.c -index abdbbe8c5a43..af654771918c 100644 ---- a/arch/mips/kernel/cpu-r3k-probe.c -+++ b/arch/mips/kernel/cpu-r3k-probe.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include "fpu-probe.h" - -@@ -158,6 +159,8 @@ void cpu_probe(void) - cpu_set_fpu_opts(c); - else - cpu_set_nofpu_opts(c); -+ -+ reserve_exception_space(0, 0x400); - } - - void cpu_report(void) -diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c -index e0352958e2f7..808b8b61ded1 100644 ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -2009,13 +2009,16 @@ void __noreturn nmi_exception_handler(struct pt_regs *regs) - nmi_exit(); - } - --#define VECTORSPACING 0x100 /* for EI/VI mode */ -- - unsigned long ebase; - EXPORT_SYMBOL_GPL(ebase); - unsigned long exception_handlers[32]; - unsigned long vi_handlers[64]; - -+void reserve_exception_space(phys_addr_t addr, unsigned long size) -+{ -+ memblock_reserve(addr, size); -+} -+ - void __init *set_except_vector(int n, void *addr) - { - unsigned long handler = (unsigned long) addr; -@@ -2367,10 +2370,7 @@ void __init trap_init(void) - - if (!cpu_has_mips_r2_r6) { - ebase = CAC_BASE; -- ebase_pa = virt_to_phys((void *)ebase); - vec_size = 0x400; -- -- memblock_reserve(ebase_pa, vec_size); - } else { - if (cpu_has_veic || cpu_has_vint) - vec_size = 0x200 + VECTORSPACING*64; --- -2.30.1 - diff --git a/queue-5.10/series b/queue-5.10/series index 369c42a40ec..d9eafd212e8 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -106,7 +106,6 @@ media-v4l-vsp1-fix-bru-null-pointer-access.patch media-rc-compile-rc-cec.c-into-rc-core.patch cifs-fix-credit-accounting-for-extra-channel.patch net-hns3-fix-error-mask-definition-of-flow-director.patch -mips-kernel-reserve-exception-base-early-to-prevent-.patch s390-qeth-don-t-replace-a-fully-completed-async-tx-b.patch s390-qeth-remove-qeth_qdio_buf_handled_delayed-state.patch s390-qeth-improve-completion-of-pending-tx-buffers.patch diff --git a/queue-5.4/mips-kernel-reserve-exception-base-early-to-prevent-.patch b/queue-5.4/mips-kernel-reserve-exception-base-early-to-prevent-.patch deleted file mode 100644 index ddab7621b0b..00000000000 --- a/queue-5.4/mips-kernel-reserve-exception-base-early-to-prevent-.patch +++ /dev/null @@ -1,141 +0,0 @@ -From daf0b8e649b6d88aeb2eb9fcab0099eb6c75794f Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 8 Mar 2021 10:24:47 +0100 -Subject: MIPS: kernel: Reserve exception base early to prevent corruption - -From: Thomas Bogendoerfer - -[ Upstream commit bd67b711bfaa02cf19e88aa2d9edae5c1c1d2739 ] - -BMIPS is one of the few platforms that do change the exception base. -After commit 2dcb39645441 ("memblock: do not start bottom-up allocations -with kernel_end") we started seeing BMIPS boards fail to boot with the -built-in FDT being corrupted. - -Before the cited commit, early allocations would be in the [kernel_end, -RAM_END] range, but after commit they would be within [RAM_START + -PAGE_SIZE, RAM_END]. - -The custom exception base handler that is installed by -bmips_ebase_setup() done for BMIPS5000 CPUs ends-up trampling on the -memory region allocated by unflatten_and_copy_device_tree() thus -corrupting the FDT used by the kernel. - -To fix this, we need to perform an early reservation of the custom -exception space. Additional we reserve the first 4k (1k for R3k) for -either normal exception vector space (legacy CPUs) or special vectors -like cache exceptions. - -Huge thanks to Serge for analysing and proposing a solution to this -issue. - -Fixes: 2dcb39645441 ("memblock: do not start bottom-up allocations with kernel_end") -Reported-by: Kamal Dasu -Debugged-by: Serge Semin -Acked-by: Mike Rapoport -Tested-by: Florian Fainelli -Reviewed-by: Serge Semin -Signed-off-by: Thomas Bogendoerfer -Signed-off-by: Sasha Levin ---- - arch/mips/include/asm/traps.h | 3 +++ - arch/mips/kernel/cpu-probe.c | 6 ++++++ - arch/mips/kernel/traps.c | 10 +++++----- - 3 files changed, 14 insertions(+), 5 deletions(-) - -diff --git a/arch/mips/include/asm/traps.h b/arch/mips/include/asm/traps.h -index 6a0864bb604d..9038b91e2d8c 100644 ---- a/arch/mips/include/asm/traps.h -+++ b/arch/mips/include/asm/traps.h -@@ -24,6 +24,9 @@ extern void (*board_ebase_setup)(void); - extern void (*board_cache_error_setup)(void); - - extern int register_nmi_notifier(struct notifier_block *nb); -+extern void reserve_exception_space(phys_addr_t addr, unsigned long size); -+ -+#define VECTORSPACING 0x100 /* for EI/VI mode */ - - #define nmi_notifier(fn, pri) \ - ({ \ -diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c -index f521cbf934e7..3bf066ad9539 100644 ---- a/arch/mips/kernel/cpu-probe.c -+++ b/arch/mips/kernel/cpu-probe.c -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include - - /* Hardware capabilities */ -@@ -1827,6 +1828,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - c->cputype = CPU_BMIPS3300; - __cpu_name[cpu] = "Broadcom BMIPS3300"; - set_elf_platform(cpu, "bmips3300"); -+ reserve_exception_space(0x400, VECTORSPACING * 64); - break; - case PRID_IMP_BMIPS43XX: { - int rev = c->processor_id & PRID_REV_MASK; -@@ -1837,6 +1839,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - __cpu_name[cpu] = "Broadcom BMIPS4380"; - set_elf_platform(cpu, "bmips4380"); - c->options |= MIPS_CPU_RIXI; -+ reserve_exception_space(0x400, VECTORSPACING * 64); - } else { - c->cputype = CPU_BMIPS4350; - __cpu_name[cpu] = "Broadcom BMIPS4350"; -@@ -1853,6 +1856,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - __cpu_name[cpu] = "Broadcom BMIPS5000"; - set_elf_platform(cpu, "bmips5000"); - c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; -+ reserve_exception_space(0x1000, VECTORSPACING * 64); - break; - } - } -@@ -2222,6 +2226,8 @@ void cpu_probe(void) - if (cpu == 0) - __ua_limit = ~((1ull << cpu_vmbits) - 1); - #endif -+ -+ reserve_exception_space(0, 0x1000); - } - - void cpu_report(void) -diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c -index 8282d0feb0b2..32c4f0410191 100644 ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -1932,13 +1932,16 @@ void __noreturn nmi_exception_handler(struct pt_regs *regs) - nmi_exit(); - } - --#define VECTORSPACING 0x100 /* for EI/VI mode */ -- - unsigned long ebase; - EXPORT_SYMBOL_GPL(ebase); - unsigned long exception_handlers[32]; - unsigned long vi_handlers[64]; - -+void reserve_exception_space(phys_addr_t addr, unsigned long size) -+{ -+ memblock_reserve(addr, size); -+} -+ - void __init *set_except_vector(int n, void *addr) - { - unsigned long handler = (unsigned long) addr; -@@ -2290,10 +2293,7 @@ void __init trap_init(void) - - if (!cpu_has_mips_r2_r6) { - ebase = CAC_BASE; -- ebase_pa = virt_to_phys((void *)ebase); - vec_size = 0x400; -- -- memblock_reserve(ebase_pa, vec_size); - } else { - if (cpu_has_veic || cpu_has_vint) - vec_size = 0x200 + VECTORSPACING*64; --- -2.30.1 - diff --git a/queue-5.4/series b/queue-5.4/series index e03609e3b69..d3634145652 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -57,7 +57,6 @@ media-v4l-vsp1-fix-uif-null-pointer-access.patch media-v4l-vsp1-fix-bru-null-pointer-access.patch media-rc-compile-rc-cec.c-into-rc-core.patch net-hns3-fix-error-mask-definition-of-flow-director.patch -mips-kernel-reserve-exception-base-early-to-prevent-.patch net-enetc-initialize-rfs-rss-memories-for-unused-por.patch net-phy-fix-save-wrong-speed-and-duplex-problem-if-a.patch i2c-rcar-faster-irq-code-to-minimize-hw-race-conditi.patch