]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 months agotimerfd: Add manual page.
Jake Freeland [Thu, 24 Aug 2023 19:59:20 +0000 (13:59 -0600)]
timerfd: Add manual page.

This manual page accompanies the timerfd system calls.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40218

10 months agotimerfd: Move implementation from linux compat to sys/kern
Jake Freeland [Thu, 24 Aug 2023 04:39:54 +0000 (22:39 -0600)]
timerfd: Move implementation from linux compat to sys/kern

Move the timerfd impelemntation from linux compat code to sys/kern. Use
it to implement the new system calls for timerfd. Add a hook to kern_tc
to allow timerfd to know when the system time has stepped. Add kqueue
support to timerfd. Adjust a few names to be less Linux centric.

RelNotes: YES
Reviewed by: markj (on irc), imp, kib (with reservations), jhb (slack)
Differential Revision: https://reviews.freebsd.org/D38459

10 months agotests: Handle SIGSEGV in the vm stack mprotect exec test
Dmitry Chagin [Thu, 24 Aug 2023 18:02:52 +0000 (21:02 +0300)]
tests: Handle SIGSEGV in the vm stack mprotect exec test

To exit gracefully handle SIGSEGV and mark the test as failed.

MFC after: 3 days

10 months agops: add a new option -D to reimplement tree traversal
Piotr Pawel Stefaniak [Thu, 24 Aug 2023 16:29:46 +0000 (18:29 +0200)]
ps: add a new option -D to reimplement tree traversal

It takes a non-optional parameter string, one of "up", "down", or "both"
that can request tree traversal in the chosen directions. This adds PIDs
from the paths to the selection of PIDs and can be used together with -d
to draw a subset of the process tree.

Differential Revision: https://reviews.freebsd.org/D41231

10 months agoRevert "ps: extend the non-standard option -d (tree view) to work with -p"
Piotr Pawel Stefaniak [Sat, 29 Jul 2023 16:16:35 +0000 (18:16 +0200)]
Revert "ps: extend the non-standard option -d (tree view) to work with -p"

This reverts commit ca8c0d5e811048ad67d0955642c5b486e9c0f3d2.

By commiting ca8c0d5e8110 I was hoping that the existing option -d
could just be extended to work with -p to implement a feature that was
and I think is still needed, that is to show all descendant processes
of a given process id or a set of process ids.

After a complaint from -current which may represent a wider
dissatisfaction with this change in the program's behavior, I think it
will be better to revert ca8c0d5e8110 and reintroduce this feature
using a separate option -D.

10 months agosctp: improve handling of socket shutdown for reading
Michael Tuexen [Thu, 24 Aug 2023 13:52:55 +0000 (15:52 +0200)]
sctp: improve handling of socket shutdown for reading

If a socket is marked as cannot read anymore, drop chunks which
should be added to a control element in the receive queue.
This is consistent with dropping control elements instead of
adding them in the same situation.

Reported by: syzbot+291f6581cecb77097b16@syzkaller.appspotmail.com
MFC after: 1 week

10 months agopf: Access r->rpool.cur->kif under mutex protection
Kajetan Staszkiewicz [Thu, 24 Aug 2023 11:05:33 +0000 (13:05 +0200)]
pf: Access r->rpool.cur->kif under mutex protection

pf_route() sends traffic to a specified next hop over a specific
interface. The next hop is obtained in pf_map_addr() but the interface
is obtained directly via r->rpool.cur->kif` outside of the lock held in
pf_map_addr() in multiple places around pf. The chosen interface is not
stored in source node.

Move the interface selection into pf_map_addr(), have the function
return it together with the chosen IP address and ensure its stored
in struct pf_ksrc_node, store it in the source node and use the stored
value when needed.

Sponsored by: InnoGames GmbH
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D41570

10 months agocam/scsi_da: Bump deprecation one release.
Warner Losh [Thu, 24 Aug 2023 04:34:41 +0000 (22:34 -0600)]
cam/scsi_da: Bump deprecation one release.

These are still used in a quick poll that I've done, so we can't remove
them in 14. Reset the removal to FreeBSD 15.

Sponsored by: Netflix

10 months agocxgbe ddp: Trim stale function prototype
John Baldwin [Wed, 23 Aug 2023 21:29:02 +0000 (14:29 -0700)]
cxgbe ddp: Trim stale function prototype

Sponsored by: Chelsio Communications

10 months agom4 tests: Update tests after $FreeBSD$ removal
Mark Johnston [Wed, 23 Aug 2023 19:43:33 +0000 (15:43 -0400)]
m4 tests: Update tests after $FreeBSD$ removal

Fixes: d54a7d337331 ("Remove $FreeBSD$: one-line m4 tag")

10 months agobectl: make mount subcommand less verbose
Robert Wing [Wed, 23 Aug 2023 18:39:13 +0000 (10:39 -0800)]
bectl: make mount subcommand less verbose

The mount subcommand currently produces output such as:
    # bectl mount <bootenv>
    Successfully mounted <bootenv> at <mountpoint>

This commit changes it to only print the mountpoint:
    # bectl mount <bootenv>
    <mountpoint>

This makes it easier to script the mount subcommand. If an error occurs
while mounting, an error message is printed to stderr and bectl will
exit with a non-zero value.

PR:             273180
Reviewed by:    kevans, asomers
Differential Revision: https://reviews.freebsd.org/D41562

10 months agoarm64: Remove duplicate fdt build option
Emmanuel Vadot [Wed, 23 Aug 2023 18:18:38 +0000 (20:18 +0200)]
arm64: Remove duplicate fdt build option

Reported by: andrew
Sponsored by: Beckhoff Automation GmbH & Co. KG

10 months agosh tests: Update $LINENO tests after $FreeBSD$ removal
Mark Johnston [Wed, 23 Aug 2023 17:24:36 +0000 (13:24 -0400)]
sh tests: Update $LINENO tests after $FreeBSD$ removal

Fixes: d0b2dbfa0ecf ("Remove $FreeBSD$: one-line sh pattern")

10 months agoMakefile: Support universe-toolchain on non-FreeBSD
Jessica Clarke [Wed, 23 Aug 2023 17:00:16 +0000 (18:00 +0100)]
Makefile: Support universe-toolchain on non-FreeBSD

We currently pass MACHINE and MACHINE_ARCH as TARGET and TARGET_ARCH
respectively for universe-toolchain, but on non-FreeBSD these may not
have values that we understand (e.g. on Linux it will be x86_64 rather
than amd64) for TARGET/TARGET_ARCH (note that we do support them for
MACHINE/MACHINE_ARCH). Since the choice is a bit arbitrary and merely
determines what LLVM's default triple will be, use amd64 on non-FreeBSD
as a known-good default.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D41545

10 months agotools/build/make.py: Make --with-default-sys-path mirror usr.bin/bmake
Jessica Clarke [Wed, 23 Aug 2023 16:56:56 +0000 (17:56 +0100)]
tools/build/make.py: Make --with-default-sys-path mirror usr.bin/bmake

The top-level Makefile passes -m to its sub-makes in order to ensure
they use the in-tree mk files in share/mk, but the top-level make itself
has to rely on whatever environment the bmake used has. For FreeBSD, we
configure the system bmake with .../share/mk:/usr/share/mk, which means
it will pick up src's share/mk whenever run from within the src tree,
but currently for non-FreeBSD we configure our bootstrap bmake only with
bmake's own mk files. This is mostly compatible, with two exceptions:

1. "targets" runs at the top level, but needs TARGET_MACHINE_LIST and
   the corresponding MACHINE_ARCH_LIST_${target}, otherwise it will just
   print an empty list.

2. "universe" and "universe-toolchain", when run at the top level (i.e.
   not via the various wrappers around universe like tinderbox), end up
   failing in universe-toolchain itself with:

     bmake[1]: "/path/to/freebsd/share/mk/src.sys.obj.mk" line 112: Cannot use MAKEOBJDIR=
     Unset MAKEOBJDIR to get default:  MAKEOBJDIR='${.CURDIR:S,^${SRCTOP},${OBJTOP},}'

By including .../share/mk in the default sys path like FreeBSD's system
bmake we ensure that we get the in-tree mk files for the top-level make,
not just sub-makes, and avoid such issues.

Note that we cannot (yet) stop using the installed mk files, since the
MAKEOBJDIRPREFIX check in Makefile runs in the object directory and uses
env -i, thereby losing the MAKESYSPATH exported by src.sys.env.mk. Other
such issues may also exist, though are likely rare if so.

Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D41544

10 months agotools/build/make.py: Keep bootstrapped bmake binary up-to-date
Jessica Clarke [Wed, 23 Aug 2023 16:56:50 +0000 (17:56 +0100)]
tools/build/make.py: Keep bootstrapped bmake binary up-to-date

We currently assume that any existing bootstrapped bmake binary will
work, but this means it never gets updated as contrib/bmake is, and
similarly we won't rebuild it as and when the configure arguments given
to boot-strap change. Whilst the former isn't necessarily a huge problem
given WANT_MAKE_VERSION rarely gets bumped in Makefile, having fewer
variables is a good thing, and so it's easiest if we just always keep it
up-to-date rather than trying to do something similar to what's already
in Makefile (which may or may not be accurate, given updating FreeBSD
gives you an updated bmake, but nothing does so for our bootstrapped
bmake on non-FreeBSD). The latter is more problematic, though, and the
next commit will be changing this configuration.

We thus now add in two checks. The first is to compare MAKE_VERSION
against _MAKE_VERSION from contrib/bmake/VERSION. The second is to
record at bootstrap time the exact configuration used, and compare that
against what we would bootstrap with.

Reviewed by: arichardson, sjg
Differential Revision: https://reviews.freebsd.org/D41556

10 months agogicv3: Add checks for the device ID
Andrew Turner [Tue, 22 Aug 2023 14:37:19 +0000 (15:37 +0100)]
gicv3: Add checks for the device ID

Add checks that the device ID is supported by the hardware and is
within the range allocated when the driver attaches.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41554

10 months agogicv3: Add a verbose message for unknown tables
Andrew Turner [Tue, 22 Aug 2023 11:30:50 +0000 (12:30 +0100)]
gicv3: Add a verbose message for unknown tables

Add a message under bootverbose when we find a gicv3 its table type
that is unknown.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41553

10 months agogicv3: Stop setting the esize field
Andrew Turner [Tue, 22 Aug 2023 11:29:03 +0000 (12:29 +0100)]
gicv3: Stop setting the esize field

The GITS_BASER esize field is read-only, there is no need to change it.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41552

10 months agoRevert "gicv3: Stop setting the esize field"
Andrew Turner [Wed, 23 Aug 2023 15:34:54 +0000 (16:34 +0100)]
Revert "gicv3: Stop setting the esize field"

This reverts commit 47a4b8ca96e3e18262629c05e46228c99a618487.

It has the wrong differential review link

10 months agoRevert "gicv3: Add a verbose message for unknown tables"
Andrew Turner [Wed, 23 Aug 2023 15:34:50 +0000 (16:34 +0100)]
Revert "gicv3: Add a verbose message for unknown tables"

This reverts commit 7f9694ad7e7c271e341cba65ce482a552ea47230.

It has the wrong differential review link

10 months agoRevert "gicv3: Add checks for the device ID"
Andrew Turner [Wed, 23 Aug 2023 15:34:42 +0000 (16:34 +0100)]
Revert "gicv3: Add checks for the device ID"

This reverts commit 950421e231e5e5067dcb09b026e14f9810cc3cd4.

It has the wrong differential review link

10 months agosyslogd: Add some basic regression tests
Jake Freeland [Thu, 22 Jun 2023 21:19:51 +0000 (16:19 -0500)]
syslogd: Add some basic regression tests

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41403

10 months agoSupport dynamically sized register sets
Andrew Turner [Wed, 23 Aug 2023 14:32:56 +0000 (15:32 +0100)]
Support dynamically sized register sets

We don't always know the size of the register set at compile time,
e.g. on arm64 the size of the SVE registers need to be queried on boot.
To support register sets that needs to be calculated at run time
query the correct size when it is zero.

Reviewed by: markj, kib (earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41302

10 months agogicv3: Add checks for the device ID
Andrew Turner [Tue, 22 Aug 2023 14:37:19 +0000 (15:37 +0100)]
gicv3: Add checks for the device ID

Add checks that the device ID is supported by the hardware and is
within the range allocated when the driver attaches.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41551

10 months agogicv3: Add a verbose message for unknown tables
Andrew Turner [Tue, 22 Aug 2023 11:30:50 +0000 (12:30 +0100)]
gicv3: Add a verbose message for unknown tables

Add a message under bootverbose when we find a gicv3 its table type
that is unknown.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41551

10 months agogicv3: Stop setting the esize field
Andrew Turner [Tue, 22 Aug 2023 11:29:03 +0000 (12:29 +0100)]
gicv3: Stop setting the esize field

The GITS_BASER esize field is read-only, there is no need to change it.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41551

10 months agogicv3: Split out finding the page size
Andrew Turner [Tue, 22 Aug 2023 10:51:26 +0000 (11:51 +0100)]
gicv3: Split out finding the page size

When adding indirect (2 level) tabled we will need to know the page
size to calculate the size of the level 1 table. To allow for this find
the page size before entering the loop to calculate the final register
value.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41551

10 months agoiavf: remove compatibility code and address some warnings
Piotr Kubaj [Tue, 22 Aug 2023 10:45:56 +0000 (12:45 +0200)]
iavf: remove compatibility code and address some warnings

Code for pre-11 FreeBSD versions is removed.
Also removed are macros that are not used anymore and "i" variable
does not shadow anymore other "i" variable.

Differential Revision: https://reviews.freebsd.org/D41547
Approved by: erj

10 months agonet: Do not overwrite if_vlan's PCP
Zhenlei Huang [Wed, 23 Aug 2023 09:48:12 +0000 (17:48 +0800)]
net: Do not overwrite if_vlan's PCP

In commit c7cffd65c5d8 the function ether_8021q_frame() was slightly
refactored to use pointer of struct ether_8021q_tag as parameter qtag to
include the new option proto.

It is wrong to write to qtag->pcp as it will effectively change the memory
that qtag points to. Unfortunately the transmit routine of if_vlan parses
pointer of the member ifv_qtag of its softc which stores vlan interface's
PCP internally, when transmitting mbufs that contains PCP the vlan
interface's PCP will get overwritten.

Fix by operating on a local copy of qtag->pcp. Also mark 'struct ether_8021q_tag'
as const so that compilers can pick up such kind of bug.

PR: 273304
Reviewed by: kp
Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39505

10 months agosctp: improve handling of SHUTDOWN and SHUTDOWN ACK chunks
Michael Tuexen [Wed, 23 Aug 2023 06:36:15 +0000 (08:36 +0200)]
sctp: improve handling of SHUTDOWN and SHUTDOWN ACK chunks

When handling a SHUTDOWN or SHUTDOWN ACK chunk detect if the peer
is violating the protocol by not having made sure all user messages
are reveived by the peer. If this situation is detected, abort the
association.

MFC after: 1 week

10 months agoarm64: xilinx: dwc3: Fix reset names
Emmanuel Vadot [Wed, 23 Aug 2023 07:41:47 +0000 (09:41 +0200)]
arm64: xilinx: dwc3: Fix reset names

Use the correct resets and not the same one three times in a row.

Reported by: rpokala
Sponsored by: Beckhoff Automation GmbH & Co. KG

10 months agoarm64: xilinx: Add glue driver for usb3 controller
Emmanuel Vadot [Wed, 23 Aug 2023 06:58:03 +0000 (08:58 +0200)]
arm64: xilinx: Add glue driver for usb3 controller

Like other dwc3 controller, on Xilinx ZynqMP the base node is just here
to provide resets, the main dwc3 controller node is a child node.

Sponsored by: Beckhoff Automation GmbH & Co. KG

10 months agolibc: iconv: zero out cv_shared on allocation
Kyle Evans [Wed, 23 Aug 2023 03:40:45 +0000 (22:40 -0500)]
libc: iconv: zero out cv_shared on allocation

Right now we have to zero-initialize most fields in the varius callers,
but this is a little error prone.  Simplify it by zeroing it out upon
allocation instead, drop the other redundant initialization.

Reviewed by: markj
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D41546

10 months agolibc: fix c*rtomb/mbrtoc*
Kyle Evans [Wed, 23 Aug 2023 03:40:45 +0000 (22:40 -0500)]
libc: fix c*rtomb/mbrtoc*

In 693f88c9da8d ("iconv_std: complete the //IGNORE support"), we
more completely implemented //IGNORE, which changed the semantics of
ci_discard_ilseq. DISCARD_ILSEQ semantics are supposed to match
//IGNORE, so we really can't do much about that particular
incompatibility.  This broke c*rtomb and mbrtoc* handling of invalid
sequences, but it turns out they don't want DISCARD_ILSEQ semantics at
all; they really want the subset that we call
_CITRUS_ICONV_F_HIDE_INVALID.

This restores the exact flow in iconv_std to precisely how it happened
prior to 693f88c9da8d.

PR: 265871
Fixes: 693f88c9da8d ("iconv_std: complete the //IGNORE support")
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D41513

10 months agoRegen
Konstantin Belousov [Tue, 22 Aug 2023 15:53:35 +0000 (18:53 +0300)]
Regen

10 months agoAdd membarrier(2)
Konstantin Belousov [Thu, 7 Oct 2021 21:10:07 +0000 (00:10 +0300)]
Add membarrier(2)

This is an attempt at clean-room implementation of the Linux'
membarrier(2) syscall.  For documentation, you would need to read
both membarrier(2) Linux man page, the comments in Linux
kernel/sched/membarrier.c implementation and possibly look at
actual uses.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32360

10 months agoAdd cpu_sync_core()
Konstantin Belousov [Thu, 7 Oct 2021 21:57:55 +0000 (00:57 +0300)]
Add cpu_sync_core()

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32360

10 months agoadd pmap_active_cpus()
Konstantin Belousov [Thu, 7 Oct 2021 22:25:54 +0000 (01:25 +0300)]
add pmap_active_cpus()

For amd64, i386, arm, and riscv, i.e. all architectures except arm64,
the custom implementation is provided since we maintain the bitmask of
active CPUs anyway.

Arm64 uses somewhat naive iteration over CPUs and match current vmspace'
pmap with the argument. It is not guaranteed that vmspace->pmap is the
same as the active pmap, but the inaccuracy should be toleratable.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32360

10 months agoofed: mask seq_num identifier to occupy only 3 bytes
Bartosz Sobczak [Tue, 22 Aug 2023 23:07:11 +0000 (16:07 -0700)]
ofed: mask seq_num identifier to occupy only 3 bytes

The seq_num among other things is used to assign rq_psn value, which is
a 24-bit identifier.  When the seq_num is full 4-byte value, we are
usually receiving: '_ib_modify_qp rq_psn overflow, masking to 24 bits'
warning.

This is burdensome for running rdma traffic with large number of
connections, because the number of logs is growing fast.

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kib@, erj@
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41531

10 months agoMakefile.asm: Drop mention of $FreeBSD$ from instructions.
John Baldwin [Tue, 22 Aug 2023 21:48:40 +0000 (14:48 -0700)]
Makefile.asm: Drop mention of $FreeBSD$ from instructions.

10 months agolibzstd: Explicitly define ZSTD_DISABLE_ASM
Jessica Clarke [Tue, 22 Aug 2023 20:01:03 +0000 (21:01 +0100)]
libzstd: Explicitly define ZSTD_DISABLE_ASM

On FreeBSD, ZSTD_ASM_SUPPORTED is defined as 0, but on macOS and Linux
it is defined as 1, yet we don't build any of the assembly sources.
Rather than add them just for bootstrapping on non-FreeBSD, explicitly
define ZSTD_DISABLE_ASM so they're not needed and everything is
consistent.

This fixes building a bootstrap LLVM toolchain on non-FreeBSD amd64 (the
only architecture with assembly available).

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D41543

10 months agoarm: Add missing no-ctfconvert for fw_stub.awk target
Jessica Clarke [Tue, 22 Aug 2023 20:00:37 +0000 (21:00 +0100)]
arm: Add missing no-ctfconvert for fw_stub.awk target

This target produces a C file not an object file, so using ctfconvert on
it should not be attempted. This keeps it in sync with all other uses of
fw_stub.awk, squashes a warning seen during the build of TEGRA124 on
FreeBSD and avoids the same issue failing the build on non-FreeBSD (such
errors are #ifdef'ed into being warnings on FreeBSD in ctfconvert, which
should be revisited in the future).

Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41542

10 months agokbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD
Jessica Clarke [Tue, 22 Aug 2023 20:00:28 +0000 (21:00 +0100)]
kbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD

Systems that predate 971bac5ace7a ("kbd: consolidate kb interfaces
(phase one)") cannot build kbdcontrol since kbdelays and kbrates moved
to sys/kbio.h. Moreover, on non-FreeBSD, it requires all kinds of ioctls
and sysctls that are highly FreeBSD-specific to build, but we use it as
a bootstrap tool to generate the keymaps used by some kernels (LINT ones
in particular). Thus, when bootstrapping kbdcontrol, disable everything
that's not needed for that singular use, and use the in-tree kbio.h to
get the definitions of the necessary structures.

This allows KBDMUX_DFLT_KEYMAP, UKBD_DFLT_KEYMAP and ATKBD_DFLT_KEYMAP
to be enabled when building on non-FreeBSD, and thus LINT kernels.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41541

10 months agotcp_info: Add and export more FreeBSD-specific fields
Marius Strobl [Tue, 22 Aug 2023 18:12:59 +0000 (20:12 +0200)]
tcp_info: Add and export more FreeBSD-specific fields

This change adds struct tcp_info fields corresponding to the following
struct tcpcb ones:
- snd_una
- snd_max
- rcv_numsacks
- rcv_adv
- dupacks

Note that while both tcp_fill_info() and fill_tcp_info_from_tcb() are
extended accordingly, no counterpart of rcv_numsacks is available in
the cxgbe(4) TOE PCB, though.

Sponsored by: NetApp, Inc. (originally)

10 months agotcp_fill_info(): Change lock assertion on INPCB to locked only
Marius Strobl [Tue, 22 Aug 2023 17:03:42 +0000 (19:03 +0200)]
tcp_fill_info(): Change lock assertion on INPCB to locked only

This function actually only ever reads from the TCP PCB. Consequently,
also make the pointer to its TCP PCB parameter const.

Sponsored by: NetApp, Inc. (originally)

10 months agoif_ovpn: clear mbuf flags on rx
Kristof Provost [Tue, 22 Aug 2023 15:39:02 +0000 (17:39 +0200)]
if_ovpn: clear mbuf flags on rx

When we receive a packet and remove the encapsulating layer we should
also clear out protocol flags and any mbuf tags.

If we do not we risk confusing firewalls filtering the tunneled packet.

See also:  https://redmine.pfsense.org/issues/14682#change-69073
Sponsored by: Rubicon Communications, LLC ("Netgate")

10 months agoetc: remove leftover leading empty comments, blank lines
Mike Karels [Tue, 22 Aug 2023 18:03:28 +0000 (13:03 -0500)]
etc: remove leftover leading empty comments, blank lines

Remove leftover empty leading comments/blank lines that had been
spacers between $FreeBSD$ and the following content in config files
in src/etc.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41548

10 months agotools/build/make.py: Grow the list of MI targets
Jessica Clarke [Tue, 22 Aug 2023 17:53:13 +0000 (18:53 +0100)]
tools/build/make.py: Grow the list of MI targets

10 months agotools/build/make.py: Make flake8 clean
Jessica Clarke [Tue, 22 Aug 2023 17:52:57 +0000 (18:52 +0100)]
tools/build/make.py: Make flake8 clean

10 months agogeom_linux_lvm: Check the offset of physical volume header
Zhenlei Huang [Tue, 22 Aug 2023 09:20:10 +0000 (17:20 +0800)]
geom_linux_lvm: Check the offset of physical volume header

The LVM label is stored on any of the first four sectors, and the
PV (physical volume) header is stored within the same sector following
the LVM label. The current implementation does not fully check the
offset of PV header, when attaching a bad formatted LVM PV the kernel
may crash due to out-of-bounds memory read.

PR: 266562
Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36773

10 months agoDocument strnstr()'s history.
David E. O'Brien [Tue, 22 Aug 2023 06:40:46 +0000 (23:40 -0700)]
Document strnstr()'s history.

10 months agobhyve: add config option to load ACPI tables into memory
Corvin Köhne [Wed, 27 Jul 2022 12:47:54 +0000 (14:47 +0200)]
bhyve: add config option to load ACPI tables into memory

For backward compatibility, the ACPI tables are loaded into the guest
memory. Windows scans the memory, finds the ACPI tables and uses them.
It ignores the ACPI tables provided by the UEFI. We are patching the
ACPI tables in the guest memory, so that's mostly fine. However, Windows
will break when the ACPI tables become to large or when we add entries
which can't be patched by bhyve. One example of an unpatchable entry, is
a TPM log. The TPM log has to be allocated by the guest firmware. As the
address of the TPM log is unpredictable, bhyve can't assign it in the
memory version of the ACPI tables. Additionally, this makes it
impossible for bhyve to calculate a correct checksum of the table.

By default ACPI tables are still loaded into guest memory for backward
compatibility. The new acpi_tables_in_memory config value can be set to
false to avoid this behaviour.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39979

10 months agolibcrypto: Update assembly build glue for x86 for OpenSSL 3.0.
John Baldwin [Tue, 22 Aug 2023 04:02:42 +0000 (21:02 -0700)]
libcrypto: Update assembly build glue for x86 for OpenSSL 3.0.

Notably, define AES_ASM which is required for any AES acceleration
(OpenSSL 1.0 gated all AES acceleration on OPENSSL_CPUID_OBJ instead).
Enabling this exposed that new assembly files added in OpenSSL 3.0
needed to be included in the build (aes-x86-64.S and aes-586.S).  Both
of these files supplant both aes_core.c and aes_cbc.c.  The last file
had to be moved out of the MI SRCS line for aes and into each ASM_*
for non-x86.

As part of this I audited the generated configdata.pm for amd64, i386,
and aarch64 and found the following additional discrepecancies that are
fixed here as well:

- Enabled BSAES_ASM on amd64 which requires bsase-x86_64.S

- Enabled WHIRLPOOL_ASM on amd64 (asm sources already built)

- Enabled CMLL_ASM on amd64 and i386 (asm sources already built)

aarch64 had no discreprecancies in configdata.pm, and no *.pl asm
generators were missing for aarch64 in Makefile.asm.  I did not check
powerpc or armv7, but for armv7 all of the asm generators seem to be
present in Makefile.asm.

Reported by: gallatin (AES-GCM using plain software on amd64)
Reviewed by: gallatin, ngie, emaste
Differential Revision: https://reviews.freebsd.org/D41539

10 months agolibcrypto: Generate new files added in OpenSSL 3.0.
John Baldwin [Tue, 22 Aug 2023 04:02:29 +0000 (21:02 -0700)]
libcrypto: Generate new files added in OpenSSL 3.0.

Reviewed by: gallatin, ngie, emaste
Differential Revision: https://reviews.freebsd.org/D41538

10 months agolibcrypto: Add new assembly files added in OpenSSL 3.0.
John Baldwin [Tue, 22 Aug 2023 04:02:12 +0000 (21:02 -0700)]
libcrypto: Add new assembly files added in OpenSSL 3.0.

This only affects amd64 and i386, but in particular includes wrappers
for AES encryption/decryption that gate all of the accelerated AES.

Reviewed by: gallatin, ngie, emaste
Differential Revision: https://reviews.freebsd.org/D41537

10 months agolibcrypto: Don't embed $FreeBSD$ in generated assembly files
John Baldwin [Tue, 22 Aug 2023 04:01:48 +0000 (21:01 -0700)]
libcrypto: Don't embed $FreeBSD$ in generated assembly files

Reviewed by: gallatin, ngie, emaste
Differential Revision: https://reviews.freebsd.org/D41536

10 months agobuild{libcompat}: Pass UNIVERSE_TOOLCHAIN_PATH to the _lc_build-tools submake
John Baldwin [Tue, 22 Aug 2023 04:00:45 +0000 (21:00 -0700)]
build{libcompat}: Pass UNIVERSE_TOOLCHAIN_PATH to the _lc_build-tools submake

This fixes make UNIVERSE_TOOLCHAIN=yes with libcompats.

Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D41535

10 months agoriscv db_trace: Ensure trapframe pointer is suitably aligned.
John Baldwin [Tue, 22 Aug 2023 04:00:26 +0000 (21:00 -0700)]
riscv db_trace: Ensure trapframe pointer is suitably aligned.

Suggested by: jrtc27
Reviewed by: jrtc27
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D41534

10 months agoDelete trailing whitespace from $FreeBSD$ removal
Warner Losh [Tue, 22 Aug 2023 01:34:15 +0000 (19:34 -0600)]
Delete trailing whitespace from $FreeBSD$ removal

Fixes: d4bf8003ee42
Sponsored by: Netflix

10 months agoUpdate freebsd-yeet for mfc
Warner Losh [Tue, 22 Aug 2023 01:37:13 +0000 (19:37 -0600)]
Update freebsd-yeet for mfc

10 months agox86: handle domains with no CPUs usable for intr delivery
Ed Maste [Fri, 18 Aug 2023 03:29:33 +0000 (23:29 -0400)]
x86: handle domains with no CPUs usable for intr delivery

We can end up with a domain having no CPUs capable of receiving I/O
interrupts.  This can occur, for example, when all APIC IDs in a given
domain are 256 or greater, and we have no IOMMU.

In this case disable per-domain interrupt support, effectively reverting
to the behaviour before commit a48de40bcc09 ("Only use CPUs in the
domain the device is attached to for default").  This has a performance
impact but at least allows the system to be functional.  It is a stop-
gap until we can rely on the presence of an IOMMU on all x86 platforms.

Thanks to AMD for providing the high-thread-count machine I used for
testing this change, and to cperciva for testing on other hardware.

Reviewed by: jhb
Tested by: cperciva, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41501

10 months agoshare/man/man7/simd.7: document new amd64 memcmp/bcmp baseline routines
Robert Clausecker [Fri, 14 Jul 2023 11:58:19 +0000 (11:58 +0000)]
share/man/man7/simd.7: document new amd64 memcmp/bcmp baseline routines

Sponsored by: The FreeBSD Foundation

bcmp(3) is implemented as a variant of memcmp(3) and benefits
from the same optimisations.

Sponsored by: The FreeBSD Foundation
Approved by: kib
Differential Revision: https://reviews.freebsd.org/D41442

10 months agolib/libc/amd64/string/memcmp.S: add baseline implementation
Robert Clausecker [Wed, 12 Jul 2023 13:35:13 +0000 (15:35 +0200)]
lib/libc/amd64/string/memcmp.S: add baseline implementation

This changeset adds a baseline implementation of memcmp and bcmp
for amd64. The same code is used for both functions with conditional
code were the behaviour differs (we need more precise output for the
memcmp case).

FreeBSD documents that memcmp returns the difference between the
mismatching characters. Slightly faster code would be possible could
we relax this requirement to the ISO/IEC 9899:1999 requirement of
merely returning a negative/positive integer or zero.

Performance is better than bionic and glibc, except for long strings
were the two are 13% faster. This could be because they use SSE4
ptest which we cannot use in a baseline kernel.

Sponsored by: The FreeBSD Foundation
Approved by: mjg
Differential Revision: https://reviews.freebsd.org/D41442

10 months agoshare/man/man7/simd.7: document SIMD-enhanced stpcpy()
Robert Clausecker [Fri, 7 Jul 2023 18:11:04 +0000 (18:11 +0000)]
share/man/man7/simd.7: document SIMD-enhanced stpcpy()

Sponsored by: The FreeBSD Foundation
Approved by: mjg kib
Differential Revision: https://reviews.freebsd.org/D41349

10 months agolib/libc/amd64/string/stpcpy.S: add baseline implementation
Robert Clausecker [Wed, 5 Jul 2023 21:23:33 +0000 (23:23 +0200)]
lib/libc/amd64/string/stpcpy.S: add baseline implementation

This commit adds a baseline implementation of stpcpy(3) for amd64.
It performs quite well in comparison to the previous scalar implementation
as well as agains bionic and glibc (though glibc is faster for very long
strings).  Fiddle with the Makefile to also have strcpy(3) call into the
optimised stpcpy(3) code, fixing an oversight from D9841.

Sponsored by: The FreeBSD Foundation
Reviewed by: imp ngie emaste
Approved by: mjg kib
Fixes: D9841
Differential Revision: https://reviews.freebsd.org/D41349

10 months agounifdef: Vendorize.
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:49:23 +0000 (19:49 +0200)]
unifdef: Vendorize.

10 months agounifdef: Reapply our 7102ec5226e5.
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:44:16 +0000 (19:44 +0200)]
unifdef: Reapply our 7102ec5226e5.

10 months agounifdef: Reapply our 61287be18189.
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:43:21 +0000 (19:43 +0200)]
unifdef: Reapply our 61287be18189.

10 months agoAdd 'contrib/unifdef/' from commit '0da44885831dc0a43c4ca6ff04a2430993cc0a80'
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:51:03 +0000 (19:51 +0200)]
Add 'contrib/unifdef/' from commit '0da44885831dc0a43c4ca6ff04a2430993cc0a80'

git-subtree-dir: contrib/unifdef
git-subtree-mainline: 3b7ffacdee49f90716cba2bcf8af3fc1971ae031
git-subtree-split: 0da44885831dc0a43c4ca6ff04a2430993cc0a80

10 months agoAdd missing version.h.
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:48:44 +0000 (19:48 +0200)]
Add missing version.h.

10 months agoImport unifdef 2.12
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:33:42 +0000 (19:33 +0200)]
Import unifdef 2.12

10 months agoImport unifdef 2.11
Dag-Erling Smørgrav [Mon, 21 Aug 2023 17:33:26 +0000 (19:33 +0200)]
Import unifdef 2.11

10 months agopctrie: change for vm_radix compatibility
Doug Moore [Mon, 21 Aug 2023 17:28:51 +0000 (12:28 -0500)]
pctrie: change for vm_radix compatibility

Restructure parts of pctrie code to make it more compatible with the
needs of vm_radix code.

1. End passing function pointers for memory management.

By breaking insertion into two functions, the call for allocating
memory can happen at the top level and be inlined, rather than
happening via an function pointer to a memory allocator.

By changing the remove function slightly, freeing of memory, when
necessary, can happen at the top level and be inlined.

By turning the reclamation code into two functions, one for starting
iteration over to-be-freed nodes and the other continuing it, all the
freeing can happen at the top level and be inlined.

2. Offer a version of remove that does not panic and returns the freed
value (or NULL).
3. Offer a 'replace' operation, to replace one leaf with another that
has the same key.

These are three of the roadblocks that prevent code sharing between
pctrie and vm_radix code.

Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D41396

10 months agoe6000sw: support building without FDT
Luiz Otavio O Souza [Mon, 21 Aug 2023 09:59:25 +0000 (11:59 +0200)]
e6000sw: support building without FDT

This enables the use of this driver on platorms without device tree,
such as Netgate's XG-7100.

Sponsored by: Rubicon Communications, LLC ("Netgate")

10 months agortld: switch from malloc_aligned() to __crt_aligned_alloc()
Konstantin Belousov [Sun, 30 Jul 2023 01:51:52 +0000 (04:51 +0300)]
rtld: switch from malloc_aligned() to __crt_aligned_alloc()

Use regular free(), since it works now.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41150

10 months agortld_malloc: add __crt_aligned_alloc_offset()
Konstantin Belousov [Sat, 22 Jul 2023 04:21:45 +0000 (07:21 +0300)]
rtld_malloc: add __crt_aligned_alloc_offset()

It is modelled after aligned_alloc(3).  Most importantly, to free the
allocation, __crt_free() can be used.  Additionally, caller may specify
offset into the aligned allocation, so that we return offset-ed from
alignment pointer.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41150

10 months agortld_malloc: increase overhead index to uint16
Konstantin Belousov [Tue, 25 Jul 2023 12:54:45 +0000 (15:54 +0300)]
rtld_malloc: increase overhead index to uint16

Reorder it with magic, to keep alignment.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41150

10 months agortld_malloc.c: change return type of cp2op() to void
Konstantin Belousov [Sun, 30 Jul 2023 01:58:01 +0000 (04:58 +0300)]
rtld_malloc.c: change return type of cp2op() to void

for it to be useful to return unaligned pointer.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41150

10 months agohwpmc: on process exit, ensure that the owned log is closed
Konstantin Belousov [Sun, 13 Aug 2023 13:42:49 +0000 (16:42 +0300)]
hwpmc: on process exit, ensure that the owned log is closed

Tested by: pho (previous version)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41521

10 months agopf tests: test syncookies on IPv6
Kristof Provost [Mon, 21 Aug 2023 06:06:50 +0000 (08:06 +0200)]
pf tests: test syncookies on IPv6

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

10 months agopf: enable the syncookie feature for IPv6
Kajetan Staszkiewicz [Mon, 21 Aug 2023 06:01:29 +0000 (08:01 +0200)]
pf: enable the syncookie feature for IPv6

When syncookie support was added to pf the relevant work was only done
in pf_test(), not pf_test6(). Do this now.

MFC after: 1 week
Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D41502

10 months agopf: reduce indentation
Kajetan Staszkiewicz [Mon, 21 Aug 2023 05:59:49 +0000 (07:59 +0200)]
pf: reduce indentation

Early-return to reduce syncookie-related indentation.

No functional change.

MFC after: 1 week
Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D41502

10 months agoPMC_OP_CONFIGURELOG: cleanup logging process if aborting due to pm_flags
Konstantin Belousov [Sun, 20 Aug 2023 20:16:58 +0000 (23:16 +0300)]
PMC_OP_CONFIGURELOG: cleanup logging process if aborting due to pm_flags

Reported by: pho
Fixes: 8e63e787abbd69d29e55e2e0b2aa0aa624339f3b
Sponsored by: The FreeBSD Foundation

10 months agortw89: update driver from upstream
Bjoern A. Zeeb [Tue, 16 May 2023 23:44:56 +0000 (23:44 +0000)]
rtw89: update driver from upstream

This is a set of updates of the rtw89 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1).
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5).
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3).
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).
(wt-2023-08-13) 81e147b1317ee7cde8b624ee8c0501b470d7e91c (after v6.5-rc5).

MFC after:      20 days

10 months agomt76: update driver from upstream
Bjoern A. Zeeb [Tue, 23 May 2023 23:03:09 +0000 (23:03 +0000)]
mt76: update driver from upstream

This is a set of updates of the mt76 driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
  This adds support for mt7996 as well.
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

The current version of LinuxKPI lacks support for "page pool" which
needs enhancing and updating a decade or so old shortcut mapping
struct page directly to struct vm_page.

MFC after: 20 days

10 months agoath12k: import driver from upstream
Bjoern A. Zeeb [Sun, 11 Jun 2023 00:23:44 +0000 (00:23 +0000)]
ath12k: import driver from upstream

Import BSD-3-Clause-Clear ath12k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1)
with further updates based on
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4),
(wt-2023-08-13) 81e147b1317ee7cde8b624ee8c0501b470d7e91c (after v6.5-rc5).

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working (as does ath11k).
There was interest by various people to enhance support further
for ath11k which will equally benefit ath12k.

Given the lack of full license texts on the files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by: core (jhb, 2023-05-11) [1]
MFC after:      20 days

10 months agoath11k: update driver from upstream
Bjoern A. Zeeb [Sat, 20 May 2023 00:36:03 +0000 (00:36 +0000)]
ath11k: update driver from upstream

This is a set of updates of the ath11k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

MFC after: 20 days

10 months agoath10k: update driver from upstream
Bjoern A. Zeeb [Sat, 20 May 2023 00:37:02 +0000 (00:37 +0000)]
ath10k: update driver from upstream

This is a set of updates of the ath10k driver based on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

MFC after: 20 days

10 months agoath1xk_common: update common athk files from upstream
Bjoern A. Zeeb [Sat, 20 May 2023 00:38:12 +0000 (00:38 +0000)]
ath1xk_common: update common athk files from upstream

Update ath1xk_common based on wireless-testing (wt-2023-05-11)
711dca0ca3d77414f8f346e564e9c8640147f40d (right after v6.4-rc1).

MFC after: 20 days

10 months agoath10k: specifically mark a debug workaround for an early firmware crash
Bjoern A. Zeeb [Wed, 17 May 2023 20:21:14 +0000 (20:21 +0000)]
ath10k: specifically mark a debug workaround for an early firmware crash

During the last import a (debug) workaround to avoid an early firmware
crash was imported.  In order to remember and to separate it from
upstream sources put it under #ifdef

MFC after: 20 days

10 months agoLinuxKPI: 802.11: update compat code for updated drivers
Bjoern A. Zeeb [Tue, 16 May 2023 22:07:53 +0000 (22:07 +0000)]
LinuxKPI: 802.11: update compat code for updated drivers

Adjust and add structs, fields, functions to make more modern versions
of LinuxKPI based wireless drivers (based on wireless-testing (
wt-2023-06-09, wt-2023-07-24, and later)) compile.

Some of these changes can only be applied once all drivers get
updated to not break the old versions currently in the tree.
Mark those changes with __FOR_LATER_DRV_UPDATE for now and flip the
switch at a later point.

Sponsored by: The FreeBSD Foundation
MFC after: 20 days

10 months agolibc/gen/_pthread_stubs.c: Remove stray whitespaces
Konstantin Belousov [Sun, 20 Aug 2023 22:32:43 +0000 (01:32 +0300)]
libc/gen/_pthread_stubs.c: Remove stray whitespaces

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 months agolibc: export pthread_getname_np stub
Minsoo Choo [Mon, 14 Aug 2023 22:21:24 +0000 (18:21 -0400)]
libc: export pthread_getname_np stub

pthread_getname_np needs to be provided by libc in order to import
jemalloc 5.3.0.

A stub implementation for libc pthread_getname_np() is added for
_pthread_stubs.c, which always reports empty name for the main thread.

Internal _pthread_getname_np() is not exported, but provided for libc
own use.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41461

10 months agoshare/mk/bsd.cpu.mk: Add AMD Zen 4 for x86
Daniel Engberg [Sun, 20 Aug 2023 21:54:19 +0000 (23:54 +0200)]
share/mk/bsd.cpu.mk: Add AMD Zen 4 for x86

Main difference between older Zen variants is that this supports AVX-512

Reviewed by: imp (previous version), emaste
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D41331

10 months agossh: fix OpenSSH 9.4 regression with multiplexed sessions
Ed Maste [Sun, 20 Aug 2023 19:16:54 +0000 (15:16 -0400)]
ssh: fix OpenSSH 9.4 regression with multiplexed sessions

Upstream commit message:
upstream: fix regression in OpenSSH 9.4 (mux.c r1.99) that caused
multiplexed sessions to ignore SIGINT under some circumstances.
Reported by / feedback naddy@, ok dtucker@

OpenBSD-Commit-ID: 4d5c6c894664f50149153fd4764f21f43e7d7e5a

Fixes: 535af610a4fd ("ssh: Update to OpenSSH 9.4p1")
Obtained from: OpenSSH 803e22eabd3b
Sponsored by: The FreeBSD Foundation

10 months agortld: unlock bind lock when calling into crt __pthread_distribute_static_tls method
Konstantin Belousov [Fri, 18 Aug 2023 19:52:24 +0000 (22:52 +0300)]
rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method

The method might require resolving and binding symbols, which means
recursing on the bind lock. It is safe to unlock the bind lock,
since we operate on the private object list, and user attempting to
unload an object from the list of not yet fully loaded objects caused
self-inflicted race.

It is similar to how we treat user' init/fini methods.

Reported by: stevek
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 months agoAdd atopcase, the Apple HID over SPI input driver
Val Packett [Sun, 20 Aug 2023 09:53:32 +0000 (12:53 +0300)]
Add atopcase, the Apple HID over SPI input driver

The driver provides support for Human Interface Devices (HID) on
Serial Peripheral Interface (SPI) buses on Apple Intel Macs
produced in 2015-2018.

The driver appears to work more stable after installation of Darwin OSI
in acpi(4) driver.
To install Darwin OSI insert following lines into /boot/loader.conf:

hw.acpi.install_interface="Darwin"
hw.acpi.remove_interface="Windows 2009, Windows 2012"

Reviewed by: wulf
Differential revision: https://reviews.freebsd.org/D39863

10 months agobcm5974(4): add support for devices attached over SPI bus
Val Packett [Sun, 20 Aug 2023 09:53:32 +0000 (12:53 +0300)]
bcm5974(4): add support for devices attached over SPI bus

Reviewed by: wulf

10 months agoAdd plug and play information macro for SPI bus.
Vladimir Kondratyev [Sun, 20 Aug 2023 09:53:32 +0000 (12:53 +0300)]
Add plug and play information macro for SPI bus.

Matching table format is compatible with ACPI_ID_PROBE bus method.