diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-13 00:38:46 -0400 |
commit | d864991b220b7c62e81d21209e1fd978fd67352c (patch) | |
tree | b570a1ad6fc1b959c5bcda6ceca0b321319c01e0 /arch/mips/kernel | |
parent | a688c53a0277d8ea21d86a5c56884892e3442c5e (diff) | |
parent | bab5c80b211035739997ebd361a679fa85b39465 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts were easy to resolve using immediate context mostly,
except the cls_u32.c one where I simply too the entire HEAD
chunk.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/process.c | 25 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 48 | ||||
-rw-r--r-- | arch/mips/kernel/vdso.c | 18 |
3 files changed, 70 insertions, 21 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 8fc69891e117..d4f7fd4550e1 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/nmi.h> | 32 | #include <linux/nmi.h> |
33 | #include <linux/cpu.h> | 33 | #include <linux/cpu.h> |
34 | 34 | ||
35 | #include <asm/abi.h> | ||
35 | #include <asm/asm.h> | 36 | #include <asm/asm.h> |
36 | #include <asm/bootinfo.h> | 37 | #include <asm/bootinfo.h> |
37 | #include <asm/cpu.h> | 38 | #include <asm/cpu.h> |
@@ -39,6 +40,7 @@ | |||
39 | #include <asm/dsp.h> | 40 | #include <asm/dsp.h> |
40 | #include <asm/fpu.h> | 41 | #include <asm/fpu.h> |
41 | #include <asm/irq.h> | 42 | #include <asm/irq.h> |
43 | #include <asm/mips-cps.h> | ||
42 | #include <asm/msa.h> | 44 | #include <asm/msa.h> |
43 | #include <asm/pgtable.h> | 45 | #include <asm/pgtable.h> |
44 | #include <asm/mipsregs.h> | 46 | #include <asm/mipsregs.h> |
@@ -645,6 +647,29 @@ out: | |||
645 | return pc; | 647 | return pc; |
646 | } | 648 | } |
647 | 649 | ||
650 | unsigned long mips_stack_top(void) | ||
651 | { | ||
652 | unsigned long top = TASK_SIZE & PAGE_MASK; | ||
653 | |||
654 | /* One page for branch delay slot "emulation" */ | ||
655 | top -= PAGE_SIZE; | ||
656 | |||
657 | /* Space for the VDSO, data page & GIC user page */ | ||
658 | top -= PAGE_ALIGN(current->thread.abi->vdso->size); | ||
659 | top -= PAGE_SIZE; | ||
660 | top -= mips_gic_present() ? PAGE_SIZE : 0; | ||
661 | |||
662 | /* Space for cache colour alignment */ | ||
663 | if (cpu_has_dc_aliases) | ||
664 | top -= shm_align_mask + 1; | ||
665 | |||
666 | /* Space to randomize the VDSO base */ | ||
667 | if (current->flags & PF_RANDOMIZE) | ||
668 | top -= VDSO_RANDOMIZE_SIZE; | ||
669 | |||
670 | return top; | ||
671 | } | ||
672 | |||
648 | /* | 673 | /* |
649 | * Don't forget that the stack pointer must be aligned on a 8 bytes | 674 | * Don't forget that the stack pointer must be aligned on a 8 bytes |
650 | * boundary for 32-bits ABI and 16 bytes for 64-bits ABI. | 675 | * boundary for 32-bits ABI and 16 bytes for 64-bits ABI. |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index c71d1eb7da59..8aaaa42f91ed 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -846,6 +846,34 @@ static void __init arch_mem_init(char **cmdline_p) | |||
846 | struct memblock_region *reg; | 846 | struct memblock_region *reg; |
847 | extern void plat_mem_setup(void); | 847 | extern void plat_mem_setup(void); |
848 | 848 | ||
849 | /* | ||
850 | * Initialize boot_command_line to an innocuous but non-empty string in | ||
851 | * order to prevent early_init_dt_scan_chosen() from copying | ||
852 | * CONFIG_CMDLINE into it without our knowledge. We handle | ||
853 | * CONFIG_CMDLINE ourselves below & don't want to duplicate its | ||
854 | * content because repeating arguments can be problematic. | ||
855 | */ | ||
856 | strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE); | ||
857 | |||
858 | /* call board setup routine */ | ||
859 | plat_mem_setup(); | ||
860 | |||
861 | /* | ||
862 | * Make sure all kernel memory is in the maps. The "UP" and | ||
863 | * "DOWN" are opposite for initdata since if it crosses over | ||
864 | * into another memory section you don't want that to be | ||
865 | * freed when the initdata is freed. | ||
866 | */ | ||
867 | arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT, | ||
868 | PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT, | ||
869 | BOOT_MEM_RAM); | ||
870 | arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT, | ||
871 | PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT, | ||
872 | BOOT_MEM_INIT_RAM); | ||
873 | |||
874 | pr_info("Determined physical RAM map:\n"); | ||
875 | print_memory_map(); | ||
876 | |||
849 | #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) | 877 | #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) |
850 | strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); | 878 | strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); |
851 | #else | 879 | #else |
@@ -873,26 +901,6 @@ static void __init arch_mem_init(char **cmdline_p) | |||
873 | } | 901 | } |
874 | #endif | 902 | #endif |
875 | #endif | 903 | #endif |
876 | |||
877 | /* call board setup routine */ | ||
878 | plat_mem_setup(); | ||
879 | |||
880 | /* | ||
881 | * Make sure all kernel memory is in the maps. The "UP" and | ||
882 | * "DOWN" are opposite for initdata since if it crosses over | ||
883 | * into another memory section you don't want that to be | ||
884 | * freed when the initdata is freed. | ||
885 | */ | ||
886 | arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT, | ||
887 | PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT, | ||
888 | BOOT_MEM_RAM); | ||
889 | arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT, | ||
890 | PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT, | ||
891 | BOOT_MEM_INIT_RAM); | ||
892 | |||
893 | pr_info("Determined physical RAM map:\n"); | ||
894 | print_memory_map(); | ||
895 | |||
896 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | 904 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); |
897 | 905 | ||
898 | *cmdline_p = command_line; | 906 | *cmdline_p = command_line; |
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c index 8f845f6e5f42..48a9c6b90e07 100644 --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/ioport.h> | 15 | #include <linux/ioport.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/random.h> | ||
18 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
19 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
20 | #include <linux/timekeeper_internal.h> | 21 | #include <linux/timekeeper_internal.h> |
@@ -97,6 +98,21 @@ void update_vsyscall_tz(void) | |||
97 | } | 98 | } |
98 | } | 99 | } |
99 | 100 | ||
101 | static unsigned long vdso_base(void) | ||
102 | { | ||
103 | unsigned long base; | ||
104 | |||
105 | /* Skip the delay slot emulation page */ | ||
106 | base = STACK_TOP + PAGE_SIZE; | ||
107 | |||
108 | if (current->flags & PF_RANDOMIZE) { | ||
109 | base += get_random_int() & (VDSO_RANDOMIZE_SIZE - 1); | ||
110 | base = PAGE_ALIGN(base); | ||
111 | } | ||
112 | |||
113 | return base; | ||
114 | } | ||
115 | |||
100 | int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | 116 | int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) |
101 | { | 117 | { |
102 | struct mips_vdso_image *image = current->thread.abi->vdso; | 118 | struct mips_vdso_image *image = current->thread.abi->vdso; |
@@ -137,7 +153,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
137 | if (cpu_has_dc_aliases) | 153 | if (cpu_has_dc_aliases) |
138 | size += shm_align_mask + 1; | 154 | size += shm_align_mask + 1; |
139 | 155 | ||
140 | base = get_unmapped_area(NULL, 0, size, 0, 0); | 156 | base = get_unmapped_area(NULL, vdso_base(), size, 0, 0); |
141 | if (IS_ERR_VALUE(base)) { | 157 | if (IS_ERR_VALUE(base)) { |
142 | ret = base; | 158 | ret = base; |
143 | goto out; | 159 | goto out; |