| ... | @@ -1275,12 +1275,7 @@ const LinuxThreadImpl = struct { | ... | @@ -1275,12 +1275,7 @@ const LinuxThreadImpl = struct { |
| 1275 | : [ptr] "{r5}" (@intFromPtr(self.mapped.ptr)), | 1275 | : [ptr] "{r5}" (@intFromPtr(self.mapped.ptr)), |
| 1276 | [len] "{r6}" (self.mapped.len), | 1276 | [len] "{r6}" (self.mapped.len), |
| 1277 | ), | 1277 | ), |
| 1278 | // We set `sp` to the address of the current function as a workaround for a Linux | | |
| 1279 | // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid. | | |
| 1280 | // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in | | |
| 1281 | // 7928eb0370d1133d0d8cd2f5ddfca19c309079d5. | | |
| 1282 | .mips, .mipsel => asm volatile ( | 1278 | .mips, .mipsel => asm volatile ( |
| 1283 | \\ move $sp, $t9 | | |
| 1284 | \\ li $v0, 4091 # SYS_munmap | 1279 | \\ li $v0, 4091 # SYS_munmap |
| 1285 | \\ syscall | 1280 | \\ syscall |
| 1286 | \\ li $v0, 4001 # SYS_exit | 1281 | \\ li $v0, 4001 # SYS_exit |