Pull MIPS updates from Ralf Baechle: "This week's round of MIPS fixes: - Fix JZ4740 build - Fix fallback to GFP_DMA - FP seccomp in case of ENOSYS - Fix bootmem panic - A number of FP and CPS fixes - Wire up new syscalls - Make sure BPF assembler objects can properly be disassembled - Fix BPF assembler code for MIPS I" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: scall: Always run the seccomp syscall filters MIPS: Octeon: Fix kernel panic on startup from memory corruption MIPS: Fix R2300 FP context switch handling MIPS: Fix octeon FP context switch handling MIPS: BPF: Fix load delay slots. MIPS: BPF: Do all exports of symbols with FEXPORT(). MIPS: Fix the build on jz4740 after removing the custom gpio.h MIPS: CPS: #ifdef on CONFIG_MIPS_MT_SMP rather than CONFIG_MIPS_MT MIPS: CPS: Don't include MT code in non-MT kernels. MIPS: CPS: Stop dangling delay slot from has_mt. MIPS: dma-default: Fix 32-bit fall back to GFP_DMA MIPS: Wire up userfaultfd and membarrier syscalls.
Unified · Split
| @@ -933,7 +933,7 @@ void __init plat_mem_setup(void) · 932 unmodified lines | ||
| 933 | 933 | while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX) |
| 934 | 934 | && (total < MAX_MEMORY)) { |
| 935 | 935 | memory = cvmx_bootmem_phy_alloc(mem_alloc_size, |
| 936 | − __pa_symbol(&__init_end), -1, | |
| 936 | + __pa_symbol(&_end), -1, | |
| 937 | 937 | 0x100000, |
| 938 | 938 | CVMX_BOOTMEM_FLAG_NO_LOCKING); |
| 939 | 939 | if (memory >= 0) { |
| @@ -377,16 +377,18 @@ · 376 unmodified lines | ||
| 377 | 377 | #define __NR_memfd_create (__NR_Linux + 354) |
| 378 | 378 | #define __NR_bpf (__NR_Linux + 355) |
| 379 | 379 | #define __NR_execveat (__NR_Linux + 356) |
| 380 | +#define __NR_userfaultfd (__NR_Linux + 357) | |
| 381 | +#define __NR_membarrier (__NR_Linux + 358) | |
| 380 | 382 | |
| 381 | 383 | /* |
| 382 | 384 | * Offset of the last Linux o32 flavoured syscall |
| 383 | 385 | */ |
| 384 | −#define __NR_Linux_syscalls 356 | |
| 386 | +#define __NR_Linux_syscalls 358 | |
| 385 | 387 | |
| 386 | 388 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
| 387 | 389 | |
| 388 | 390 | #define __NR_O32_Linux 4000 |
| 389 | −#define __NR_O32_Linux_syscalls 356 | |
| 391 | +#define __NR_O32_Linux_syscalls 358 | |
| 390 | 392 | |
| 391 | 393 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
| 392 | 394 | |
| @@ -711,16 +713,18 @@ · 318 unmodified lines | ||
| 711 | 713 | #define __NR_memfd_create (__NR_Linux + 314) |
| 712 | 714 | #define __NR_bpf (__NR_Linux + 315) |
| 713 | 715 | #define __NR_execveat (__NR_Linux + 316) |
| 716 | +#define __NR_userfaultfd (__NR_Linux + 317) | |
| 717 | +#define __NR_membarrier (__NR_Linux + 318) | |
| 714 | 718 | |
| 715 | 719 | /* |
| 716 | 720 | * Offset of the last Linux 64-bit flavoured syscall |
| 717 | 721 | */ |
| 718 | −#define __NR_Linux_syscalls 316 | |
| 722 | +#define __NR_Linux_syscalls 318 | |
| 719 | 723 | |
| 720 | 724 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
| 721 | 725 | |
| 722 | 726 | #define __NR_64_Linux 5000 |
| 723 | −#define __NR_64_Linux_syscalls 316 | |
| 727 | +#define __NR_64_Linux_syscalls 318 | |
| 724 | 728 | |
| 725 | 729 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
| 726 | 730 | |
| @@ -1049,15 +1053,17 @@ · 322 unmodified lines | ||
| 1049 | 1053 | #define __NR_memfd_create (__NR_Linux + 318) |
| 1050 | 1054 | #define __NR_bpf (__NR_Linux + 319) |
| 1051 | 1055 | #define __NR_execveat (__NR_Linux + 320) |
| 1056 | +#define __NR_userfaultfd (__NR_Linux + 321) | |
| 1057 | +#define __NR_membarrier (__NR_Linux + 322) | |
| 1052 | 1058 | |
| 1053 | 1059 | /* |
| 1054 | 1060 | * Offset of the last N32 flavoured syscall |
| 1055 | 1061 | */ |
| 1056 | −#define __NR_Linux_syscalls 320 | |
| 1062 | +#define __NR_Linux_syscalls 322 | |
| 1057 | 1063 | |
| 1058 | 1064 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
| 1059 | 1065 | |
| 1060 | 1066 | #define __NR_N32_Linux 6000 |
| 1061 | −#define __NR_N32_Linux_syscalls 320 | |
| 1067 | +#define __NR_N32_Linux_syscalls 322 | |
| 1062 | 1068 | |
| 1063 | 1069 | #endif /* _UAPI_ASM_UNISTD_H */ |
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <linux/power/jz4740-battery.h> |
| 27 | 27 | #include <linux/power/gpio-charger.h> |
| 28 | 28 | |
| 29 | +#include <asm/mach-jz4740/gpio.h> | |
| 29 | 30 | #include <asm/mach-jz4740/jz4740_fb.h> |
| 30 | 31 | #include <asm/mach-jz4740/jz4740_mmc.h> |
| 31 | 32 | #include <asm/mach-jz4740/jz4740_nand.h> |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/seq_file.h> |
| 29 | 29 | |
| 30 | 30 | #include <asm/mach-jz4740/base.h> |
| 31 | +#include <asm/mach-jz4740/gpio.h> | |
| 31 | 32 | |
| 32 | 33 | #define JZ4740_GPIO_BASE_A (32*0) |
| 33 | 34 | #define JZ4740_GPIO_BASE_B (32*1) |
| @@ -39,6 +39,7 @@ · 38 unmodified lines | ||
| 39 | 39 | mfc0 \dest, CP0_CONFIG, 3 |
| 40 | 40 | andi \dest, \dest, MIPS_CONF3_MT |
| 41 | 41 | beqz \dest, \nomt |
| 42 | + nop | |
| 42 | 43 | .endm |
| 43 | 44 | |
| 44 | 45 | .section .text.cps-vec |
| @@ -223,10 +224,9 @@ LEAF(excep_ejtag) · 178 unmodified lines | ||
| 223 | 224 | END(excep_ejtag) |
| 224 | 225 | |
| 225 | 226 | LEAF(mips_cps_core_init) |
| 226 | −#ifdef CONFIG_MIPS_MT | |
| 227 | +#ifdef CONFIG_MIPS_MT_SMP | |
| 227 | 228 | /* Check that the core implements the MT ASE */ |
| 228 | 229 | has_mt t0, 3f |
| 229 | − nop | |
| 230 | 230 | |
| 231 | 231 | .set push |
| 232 | 232 | .set mips64r2 |
| @@ -310,8 +310,9 @@ LEAF(mips_cps_boot_vpes) · 77 unmodified lines | ||
| 310 | 310 | PTR_ADDU t0, t0, t1 |
| 311 | 311 | |
| 312 | 312 | /* Calculate this VPEs ID. If the core doesn't support MT use 0 */ |
| 313 | + li t9, 0 | |
| 314 | +#ifdef CONFIG_MIPS_MT_SMP | |
| 313 | 315 | has_mt ta2, 1f |
| 314 | − li t9, 0 | |
| 315 | 316 | |
| 316 | 317 | /* Find the number of VPEs present in the core */ |
| 317 | 318 | mfc0 t1, CP0_MVPCONF0 |
| @@ -330,6 +331,7 @@ LEAF(mips_cps_boot_vpes) · 12 unmodified lines | ||
| 330 | 331 | /* Retrieve the VPE ID from EBase.CPUNum */ |
| 331 | 332 | mfc0 t9, $15, 1 |
| 332 | 333 | and t9, t9, t1 |
| 334 | +#endif | |
| 333 | 335 | |
| 334 | 336 | 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */ |
| 335 | 337 | li t1, VPEBOOTCFG_SIZE |
| @@ -337,7 +339,7 @@ LEAF(mips_cps_boot_vpes) · 1 unmodified line | ||
| 337 | 339 | PTR_L ta3, COREBOOTCFG_VPECONFIG(t0) |
| 338 | 340 | PTR_ADDU v0, v0, ta3 |
| 339 | 341 | |
| 340 | −#ifdef CONFIG_MIPS_MT | |
| 342 | +#ifdef CONFIG_MIPS_MT_SMP | |
| 341 | 343 | |
| 342 | 344 | /* If the core doesn't support MT then return */ |
| 343 | 345 | bnez ta2, 1f |
| @@ -451,7 +453,7 @@ LEAF(mips_cps_boot_vpes) · 107 unmodified lines | ||
| 451 | 453 | |
| 452 | 454 | 2: .set pop |
| 453 | 455 | |
| 454 | −#endif /* CONFIG_MIPS_MT */ | |
| 456 | +#endif /* CONFIG_MIPS_MT_SMP */ | |
| 455 | 457 | |
| 456 | 458 | /* Return */ |
| 457 | 459 | jr ra |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | .set pop |
| 19 | 19 | /* |
| 20 | 20 | * task_struct *resume(task_struct *prev, task_struct *next, |
| 21 | − * struct thread_info *next_ti, int usedfpu) | |
| 21 | + * struct thread_info *next_ti) | |
| 22 | 22 | */ |
| 23 | 23 | .align 7 |
| 24 | 24 | LEAF(resume) |
| @@ -28,30 +28,6 @@ · 3 unmodified lines | ||
| 28 | 28 | cpu_save_nonscratch a0 |
| 29 | 29 | LONG_S ra, THREAD_REG31(a0) |
| 30 | 30 | |
| 31 | − /* | |
| 32 | − * check if we need to save FPU registers | |
| 33 | − */ | |
| 34 | − .set push | |
| 35 | − .set noreorder | |
| 36 | − beqz a3, 1f | |
| 37 | − PTR_L t3, TASK_THREAD_INFO(a0) | |
| 38 | − .set pop | |
| 39 | − | |
| 40 | − /* | |
| 41 | − * clear saved user stack CU1 bit | |
| 42 | − */ | |
| 43 | − LONG_L t0, ST_OFF(t3) | |
| 44 | − li t1, ~ST0_CU1 | |
| 45 | − and t0, t0, t1 | |
| 46 | − LONG_S t0, ST_OFF(t3) | |
| 47 | − | |
| 48 | − .set push | |
| 49 | − .set arch=mips64r2 | |
| 50 | − fpu_save_double a0 t0 t1 # c0_status passed in t0 | |
| 51 | − # clobbers t1 | |
| 52 | − .set pop | |
| 53 | −1: | |
| 54 | − | |
| 55 | 31 | #if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0 |
| 56 | 32 | /* Check if we need to store CVMSEG state */ |
| 57 | 33 | dmfc0 t0, $11,7 /* CvmMemCtl */ |
| @@ -30,19 +30,9 @@ · 29 unmodified lines | ||
| 30 | 30 | */ |
| 31 | 31 | #define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS) |
| 32 | 32 | |
| 33 | −/* | |
| 34 | − * FPU context is saved iff the process has used it's FPU in the current | |
| 35 | − * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user | |
| 36 | − * space STATUS register should be 0, so that a process *always* starts its | |
| 37 | − * userland with FPU disabled after each context switch. | |
| 38 | − * | |
| 39 | − * FPU will be enabled as soon as the process accesses FPU again, through | |
| 40 | − * do_cpu() trap. | |
| 41 | − */ | |
| 42 | − | |
| 43 | 33 | /* |
| 44 | 34 | * task_struct *resume(task_struct *prev, task_struct *next, |
| 45 | − * struct thread_info *next_ti, int usedfpu) | |
| 35 | + * struct thread_info *next_ti) | |
| 46 | 36 | */ |
| 47 | 37 | LEAF(resume) |
| 48 | 38 | mfc0 t1, CP0_STATUS |
| @@ -50,22 +40,6 @@ LEAF(resume) · 1 unmodified line | ||
| 50 | 40 | cpu_save_nonscratch a0 |
| 51 | 41 | sw ra, THREAD_REG31(a0) |
| 52 | 42 | |
| 53 | − beqz a3, 1f | |
| 54 | − | |
| 55 | − PTR_L t3, TASK_THREAD_INFO(a0) | |
| 56 | − | |
| 57 | − /* | |
| 58 | − * clear saved user stack CU1 bit | |
| 59 | − */ | |
| 60 | − lw t0, ST_OFF(t3) | |
| 61 | − li t1, ~ST0_CU1 | |
| 62 | − and t0, t0, t1 | |
| 63 | − sw t0, ST_OFF(t3) | |
| 64 | − | |
| 65 | − fpu_save_single a0, t0 # clobbers t0 | |
| 66 | − | |
| 67 | −1: | |
| 68 | − | |
| 69 | 43 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) |
| 70 | 44 | PTR_LA t8, __stack_chk_guard |
| 71 | 45 | LONG_L t9, TASK_STACK_CANARY(a1) |
| @@ -36,16 +36,8 @@ NESTED(handle_sys, PT_SIZE, sp) · 35 unmodified lines | ||
| 36 | 36 | lw t1, PT_EPC(sp) # skip syscall on return |
| 37 | 37 | |
| 38 | 38 | subu v0, v0, __NR_O32_Linux # check syscall number |
| 39 | − sltiu t0, v0, __NR_O32_Linux_syscalls + 1 | |
| 40 | 39 | addiu t1, 4 # skip to next instruction |
| 41 | 40 | sw t1, PT_EPC(sp) |
| 42 | − beqz t0, illegal_syscall | |
| 43 | − | |
| 44 | − sll t0, v0, 2 | |
| 45 | − la t1, sys_call_table | |
| 46 | − addu t1, t0 | |
| 47 | − lw t2, (t1) # syscall routine | |
| 48 | − beqz t2, illegal_syscall | |
| 49 | 41 | |
| 50 | 42 | sw a3, PT_R26(sp) # save a3 for syscall restarting |
| 51 | 43 | |
| @@ -96,6 +88,16 @@ loads_done: · 44 unmodified lines | ||
| 96 | 88 | li t1, _TIF_WORK_SYSCALL_ENTRY |
| 97 | 89 | and t0, t1 |
| 98 | 90 | bnez t0, syscall_trace_entry # -> yes |
| 91 | +syscall_common: | |
| 92 | + sltiu t0, v0, __NR_O32_Linux_syscalls + 1 | |
| 93 | + beqz t0, illegal_syscall | |
| 94 | + | |
| 95 | + sll t0, v0, 2 | |
| 96 | + la t1, sys_call_table | |
| 97 | + addu t1, t0 | |
| 98 | + lw t2, (t1) # syscall routine | |
| 99 | + | |
| 100 | + beqz t2, illegal_syscall | |
| 99 | 101 | |
| 100 | 102 | jalr t2 # Do The Real Thing (TM) |
| 101 | 103 | |
| @@ -116,7 +118,7 @@ o32_syscall_exit: · 14 unmodified lines | ||
| 116 | 118 | |
| 117 | 119 | syscall_trace_entry: |
| 118 | 120 | SAVE_STATIC |
| 119 | − move s0, t2 | |
| 121 | + move s0, v0 | |
| 120 | 122 | move a0, sp |
| 121 | 123 | |
| 122 | 124 | /* |
| @@ -129,27 +131,18 @@ syscall_trace_entry: · 6 unmodified lines | ||
| 129 | 131 | |
| 130 | 132 | 1: jal syscall_trace_enter |
| 131 | 133 | |
| 132 | − bltz v0, 2f # seccomp failed? Skip syscall | |
| 134 | + bltz v0, 1f # seccomp failed? Skip syscall | |
| 135 | + | |
| 136 | + move v0, s0 # restore syscall | |
| 133 | 137 | |
| 134 | − move t0, s0 | |
| 135 | 138 | RESTORE_STATIC |
| 136 | 139 | lw a0, PT_R4(sp) # Restore argument registers |
| 137 | 140 | lw a1, PT_R5(sp) |
| 138 | 141 | lw a2, PT_R6(sp) |
| 139 | 142 | lw a3, PT_R7(sp) |
| 140 | − jalr t0 | |
| 141 | − | |
| 142 | − li t0, -EMAXERRNO - 1 # error? | |
| 143 | − sltu t0, t0, v0 | |
| 144 | − sw t0, PT_R7(sp) # set error flag | |
| 145 | − beqz t0, 1f | |
| 146 | − | |
| 147 | − lw t1, PT_R2(sp) # syscall number | |
| 148 | − negu v0 # error | |
| 149 | − sw t1, PT_R0(sp) # save it for syscall restarting | |
| 150 | −1: sw v0, PT_R2(sp) # result | |
| 143 | + j syscall_common | |
| 151 | 144 | |
| 152 | −2: j syscall_exit | |
| 145 | +1: j syscall_exit | |
| 153 | 146 | |
| 154 | 147 | /* ------------------------------------------------------------------------ */ |
| 155 | 148 | |
| @@ -599,3 +592,5 @@ EXPORT(sys_call_table) · 443 unmodified lines | ||
| 599 | 592 | PTR sys_memfd_create |
| 600 | 593 | PTR sys_bpf /* 4355 */ |
| 601 | 594 | PTR sys_execveat |
| 595 | + PTR sys_userfaultfd | |
| 596 | + PTR sys_membarrier | |
| @@ -39,18 +39,11 @@ NESTED(handle_sys64, PT_SIZE, sp) · 38 unmodified lines | ||
| 39 | 39 | .set at |
| 40 | 40 | #endif |
| 41 | 41 | |
| 42 | − dsubu t0, v0, __NR_64_Linux # check syscall number | |
| 43 | − sltiu t0, t0, __NR_64_Linux_syscalls + 1 | |
| 44 | 42 | #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32) |
| 45 | 43 | ld t1, PT_EPC(sp) # skip syscall on return |
| 46 | 44 | daddiu t1, 4 # skip to next instruction |
| 47 | 45 | sd t1, PT_EPC(sp) |
| 48 | 46 | #endif |
| 49 | − beqz t0, illegal_syscall | |
| 50 | − | |
| 51 | − dsll t0, v0, 3 # offset into table | |
| 52 | − ld t2, (sys_call_table - (__NR_64_Linux * 8))(t0) | |
| 53 | − # syscall routine | |
| 54 | 47 | |
| 55 | 48 | sd a3, PT_R26(sp) # save a3 for syscall restarting |
| 56 | 49 | |
| @@ -59,6 +52,17 @@ NESTED(handle_sys64, PT_SIZE, sp) · 2 unmodified lines | ||
| 59 | 52 | and t0, t1, t0 |
| 60 | 53 | bnez t0, syscall_trace_entry |
| 61 | 54 | |
| 55 | +syscall_common: | |
| 56 | + dsubu t2, v0, __NR_64_Linux | |
| 57 | + sltiu t0, t2, __NR_64_Linux_syscalls + 1 | |
| 58 | + beqz t0, illegal_syscall | |
| 59 | + | |
| 60 | + dsll t0, t2, 3 # offset into table | |
| 61 | + dla t2, sys_call_table | |
| 62 | + daddu t0, t2, t0 | |
| 63 | + ld t2, (t0) # syscall routine | |
| 64 | + beqz t2, illegal_syscall | |
| 65 | + | |
| 62 | 66 | jalr t2 # Do The Real Thing (TM) |
| 63 | 67 | |
| 64 | 68 | li t0, -EMAXERRNO - 1 # error? |
| @@ -78,14 +82,14 @@ n64_syscall_exit: · 13 unmodified lines | ||
| 78 | 82 | |
| 79 | 83 | syscall_trace_entry: |
| 80 | 84 | SAVE_STATIC |
| 81 | − move s0, t2 | |
| 85 | + move s0, v0 | |
| 82 | 86 | move a0, sp |
| 83 | 87 | move a1, v0 |
| 84 | 88 | jal syscall_trace_enter |
| 85 | 89 | |
| 86 | − bltz v0, 2f # seccomp failed? Skip syscall | |
| 90 | + bltz v0, 1f # seccomp failed? Skip syscall | |
| 87 | 91 | |
| 88 | − move t0, s0 | |
| 92 | + move v0, s0 | |
| 89 | 93 | RESTORE_STATIC |
| 90 | 94 | ld a0, PT_R4(sp) # Restore argument registers |
| 91 | 95 | ld a1, PT_R5(sp) |
| @@ -93,19 +97,9 @@ syscall_trace_entry: · 1 unmodified line | ||
| 93 | 97 | ld a3, PT_R7(sp) |
| 94 | 98 | ld a4, PT_R8(sp) |
| 95 | 99 | ld a5, PT_R9(sp) |
| 96 | − jalr t0 | |
| 97 | − | |
| 98 | − li t0, -EMAXERRNO - 1 # error? | |
| 99 | − sltu t0, t0, v0 | |
| 100 | − sd t0, PT_R7(sp) # set error flag | |
| 101 | − beqz t0, 1f | |
| 102 | − | |
| 103 | − ld t1, PT_R2(sp) # syscall number | |
| 104 | − dnegu v0 # error | |
| 105 | − sd t1, PT_R0(sp) # save it for syscall restarting | |
| 106 | −1: sd v0, PT_R2(sp) # result | |
| 100 | + j syscall_common | |
| 107 | 101 | |
| 108 | −2: j syscall_exit | |
| 102 | +1: j syscall_exit | |
| 109 | 103 | |
| 110 | 104 | illegal_syscall: |
| 111 | 105 | /* This also isn't a 64-bit syscall, throw an error. */ |
| @@ -436,4 +430,6 @@ EXPORT(sys_call_table) · 324 unmodified lines | ||
| 436 | 430 | PTR sys_memfd_create |
| 437 | 431 | PTR sys_bpf /* 5315 */ |
| 438 | 432 | PTR sys_execveat |
| 433 | + PTR sys_userfaultfd | |
| 434 | + PTR sys_membarrier | |
| 439 | 435 | .size sys_call_table,.-sys_call_table |
| @@ -52,6 +52,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) · 51 unmodified lines | ||
| 52 | 52 | and t0, t1, t0 |
| 53 | 53 | bnez t0, n32_syscall_trace_entry |
| 54 | 54 | |
| 55 | +syscall_common: | |
| 55 | 56 | jalr t2 # Do The Real Thing (TM) |
| 56 | 57 | |
| 57 | 58 | li t0, -EMAXERRNO - 1 # error? |
| @@ -75,9 +76,9 @@ n32_syscall_trace_entry: · 17 unmodified lines | ||
| 75 | 76 | move a1, v0 |
| 76 | 77 | jal syscall_trace_enter |
| 77 | 78 | |
| 78 | − bltz v0, 2f # seccomp failed? Skip syscall | |
| 79 | + bltz v0, 1f # seccomp failed? Skip syscall | |
| 79 | 80 | |
| 80 | − move t0, s0 | |
| 81 | + move t2, s0 | |
| 81 | 82 | RESTORE_STATIC |
| 82 | 83 | ld a0, PT_R4(sp) # Restore argument registers |
| 83 | 84 | ld a1, PT_R5(sp) |
| @@ -85,19 +86,9 @@ n32_syscall_trace_entry: · 1 unmodified line | ||
| 85 | 86 | ld a3, PT_R7(sp) |
| 86 | 87 | ld a4, PT_R8(sp) |
| 87 | 88 | ld a5, PT_R9(sp) |
| 88 | − jalr t0 | |
| 89 | + j syscall_common | |
| 89 | 90 | |
| 90 | − li t0, -EMAXERRNO - 1 # error? | |
| 91 | − sltu t0, t0, v0 | |
| 92 | − sd t0, PT_R7(sp) # set error flag | |
| 93 | − beqz t0, 1f | |
| 94 | − | |
| 95 | − ld t1, PT_R2(sp) # syscall number | |
| 96 | − dnegu v0 # error | |
| 97 | − sd t1, PT_R0(sp) # save it for syscall restarting | |
| 98 | −1: sd v0, PT_R2(sp) # result | |
| 99 | − | |
| 100 | −2: j syscall_exit | |
| 91 | +1: j syscall_exit | |
| 101 | 92 | |
| 102 | 93 | not_n32_scall: |
| 103 | 94 | /* This is not an n32 compatibility syscall, pass it on to |
| @@ -429,4 +420,6 @@ EXPORT(sysn32_call_table) · 325 unmodified lines | ||
| 429 | 420 | PTR sys_memfd_create |
| 430 | 421 | PTR sys_bpf |
| 431 | 422 | PTR compat_sys_execveat /* 6320 */ |
| 423 | + PTR sys_userfaultfd | |
| 424 | + PTR sys_membarrier | |
| 432 | 425 | .size sysn32_call_table,.-sysn32_call_table |
| @@ -87,6 +87,7 @@ loads_done: · 86 unmodified lines | ||
| 87 | 87 | and t0, t1, t0 |
| 88 | 88 | bnez t0, trace_a_syscall |
| 89 | 89 | |
| 90 | +syscall_common: | |
| 90 | 91 | jalr t2 # Do The Real Thing (TM) |
| 91 | 92 | |
| 92 | 93 | li t0, -EMAXERRNO - 1 # error? |
| @@ -130,9 +131,9 @@ trace_a_syscall: · 37 unmodified lines | ||
| 130 | 131 | |
| 131 | 132 | 1: jal syscall_trace_enter |
| 132 | 133 | |
| 133 | − bltz v0, 2f # seccomp failed? Skip syscall | |
| 134 | + bltz v0, 1f # seccomp failed? Skip syscall | |
| 134 | 135 | |
| 135 | − move t0, s0 | |
| 136 | + move t2, s0 | |
| 136 | 137 | RESTORE_STATIC |
| 137 | 138 | ld a0, PT_R4(sp) # Restore argument registers |
| 138 | 139 | ld a1, PT_R5(sp) |
| @@ -142,19 +143,9 @@ trace_a_syscall: · 3 unmodified lines | ||
| 142 | 143 | ld a5, PT_R9(sp) |
| 143 | 144 | ld a6, PT_R10(sp) |
| 144 | 145 | ld a7, PT_R11(sp) # For indirect syscalls |
| 145 | − jalr t0 | |
| 146 | + j syscall_common | |
| 146 | 147 | |
| 147 | − li t0, -EMAXERRNO - 1 # error? | |
| 148 | − sltu t0, t0, v0 | |
| 149 | − sd t0, PT_R7(sp) # set error flag | |
| 150 | − beqz t0, 1f | |
| 151 | − | |
| 152 | − ld t1, PT_R2(sp) # syscall number | |
| 153 | − dnegu v0 # error | |
| 154 | − sd t1, PT_R0(sp) # save it for syscall restarting | |
| 155 | −1: sd v0, PT_R2(sp) # result | |
| 156 | − | |
| 157 | −2: j syscall_exit | |
| 148 | +1: j syscall_exit | |
| 158 | 149 | |
| 159 | 150 | /* ------------------------------------------------------------------------ */ |
| 160 | 151 | |
| @@ -584,4 +575,6 @@ EXPORT(sys32_call_table) · 423 unmodified lines | ||
| 584 | 575 | PTR sys_memfd_create |
| 585 | 576 | PTR sys_bpf /* 4355 */ |
| 586 | 577 | PTR compat_sys_execveat |
| 578 | + PTR sys_userfaultfd | |
| 579 | + PTR sys_membarrier | |
| 587 | 580 | .size sys32_call_table,.-sys32_call_table |
| @@ -100,7 +100,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) · 99 unmodified lines | ||
| 100 | 100 | else |
| 101 | 101 | #endif |
| 102 | 102 | #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32) |
| 103 | − if (dev->coherent_dma_mask < DMA_BIT_MASK(64)) | |
| 103 | + if (dev->coherent_dma_mask < DMA_BIT_MASK(sizeof(phys_addr_t) * 8)) | |
| 104 | 104 | dma_flag = __GFP_DMA; |
| 105 | 105 | else |
| 106 | 106 | #endif |
| @@ -57,12 +57,13 @@ · 56 unmodified lines | ||
| 57 | 57 | |
| 58 | 58 | LEAF(sk_load_word) |
| 59 | 59 | is_offset_negative(word) |
| 60 | − .globl sk_load_word_positive | |
| 61 | −sk_load_word_positive: | |
| 60 | +FEXPORT(sk_load_word_positive) | |
| 62 | 61 | is_offset_in_header(4, word) |
| 63 | 62 | /* Offset within header boundaries */ |
| 64 | 63 | PTR_ADDU t1, $r_skb_data, offset |
| 64 | + .set reorder | |
| 65 | 65 | lw $r_A, 0(t1) |
| 66 | + .set noreorder | |
| 66 | 67 | #ifdef CONFIG_CPU_LITTLE_ENDIAN |
| 67 | 68 | # if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) |
| 68 | 69 | wsbh t0, $r_A |
| @@ -85,12 +86,13 @@ sk_load_word_positive: · 16 unmodified lines | ||
| 85 | 86 | |
| 86 | 87 | LEAF(sk_load_half) |
| 87 | 88 | is_offset_negative(half) |
| 88 | − .globl sk_load_half_positive | |
| 89 | −sk_load_half_positive: | |
| 89 | +FEXPORT(sk_load_half_positive) | |
| 90 | 90 | is_offset_in_header(2, half) |
| 91 | 91 | /* Offset within header boundaries */ |
| 92 | 92 | PTR_ADDU t1, $r_skb_data, offset |
| 93 | + .set reorder | |
| 93 | 94 | lh $r_A, 0(t1) |
| 95 | + .set noreorder | |
| 94 | 96 | #ifdef CONFIG_CPU_LITTLE_ENDIAN |
| 95 | 97 | # if defined(__mips_isa_rev) && (__mips_isa_rev >= 2) |
| 96 | 98 | wsbh t0, $r_A |
| @@ -109,8 +111,7 @@ sk_load_half_positive: · 12 unmodified lines | ||
| 109 | 111 | |
| 110 | 112 | LEAF(sk_load_byte) |
| 111 | 113 | is_offset_negative(byte) |
| 112 | − .globl sk_load_byte_positive | |
| 113 | −sk_load_byte_positive: | |
| 114 | +FEXPORT(sk_load_byte_positive) | |
| 114 | 115 | is_offset_in_header(1, byte) |
| 115 | 116 | /* Offset within header boundaries */ |
| 116 | 117 | PTR_ADDU t1, $r_skb_data, offset |