| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
This is in preparation for annotating copyin() and related functions
with __result_use_check.
Reviewed by: olce, dchagin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43104
(cherry picked from commit 3fde275167ce1f1455a03586d29840546d06d97a)
|
| |
|
|
| |
(cherry picked from commit 39024a89146902ca9aba250130b828ad9aced99d)
|
| |
|
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Similar commit in current:
(cherry picked from commit 685dc743dc3b)
|
| |
|
|
|
|
|
|
|
|
|
| |
On x86 Linux via AT_HWCAP2 the user controlled (by tunables) processor
capabilities are exposed.
Reviewed by:
Differential Revision: https://reviews.freebsd.org/D41165
MFC after: 2 weeks
(cherry picked from commit 4281dab8bc11b3b2f3b58be5e0f67806329bddae)
|
| |
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
|
| |
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 7d8c98398302b939b97310d31883ebdab8c0b938)
|
| |
|
|
|
|
|
|
|
| |
Cleanup unneeded includes, sort the rest according to style(9).
No functional changes.
MFC after: 2 weeks
(cherry picked from commit f4a512a5f187d9139c04111784fe811572bc0ed6)
|
| |
|
|
|
|
|
| |
Discussed with: melifaro
MFC after: 3 days
(cherry picked from commit 07db1f36848c008efb7ab6b37e199212560833ae)
|
| |
|
|
|
|
| |
MFC after: 1 week
(cherry picked from commit 95b8603427d5759c5d6090ffaacfaf7f3b8fb926)
|
| |
|
|
|
|
|
|
| |
It is still present in the 32-bit Linuxulator on amd64.
MFC after: 1 week
(cherry picked from commit 6039e966ff276ff6bcb57f2f70e7d8ff376b24fd)
|
| |
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 9e550625f867a23ea3d87a77aa3c216b79ecd790)
|
| |
|
|
|
|
| |
MFC after: 1 week
(cherry picked from commit cc1b0f7d9626bbd116429014444cbf61edf708a2)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 1da65dcb1c57fae7be75ddf1bd300ddf19ced850)
(cherry picked from commit f396f9b6c96f6d68d4e3606ddb090287230fc565)
|
| |
|
|
|
|
|
|
|
|
|
| |
Replace sigframe sf_extramask by native sigset_t and use it to
store/restore the thread signal mask without conversion to/from
Linux signal mask.
Pointy hat to: dchagin
MFC after: 2 weeks
(cherry picked from commit 4a6c2d075da0c5105269e6edcbe57bf6aaa0a0ae)
|
| |
|
|
|
|
|
|
|
| |
As bsd_to_linux_trapcode() is common for x86 Linuxulators,
move it under x86/linux.
MFC after: 2 weeks
(cherry picked from commit 9016ec056ae3896522798ead39bb2f3ff4f68809)
|
| |
|
|
|
|
|
|
|
| |
As translate_traps() is common for x86 Linuxulators,
move it under x86/linux.
MFC after: 2 weeks
(cherry picked from commit 2434137f690dabc35586ab45fc4c4ecc5b71184f)
|
| |
|
|
|
|
|
|
| |
Call translate_traps directly from sendsig().
MFC after: 2 weeks
(cherry picked from commit eca368ecb6e00e9db7e1c090e98a29439d255895)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 8f9635dc99f571a0ae4e613b9a0439e68da7b160)
|
| |
|
|
|
|
|
|
|
| |
To reduce sendsig code difference and to avoid confusing me,
rename sf_sc to sf_uc to match the content.
MFC after: 2 weeks
(cherry picked from commit 6e826d27c340fa29e166d06e5d8553f6c63c409e)
|
| |
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 21f246174184742ba8952aeb1dadbf58d48d54b4)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit ba279bcd6d75aa236bcb9ccf11aeb6f51a2f8514)
|
| |
|
|
|
|
|
|
|
|
| |
Both uc_flags and uc_link are zeroed above. On amd64 and i386 the
uc_link field is not used at all. The UC_FP_XSTATE bit should be set
in the uc_flags if OS xsave knob is turned on (and xsave is implemented).
MFC after: 2 weeks
(cherry picked from commit 0b5d5dc3767fcf2f0198f0f9549cb23983e0ee3e)
|
| |
|
|
|
|
|
|
| |
This is modeled after f2395455 (by kib@).
MFC after: 2 weeks
(cherry picked from commit 5a6a4fb284b1a9c4b4105fd6ab8143356f3ef3f7)
|
| |
|
|
| |
(cherry picked from commit 9e70163017ff929a36926ddbc5bd6e8b6b19cfeb)
|
| |
|
|
|
|
|
|
|
|
|
| |
In preparation for clone3 system call add struct clone_args and use it in
clone implementation.
Move all of clone related bits to the newly created linux_fork.h header.
Differential revision: https://reviews.freebsd.org/D31474
MFC after: 2 weeks
(cherry picked from commit 0a4b664ae8582b7596858317b53d84eb4f8bbf9a)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least Linux x86 ABI's does not use carry bit and expects that the dx register
is preserved. For this add a new sv_set_fork_retval hook and call it from cpu_fork().
Add a short comment about touching dx in x86_set_fork_retval(), for more details
see phab comments from kib@ and imp@.
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D31472
MFC after: 2 weeks
(cherry picked from commit de8374df28cc23ce0d893fd96d1ad0a861414154)
|
| |
|
|
|
|
| |
MFC after: 2 weeks
(cherry picked from commit 741f80df531cb58a38a8ec98203c7e315b6f9bca)
|
| |
|
|
|
|
|
| |
Differential Revision: https://reviews.freebsd.org/D31236
MFC after: 2 weeks
(cherry picked from commit 0dc38e33031b353468888fe25a6f8ba1f910dd26)
|
| |
|
|
|
|
|
|
|
|
|
| |
Initial patch from submitter was adapted by me to prevent unconditional
FUTEX_REQUEUE use.
PR: 255947
Submitted by: Philippe Michaud-Boudreault
Differential Revision: https://reviews.freebsd.org/D30332
(cherry picked from commit cf8d74e3fe63da7359d6ca7e0b4b57c5684c2845)
|
| |
|
|
|
|
|
|
|
|
| |
... by making it machine-independent.
Reviewed By: dchagin
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D31286
(cherry picked from commit 30c6d982190482857883fc96eefafcc6fd769fa0)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The vDSO initialisation order should be as follows:
- native abi init via exec_sysvec_init();
- vDSO symbols queued to the linux_vdso_syms list;
- linux_vdso_install();
- linux_exec_sysvec_init();
As the exec_sysvec_init() called with SI_ORDER_ANY (last) at SI_SUB_EXEC
order, move linux_vdso_install() and linux_exec_sysvec_init() to the
SI_SUB_EXEC+1 order.
Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D30902
MFC after 2 weeks
(cherry picked from commit 09cffde975b87b293457c9a228cb980ec729384a)
|
| |
|
|
|
|
|
|
|
|
|
| |
In order to reduce diff between arches constify vdso install/deinstall
functions like arm64.
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D30901
MFC after: 2 weeks
(cherry picked from commit a543556c8128c52fb044250b8f52f9702c81788d)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The vDSO (virtual dynamic shared object) is a small shared library that the
kernel maps R/O into the address space of all Linux processes on image
activation. The vDSO is a fully formed ELF image, shared by all processes
with the same ABI, has no process private data.
The primary purpose of the vDSO:
- non-executable stack, signal trampolines not copied to the stack;
- signal trampolines unwind, mandatory for the NPTL;
- to avoid contex-switch overhead frequently used system calls can be
implemented in the vDSO: for now gettimeofday, clock_gettime.
The first two have been implemented, so add the implementation of system
calls.
System calls implemenation based on a native timekeeping code with some
limitations:
- ifunc can't be used, as vDSO r/o mapped to the process VA and rtld
can't relocate symbols;
- reading HPET memory is not implemented for now (TODO).
In case on any error vDSO system calls fallback to the kernel system
calls. For unimplemented vDSO system calls added prototypes which call
corresponding kernel system call.
Relnotes: yes
Tested by: trasz (arm64)
Differential revision: https://reviews.freebsd.org/D30900
MFC after: 2 weeks
(cherry picked from commit 9931033bbfbe56a037723638cf3712366c6d943f)
|
| |
|
|
|
|
|
|
|
|
| |
Temporary add stubs to the Linux emulation layer which calls the existing hook.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D30911
MFC after: 2 weeks
(cherry picked from commit 5fd9cd53d256e08c601548c425bfcb3472f2d09b)
|
| |
|
|
|
|
|
|
|
| |
In Linux vDSO is a small shared ELF library, so it is not intended
for aout binaries. This was added on 64-bit Linuxulator import by mistake.
MFC after: 2 weeks
(cherry picked from commit bfe29037983913f27eae9c5a6d31545ed89f4040)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assuming we can't run on i486, i586 class cpu, retire linux_kplatform var
and use hardcoded 'machine' value in linux_newuname().
I have added linux_kplatform for consistency with linux_platform which is
placed in to vdso to avoid excess copyout it on stack for AT_PLATFORM at
exec time.
This is the first stage of Linuxulator's vdso revision.
Reviewed by: trasz, imp
Differential Revision: https://reviews.freebsd.org/D30774
MFC after: 2 weeks
(cherry picked from commit c1da89fec254f9d079fc17a186e2665a32cc718d)
|
| |
|
|
|
|
|
|
|
| |
Retire ksiginfo_to_lsiginfo function, use siginfo_to_lsiginfo instead.
Convert rt_sigtimedwait siginfo variables to well known names.
MFC after: 2 weeks
(cherry picked from commit f4e801085b055fd33f680dd7cb9f8562d236f39a)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds `sv_elf_core_osabi`, `sv_elf_core_abi_vendor`,
and `sv_elf_core_prepare_notes` fields to `struct sysentvec`,
and modifies imgact_elf.c to make use of them instead
of hardcoding FreeBSD-specific values. It also updates all
of the ABI definitions to preserve current behaviour.
This makes it possible to implement non-native ELF coredump
support without unnecessary code duplication. It will be used
for Linux coredumps.
Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30921
(cherry picked from commit 435754a59ee203c3369f47ff9103f269c81581b7)
|
| |
|
|
|
|
|
|
|
|
|
| |
The size of the ps_strings structure varies between ABIs, so this is
useful for computing the address of the ps_strings structure relative to
the top of the stack when stack address randomization is enabled.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 3fc21fdd5f8a4eeb71f43cc6841f59ef1debaf9a)
|
| |
|
|
|
|
|
|
|
|
|
| |
Rather than fetching the ps_strings address directly from a process'
sysentvec, use this macro. With stack address randomization the
ps_strings address is no longer fixed.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 706f4a81a81250a326ea25914e7effe1768f1a37)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Simplify control flow around handling of the execpath length and signal
trampoline. Cache the sysentvec pointer in a local variable.
No functional change intended.
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
(cherry picked from commit f04a096049382637178b54ffb45089f5f9fb3db9)
|
| |
|
|
| |
(cherry picked from commit 870e197d52c1cb8c3ed6d04ddae34dcae57cb657)
|
| |
|
|
|
|
| |
PR: 21463
(cherry picked from commit 598f6fb49c9ca688029b79de0a44227ab79c608c)
|
| |
|
|
|
|
|
|
|
|
| |
This was missed in commit 0fc8a796722 ("linux: Unmap the VDSO page when
unloading").
Reported by: Mark Millard
MFC with: 0fc8a796722
(cherry picked from commit aa5fef60bf663d31cddf53d7a8c6856d5e4672c0)
|
| |
|
|
|
|
|
|
|
| |
This is what amd64 calls the i386 Linux ABI in order to distinguish it
from the amd64 Linux ABI, and matches the nomenclature used for the
FreeBSD ABIs where they always have the size suffix in the name.
Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D27647
|
| |
|
|
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D27309
Notes:
svn path=/head/; revision=367960
|
| |
|
|
|
|
|
|
|
|
| |
Reported by: arichardson
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26965
Notes:
svn path=/head/; revision=367079
|
| |
|
|
|
|
|
|
|
| |
Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26458
Notes:
svn path=/head/; revision=366205
|
| |
|
|
|
|
|
|
|
| |
Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26388
Notes:
svn path=/head/; revision=365832
|
| |
|
|
|
|
|
|
|
|
|
|
| |
the syscall path and declutter it a bit. No functional changes intended.
Reviewed by: kib (earlier version)
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26378
Notes:
svn path=/head/; revision=365755
|