Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'mips-fixes_5.12_1' into mips-next

- fixes for boot breakage because of misaligned FDTs
- fix for overwritten exception handlers
- enable MIPS optimized crypto for all MIPS CPUs to improve wireguard
performance

+35 -9
+8
arch/mips/boot/compressed/decompress.c
··· 14 14 15 15 #include <asm/addrspace.h> 16 16 #include <asm/unaligned.h> 17 + #include <asm-generic/vmlinux.lds.h> 17 18 18 19 /* 19 20 * These two variables specify the free mem region ··· 120 119 121 120 /* last four bytes is always image size in little endian */ 122 121 image_size = get_unaligned_le32((void *)&__image_end - 4); 122 + 123 + /* The device tree's address must be properly aligned */ 124 + image_size = ALIGN(image_size, STRUCT_ALIGNMENT); 125 + 126 + puts("Copy device tree to address "); 127 + puthex(VMLINUX_LOAD_ADDRESS_ULL + image_size); 128 + puts("\n"); 123 129 124 130 /* copy dtb to where the booted kernel will expect it */ 125 131 memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size,
+2 -2
arch/mips/crypto/Makefile
··· 12 12 obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o 13 13 poly1305-mips-y := poly1305-core.o poly1305-glue.o 14 14 15 - perlasm-flavour-$(CONFIG_CPU_MIPS32) := o32 16 - perlasm-flavour-$(CONFIG_CPU_MIPS64) := 64 15 + perlasm-flavour-$(CONFIG_32BIT) := o32 16 + perlasm-flavour-$(CONFIG_64BIT) := 64 17 17 18 18 quiet_cmd_perlasm = PERLASM $@ 19 19 cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@)
+3
arch/mips/include/asm/traps.h
··· 24 24 extern void (*board_cache_error_setup)(void); 25 25 26 26 extern int register_nmi_notifier(struct notifier_block *nb); 27 + extern void reserve_exception_space(phys_addr_t addr, unsigned long size); 27 28 extern char except_vec_nmi[]; 29 + 30 + #define VECTORSPACING 0x100 /* for EI/VI mode */ 28 31 29 32 #define nmi_notifier(fn, pri) \ 30 33 ({ \
+6
arch/mips/kernel/cpu-probe.c
··· 26 26 #include <asm/elf.h> 27 27 #include <asm/pgtable-bits.h> 28 28 #include <asm/spram.h> 29 + #include <asm/traps.h> 29 30 #include <linux/uaccess.h> 30 31 31 32 #include "fpu-probe.h" ··· 1629 1628 c->cputype = CPU_BMIPS3300; 1630 1629 __cpu_name[cpu] = "Broadcom BMIPS3300"; 1631 1630 set_elf_platform(cpu, "bmips3300"); 1631 + reserve_exception_space(0x400, VECTORSPACING * 64); 1632 1632 break; 1633 1633 case PRID_IMP_BMIPS43XX: { 1634 1634 int rev = c->processor_id & PRID_REV_MASK; ··· 1640 1638 __cpu_name[cpu] = "Broadcom BMIPS4380"; 1641 1639 set_elf_platform(cpu, "bmips4380"); 1642 1640 c->options |= MIPS_CPU_RIXI; 1641 + reserve_exception_space(0x400, VECTORSPACING * 64); 1643 1642 } else { 1644 1643 c->cputype = CPU_BMIPS4350; 1645 1644 __cpu_name[cpu] = "Broadcom BMIPS4350"; ··· 1657 1654 __cpu_name[cpu] = "Broadcom BMIPS5000"; 1658 1655 set_elf_platform(cpu, "bmips5000"); 1659 1656 c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; 1657 + reserve_exception_space(0x1000, VECTORSPACING * 64); 1660 1658 break; 1661 1659 } 1662 1660 } ··· 2137 2133 if (cpu == 0) 2138 2134 __ua_limit = ~((1ull << cpu_vmbits) - 1); 2139 2135 #endif 2136 + 2137 + reserve_exception_space(0, 0x1000); 2140 2138 } 2141 2139 2142 2140 void cpu_report(void)
+3
arch/mips/kernel/cpu-r3k-probe.c
··· 21 21 #include <asm/fpu.h> 22 22 #include <asm/mipsregs.h> 23 23 #include <asm/elf.h> 24 + #include <asm/traps.h> 24 25 25 26 #include "fpu-probe.h" 26 27 ··· 159 158 cpu_set_fpu_opts(c); 160 159 else 161 160 cpu_set_nofpu_opts(c); 161 + 162 + reserve_exception_space(0, 0x400); 162 163 } 163 164 164 165 void cpu_report(void)
+5 -5
arch/mips/kernel/traps.c
··· 2009 2009 nmi_exit(); 2010 2010 } 2011 2011 2012 - #define VECTORSPACING 0x100 /* for EI/VI mode */ 2013 - 2014 2012 unsigned long ebase; 2015 2013 EXPORT_SYMBOL_GPL(ebase); 2016 2014 unsigned long exception_handlers[32]; 2017 2015 unsigned long vi_handlers[64]; 2016 + 2017 + void reserve_exception_space(phys_addr_t addr, unsigned long size) 2018 + { 2019 + memblock_reserve(addr, size); 2020 + } 2018 2021 2019 2022 void __init *set_except_vector(int n, void *addr) 2020 2023 { ··· 2370 2367 2371 2368 if (!cpu_has_mips_r2_r6) { 2372 2369 ebase = CAC_BASE; 2373 - ebase_pa = virt_to_phys((void *)ebase); 2374 2370 vec_size = 0x400; 2375 - 2376 - memblock_reserve(ebase_pa, vec_size); 2377 2371 } else { 2378 2372 if (cpu_has_veic || cpu_has_vint) 2379 2373 vec_size = 0x200 + VECTORSPACING*64;
+6
arch/mips/kernel/vmlinux.lds.S
··· 145 145 } 146 146 147 147 #ifdef CONFIG_MIPS_ELF_APPENDED_DTB 148 + STRUCT_ALIGN(); 148 149 .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { 149 150 *(.appended_dtb) 150 151 KEEP(*(.appended_dtb)) ··· 173 172 #endif 174 173 175 174 #ifdef CONFIG_MIPS_RAW_APPENDED_DTB 175 + .fill : { 176 + FILL(0); 177 + BYTE(0); 178 + . = ALIGN(8); 179 + } 176 180 __appended_dtb = .; 177 181 /* leave space for appended DTB */ 178 182 . += 0x100000;
+1 -1
crypto/Kconfig
··· 767 767 768 768 config CRYPTO_POLY1305_MIPS 769 769 tristate "Poly1305 authenticator algorithm (MIPS optimized)" 770 - depends on CPU_MIPS32 || (CPU_MIPS64 && 64BIT) 770 + depends on MIPS 771 771 select CRYPTO_ARCH_HAVE_LIB_POLY1305 772 772 773 773 config CRYPTO_MD4
+1 -1
drivers/net/Kconfig
··· 94 94 select CRYPTO_BLAKE2S_ARM if ARM 95 95 select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON 96 96 select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2 97 - select CRYPTO_POLY1305_MIPS if CPU_MIPS32 || (CPU_MIPS64 && 64BIT) 97 + select CRYPTO_POLY1305_MIPS if MIPS 98 98 help 99 99 WireGuard is a secure, fast, and easy to use replacement for IPSec 100 100 that uses modern cryptography and clever networking tricks. It's