From 2d0bb30192adea21bafeb40c957d853734a4b205 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 11 Jun 2016 23:40:53 +0200 Subject: linux: bump to 4.5.7 --- .../linux/patches/4.5.4/coldfire-sighandler.patch | 100 --------------------- .../patches/4.5.4/initramfs-nosizelimit.patch | 57 ------------ target/linux/patches/4.5.4/ld-or1k.patch | 12 --- target/linux/patches/4.5.4/startup.patch | 34 ------- .../linux/patches/4.5.7/coldfire-sighandler.patch | 100 +++++++++++++++++++++ .../patches/4.5.7/initramfs-nosizelimit.patch | 57 ++++++++++++ target/linux/patches/4.5.7/ld-or1k.patch | 12 +++ target/linux/patches/4.5.7/startup.patch | 34 +++++++ 8 files changed, 203 insertions(+), 203 deletions(-) delete mode 100644 target/linux/patches/4.5.4/coldfire-sighandler.patch delete mode 100644 target/linux/patches/4.5.4/initramfs-nosizelimit.patch delete mode 100644 target/linux/patches/4.5.4/ld-or1k.patch delete mode 100644 target/linux/patches/4.5.4/startup.patch create mode 100644 target/linux/patches/4.5.7/coldfire-sighandler.patch create mode 100644 target/linux/patches/4.5.7/initramfs-nosizelimit.patch create mode 100644 target/linux/patches/4.5.7/ld-or1k.patch create mode 100644 target/linux/patches/4.5.7/startup.patch (limited to 'target/linux') diff --git a/target/linux/patches/4.5.4/coldfire-sighandler.patch b/target/linux/patches/4.5.4/coldfire-sighandler.patch deleted file mode 100644 index c52a4e228..000000000 --- a/target/linux/patches/4.5.4/coldfire-sighandler.patch +++ /dev/null @@ -1,100 +0,0 @@ -From a95517992a37488c0bc8b629c47c570e580e407d Mon Sep 17 00:00:00 2001 -From: Greg Ungerer -Date: Mon, 15 Feb 2016 16:36:29 +1000 -Subject: m68k: Use conventional function parameters for do_sigreturn - -Create conventional stack parameters for the calls to do_sigreturn and -do_rt_sigreturn. The current C code for do_sigreturn and do_rt_sigreturn -dig into the stack to create local pointers to the saved switch stack -and the pt_regs structs. - -The motivation for this change is a problem with non-MMU targets that -have broken signal return paths on newer versions of gcc. It appears as -though gcc has determined that the pointers into the saved stack structs, -and the saved structs themselves, are function parameters and updates to -them will be lost on function return, so they are optimized away. This -results in large parts of restore_sigcontext() and mangle_kernel_stack() -functions being removed. Of course this results in non-functional code -causing kernel oops. This problem has been observed with gcc version -5.2 and 5.3, and probably exists in earlier versions as well. - -Using conventional stack parameter pointers passed to these functions has -the advantage of the code here not needing to know the exact details of -how the underlying entry handler layed these structs out on the stack. -So the rather ugly pointer setup casting and arg referencing can be -removed. - -The resulting code after this change is a few bytes larger (due to the -overhead of creating the stack args and their tear down). Not being hot -paths I don't think this is too much of a problem here. - -An alternative solution is to put a barrier() in the do_sigreturn() code, -but this doesn't feel quite as clean as this solution. - -This change has been compile tested on all defconfigs, and run tested on -Atari (through aranym), ColdFire with MMU (M5407EVB) and ColdFire with -no-MMU (QEMU and M5208EVB). - -Signed-off-by: Greg Ungerer -Acked-by: Andreas Schwab -Signed-off-by: Geert Uytterhoeven ---- - arch/m68k/kernel/entry.S | 6 ++++++ - arch/m68k/kernel/signal.c | 8 ++------ - 2 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S -index b54ac7a..97cd3ea 100644 ---- a/arch/m68k/kernel/entry.S -+++ b/arch/m68k/kernel/entry.S -@@ -71,13 +71,19 @@ ENTRY(__sys_vfork) - - ENTRY(sys_sigreturn) - SAVE_SWITCH_STACK -+ movel %sp,%sp@- | switch_stack pointer -+ pea %sp@(SWITCH_STACK_SIZE+4) | pt_regs pointer - jbsr do_sigreturn -+ addql #8,%sp - RESTORE_SWITCH_STACK - rts - - ENTRY(sys_rt_sigreturn) - SAVE_SWITCH_STACK -+ movel %sp,%sp@- | switch_stack pointer -+ pea %sp@(SWITCH_STACK_SIZE+4) | pt_regs pointer - jbsr do_rt_sigreturn -+ addql #8,%sp - RESTORE_SWITCH_STACK - rts - -diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c -index af1c4f3..2dcee3a 100644 ---- a/arch/m68k/kernel/signal.c -+++ b/arch/m68k/kernel/signal.c -@@ -737,10 +737,8 @@ badframe: - return 1; - } - --asmlinkage int do_sigreturn(unsigned long __unused) -+asmlinkage int do_sigreturn(struct pt_regs *regs, struct switch_stack *sw) - { -- struct switch_stack *sw = (struct switch_stack *) &__unused; -- struct pt_regs *regs = (struct pt_regs *) (sw + 1); - unsigned long usp = rdusp(); - struct sigframe __user *frame = (struct sigframe __user *)(usp - 4); - sigset_t set; -@@ -764,10 +762,8 @@ badframe: - return 0; - } - --asmlinkage int do_rt_sigreturn(unsigned long __unused) -+asmlinkage int do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw) - { -- struct switch_stack *sw = (struct switch_stack *) &__unused; -- struct pt_regs *regs = (struct pt_regs *) (sw + 1); - unsigned long usp = rdusp(); - struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(usp - 4); - sigset_t set; --- -cgit v0.12 - diff --git a/target/linux/patches/4.5.4/initramfs-nosizelimit.patch b/target/linux/patches/4.5.4/initramfs-nosizelimit.patch deleted file mode 100644 index 40d2f6bd8..000000000 --- a/target/linux/patches/4.5.4/initramfs-nosizelimit.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 9a18df7a71bfa620b1278777d64783a359d7eb4e Mon Sep 17 00:00:00 2001 -From: Thorsten Glaser -Date: Sun, 4 May 2014 01:37:54 +0200 -Subject: [PATCH] mount tmpfs-as-rootfs (initramfs) with -o - nr_blocks=0,nr_inodes=0 - -I would have preferred to write this patch to be able to pass -rootflags=nr_blocks=0,nr_inodes=0 on the kernel command line, -and then hand these rootflags over to the initramfs (tmpfs) -mount in the same way the kernel hands them over to the block -device rootfs mount. But at least the Debian/m68k initrd also -parses $rootflags from the environment and adds it to the call -to the user-space mount for the eventual root device, which -would make the kernel command line rootflags option be used in -both places (tmpfs and e.g. ext4) which is guaranteed to error -out in at least one of them. - -This change is intended to aid people in a setup where the -initrd is the final root filesystem, i.e. not mounted over. -This is especially useful in automated tests running on qemu -for boards with constrained memory (e.g. 64 MiB on sh4). - -Considering that the initramfs is normally emptied out then -overmounted, this change is probably safe for setups where -initramfs just hosts early userspace, too, since the tmpfs -backing it is not accessible any more later on, AFAICT. - -Signed-off-by: Thorsten Glaser ---- - init/do_mounts.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/init/do_mounts.c b/init/do_mounts.c -index 82f2288..55a4cfe 100644 ---- a/init/do_mounts.c -+++ b/init/do_mounts.c -@@ -594,6 +594,7 @@ out: - } - - static bool is_tmpfs; -+static char tmpfs_rootflags[] = "nr_blocks=0,nr_inodes=0"; - static struct dentry *rootfs_mount(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) - { -@@ -606,6 +607,9 @@ static struct dentry *rootfs_mount(struct file_system_type *fs_type, - if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs) - fill = shmem_fill_super; - -+ if (is_tmpfs) -+ data = tmpfs_rootflags; -+ - return mount_nodev(fs_type, flags, data, fill); - } - --- -2.0.0.rc0 - diff --git a/target/linux/patches/4.5.4/ld-or1k.patch b/target/linux/patches/4.5.4/ld-or1k.patch deleted file mode 100644 index 264f9166f..000000000 --- a/target/linux/patches/4.5.4/ld-or1k.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur linux-4.4.5.orig/arch/openrisc/kernel/vmlinux.lds.S linux-4.4.5/arch/openrisc/kernel/vmlinux.lds.S ---- linux-4.4.5.orig/arch/openrisc/kernel/vmlinux.lds.S 2016-03-10 00:35:58.000000000 +0100 -+++ linux-4.4.5/arch/openrisc/kernel/vmlinux.lds.S 2016-03-16 09:21:07.933535532 +0100 -@@ -30,7 +30,7 @@ - #include - #include - --OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32") -+OUTPUT_FORMAT("elf32-or1k", "elf32-or1k", "elf32-or1k") - jiffies = jiffies_64 + 4; - - SECTIONS diff --git a/target/linux/patches/4.5.4/startup.patch b/target/linux/patches/4.5.4/startup.patch deleted file mode 100644 index e54ac19a6..000000000 --- a/target/linux/patches/4.5.4/startup.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -Nur linux-4.4.6.orig/init/initramfs.c linux-4.4.6/init/initramfs.c ---- linux-4.4.6.orig/init/initramfs.c 2016-03-16 16:43:17.000000000 +0100 -+++ linux-4.4.6/init/initramfs.c 2016-03-27 14:15:43.931044532 +0200 -@@ -653,6 +653,9 @@ - */ - load_default_modules(); - } -+#ifdef CONFIG_DEVTMPFS_MOUNT -+ devtmpfs_mount("dev"); -+#endif - return 0; - } - rootfs_initcall(populate_rootfs); -diff -Nur linux-4.4.6.orig/init/main.c linux-4.4.6/init/main.c ---- linux-4.4.6.orig/init/main.c 2016-03-16 16:43:17.000000000 +0100 -+++ linux-4.4.6/init/main.c 2016-03-27 14:15:43.935044783 +0200 -@@ -1011,6 +1011,8 @@ - if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) - pr_err("Warning: unable to open an initial console.\n"); - -+ printk(KERN_WARNING "Starting Linux (built with OpenADK).\n"); -+ - (void) sys_dup(0); - (void) sys_dup(0); - /* -@@ -1019,7 +1021,7 @@ - */ - - if (!ramdisk_execute_command) -- ramdisk_execute_command = "/init"; -+ ramdisk_execute_command = "/sbin/init"; - - if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) { - ramdisk_execute_command = NULL; diff --git a/target/linux/patches/4.5.7/coldfire-sighandler.patch b/target/linux/patches/4.5.7/coldfire-sighandler.patch new file mode 100644 index 000000000..c52a4e228 --- /dev/null +++ b/target/linux/patches/4.5.7/coldfire-sighandler.patch @@ -0,0 +1,100 @@ +From a95517992a37488c0bc8b629c47c570e580e407d Mon Sep 17 00:00:00 2001 +From: Greg Ungerer +Date: Mon, 15 Feb 2016 16:36:29 +1000 +Subject: m68k: Use conventional function parameters for do_sigreturn + +Create conventional stack parameters for the calls to do_sigreturn and +do_rt_sigreturn. The current C code for do_sigreturn and do_rt_sigreturn +dig into the stack to create local pointers to the saved switch stack +and the pt_regs structs. + +The motivation for this change is a problem with non-MMU targets that +have broken signal return paths on newer versions of gcc. It appears as +though gcc has determined that the pointers into the saved stack structs, +and the saved structs themselves, are function parameters and updates to +them will be lost on function return, so they are optimized away. This +results in large parts of restore_sigcontext() and mangle_kernel_stack() +functions being removed. Of course this results in non-functional code +causing kernel oops. This problem has been observed with gcc version +5.2 and 5.3, and probably exists in earlier versions as well. + +Using conventional stack parameter pointers passed to these functions has +the advantage of the code here not needing to know the exact details of +how the underlying entry handler layed these structs out on the stack. +So the rather ugly pointer setup casting and arg referencing can be +removed. + +The resulting code after this change is a few bytes larger (due to the +overhead of creating the stack args and their tear down). Not being hot +paths I don't think this is too much of a problem here. + +An alternative solution is to put a barrier() in the do_sigreturn() code, +but this doesn't feel quite as clean as this solution. + +This change has been compile tested on all defconfigs, and run tested on +Atari (through aranym), ColdFire with MMU (M5407EVB) and ColdFire with +no-MMU (QEMU and M5208EVB). + +Signed-off-by: Greg Ungerer +Acked-by: Andreas Schwab +Signed-off-by: Geert Uytterhoeven +--- + arch/m68k/kernel/entry.S | 6 ++++++ + arch/m68k/kernel/signal.c | 8 ++------ + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S +index b54ac7a..97cd3ea 100644 +--- a/arch/m68k/kernel/entry.S ++++ b/arch/m68k/kernel/entry.S +@@ -71,13 +71,19 @@ ENTRY(__sys_vfork) + + ENTRY(sys_sigreturn) + SAVE_SWITCH_STACK ++ movel %sp,%sp@- | switch_stack pointer ++ pea %sp@(SWITCH_STACK_SIZE+4) | pt_regs pointer + jbsr do_sigreturn ++ addql #8,%sp + RESTORE_SWITCH_STACK + rts + + ENTRY(sys_rt_sigreturn) + SAVE_SWITCH_STACK ++ movel %sp,%sp@- | switch_stack pointer ++ pea %sp@(SWITCH_STACK_SIZE+4) | pt_regs pointer + jbsr do_rt_sigreturn ++ addql #8,%sp + RESTORE_SWITCH_STACK + rts + +diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c +index af1c4f3..2dcee3a 100644 +--- a/arch/m68k/kernel/signal.c ++++ b/arch/m68k/kernel/signal.c +@@ -737,10 +737,8 @@ badframe: + return 1; + } + +-asmlinkage int do_sigreturn(unsigned long __unused) ++asmlinkage int do_sigreturn(struct pt_regs *regs, struct switch_stack *sw) + { +- struct switch_stack *sw = (struct switch_stack *) &__unused; +- struct pt_regs *regs = (struct pt_regs *) (sw + 1); + unsigned long usp = rdusp(); + struct sigframe __user *frame = (struct sigframe __user *)(usp - 4); + sigset_t set; +@@ -764,10 +762,8 @@ badframe: + return 0; + } + +-asmlinkage int do_rt_sigreturn(unsigned long __unused) ++asmlinkage int do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw) + { +- struct switch_stack *sw = (struct switch_stack *) &__unused; +- struct pt_regs *regs = (struct pt_regs *) (sw + 1); + unsigned long usp = rdusp(); + struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(usp - 4); + sigset_t set; +-- +cgit v0.12 + diff --git a/target/linux/patches/4.5.7/initramfs-nosizelimit.patch b/target/linux/patches/4.5.7/initramfs-nosizelimit.patch new file mode 100644 index 000000000..40d2f6bd8 --- /dev/null +++ b/target/linux/patches/4.5.7/initramfs-nosizelimit.patch @@ -0,0 +1,57 @@ +From 9a18df7a71bfa620b1278777d64783a359d7eb4e Mon Sep 17 00:00:00 2001 +From: Thorsten Glaser +Date: Sun, 4 May 2014 01:37:54 +0200 +Subject: [PATCH] mount tmpfs-as-rootfs (initramfs) with -o + nr_blocks=0,nr_inodes=0 + +I would have preferred to write this patch to be able to pass +rootflags=nr_blocks=0,nr_inodes=0 on the kernel command line, +and then hand these rootflags over to the initramfs (tmpfs) +mount in the same way the kernel hands them over to the block +device rootfs mount. But at least the Debian/m68k initrd also +parses $rootflags from the environment and adds it to the call +to the user-space mount for the eventual root device, which +would make the kernel command line rootflags option be used in +both places (tmpfs and e.g. ext4) which is guaranteed to error +out in at least one of them. + +This change is intended to aid people in a setup where the +initrd is the final root filesystem, i.e. not mounted over. +This is especially useful in automated tests running on qemu +for boards with constrained memory (e.g. 64 MiB on sh4). + +Considering that the initramfs is normally emptied out then +overmounted, this change is probably safe for setups where +initramfs just hosts early userspace, too, since the tmpfs +backing it is not accessible any more later on, AFAICT. + +Signed-off-by: Thorsten Glaser +--- + init/do_mounts.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/init/do_mounts.c b/init/do_mounts.c +index 82f2288..55a4cfe 100644 +--- a/init/do_mounts.c ++++ b/init/do_mounts.c +@@ -594,6 +594,7 @@ out: + } + + static bool is_tmpfs; ++static char tmpfs_rootflags[] = "nr_blocks=0,nr_inodes=0"; + static struct dentry *rootfs_mount(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data) + { +@@ -606,6 +607,9 @@ static struct dentry *rootfs_mount(struct file_system_type *fs_type, + if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs) + fill = shmem_fill_super; + ++ if (is_tmpfs) ++ data = tmpfs_rootflags; ++ + return mount_nodev(fs_type, flags, data, fill); + } + +-- +2.0.0.rc0 + diff --git a/target/linux/patches/4.5.7/ld-or1k.patch b/target/linux/patches/4.5.7/ld-or1k.patch new file mode 100644 index 000000000..264f9166f --- /dev/null +++ b/target/linux/patches/4.5.7/ld-or1k.patch @@ -0,0 +1,12 @@ +diff -Nur linux-4.4.5.orig/arch/openrisc/kernel/vmlinux.lds.S linux-4.4.5/arch/openrisc/kernel/vmlinux.lds.S +--- linux-4.4.5.orig/arch/openrisc/kernel/vmlinux.lds.S 2016-03-10 00:35:58.000000000 +0100 ++++ linux-4.4.5/arch/openrisc/kernel/vmlinux.lds.S 2016-03-16 09:21:07.933535532 +0100 +@@ -30,7 +30,7 @@ + #include + #include + +-OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32") ++OUTPUT_FORMAT("elf32-or1k", "elf32-or1k", "elf32-or1k") + jiffies = jiffies_64 + 4; + + SECTIONS diff --git a/target/linux/patches/4.5.7/startup.patch b/target/linux/patches/4.5.7/startup.patch new file mode 100644 index 000000000..e54ac19a6 --- /dev/null +++ b/target/linux/patches/4.5.7/startup.patch @@ -0,0 +1,34 @@ +diff -Nur linux-4.4.6.orig/init/initramfs.c linux-4.4.6/init/initramfs.c +--- linux-4.4.6.orig/init/initramfs.c 2016-03-16 16:43:17.000000000 +0100 ++++ linux-4.4.6/init/initramfs.c 2016-03-27 14:15:43.931044532 +0200 +@@ -653,6 +653,9 @@ + */ + load_default_modules(); + } ++#ifdef CONFIG_DEVTMPFS_MOUNT ++ devtmpfs_mount("dev"); ++#endif + return 0; + } + rootfs_initcall(populate_rootfs); +diff -Nur linux-4.4.6.orig/init/main.c linux-4.4.6/init/main.c +--- linux-4.4.6.orig/init/main.c 2016-03-16 16:43:17.000000000 +0100 ++++ linux-4.4.6/init/main.c 2016-03-27 14:15:43.935044783 +0200 +@@ -1011,6 +1011,8 @@ + if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) + pr_err("Warning: unable to open an initial console.\n"); + ++ printk(KERN_WARNING "Starting Linux (built with OpenADK).\n"); ++ + (void) sys_dup(0); + (void) sys_dup(0); + /* +@@ -1019,7 +1021,7 @@ + */ + + if (!ramdisk_execute_command) +- ramdisk_execute_command = "/init"; ++ ramdisk_execute_command = "/sbin/init"; + + if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) { + ramdisk_execute_command = NULL; -- cgit v1.2.3