aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* linux(4): Simplify %r10 restoring on amd64Dmitry Chagin2023-05-282-9/+3
| | | | | | | Restore %r10 at system call entry to avoid doing this multiply times. Differential Revision: https://reviews.freebsd.org/D40154 MFC after: 1 month
* linux(4): Add a comment explaining registers at syscall entry point on amd64Dmitry Chagin2023-05-281-0/+17
| | | | | Differential Revision: https://reviews.freebsd.org/D40153 MFC after: 1 month
* linux(4): Drop a weird comment from linux_set_syscall_retval on amd64Dmitry Chagin2023-05-281-3/+0
| | | | | | | | | I agree, it would be great to avoid PCB_FULL_IRET, however we should follow Linux system call ABI. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40152 MFC after: 1 month
* linux(4): Implement ptrace_pokeusr for x86_64Dmitry Chagin2023-05-181-3/+70
| | | | | Differential Revision: https://reviews.freebsd.org/D40097 MFC after: 1 week
* linux(4): Make ptrace_pokeusr machine dependentDmitry Chagin2023-05-182-0/+10
| | | | | Differential Revision: https://reviews.freebsd.org/D40096 MFC after: 1 week
* linux(4): Make ptrace_peekusr machine dependendDmitry Chagin2023-05-182-0/+33
| | | | | | | And partially implement it for x86_64. Differential Revision: https://reviews.freebsd.org/D40095 MFC after: 1 week
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-125-5/+5
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* linux(4): Regen for mknod syscall changesDmitry Chagin2023-04-282-6/+6
|
* linux(4): Use Linux dev_t type for mknod syscalls dev argumentDmitry Chagin2023-04-281-2/+2
| | | | | | | | | | | | As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit unsigned integer on all platforms. Prior the 2.6 kernel dev_t type was an unsigned short. However, since the firs commit of the Linuxulator, mknod syscall get int dev argument. Also, there is some confusion here, while the kernel declares a dev_t type as a 32-bit sized, the user-space dev_t type can be size of 64 bits, e.g., in the Glibc library. To avoid confusion and to help porting of the Linuxulator to other platforms use explicit l_dev_t for dev argument of mknod syscalls.
* linux(4): Move dev_t type declaration under /compat/linuxDmitry Chagin2023-04-281-1/+0
| | | | | As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit unsigned integer on all platforms. Move it into the MI linux.h under /compat/linux.
* linux(4): Make struct newstat to match actual Linux oneDmitry Chagin2023-04-281-3/+3
| | | | In the struct stat the st_dev, st_rdev are unsigned long.
* linux(4): Fix LINUX_AT_COUNT commentsDmitry Chagin2023-04-221-1/+4
| | | | | Differential Revision: https://reviews.freebsd.org/D39645 MFC after: 1 month
* linux(4): Deduplicate linux_copyout_auxargs()Dmitry Chagin2023-04-222-47/+11
| | | | | | | | Export default MINSIGSTKSZ value for the x86 until we do not preserve AVX registers in the signal context. Differential Revision: https://reviews.freebsd.org/D39644 MFC after: 1 month
* syscall.master: Fix commentsWarner Losh2023-04-201-2/+4
| | | | | | | | | | | Have more accruate comments. While #if, #else, etc are copied to the header files, lines that don't start with # are not. And #include files are only output to sysinc (which winds up at the front of init_sysent.c which seems a bit odd). This is all radically undocumented, and likely has drifted somewhat from 4.4BSD and what other systems do (they've drifted too, fwiw). Sponsored by: Netflix
* linux(4): Regen for close_range syscallDmitry Chagin2023-04-043-4/+26
| | | | MFC after: 2 weeks
* linux(4): Modify close_range syscall to match LinuxDmitry Chagin2023-04-041-2/+6
| | | | MFC after: 2 weeks
* linux(4): Drop unncessary struct l_ifconf declaration from amd64/linuxDmitry Chagin2023-03-041-11/+0
| | | | | | Its needed only for amd64/linux32 Linuxulator. Differential Revision: https://reviews.freebsd.org/D38793
* linux(4): Reduce code duplication between MD filesDmitry Chagin2023-03-041-34/+0
| | | | | | | Move struct ifnet definitions under compat/linux. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38791
* linux(4): Rename linux_timer.h to linux_time.hDmitry Chagin2023-02-141-1/+1
| | | | | | | | | To avoid confusing people, rename linux_timer.h to linux_time.h, as linux_timer.c is the implementation of timer syscalls only, while linux_time.c contains implementation of all stuff declared in linux_time.h. MFC after: 2 weeks
* linux(4): Cleanup includes under amd64/linuxDmitry Chagin2023-02-144-34/+4
| | | | | | | Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks
* linux(4): Cleanup vm includes from linux_util.hDmitry Chagin2023-02-141-0/+1
| | | | | | | | Include vm headers directly where they needed. The linux_util.h included in a most source files of the Linuxulator, avoid collecting a rarely used includes here. MFC after: 2 weeks
* linux(4): Remove stale comment that no longer applies.Dmitry Chagin2023-02-021-2/+0
| | | | MFC after: 1 week
* linux(4): Microoptimize rt_sendsig() on amd64.Dmitry Chagin2023-02-021-17/+17
| | | | | | | | | Drop proc lock earlier, before copying user stuff. Pointed out by: kib Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38326 MFC after: 1 week
* linux(4): Preserve fpu fxsave state across signal delivery on amd64.Dmitry Chagin2023-02-021-6/+64
| | | | | | | PR: 240768 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38302 MFC after: 1 week
* linux(4): Deduplicate linux_trans_osrel().Dmitry Chagin2023-02-021-29/+2
| | | | MFC after: 1 week
* linux(4): Deduplicate linux_copyout_strings().Dmitry Chagin2023-02-021-129/+1
| | | | | | It is still present in the 32-bit Linuxulator on amd64. MFC after: 1 week
* linux(4): Deduplicate linux_fixup_elf().Dmitry Chagin2023-02-021-17/+1
| | | | | | | Use native routines to fixup initial process stack. On Arm64 linux_elf_fixup() is noop, as it do the stack fixup (room for argc) in the linux_copyout_strings(). MFC after: 1 week
* linux(4): Microoptimize linux_elf.h for future use.Dmitry Chagin2023-02-021-0/+1
| | | | | | | In order to reduce code duplication move coredump support definitions into the appropriate header and hide private definitions. MFC after: 1 week
* linux(4): Deduplicate MI futex structures.Dmitry Chagin2023-02-011-11/+0
| | | | MFC after: 1 week
* sys: use .S for assembly language files that use the preprocessorElliott Mitchell2022-11-021-0/+0
| | | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/609 Differential Revision: https://reviews.freebsd.org/D35908
* linux: populate sv_syscallnames in each sysentvecMitchell Horne2022-10-281-1/+2
| | | | | | | | | | | This allows the syscallname() function to give a usable result for Linux ABIs. Reported by: jrtc27 Reviewed by: jrtc27, markj, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37199
* Rework how shared page related data is storedKornel Dulęba2022-07-181-1/+1
| | | | | | | | | | | | | Store the shared page address in struct vmspace. Also instead of storing absolute addresses of various shared page segments save their offsets with respect to the shared page address. This will be more useful when the shared page address is randomized. Approved by: mw(mentor) Sponsored by: Stormshield Obtained from: Semihalf Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D35393
* linux(4): To reuse MD linux.h hide kernel dependencies unde _KERNEL constraintDmitry Chagin2022-06-221-0/+2
| | | | MFC after: 2 weeks
* linux(4): Properly build argument list for the signal handlerDmitry Chagin2022-05-301-12/+16
| | | | | | Provide arguments 2 and 3 if signal handler installed with SA_SIGINFO. MFC after: 2 weeks
* linux(4): Microoptimize rt_sendsig(), convert signal mask onceDmitry Chagin2022-05-301-1/+1
| | | | | | | | On amd64 Linux saves the thread signal mask in both contexts, in the machine dependent and in the machine independent. Both contexts are user accessible. Convert the mask once, then copy it. MFC after: 2 weeks
* linux(4): Avoid direct manipulation of td_sigmaskDmitry Chagin2022-05-301-5/+3
| | | | | | | Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals. MFC after: 2 weeks
* linux(4): Reduce duplication between MD parts of the LinuxulatorDmitry Chagin2022-05-301-5/+0
| | | | | | | Move sigprocmask actions defines under compat/linux, they are identical across all Linux architectures. MFC after: 2 weeks
* linux(4): Deduplicate execveDmitry Chagin2022-05-231-27/+0
| | | | | | | | As linux_execve is common across archs, except amd64 32-bit Linuxulator, move it under compat/linux. Noted by: andrew@ MFC after: 2 weeks
* linux(4): Deduplicate bsd_to_linux_trapcode()Dmitry Chagin2022-05-231-39/+0
| | | | | | | As bsd_to_linux_trapcode() is common for x86 Linuxulators, move it under x86/linux. MFC after: 2 weeks
* linux(4): Deduplicate translate_traps()Dmitry Chagin2022-05-231-23/+0
| | | | | | | As translate_traps() is common for x86 Linuxulators, move it under x86/linux. MFC after: 2 weeks
* Retire sv_transtrapDmitry Chagin2022-05-201-2/+1
| | | | | | Call translate_traps directly from sendsig(). MFC after: 2 weeks
* linux(4): Retire handmade DWARF annotations from signal trampolinesDmitry Chagin2022-05-152-38/+74
| | | | | | | | | | | | | | | The Linux exports __kernel_sigreturn and __kernel_rt_sigreturn from the vdso. Modern glibc's sigaction sets the sa_restorer field of sigaction to the corresponding vdso __sigreturn, and sets the SA_RESTORER. Our signal trampolines uses the FreeBSD-way to call a signal handler, so does not use the sigaction's sa_restorer. However, as glibc's runtime linker depends on the existment of the vdso __sigreturn symbols, for all Linuxulators was added separate trampolines named __sigcode with DWARF anotations and left separate __sigreturn methods, which are exported. MFC after: 2 weeks
* linux(4): Better naming for ucontext field of struct rt_sigframeDmitry Chagin2022-05-152-29/+29
| | | | | | | To reduce sendsig code difference and to avoid confusing me, rename sf_sc to sf_uc to match the content. MFC after: 2 weeks
* linux(4): Rework the definition of struct siginfo to match Linux actual oneDmitry Chagin2022-05-151-69/+2
| | | | | | | | | | | | Rework the defintion of struct siginfo so that the array padding struct siginfo to SI_MAX_SIZE can be placed in a union along side of the rest of the struct siginfo members. The result is that we no longer need the __ARCH_SI_PREAMBLE_SIZE or SI_PAD_SIZE definitions. Move struct siginfo definition under /compat/linux to reduce MD part. To avoid headers polution include linux_siginfo.h in the MD linux.h MFC after: 2 weeks
* linux(4): Move sigframe definitions to separate headersDmitry Chagin2022-05-153-65/+4
| | | | | | | | The signal trampoine-related definitions are used only in the MD part of code, wherefore moved from everywhere used linux.h to separate MD headers. MFC after: 2 weeks
* linux(4): Cleanup signal trampolinesDmitry Chagin2022-05-154-17/+6
| | | | | | | | | | | | | | | | | | This is the first stage of a signal trampolines refactoring. From trampolines retired emulation of the 'call' instruction, which is replaced by direct call of a signal handler. The signal handler address is in the register. The previous trampoline implemenatation used semi-Linux-way to call a signal handler via the 'jmp' instruction. Wherefore the trampoline emulated a 'call' instruction to into the stack the return address for signal handler's 'ret' instruction. Wherefore handmade DWARD annotations was used. While here rephrased and removed excessive comments. MFC after: 2 weeks
* linux(4): Return native error from futex_atomic_op to avoid conversion by ↵Dmitry Chagin2022-05-091-1/+1
| | | | | | the caller. MFC after: 2 weeks
* linux(4): Implement vdso getcpu for x86.Dmitry Chagin2022-05-083-0/+10
| | | | | | This is modeled after f2395455 (by kib@). MFC after: 2 weeks
* linux(4): Refactor vdso_gettc_x86 includes.Dmitry Chagin2022-05-081-0/+1
| | | | | | | Factor out includes from common vdso_gettc_x86 file to the corresponding MD files. MFC after: 2 weeks
* linux(4): Implement semtimedop syscalls.Dmitry Chagin2022-05-061-1/+0
| | | | | | | | On i386 are two semtimedop. The old one is called via multiplexor and uses 32-bit timespec, and new semtimedop_tim64, which is uses 64-bit timespec. MFC after: 2 weeks