Commit Graph

270116 Commits

Author SHA1 Message Date
Gleb Smirnoff
1e3ca25d92 ifnet: make if_alloc_domain() static 2021-11-22 19:49:57 -08:00
Gleb Smirnoff
ce40632a31 ifnet: append if_debug.c to if.c
With this change if_index can become static.  There is nothing
that if_debug.c would want to isolate from if.c.  Potentially
if.c wants to share everything with if_debug.c.

Move Bjoern's copyright to if.c.

Reviewed by:	bz
2021-11-22 19:49:57 -08:00
Gleb Smirnoff
8a6f38c8ac ifnet: garbage collect drbr_*_drv().
They were left in 62d76917b8 but after years proved not to be useful.
2021-11-22 19:49:57 -08:00
Brooks Davis
b92f4ae58a freebsd32: regen
There there are two changes here. First, ofreebsd32_sigreturn
is declared to take a struct osigcontext rather than a struct
ia32_sigcontext3. This type is incorrect, but harmlessly so.
Second, the name of the unimplemented ogetkerninfo changes in
freebsd32_syscallnames.
2021-11-22 22:36:58 +00:00
Brooks Davis
be67ea40c5 freebsd32: generate from sys/kern/syscalls.master
This avoids the need to keep a freebsd32-specific syscalls.master
in sync with the default ABI.  As evidenced by the number of commits
required to sync the two, it is extremely easy for them to get out
of sync due to misunderstandings and user errors.

Reviewed by:	kevans, kib
2021-11-22 22:36:58 +00:00
Brooks Davis
799ce8b8d2 syscalls: annotate args pointing to long, pointer, or time_t
Add _Contains_ annotations indicating that the data pointed to by a
pointer argument contains types that vary between FreeBSD ABIs. The
supported set is long (including size_t), pointer (including
intptr_t), and time_t.  The first two vary between 32- and 64-bit
ABIs.  The laste betwen i386 and everything else.

These will be used to detect which syscalls require handling on
particular ABIs.

Reviewed by:	kevans, kib
2021-11-22 22:36:58 +00:00
Brooks Davis
f260a69dec makesyscalls: strip _Contains_ argument annotations
Reviewed by:	kevans
2021-11-22 22:36:58 +00:00
Brooks Davis
64cc9803ab makesyscalls: add override of ABI change detection
While we can detect most ABI changes through analysis of
syscalls.master with suitable annotations, to cases are handled
in the core implementation and others have changes that can not be
infered.  Add two new config variables syscall_abi_change and
syscall_no_abi_change which override the detected value.  Both are
space-seperated lists of syscall names.

Reviewed by:	kevans
2021-11-22 22:36:58 +00:00
Brooks Davis
988e8db3c0 makesyscalls: automate detection of ABI changes
Use pattern matching including matches of _Contains_*_ argument
annotations to (mostly) determine which system calls require
ABI-specific handling.  Automatically treat syscalls as NOPROTO
if no ABI changes are present.

Reviewed by:	kevans
2021-11-22 22:36:58 +00:00
Brooks Davis
804a84fbf2 makesyscalls.lua: Add the ABI function prefix reliably.
The previous code mostly worked, but ended up adding bogus sys_<foo>()
declerations.

Reviewed by:	kevans
2021-11-22 22:36:58 +00:00
Brooks Davis
5e70931184 makesyscalls: allow config to force OBSOL and UNIMPL
The obsol and unimpl config variables are space-seperated lists of
syscalls that should treated as being declared OBSOL and UNIMPL.

The allows an ABI to exclude select system calls listed in
syscalls.master.

Reviewed by:	kevans
2021-11-22 22:36:57 +00:00
Brooks Davis
30bc335a05 freebsd32: regen 2021-11-22 22:36:57 +00:00
Brooks Davis
faa67c2b20 freebsd32: generate splits of 64-bit arguments
This eliminates the need for ifdefs in syscalls.master and contains the
largest set of diff to generated files on the way to switching to using
the default ABI's syscalls.master.

Reviewed by:	kevans
2021-11-22 22:36:57 +00:00
Brooks Davis
6b7c23a026 syscalls: regen 2021-11-22 22:36:57 +00:00
Brooks Davis
64007b000a makesyscalls: handle 64-bit args on 32-bit
On 32-bit architectures, 64-bit arguments are passed in pairs of
registers. On non-x86 architectures these arguments must be in evenly
aligned registers which necessiciates inserting a pad register into the
argument list. This has historically been supported by adding ifdefs
around padded and unpadded syscall defintions in syscalls.master.

In order to enable generation of 32-bit support files from the base
syscalls.master, pull this support in to makesyscalls.lua enabled by
adding pair_64bit to abi_flags.

The changes to sys_proto.h simply add #ifdef PAD64_REQUIRED
around pad arguments in struct <syscall>_args. In systrace_args(),
replace static syscall index values with post-incremented indexs
allowing a simple ifdef around the argument. Under -O1 or higher
code generation is identical. systrace_entry_setargdesc() is a bit
more complicated as we switch on argument indices.  Solve this
with some use of define/undef pairs to compute the correct indices.

Reviewed by:	kevans
2021-11-22 22:36:57 +00:00
Brooks Davis
79634eb90b makesyscalls: handle arrays of pointers
When the config variable abi_intptr_t is not "", transform arrays of
pointers to arrays of abi_intptr_t.

Reviewed by:	kevans
2021-11-22 22:36:57 +00:00
Brooks Davis
0a4e16446b makesyscalls: handle longs in ABI compat
Replace long-derived types with their abi equivalent where
required by the target ABI. There are two cases:
 - All pointers to types that go from 64-bit to 32-bit between the
   default ABI and the target ABI.
 - Signed arguments that go from 64-bit to 32-bit (these require
   sign-extension before passing to general kernel ABIs).

This adds four new config variables: abi_long, semid_t, abi_size_t,
and abi_u_long which default to long, size_t, and u_long respectively.

Reviewed by:	kevans
2021-11-22 22:36:57 +00:00
Brooks Davis
b85fb39047 makesyscalls.lua: Allow translation of intptr_t arguments
Translate instances of intptr_t to the config value abi_intptr_t
(defaults to "intptr_t").  Used in CheriABI to translate intptr_t
to intcap_t for hybrid kernels.

Reviewed by:	kevans
2021-11-22 22:36:57 +00:00
Brooks Davis
f0cfbffc36 syscalls: regen 2021-11-22 22:36:56 +00:00
Brooks Davis
37b425bd05 makesyscalls: intptr_t arguments are pointers
Match intptr_t arguments as pointers.  Currently this is a no-op
change to systrace_args.c.

Reviewed by:	kevans
2021-11-22 22:36:56 +00:00
Brooks Davis
3f8f46a0ae makesyscalls: Add a way to include per-ABI headers
When the string %%ABI_HEADERS%% is found in syscalls.master, replace
it with the contents of the abi_headers config variable.  This allows
an ABI-specific syscalls.conf to add lines like:

	#include <compat/freebsd32/freebsd32.h>

when working from a shared syscalls.master.

Reviewed by:	kevans
2021-11-22 22:36:56 +00:00
Brooks Davis
ed8a4423fb makesyscalls: allow multiple expressions for each abi change
Limitations in lua patterns means we need to be able to match more
than one possible expression.

Reviewed by:	kevans
2021-11-22 22:36:56 +00:00
Brooks Davis
818aa9543d makesyscalls: Fix expression for time_t_size
Reviewed by:	kevans
2021-11-22 22:36:56 +00:00
Brooks Davis
5203efead7 makesyscalls: Remove _native suffix handling
This supported a hack we used in CheriBSD which has been removed.

Reviewed by:	kevans
2021-11-22 22:36:56 +00:00
Brooks Davis
97fdcfcaf7 freebsd32: remove unnecessicary headers
Reviewed by:	kib
2021-11-22 22:36:56 +00:00
Brooks Davis
bcd07aaa4e freebsd32: regen 2021-11-22 22:36:56 +00:00
Brooks Davis
6eefabd4ca syscalls: improve nstat, nfstat, nlstat
Optionally return errors when truncating dev_t, ino_t, and nlink_t.
In the interest of code reuse, use freebsd11_cvtstat() to perform the
truncation and error handling and then convert the resulting struct
freebsd11_stat to struct nstat.

Add missing freebsd32 compat syscalls. These syscalls require
translation because struct nstat contains four instances of struct
timespec which in turn contains a time_t and a long.

Reviewed by:	kib
2021-11-22 22:36:56 +00:00
Brooks Davis
8460d3e9e6 freebsd32: regen 2021-11-22 22:36:55 +00:00
Brooks Davis
151ddfec6f freebsd32: add _'s to _umtx_(un)lock
This aligns with the default ABI's configuration.

Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
b2be098e52 freebsd32: enable orecvfrom
It requires no translation, just a correct decleration.

Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
2d691434d5 freebsd32: declare ogetsockname correctly
Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
6f5eb383bd freebsd32: sync some osig* audit flags with default ABI
Discussed with:	rwatson

Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
802280ada8 freebsd32: sctp syscalls take struct iovec32
Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
06759303ec freebsd32: aio_cancel takes a struct aiocb32
Strictly speaking, it takes a virtual address and doesn't touch the
object directly, but this is consistant with other aio_*() syscalls.

Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
e11f2743ff freebsd32: [gs]etgroups take an int gidsetsize
Reviewed by:	kib
2021-11-22 22:36:55 +00:00
Brooks Davis
e54a870e35 freebsd32: make semsys take int arguments
This matches the default ABI.

Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
1eacca4397 freebsd32: make fcntl's arg argument int32_t
It's a long in the default ABI so this is consistant with other caes.

Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
d330857439 syscalls: regen 2021-11-22 22:36:54 +00:00
Brooks Davis
00e0a4c0d7 syscalls: abort2 doesn't return so declare as void
Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
4b2e1f1480 syscalls: umask returns a mode_t
Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
27f5b514a0 syscalls: update a few return types to ssize_t
Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
717e7fb27a syscalls: struct ucontext4 -> struct freebsd4_ucontext
This aligns with struct freebsd4_ucontext32 in freebsd32.

Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
e58e9a8cbd syscalls: regen 2021-11-22 22:36:54 +00:00
Brooks Davis
d8bd949beb sys___sysctl: regularize argument struct
Let makesyscalls generate the normal struct __sysctl_args structure.
It works fine.

Reviewed by:	kib
2021-11-22 22:36:54 +00:00
Brooks Davis
97e4bec56d syscalls: regen 2021-11-22 22:36:53 +00:00
Brooks Davis
88dfcfa2a0 sys_sigaltstack: use struct sigaltstack arg
This is idential to stack_t and more amenable to prepending "32" to
for freebsd32.

Reviewed by:	kib
2021-11-22 22:36:53 +00:00
Cy Schubert
e383c423c4 RELNOTES: Add comment about WiFi 6 support to wpa 2021-11-22 12:03:34 -08:00
Cy Schubert
22b1cbec8e Revert "RELNOTES: Add comment about WiFi 6 support"
This reverts commit c0601c3e01.
2021-11-22 12:01:36 -08:00
Cy Schubert
c0601c3e01 RELNOTES: Add comment about WiFi 6 support 2021-11-22 10:34:42 -08:00
Allan Jude
d9bb798725 openssl: Fix detection of ARMv7 and ARM64 CPU features
OpenSSL assumes the same value for AT_HWCAP=16 (Linux)
So it ends up calling elf_auxv_info() with AT_CANARY which
returns ENOENT, and all acceleration features are disabled.

With this, my ARM64 test machine runs the benchmark
`openssl speed -evp aes-256-gcm` nearly 20x faster
going from 100 MB/sec to 2000 MB/sec

It also improves sha256 from 300 MB/sec to 1800 MB/sec

This fix has been accepted but not yet merged upstream:
https://github.com/openssl/openssl/pull/17082

PR:		259937
Reviewed by:	manu, imp
MFC after:	immediate
Relnotes:	yes
Fixes:		88e852c0b5 ("OpenSSL: Merge OpenSSL 1.1.1j")
Sponsored by:	Ampere Computing LLC
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33060
2021-11-22 18:10:43 +00:00