sysarch.x86.2: manual page for the sysarch(2) functions on x86
Reviewed by: ziaee
Discussed with: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60047
net*: remove remnants of caddr_t
caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979. It became obsolete in 1989,
when ANSI C introduced void *.
What's left:
* ioctl(9) KPI still uses caddr_t, thus network related ioctl method
still use it.
* if_clone KPI, to be done separately.
* bpf(4), to be done separately.
* SCTP, let maintainers decide.
* iflib(4), let maintainers decide.
Reviewed by: zlei
Differential Revision: https://reviews.freebsd.org/D60738
mbuf: remove remnants of caddr_t
caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979. It became obsolete in 1989,
when ANSI C introduced void *.
There is a lot of code that uses m->m_data for arithmetics, thus we can't
switch it to void * easily. Let's at least stop proliferation of caddr_t.
We have developers that are twice younger than obsoletion of this type.
Reviewed by: zlei, tuexen, adrian
Differential Revision: https://reviews.freebsd.org/D60736
ipfw: cleanup SYSINIT(9)s
Make them all belong to SI_SUB_PROTO_FIREWALL and explicitly specify
order. Prefer SYSINIT() over modevent, for those subsystems that don't
have dependencies. All subsystems just depend on the main module and they
don't depend on each other, except dummynet which also has submodules.
Thus, keep DECLARE_MODULE() only for the main module and dummynet.
Differential Revision: https://reviews.freebsd.org/D60685
loopback: set MTU to IF_MAXMTU
It was temporarily reduced in af78195e0024 in 1994 to hide some bugs with
signed short overflow. We believe all these bugs were sorted out by
today. :)
Note that earlier ba582a82b0e36 reduced the MTU be rounded to a longword
with a reference "NFS likes it to be rounded". We have had several
refactors of the NFS code since that.
Reviewed by: pouria, zlei, tuexen
Differential Revision: https://reviews.freebsd.org/D59450
linuxkpi: implement irqs_disabled
This adds a function which is used from various places in drm-kmod
to detect if the code can sleep or not. Currently, these locations
(such as intel_guc_send_busy_loop) are ifdeffed to freebsd specific
solutions (usually drm_can_sleep).
This change implements irqs_disabled. We check td_pinned as spinlocks
will call sched_pin, and td_critnest to check if we are in a critical
section.
Approved by: wulf, khng (mentor)
Differential Revision: https://reviews.freebsd.org/D57782
linux: preserve epoll descriptors across fork using KQUEUE_CPONFORK
Linuxulator implements epoll instances using kqueues. Currently,
epoll_create_common() creates the backing kqueue with copy-on-fork
disabled. When fork() copies the descriptor table, the kqueue is
omitted from the child's table.
This differs from Linux, where an epoll descriptor survives fork(),
including when it was created with EPOLL_CLOEXEC. That flag controls
descriptor lifetime across exec(), not fork().
The missing descriptor breaks dbus-daemon daemonization. The daemon
creates its epoll instance before forking and continues using the
saved descriptor number in the child. F_GETFD initially fails with
EBADF. Once another open reuses that number, subsequent epoll_ctl()
calls fail with EINVAL because the descriptor no longer refers to
an epoll instance. The daemon then exits, preventing applications
that depend on the session bus from starting correctly.
[31 lines not shown]
pty: preserve O_NONBLOCK when opening /dev/ptmx
ptmx_fdopen() masks the supplied file flags to FREAD | FWRITE before
passing them to pts_alloc(). This discards FNONBLOCK even when the
caller explicitly requests O_NONBLOCK.
As a result, open("/dev/ptmx", O_RDWR | O_NOCTTY | O_NONBLOCK) succeeds,
but the returned file is blocking. F_GETFL reports O_NONBLOCK cleared,
and a subsequent read can block instead of returning EAGAIN when no
data is available.
This causes Linux xfce4-terminal/VTE running under Linuxulator to
freeze. VTE opens the PTY master with O_NONBLOCK and relies on
nonblocking reads while draining terminal output. Once the available
data has been consumed, the main UI thread blocks in ptsdev_read(),
leaving the window unresponsive even though the child shell has
started successfully.
Include FNONBLOCK in the flags passed to pts_alloc(). Blocking opens
[20 lines not shown]
sctp: improve locking validation
Ensure that the TCB lock is hold in sctp_calc_rwnd().
Reviewed by: tuexen
MFC after: 1 week
MFC to: stable/14
MFC to: stable/15
pf: only log that we're not creating a tag in verbose mode
While here get rid of the aesthetically unpleasing '== false' construct.
Sponsored by: Rubicon Communications, LLC ("Netgate")
ktls: Fix capability checks in ktls_reset_receive_tag()
IFCAP2_RXTLS4 and IFCAP2_RXTLS6 are bit numbers, not masks, so
ktls_reset_receive_tag() tested if_capenable2 against 0 for IPv4 and against the
RXTLS4 bit for IPv6. An IPv4 connection with NIC receive TLS offload thus never
got a new receive tag after its packets moved to another interface, and fell
back to software decryption for good.
c721694 fixed the same checks in ktls_alloc_rcv_tag(); use IFCAP2_BIT() here
as well.
Fixes: fe8c78f ("ktls: Add full support for TLS RX offloading via network interface.")
Approved by: gallatin, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60757
ktls: Take the receiving interface of each packet in sbappend_ktls_rx()
sbappend_ktls_rx() read the receiving interface of each packet header it
demotes from the chain's first mbuf, whose header it had zeroed on the first
pass. A chain of two packets or more thus had no interface, and a change of
input interface went unnoticed: the TLS receive tag stayed on the old interface
until a later append of one packet.
Read it from the packet being demoted, as the decrypted mark is.
Fixes: fe8c78f0d202 ("ktls: Add full support for TLS RX offloading via network interface.")
Approved by: gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60758
iwm: add iwm_enable_ac_txq(); use it for command queue setup
Port iwm_enable_ac_txq() from OpenBSD. It's effictively the
command FIFO path in the existing iwm_enable_txq().
The OpenBSD driver does a bunch of TX aggregation queue setup in
iwm_enable_txq() which isn't relevant here just quite yet and
it doesn't currently hurt to leave the existing one here
whilst I figure out the next steps.
Locally tested:
* 3160, 7260, 8260, 9260 - STA mode
Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674
Differential Revision: https://reviews.freebsd.org/D60696