From 1c52662da875d102a79fe016038434be7b6bd82b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 18 Apr 2024 17:39:30 +0200 Subject: linux: update to 6.6.28 --- target/linux/Config.in.kernelversion | 2 +- .../6.6.22/armnommu-fix-thread-registers.patch | 57 ------------ .../linux/patches/6.6.22/armnommu-versatile.patch | 101 --------------------- .../linux/patches/6.6.22/hppa-cross-compile.patch | 12 --- target/linux/patches/6.6.22/macsonic.patch | 11 --- target/linux/patches/6.6.22/riscv-flat.patch | 19 ---- .../6.6.28/armnommu-fix-thread-registers.patch | 57 ++++++++++++ .../linux/patches/6.6.28/armnommu-versatile.patch | 101 +++++++++++++++++++++ .../linux/patches/6.6.28/hppa-cross-compile.patch | 12 +++ target/linux/patches/6.6.28/macsonic.patch | 11 +++ target/linux/patches/6.6.28/riscv-flat.patch | 19 ++++ 11 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 target/linux/patches/6.6.22/armnommu-fix-thread-registers.patch delete mode 100644 target/linux/patches/6.6.22/armnommu-versatile.patch delete mode 100644 target/linux/patches/6.6.22/hppa-cross-compile.patch delete mode 100644 target/linux/patches/6.6.22/macsonic.patch delete mode 100644 target/linux/patches/6.6.22/riscv-flat.patch create mode 100644 target/linux/patches/6.6.28/armnommu-fix-thread-registers.patch create mode 100644 target/linux/patches/6.6.28/armnommu-versatile.patch create mode 100644 target/linux/patches/6.6.28/hppa-cross-compile.patch create mode 100644 target/linux/patches/6.6.28/macsonic.patch create mode 100644 target/linux/patches/6.6.28/riscv-flat.patch (limited to 'target') diff --git a/target/linux/Config.in.kernelversion b/target/linux/Config.in.kernelversion index d53fea61b..a1c346987 100644 --- a/target/linux/Config.in.kernelversion +++ b/target/linux/Config.in.kernelversion @@ -51,7 +51,7 @@ config ADK_TARGET_LINUX_KERNEL_VERSION_6_8 depends on !ADK_TARGET_ARCH_NDS32 config ADK_TARGET_LINUX_KERNEL_VERSION_6_6 - bool "6.6.22" + bool "6.6.28" depends on !ADK_TARGET_ARCH_AVR32 depends on !ADK_TARGET_ARCH_BFIN depends on !ADK_TARGET_ARCH_C6X diff --git a/target/linux/patches/6.6.22/armnommu-fix-thread-registers.patch b/target/linux/patches/6.6.22/armnommu-fix-thread-registers.patch deleted file mode 100644 index 8ab2196dc..000000000 --- a/target/linux/patches/6.6.22/armnommu-fix-thread-registers.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 1410ebe685f13c1699a16bf147ae1332e7fd1983 Mon Sep 17 00:00:00 2001 -From: Greg Ungerer -Date: Thu, 20 Apr 2023 09:52:08 +1000 -Subject: [PATCH] ARM: start_thread: restore registers on ELF load for noMMU - -The binfmt_elf-fdpic loader is capable of loading constant displacement -ELF format binaries (like those compiled -pie) on noMMU systems as well -as elf-fdpic format binaries. The traditional ELF loader cannot be -enabled on noMMU systems. - -Commit 5e588114329c ("ARM: start_thread(): don't always clear all regs") -fixed the start_thread() code so that it maintains the required -elf-fdpic registers through to the new process, but it only does that if -current has its personality FDPIC_FUNCPTRS bit set. That is true for -elf-fdpic format binaries but will not be true for non-fdpic ELF -binaries. - -Modify the test of the FDPIC_FUNCPTRS personality bit to also carry out -the register restore if this is a noMMU system. This is not perfect, -since it will also preserve these registers on noMMU systems for all -binary format types (could be flat format for example). That won't break -anything, but it is potentially leaking some information into the new -process. But for the noMMU case we need those start time registers set to -be able to finalize the runtime loading of the -pie style ELF binary -(carry out its segment and dynamic relocation processing). - -Unfortunately the FDPIC_FUNCPTRS flag cannot just be enabled for all -elf-fdpic loaded binaries. That personality bit is used for other things -like the controlling the changed behavior for signal handling. - -There is no change in behavior for normal ELF loading on MMU systems. -A -pie style ELF binary built for noMMU systems can be load and run using -the usual ELF loader on an MMU system (elf-fdpic loader not required in -this case). - -Signed-off-by: Greg Ungerer ---- - arch/arm/include/asm/processor.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h -index 326864f79d18..5074cc3ae4e1 100644 ---- a/arch/arm/include/asm/processor.h -+++ b/arch/arm/include/asm/processor.h -@@ -60,7 +60,8 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset, - } \ - memset(regs->uregs, 0, sizeof(regs->uregs)); \ - if (IS_ENABLED(CONFIG_BINFMT_ELF_FDPIC) && \ -- current->personality & FDPIC_FUNCPTRS) { \ -+ ((! IS_ENABLED(CONFIG_MMU)) || \ -+ current->personality & FDPIC_FUNCPTRS)) { \ - regs->ARM_r7 = r7; \ - regs->ARM_r8 = r8; \ - regs->ARM_r9 = r9; \ --- -2.25.1 - diff --git a/target/linux/patches/6.6.22/armnommu-versatile.patch b/target/linux/patches/6.6.22/armnommu-versatile.patch deleted file mode 100644 index f8f10f50b..000000000 --- a/target/linux/patches/6.6.22/armnommu-versatile.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 77c038d93769c92ef54cdbb50388564d1b37987b Mon Sep 17 00:00:00 2001 -From: Greg Ungerer -Date: Fri, 23 Sep 2016 13:37:34 +1000 -Subject: [PATCH] ARM: versatile: support configuring versatile machine for no-MMU - -Allow the arm versatile machine to be configured for no-MMU operation. - -Older kernels had the ability to build the versatile machine with the MMU -disabled (!CONFIG_MMU). Recent changes to convert the versatile machine -to device tree lost this ability. (Although older kernels could be built -they did not run due to a bug in the IO_ADDRESS() mapping on this machine). - -The motivation for this is that the versatile machine is well supported -in qemu. And this provides an excellent platform for development and -testing no-MMU support on ARM in general. - -This patch adds a versatile platform selection in the upper level arm -system type menu - where it appeared in older kernel versions - when -configuring for the no-MMU case. There is no visible change to the way -versatile is selected for the MMU enabled case. - -Signed-off-by: Greg Ungerer ---- - arch/arm/Kconfig | 13 ++++++++++++- - arch/arm/include/asm/mach/map.h | 1 + - arch/arm/mach-versatile/Kconfig | 2 +- - arch/arm/mach-versatile/versatile.c | 4 ++++ - 4 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/mach-versatile/versatile.c b/arch/arm/mach-versatile/versatile.c -index 02ba68abe533..835b51bc597b 100644 ---- a/arch/arm/mach-versatile/versatile.c -+++ b/arch/arm/mach-versatile/versatile.c -@@ -22,7 +22,11 @@ - #include - - /* macro to get at MMIO space when running virtually */ -+#ifdef CONFIG_MMU - #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) -+#else -+#define IO_ADDRESS(x) (x) -+#endif - #define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n)) - - /* -diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h -index 2b8970d8e5a2..41844ab6aec5 100644 ---- a/arch/arm/include/asm/mach/map.h -+++ b/arch/arm/include/asm/mach/map.h -@@ -60,6 +60,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys, - #else - #define iotable_init(map,num) do { } while (0) - #define vm_reserve_area_early(a,s,c) do { } while (0) -+#define debug_ll_io_init() do { } while (0) - #endif - - #endif -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index e24a9820e12f..342e1efa583a 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -307,12 +307,23 @@ config MMU - Select if you want MMU-based virtualised addressing space - support by paged memory management. If unsure, say 'Y'. - -+choice -+ prompt "ARM system type" -+ depends on !MMU -+ default ARM_SINGLE_ARMV7M -+ - config ARM_SINGLE_ARMV7M -- def_bool !MMU -+ bool "ARMv7-M based platforms (Cortex-M0/M3/M4)" - select ARM_NVIC - select CPU_V7M - select NO_IOPORT_MAP - -+config ARM_SINGLE_ARM926 -+ bool "ARM926 based platforms" -+ select CPU_ARM926T -+ -+endchoice -+ - config ARCH_MMAP_RND_BITS_MIN - default 8 - -diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig -index b1519b4dc03a..2f1bf95daeb0 100644 ---- a/arch/arm/mach-versatile/Kconfig -+++ b/arch/arm/mach-versatile/Kconfig -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - config ARCH_VERSATILE - bool "ARM Ltd. Versatile family" -- depends on ARCH_MULTI_V5 -+ depends on ARCH_MULTI_V5 || ARM_SINGLE_ARM926 - depends on CPU_LITTLE_ENDIAN - select ARM_AMBA - select ARM_TIMER_SP804 --- -2.25.1 diff --git a/target/linux/patches/6.6.22/hppa-cross-compile.patch b/target/linux/patches/6.6.22/hppa-cross-compile.patch deleted file mode 100644 index 51c24fff2..000000000 --- a/target/linux/patches/6.6.22/hppa-cross-compile.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur linux-6.6.22.orig/arch/parisc/Makefile linux-6.6.22/arch/parisc/Makefile ---- linux-6.6.22.orig/arch/parisc/Makefile 2024-03-15 19:25:07.000000000 +0100 -+++ linux-6.6.22/arch/parisc/Makefile 2024-04-16 03:57:37.515308996 +0200 -@@ -41,7 +41,7 @@ - - # Set default 32 bits cross compilers for vdso - CC_ARCHES_32 = hppa hppa2.0 hppa1.1 --CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux -+CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux openadk-linux-uclibc - CROSS32_COMPILE := $(call cc-cross-prefix, \ - $(foreach a,$(CC_ARCHES_32), \ - $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-))) diff --git a/target/linux/patches/6.6.22/macsonic.patch b/target/linux/patches/6.6.22/macsonic.patch deleted file mode 100644 index 51e76113b..000000000 --- a/target/linux/patches/6.6.22/macsonic.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur linux-6.6.22.orig/drivers/net/ethernet/natsemi/Kconfig linux-6.6.22/drivers/net/ethernet/natsemi/Kconfig ---- linux-6.6.22.orig/drivers/net/ethernet/natsemi/Kconfig 2024-03-15 19:25:07.000000000 +0100 -+++ linux-6.6.22/drivers/net/ethernet/natsemi/Kconfig 2024-04-16 10:16:50.352443898 +0200 -@@ -19,6 +19,7 @@ - config MACSONIC - tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)" - depends on MAC -+ select BITREVERSE - help - Support for NatSemi SONIC based Ethernet devices. This includes - the onboard Ethernet in many Quadras as well as some LC-PDS, diff --git a/target/linux/patches/6.6.22/riscv-flat.patch b/target/linux/patches/6.6.22/riscv-flat.patch deleted file mode 100644 index 6d26c638f..000000000 --- a/target/linux/patches/6.6.22/riscv-flat.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nur linux-6.6.22.orig/fs/binfmt_flat.c linux-6.6.22/fs/binfmt_flat.c ---- linux-6.6.22.orig/fs/binfmt_flat.c 2024-03-15 19:25:07.000000000 +0100 -+++ linux-6.6.22/fs/binfmt_flat.c 2024-04-17 15:41:29.292461687 +0200 -@@ -879,6 +879,7 @@ - if (res < 0) - return res; - -+#ifndef CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET - /* Update data segment pointers for all libraries */ - for (i = 0; i < MAX_SHARED_LIBS; i++) { - if (!libinfo.lib_list[i].loaded) -@@ -893,6 +894,7 @@ - return -EFAULT; - } - } -+#endif - - set_binfmt(&flat_format); - diff --git a/target/linux/patches/6.6.28/armnommu-fix-thread-registers.patch b/target/linux/patches/6.6.28/armnommu-fix-thread-registers.patch new file mode 100644 index 000000000..8ab2196dc --- /dev/null +++ b/target/linux/patches/6.6.28/armnommu-fix-thread-registers.patch @@ -0,0 +1,57 @@ +From 1410ebe685f13c1699a16bf147ae1332e7fd1983 Mon Sep 17 00:00:00 2001 +From: Greg Ungerer +Date: Thu, 20 Apr 2023 09:52:08 +1000 +Subject: [PATCH] ARM: start_thread: restore registers on ELF load for noMMU + +The binfmt_elf-fdpic loader is capable of loading constant displacement +ELF format binaries (like those compiled -pie) on noMMU systems as well +as elf-fdpic format binaries. The traditional ELF loader cannot be +enabled on noMMU systems. + +Commit 5e588114329c ("ARM: start_thread(): don't always clear all regs") +fixed the start_thread() code so that it maintains the required +elf-fdpic registers through to the new process, but it only does that if +current has its personality FDPIC_FUNCPTRS bit set. That is true for +elf-fdpic format binaries but will not be true for non-fdpic ELF +binaries. + +Modify the test of the FDPIC_FUNCPTRS personality bit to also carry out +the register restore if this is a noMMU system. This is not perfect, +since it will also preserve these registers on noMMU systems for all +binary format types (could be flat format for example). That won't break +anything, but it is potentially leaking some information into the new +process. But for the noMMU case we need those start time registers set to +be able to finalize the runtime loading of the -pie style ELF binary +(carry out its segment and dynamic relocation processing). + +Unfortunately the FDPIC_FUNCPTRS flag cannot just be enabled for all +elf-fdpic loaded binaries. That personality bit is used for other things +like the controlling the changed behavior for signal handling. + +There is no change in behavior for normal ELF loading on MMU systems. +A -pie style ELF binary built for noMMU systems can be load and run using +the usual ELF loader on an MMU system (elf-fdpic loader not required in +this case). + +Signed-off-by: Greg Ungerer +--- + arch/arm/include/asm/processor.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h +index 326864f79d18..5074cc3ae4e1 100644 +--- a/arch/arm/include/asm/processor.h ++++ b/arch/arm/include/asm/processor.h +@@ -60,7 +60,8 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset, + } \ + memset(regs->uregs, 0, sizeof(regs->uregs)); \ + if (IS_ENABLED(CONFIG_BINFMT_ELF_FDPIC) && \ +- current->personality & FDPIC_FUNCPTRS) { \ ++ ((! IS_ENABLED(CONFIG_MMU)) || \ ++ current->personality & FDPIC_FUNCPTRS)) { \ + regs->ARM_r7 = r7; \ + regs->ARM_r8 = r8; \ + regs->ARM_r9 = r9; \ +-- +2.25.1 + diff --git a/target/linux/patches/6.6.28/armnommu-versatile.patch b/target/linux/patches/6.6.28/armnommu-versatile.patch new file mode 100644 index 000000000..f8f10f50b --- /dev/null +++ b/target/linux/patches/6.6.28/armnommu-versatile.patch @@ -0,0 +1,101 @@ +From 77c038d93769c92ef54cdbb50388564d1b37987b Mon Sep 17 00:00:00 2001 +From: Greg Ungerer +Date: Fri, 23 Sep 2016 13:37:34 +1000 +Subject: [PATCH] ARM: versatile: support configuring versatile machine for no-MMU + +Allow the arm versatile machine to be configured for no-MMU operation. + +Older kernels had the ability to build the versatile machine with the MMU +disabled (!CONFIG_MMU). Recent changes to convert the versatile machine +to device tree lost this ability. (Although older kernels could be built +they did not run due to a bug in the IO_ADDRESS() mapping on this machine). + +The motivation for this is that the versatile machine is well supported +in qemu. And this provides an excellent platform for development and +testing no-MMU support on ARM in general. + +This patch adds a versatile platform selection in the upper level arm +system type menu - where it appeared in older kernel versions - when +configuring for the no-MMU case. There is no visible change to the way +versatile is selected for the MMU enabled case. + +Signed-off-by: Greg Ungerer +--- + arch/arm/Kconfig | 13 ++++++++++++- + arch/arm/include/asm/mach/map.h | 1 + + arch/arm/mach-versatile/Kconfig | 2 +- + arch/arm/mach-versatile/versatile.c | 4 ++++ + 4 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-versatile/versatile.c b/arch/arm/mach-versatile/versatile.c +index 02ba68abe533..835b51bc597b 100644 +--- a/arch/arm/mach-versatile/versatile.c ++++ b/arch/arm/mach-versatile/versatile.c +@@ -22,7 +22,11 @@ + #include + + /* macro to get at MMIO space when running virtually */ ++#ifdef CONFIG_MMU + #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) ++#else ++#define IO_ADDRESS(x) (x) ++#endif + #define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n)) + + /* +diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h +index 2b8970d8e5a2..41844ab6aec5 100644 +--- a/arch/arm/include/asm/mach/map.h ++++ b/arch/arm/include/asm/mach/map.h +@@ -60,6 +60,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys, + #else + #define iotable_init(map,num) do { } while (0) + #define vm_reserve_area_early(a,s,c) do { } while (0) ++#define debug_ll_io_init() do { } while (0) + #endif + + #endif +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index e24a9820e12f..342e1efa583a 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -307,12 +307,23 @@ config MMU + Select if you want MMU-based virtualised addressing space + support by paged memory management. If unsure, say 'Y'. + ++choice ++ prompt "ARM system type" ++ depends on !MMU ++ default ARM_SINGLE_ARMV7M ++ + config ARM_SINGLE_ARMV7M +- def_bool !MMU ++ bool "ARMv7-M based platforms (Cortex-M0/M3/M4)" + select ARM_NVIC + select CPU_V7M + select NO_IOPORT_MAP + ++config ARM_SINGLE_ARM926 ++ bool "ARM926 based platforms" ++ select CPU_ARM926T ++ ++endchoice ++ + config ARCH_MMAP_RND_BITS_MIN + default 8 + +diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig +index b1519b4dc03a..2f1bf95daeb0 100644 +--- a/arch/arm/mach-versatile/Kconfig ++++ b/arch/arm/mach-versatile/Kconfig +@@ -1,7 +1,7 @@ + # SPDX-License-Identifier: GPL-2.0 + config ARCH_VERSATILE + bool "ARM Ltd. Versatile family" +- depends on ARCH_MULTI_V5 ++ depends on ARCH_MULTI_V5 || ARM_SINGLE_ARM926 + depends on CPU_LITTLE_ENDIAN + select ARM_AMBA + select ARM_TIMER_SP804 +-- +2.25.1 diff --git a/target/linux/patches/6.6.28/hppa-cross-compile.patch b/target/linux/patches/6.6.28/hppa-cross-compile.patch new file mode 100644 index 000000000..51c24fff2 --- /dev/null +++ b/target/linux/patches/6.6.28/hppa-cross-compile.patch @@ -0,0 +1,12 @@ +diff -Nur linux-6.6.22.orig/arch/parisc/Makefile linux-6.6.22/arch/parisc/Makefile +--- linux-6.6.22.orig/arch/parisc/Makefile 2024-03-15 19:25:07.000000000 +0100 ++++ linux-6.6.22/arch/parisc/Makefile 2024-04-16 03:57:37.515308996 +0200 +@@ -41,7 +41,7 @@ + + # Set default 32 bits cross compilers for vdso + CC_ARCHES_32 = hppa hppa2.0 hppa1.1 +-CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux ++CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux openadk-linux-uclibc + CROSS32_COMPILE := $(call cc-cross-prefix, \ + $(foreach a,$(CC_ARCHES_32), \ + $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-))) diff --git a/target/linux/patches/6.6.28/macsonic.patch b/target/linux/patches/6.6.28/macsonic.patch new file mode 100644 index 000000000..51e76113b --- /dev/null +++ b/target/linux/patches/6.6.28/macsonic.patch @@ -0,0 +1,11 @@ +diff -Nur linux-6.6.22.orig/drivers/net/ethernet/natsemi/Kconfig linux-6.6.22/drivers/net/ethernet/natsemi/Kconfig +--- linux-6.6.22.orig/drivers/net/ethernet/natsemi/Kconfig 2024-03-15 19:25:07.000000000 +0100 ++++ linux-6.6.22/drivers/net/ethernet/natsemi/Kconfig 2024-04-16 10:16:50.352443898 +0200 +@@ -19,6 +19,7 @@ + config MACSONIC + tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)" + depends on MAC ++ select BITREVERSE + help + Support for NatSemi SONIC based Ethernet devices. This includes + the onboard Ethernet in many Quadras as well as some LC-PDS, diff --git a/target/linux/patches/6.6.28/riscv-flat.patch b/target/linux/patches/6.6.28/riscv-flat.patch new file mode 100644 index 000000000..6d26c638f --- /dev/null +++ b/target/linux/patches/6.6.28/riscv-flat.patch @@ -0,0 +1,19 @@ +diff -Nur linux-6.6.22.orig/fs/binfmt_flat.c linux-6.6.22/fs/binfmt_flat.c +--- linux-6.6.22.orig/fs/binfmt_flat.c 2024-03-15 19:25:07.000000000 +0100 ++++ linux-6.6.22/fs/binfmt_flat.c 2024-04-17 15:41:29.292461687 +0200 +@@ -879,6 +879,7 @@ + if (res < 0) + return res; + ++#ifndef CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET + /* Update data segment pointers for all libraries */ + for (i = 0; i < MAX_SHARED_LIBS; i++) { + if (!libinfo.lib_list[i].loaded) +@@ -893,6 +894,7 @@ + return -EFAULT; + } + } ++#endif + + set_binfmt(&flat_format); + -- cgit v1.2.3