Commit graph

12 commits

Author SHA1 Message Date
Dmitry Chagin
00c933e925 linux(4): Use saved cpu feature bits
MFC after:		3 days

(cherry picked from commit 03473e8ec8)
2022-07-12 00:28:11 +03:00
Dmitry Chagin
d37548e010 linux(4): Properly restore the thread signal mask after signal delivery on i386
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 4a6c2d075d)
2022-06-17 22:35:40 +03:00
Dmitry Chagin
06f6414a64 linux(4): Deduplicate bsd_to_linux_trapcode()
As bsd_to_linux_trapcode() is common for x86 Linuxulators,
move it under x86/linux.

MFC after:		2 weeks

(cherry picked from commit 9016ec056a)
2022-06-17 22:35:28 +03:00
Dmitry Chagin
f327f595cb linux(4): Deduplicate translate_traps()
As translate_traps() is common for x86 Linuxulators,
move it under x86/linux.

MFC after:		2 weeks

(cherry picked from commit 2434137f69)
2022-06-17 22:35:28 +03:00
Dmitry Chagin
c2704d3780 linux(4): Better naming for ucontext field of struct rt_sigframe
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 6e826d27c3)
2022-06-17 22:35:21 +03:00
Dmitry Chagin
3f3bfb8266 linux(4): Move sigframe definitions to separate headers
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 21f2461741)
2022-06-17 22:35:20 +03:00
Dmitry Chagin
e7a07ad1db linux(4): Implement vdso getcpu for x86.
This is modeled after f2395455 (by kib@).

MFC after:		2 weeks

(cherry picked from commit 5a6a4fb284)
2022-06-17 22:35:00 +03:00
Dmitry Chagin
f360bdf68d linux(4): Refactor vdso_gettc_x86 includes.
Factor out includes from common vdso_gettc_x86 file to the corresponding
MD files.

MFC after:		2 weeks

(cherry picked from commit 332eca05b5)
2022-06-17 22:34:59 +03:00
Dmitry Chagin
2e084b4b54 Drop "All rights reserved" from my copyright statements.
Add email and fixup years while here.

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D30912
MFC after:		2 weeks

(cherry picked from commit 1ca6b15bbd)
2022-06-17 22:33:09 +03:00
Dmitry Chagin
a340b5b4bd linux(4); Almost complete the vDSO.
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 9931033bbf)
2022-06-17 22:33:07 +03:00
Edward Tomasz Napierala
cbab32bdf1 linux: deduplicate DUMMY() entries
No functional changes.

Reviewed By:	emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D30524

(cherry picked from commit 83043a741d)
2022-02-13 22:22:11 +00:00
Conrad Meyer
e9b13c6612 linux(4): Deduplicate unimpl/dummy syscall handlers
No functional change.

Reviewed by:	emaste, trasz
Differential Revision:	https://reviews.freebsd.org/D27099
2020-11-05 19:30:31 +00:00