]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 weeks agoadduser: Overhaul.
Dag-Erling Smørgrav [Fri, 19 Apr 2024 15:11:16 +0000 (17:11 +0200)]
adduser: Overhaul.

Most importantly:

* Make local variables local.
* Use `$()` instead of backticks.
* Avoid unsafe use of `-a` and `-o` operators in `test` expressions.
* Remove a hack intended to ease the transition from Perl 22 years ago.

MFC after: 1 week
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44863

6 weeks agoldconfig: use little-endian hints file on all architectures
Stefan Eßer [Fri, 19 Apr 2024 14:49:57 +0000 (16:49 +0200)]
ldconfig: use little-endian hints file on all architectures

Remove the test for building on a big-endian architecture, which
preserved the previous default of creating the ELF hints file in
native byte-order of the respective architecture.

Support for little-endian hints files has been added to the
run-time linker and the pkg command.

This is a step towards architecture independent little-endian hints
files, but support for big-endian hints files shall only be removed
from the run-time linker (and ldconfig and pkg) when the last release
that defaulted to hints files in host-byte has been declared EOL.

Reviewed by:    kib
Tested by: tuexen
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D44734

6 weeks agoldconfig: small optimization
Stefan Eßer [Fri, 19 Apr 2024 14:29:12 +0000 (16:29 +0200)]
ldconfig: small optimization

Swap which side of a comparison is byte-swapped by be32toh()
on little-endian architectures.

The be32toh() macro just returns the operand and big-endian
architectures and returns it byte-swapped on little-endian
architectures.

When operating on a constant argument, the compiler can perform
the swap operation at build time instead of swapping the data
read from the hints file at run time.

Reviewed by: kib
Tested by: tuexen
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44734

7 weeks agoarm: Fix a typo in a KASSERT message
Gordon Bergling [Fri, 19 Apr 2024 06:54:39 +0000 (08:54 +0200)]
arm: Fix a typo in a KASSERT message

- s/resoure/resource/

MFC after: 5 days

7 weeks agouipc_shm: Fix a free() of an uninitialized variable
Mark Johnston [Fri, 19 Apr 2024 00:15:51 +0000 (20:15 -0400)]
uipc_shm: Fix a free() of an uninitialized variable

Reported by: Coverity
CID: 1544043
Fixes: b112232e4fb9 ("uipc_shm: Copyin userpath for ktrace(2)")

7 weeks agoice(4): Update to 1.39.13-k
Eric Joyner [Tue, 13 Feb 2024 06:26:26 +0000 (22:26 -0800)]
ice(4): Update to 1.39.13-k

- Adds mirror interface functionality
- Remove unused virtchnl headers

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC-with: 768329961dc0c041f7647f1c4549944a2ca168aa
MFC after: 3 days
Sponsored by: Intel Corporation
Tested by: jeffrey.e.pieper@intel.com
Differential Revision: https://reviews.freebsd.org/D44004

7 weeks agoice(4): Update copyright year to 2024
Eric Joyner [Tue, 13 Feb 2024 06:25:47 +0000 (22:25 -0800)]
ice(4): Update copyright year to 2024

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D44003

7 weeks agoiflib: Add subinterface interrupt allocation function
Eric Joyner [Wed, 18 Jan 2023 00:46:39 +0000 (16:46 -0800)]
iflib: Add subinterface interrupt allocation function

The ice(4) driver will add the ability to create extra interfaces
that hang off of the base interface; to do that the driver requires
a method for the subinterface to request hardware interrupt resources
from the base interface.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39930

7 weeks agoiflib: Add sysctl to request extra MSIX vectors on driver load
Eric Joyner [Wed, 22 Mar 2023 19:18:44 +0000 (12:18 -0700)]
iflib: Add sysctl to request extra MSIX vectors on driver load

Intended to be used with upcoming feature to add sub-interfaces, since
those new interfaces will be dynamically created and will need to have
spare MSI-X interrupts already allocated for them on driver load.

This sysctl is marked as a tunable since it will need to be set before
the driver is loaded since MSI-X interrupt allocation and setup is
done during the attach process.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41326

7 weeks agoUpdate sys.dirdeps.mk set default DEP_*
Simon J. Gerraty [Thu, 18 Apr 2024 21:07:24 +0000 (14:07 -0700)]
Update sys.dirdeps.mk set default DEP_*

Even at level 0 it is handy to default DEP_*
used by Makefile.depend* to aid the first include if
in a leaf dir.

Reviewed by: stevek

7 weeks agosound: Remove obsolete DV_F_* flags
Christos Margiolis [Thu, 18 Apr 2024 20:35:26 +0000 (22:35 +0200)]
sound: Remove obsolete DV_F_* flags

The ISA sound drivers that used them are retired.

Last reference of DV_F_DRQ_MASK and DV_F_DUAL_DMA:
716924cb4832ea0a440daf09913a06f3166f243e ("Retire snd_sbc ISA sound card
driver")

Last reference of DV_F_DEV_MASK and DV_F_DEV_SHIFT:
5126e5eeeb5e07ceef3c809452a8c9f508b2d4d1 ("Retire snd_mss ISA sound card
driver")

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

7 weeks agosound: Simplify unit fetching in dsp_oss_audioinfo()
Christos Margiolis [Thu, 18 Apr 2024 20:35:20 +0000 (22:35 +0200)]
sound: Simplify unit fetching in dsp_oss_audioinfo()

"i" keeps the value of the current unit, so we do not have to call
PCMUNIT() and device_get_unit() to fetch it.

In the mixer case, I think it is more correct to do it like this, since
mixer and DSP device units have a 1-1 relationship (i.e the mixer unit
is always the same as the corresponding DSP device one) and that way we
can make it more clear.

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

7 weeks agosound: Remove PCMMINOR()
Christos Margiolis [Thu, 18 Apr 2024 20:35:15 +0000 (22:35 +0200)]
sound: Remove PCMMINOR()

It's a NO-OP.

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

7 weeks agosound: Remove obsolete chn_setvolume()
Christos Margiolis [Thu, 18 Apr 2024 20:35:11 +0000 (22:35 +0200)]
sound: Remove obsolete chn_setvolume()

It is marked as obsolete and there are no consumers of it anymore.

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

7 weeks agosound: Get rid of snddev_info->devcount
Christos Margiolis [Thu, 18 Apr 2024 20:35:06 +0000 (22:35 +0200)]
sound: Get rid of snddev_info->devcount

snddev_info->devcount keeps track of the total number of channels for a
given device. However, it is redundant to have it, since it is only used
in sound_oss_sysinfo() to populate the "numaudios" field, and we also
keep track of the channel counts in the playcount, pvchancount, reccount
and rvchancount fields anyway. We can simply sum those fields together
instead of updating a separate variable upon every channel
addition/deletion.

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

7 weeks agosound: Call device_get_name() and device_get_unit() only once in mixer_init()
Christos Margiolis [Thu, 18 Apr 2024 20:35:01 +0000 (22:35 +0200)]
sound: Call device_get_name() and device_get_unit() only once in mixer_init()

No functional change intended.

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

7 weeks agosound: Be more verbose with virtual channel descriptions
Christos Margiolis [Thu, 18 Apr 2024 20:34:45 +0000 (22:34 +0200)]
sound: Be more verbose with virtual channel descriptions

Non-virtual channel description denote "play" or "record", so do the
same for virtual ones as well.

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

7 weeks agotcp rack: improve BBR_LOG_CWND event
Michael Tuexen [Thu, 18 Apr 2024 19:57:44 +0000 (21:57 +0200)]
tcp rack: improve BBR_LOG_CWND event

Fix a typo, which resulted in missing r_ctl.gate_to_fs in the BBLog
event.

Reported by: Coverity Scan
CID: 1540024
Reviewed by: rrs, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44648

7 weeks agotcp: drop data received after a FIN has been processed
Michael Tuexen [Thu, 18 Apr 2024 19:50:31 +0000 (21:50 +0200)]
tcp: drop data received after a FIN has been processed

RFC 9293 describes the handling of data in the CLOSE-WAIT, CLOSING,
LAST-ACK, and TIME-WAIT states:
This should not occur since a FIN has been received from the remote
side. Ignore the segment text.
Therefore, implement this handling.

Reviewed by: rrs, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44746

7 weeks agoorganization.dot: Fix typos
Mateusz Piotrowski [Thu, 18 Apr 2024 19:59:49 +0000 (21:59 +0200)]
organization.dot: Fix typos

MFC after: 3 days

7 weeks agoCONTRIBUTING: request only one submission type per change
Ed Maste [Thu, 18 Apr 2024 18:38:54 +0000 (14:38 -0400)]
CONTRIBUTING: request only one submission type per change

We have some instances of contributors opening a GitHub pull request and
a Phabricator review for the same change, which divides or duplicates
review effort.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44856

7 weeks agoCONTRIBUTING: mention sys/crypto as another "contrib" directory
Ed Maste [Thu, 18 Apr 2024 18:44:30 +0000 (14:44 -0400)]
CONTRIBUTING: mention sys/crypto as another "contrib" directory

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44857

7 weeks agoshare/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures
Dimitry Andric [Thu, 18 Apr 2024 17:46:57 +0000 (19:46 +0200)]
share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures

As discussed in bug 278417, some ports require the F16C instruction set
to compile, but there is no way yet to detect whether the currently
chosen CPUTYPE supports this feature.

Add the feature to the MACHINE_CPU variable, for each processor that
supports it. The list of processors was extracted from clang 18's -dM
output, filtered on the __F16C__ define.

PR: 278417
Reviewed by: brooks, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44848

7 weeks agoAdd preliminary in-tree CI infrastructure for developers
Muhammad Moinur Rahman [Thu, 18 Apr 2024 17:57:38 +0000 (19:57 +0200)]
Add preliminary in-tree CI infrastructure for developers

The goal of this project is to integrate the relevant scripts from the
FreeBSD-CI project (https://github.com/freebsd/freebsd-ci) into the src
repository. This allows developers to run the test suite similar to how
it is executed on ci.freebsd.org, and eventually, have it directly used
by our CI system. This effort is also part of the workflow improvement
project, aiming to incorporate pre-merge testing.

Current Features:
* Does smoke tests using either bhyve(amd64 only) or qemu(Non x86_64 or
  when defined USE_QEMU=1). Currently defined CITYPE=smoke. Once we have
  added full tests we can also utilize something like CITYPE=full
* Most of the resources are dynamically allocated based on available
  resources in the host
* If CPU supports POPCNT or vmm can be loaded then bhyve is used for
  amd64 otherwise automatically installs and uses qemu@nox11
* When required third party applications or packages for booting non-x86
  images are automatically installed

Current Limitation:
* Does not support full tests like the one in our Jenkins
* At this moment this is also not suitable to be used in our Jenkins
  platform as the jobs are divided in multiple smaller tasks and
  artifacts are moved here and there which are not exactly the scenario
  for individual developers.

Future Works:
* Add full tests like the one in ci.freebsd.org
* Add different tests or options to disable some tests
* Add test profiles full
* Possibly add test through Cloud Providers like AWS/GCP/Azure or Cirrus
  or Github Actions
* Update documentation

Test Plan:
cd /usr/src/tests/ci
make ci
make TARGET=amd64 TARGET_ARCH=amd64 ci
make TARGET=amd64 TARGET_ARCH=amd64 USE_QEMU=1 ci
make TARGET=arm64 TARGET_ARCH=aarch64 ci
make TARGET=powerpc TARGET_ARCH=powerpc64 ci
make TARGET=powerpc TARGET_ARCH=powerpc64le ci
make TARGET=riscv TARGET_ARCH=riscv64 ci

Reviewed by:           lwhsu
Sponsored by:          The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43786

7 weeks agointro(7): add link to new networking(7)
Mitchell Horne [Thu, 18 Apr 2024 17:58:33 +0000 (14:58 -0300)]
intro(7): add link to new networking(7)

It improves the discoverability of the page.

Sponsored by: The FreeBSD Foundation

7 weeks agohier.7: polish entry to system manual
Alexander Ziaee [Wed, 20 Mar 2024 17:40:57 +0000 (13:40 -0400)]
hier.7: polish entry to system manual

Entries reworded to improve grammar or add keywords:
- document description: substitute layout for index for first-glance
- /etc/freebsd/update.conf
- /usr/share/vi/

Entries that have been wordshuffled for brevity or consistency:
- /{bin,libexec,nonexistent,sbin,tmp}/
- /boot/dtb/overlays/
- /boot/{defaults,efi,kernel,lua}/
- /usr/libexec/
- /var/{db,games,lib,log/{bsdisks.log,spool/,tmp/}}
- /usr/share/sysroot/VERSION/MACHINE.MACHINE_ARCH/ (unfold a little)
- /usr/local/share/doc/freebsd/ (unfold a little)

Entries that have macro or linking adjustments:
- /{boot,boot/efi,dev,etc,home,sbin,usr/bin}/ (overview or intro pages)
- /media/ (bsdisks is from ports, but afaik pulled by every desktop)
- /usr/share/{lib/,lib/dtrace/,libdata/games/,man/}/ (intro pages)
- /var/log/messages (syslog(3) -> syslogd(8))

Entries that have been added:
- /dev/{cuaU0,vmm,zvol}/
- /usr/share/{atf,bhyve}/
- /usr/share/libexec/hyperv/ (thanks @rtprio)
- /local/<subdirectories>/
- /var/log/debug.log (thanks @pauamma)
- /var/spool/{lock,lpd}

Please forgive my earlier mistakes fixed in this commit:
- /{dev,/usr/share/{calendar,misc}} : accidentally reverted description
- /etc/local-unbound.conf/ (wrong link)
- /usr/{freebsd-dist,lib32,libdata},/var/log/{dmesg.today,lpd-errs} (typos)
- /{usr/libdata/gcc/,var/log/bsdisks.log} (removed, unnecessary)

PR: 261349
Reviewed by: mhorne
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1131

7 weeks agodumpon: fix set but not used variable
inkeliz [Wed, 17 Apr 2024 21:22:44 +0000 (21:22 +0000)]
dumpon: fix set but not used variable

Signed-off-by: inkeliz <inkeliz@inkeliz.com>
Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1178

7 weeks agotools: Remove stray "then"
Cy Schubert [Thu, 18 Apr 2024 14:31:13 +0000 (07:31 -0700)]
tools: Remove stray "then"

Fixes: 26a09db3add3

7 weeks agovtnet: use CURVNET_SET() instead of CURVNET_SET_QUIET()
Gleb Smirnoff [Thu, 18 Apr 2024 14:58:00 +0000 (07:58 -0700)]
vtnet: use CURVNET_SET() instead of CURVNET_SET_QUIET()

We don't expect the VNET context to be set for virtqueue neither
for taskqueue handlers.

Suggested by: zec
Fixes: 3f2b9607756d0f92ca29c844db0718b313a06634

7 weeks agooce(4): Fix a typo in a source code comment
Gordon Bergling [Thu, 18 Apr 2024 14:19:18 +0000 (16:19 +0200)]
oce(4): Fix a typo in a source code comment

- s/addres/address/

MFC after: 3 days

7 weeks agomuge(4): Fix a typo in a source code comment
Gordon Bergling [Thu, 18 Apr 2024 14:18:26 +0000 (16:18 +0200)]
muge(4): Fix a typo in a source code comment

- s/addres/address/

MFC after: 3 days

7 weeks agonetpfil: Fix typos in source code comments
Gordon Bergling [Thu, 18 Apr 2024 14:17:10 +0000 (16:17 +0200)]
netpfil: Fix typos in source code comments

- s/addres/address/

MFC after: 3 days

7 weeks agoFix incremental build with WITH_NVME newly enabled
Brooks Davis [Thu, 18 Apr 2024 13:57:38 +0000 (14:57 +0100)]
Fix incremental build with WITH_NVME newly enabled

rescue.mk doesn't get updated when options change so nvme_util.o is now
missing on architectures were NVME was previously marked BROKEN.

Reviewed by: imp
Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken.
Differential Revision: https://reviews.freebsd.org/D44826

7 weeks agolib{c,sys}: normalize export of openat, setcontext, and swapcontext
Brooks Davis [Tue, 16 Apr 2024 22:26:29 +0000 (23:26 +0100)]
lib{c,sys}: normalize export of openat, setcontext, and swapcontext

List them in the symbol map rather than using the __sym_default to
expose them.  This will allow later improvements in the stub
implementations in libc.so.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44113

7 weeks agolibsys: expose a few more symbols for libc's use
Brooks Davis [Tue, 16 Apr 2024 21:50:52 +0000 (22:50 +0100)]
libsys: expose a few more symbols for libc's use

These private symbols are used by libc so expose as we do with
auxargs bits rather then relying on duplicate implementations in libc.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44114

7 weeks agolibcompiler_rt Makefile.inc: update _Float16/__bf16 checks
Dimitry Andric [Wed, 17 Apr 2024 20:20:47 +0000 (22:20 +0200)]
libcompiler_rt Makefile.inc: update _Float16/__bf16 checks

Clang supports __bf16 for riscv from version 18.0 onwards, so update the
checks for it. While here, rewrite the checks so they are hopefully more
readable, and also handle gcc a little better.

In addition, define COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_BFLOAT16
when these features should be available, since there are some parts in
compiler-rt that check for these defines.

PR: 276104
MFC after: 1 month

7 weeks agocrunchgen: add --list option
Martin Tournoij [Wed, 17 Apr 2024 16:04:27 +0000 (10:04 -0600)]
crunchgen: add --list option

"bsdbox --list" will print all tools in the binary, one per line. The
main use case for this is to make it easier to create links:

for t in $(bsdbox --list); do
ln -s bsdbox $t
done

The name --list was taken from busybox.

This just adds a new "program" with the name "--list". I don't think we
need to do real argument parsing here, and this is also how busybox does
it.

An additional minor change is that just "bsdbox" will no longer print
the binary name itself ("bsdbox" in this case). Before it would do:

% bsdbox
usage: boxlike <prog> <args> ..., where <prog> is one of:
 cp ls mv bsdbox

And now just:

% bsdbox
usage: boxlike <prog> <args> ..., where <prog> is one of:
 cp ls mv

And just "bsdbox" will also exit with code 0 (and print to stdout)
rather than exit with 0 and print to stderr

Example output:

% ./bsdbox
usage: bsdbox program [args ...]
       bsdbox --list
       program [args ...]

bsdbox combines several programs in one executable. Create a link to this
executable with the program name to run that program, or give the program
name as the first argument.

Currently defined programs:
 true false tail head uname

% ./bsdbox --list
true
false
tail
head
uname

% ./bsdbox uname -a
FreeBSD freebsd 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64

% ln -s bsdbox uname
% ./uname -a
FreeBSD freebsd 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64

Pull Request: https://github.com/freebsd/freebsd-src/pull/894
Signed-off-by: Martin Tournoij <martin@arp242.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/894

7 weeks agoheimdal: asn1: Use unsigned bitfields for named bitsets
Dimitry Andric [Wed, 17 Apr 2024 17:49:30 +0000 (19:49 +0200)]
heimdal: asn1: Use unsigned bitfields for named bitsets

Import upstream 6747e1628:

  asn1: Use unsigned bitfields for named bitsets

  Signed 1-bit bitfields are undefined in C.

This should fix the following warnings, which for unknown reasons are
errors in CI:

  /usr/src/crypto/heimdal/lib/hx509/ca.c:1020:22: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1020 |         ku.digitalSignature = 1;
        |                             ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1021:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1021 |         ku.keyEncipherment = 1;
        |                            ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1028:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1028 |         ku.keyCertSign = 1;
        |                        ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1029:13: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1029 |         ku.cRLSign = 1;
        |                    ^ ~

PR: 276960
Fixes: 1b7487592987
MFC after: 1 week

7 weeks agoheimdal: Add 64-bit integer support to ASN.1 compiler
Dimitry Andric [Tue, 16 Apr 2024 18:56:37 +0000 (20:56 +0200)]
heimdal: Add 64-bit integer support to ASN.1 compiler

Import upstream 19d378f44:

  ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
  on whether the constraint ranges include numbers that cannot be
  represented in 32-bit ints and whether they include negative
  numbers.

  Template backend support included.  check-template is now built with
  --template, so we know we're testing it.

  Tests included.

Also adjusts the generated files:
* asn1parse.c, asn1parse.h (not strictly necessary, but nice to have)
* der-protos.h, which needs a bunch of new prototypes. I copied these
  from a der-protos.h generated by the upstream build system, which
  uses a perl script for this.
* adjust printf format strings for int64_t. Upstream uses %lld for this,
  but that is not portable, and leads to lots of -Werror warnings.

This should fix target-dependent differences between headers generated
by asn1_compile. For example, when cross compiling world from amd64 to
i386, the generated cms_asn1.h header has:

  CMSRC2CBCParameter ::= SEQUENCE {
    rc2ParameterVersion   INTEGER (0..-1),
    iv                    OCTET STRING,
  }

while a native build on i386 has:

  CMSRC2CBCParameter ::= SEQUENCE {
    rc2ParameterVersion   INTEGER (0..2147483647),
    iv                    OCTET STRING,
  }

These are _both_ wrong, since the source file, cms.asn1, has:

  CMSRC2CBCParameter ::= SEQUENCE {
          rc2ParameterVersion   INTEGER (0..4294967295),
          iv                    OCTET STRING -- exactly 8 octets
  }

PR: 276960
Reviewed by: cy, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44814
Differential Revision: https://reviews.freebsd.org/D44815

7 weeks agonetworking.7 : create network quickstart guide
Alexander Ziaee [Wed, 17 Apr 2024 15:51:35 +0000 (09:51 -0600)]
networking.7 : create network quickstart guide

Now that the handbook has been moved to ports, I think it's very nice to
have a network quickstart guide in-band, in base, in the system manual.
If the user uses any of the following terms "man -k
{network,networking,wifi,quickstart}" this page will come up, which is I
think a very common use case for new users.

Currently, this document explains connecting to a basic Ethernet
network, a basic wifi network, scanning for wifi networks, and airplane
mode, as well as linking to other sections, including the handbook

Co-authored-by: Graham Perrin <grahamperrin@gmail.com>
Reviewed by: imp, bcr, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/833

7 weeks agonfsserver: Rate-limit messages about requests from unprivileged ports
Mark Johnston [Wed, 17 Apr 2024 14:36:58 +0000 (10:36 -0400)]
nfsserver: Rate-limit messages about requests from unprivileged ports

If access from unreserved ports is disabled, then a remote host can
cause an NFS server to log a message by sending a packet.  This is
useful for diagnosing problems but bad for resiliency in the case where
the server is being spammed with a large number of rejected requests.

Limit prints to once per second (racily).

Reviewed by: rmacklem, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44819

7 weeks agonuageinit: start the script after zfs
Baptiste Daroussin [Wed, 17 Apr 2024 14:25:02 +0000 (16:25 +0200)]
nuageinit: start the script after zfs

It prevents the home directory for the new users to be hidden
by late mount of the home directory

7 weeks agolibarchive: add two missing package files to libarchive tests
Martin Matuska [Wed, 17 Apr 2024 07:58:32 +0000 (09:58 +0200)]
libarchive: add two missing package files to libarchive tests

MFC after: 1 week

7 weeks agolibarchive: fix null format string error in tests (unbreaks gcc13 build)
Martin Matuska [Wed, 17 Apr 2024 07:33:13 +0000 (09:33 +0200)]
libarchive: fix null format string error in tests (unbreaks gcc13 build)

Obtained from: libarchive (d43c39247)
MFC after: 1 week

7 weeks agozfs: unbreak aarch64 build with non-gcc compilers
Martin Matuska [Tue, 16 Apr 2024 23:34:25 +0000 (01:34 +0200)]
zfs: unbreak aarch64 build with non-gcc compilers

Workaround until a permanent fix comes from vendor

7 weeks agoWITH_NVME: Remove from broken.
Warner Losh [Tue, 16 Apr 2024 23:07:49 +0000 (17:07 -0600)]
WITH_NVME: Remove from broken.

NVME works everywhere, so we can eliminate this. We may remove the
option altogether.

Sponsored by: Netflix
Discussed with: ken, jhb

7 weeks agonvmecontrol: One file per line
Warner Losh [Tue, 16 Apr 2024 22:37:30 +0000 (16:37 -0600)]
nvmecontrol: One file per line

Move to a one file per line setup, and sort the files alphabetically.

Sponsored by: Netflix
Reviewed by: chuck, jhb
Differential Revision: https://reviews.freebsd.org/D44684

7 weeks agonvmecontrol: Add nvme 2.0 fields to read_logpage
Warner Losh [Tue, 16 Apr 2024 22:37:20 +0000 (16:37 -0600)]
nvmecontrol: Add nvme 2.0 fields to read_logpage

Add the lpo, ot, csi and uuid_index fields to read_logpage. The logpage
command has not been updated to allow these to be specified.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44683

7 weeks agonvmecontrol: Preliminary namespace documentation
Warner Losh [Tue, 16 Apr 2024 22:37:02 +0000 (16:37 -0600)]
nvmecontrol: Preliminary namespace documentation

Provide preliminary namespace subcommand documentation, along with some
basic definitions from the NVM standards relating to namespaces.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D44682

7 weeks agonvmecontrol: add newlines where needed for ns command printfs
Warner Losh [Tue, 16 Apr 2024 22:36:54 +0000 (16:36 -0600)]
nvmecontrol: add newlines where needed for ns command printfs

Sponsored by: Netflix
Reviewed by: chuck, jhb
Differential Revision: https://reviews.freebsd.org/D44681

7 weeks agonvme: Eliminate intel_log_temp_stats_swapbytes
Warner Losh [Tue, 16 Apr 2024 22:36:47 +0000 (16:36 -0600)]
nvme: Eliminate intel_log_temp_stats_swapbytes

We can't post a AER for this page, so there's no need to be able to swap
it to host byte order. It's not one of the standard defined pages that
can post via AER, and the vendor's public docs for this temperature page
don't suggest it's possible to get over or under event changes. Since
nvmecontrol no longer needsd the swap routine, remove it since it's
now unused.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44659

7 weeks agonvmecontrol: Move intel temperature page printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:41 +0000 (16:36 -0600)]
nvmecontrol: Move intel temperature page printing to little endian orderinng

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44658

7 weeks agonvmecontrol: Move sanitize status page printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:36 +0000 (16:36 -0600)]
nvmecontrol: Move sanitize status page printing to little endian orderinng

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44657

7 weeks agonvmecontrol: Move reservation notifcation page printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:31 +0000 (16:36 -0600)]
nvmecontrol: Move reservation notifcation page printing to little endian orderinng

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44656

7 weeks agonvmecontrol: Move command effeccts page printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:25 +0000 (16:36 -0600)]
nvmecontrol: Move command effeccts page printing to little endian orderinng

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44655

7 weeks agonvmecontrol: Move self test status page printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:19 +0000 (16:36 -0600)]
nvmecontrol: Move self test status page printing to little endian orderinng

Also, add printing vnedor_specific field, which doesn't have a valid
bit, so is always valid.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44654

7 weeks agonvmecontrol: Move namespace change page printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:13 +0000 (16:36 -0600)]
nvmecontrol: Move namespace change page printing to little endian orderinng

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44653

7 weeks agonvmecontrol: Move smart/health printing to little endian orderinng
Warner Losh [Tue, 16 Apr 2024 22:36:05 +0000 (16:36 -0600)]
nvmecontrol: Move smart/health printing to little endian orderinng

Move health printing to little endian ordering...

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44652

7 weeks agonvmecontrol: Fix to128 for big endian targets
Warner Losh [Tue, 16 Apr 2024 22:35:59 +0000 (16:35 -0600)]
nvmecontrol: Fix to128 for big endian targets

The source is always 128-bits in little endian format. For big endian
hosts, we have to convert, or we print bogus numbers.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44651

7 weeks agonvmecontrol: Have to truncate on all 32-bit architectures
Warner Losh [Tue, 16 Apr 2024 22:35:53 +0000 (16:35 -0600)]
nvmecontrol: Have to truncate on all 32-bit architectures

armv7, powerpc, powerpcspe and i386 all lack 128-bit integer
types. Adjust the comment and #ifdef. I don't think we support nvme on
any of these other architectures at the moment, but it won't hurt to be
more precise.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44650

7 weeks agonvmecontrol: Make the error log page work on native format
Warner Losh [Tue, 16 Apr 2024 22:35:46 +0000 (16:35 -0600)]
nvmecontrol: Make the error log page work on native format

As the number of page types proliferates, it becomes untennable to
convert them in read_logpage (especailly since new UUID page types will
need to be supported). Convert the error page printing code to operate
on little endian data.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44680

7 weeks agonvmecontrol: Create letoh to generically convert to host order
Warner Losh [Tue, 16 Apr 2024 22:35:33 +0000 (16:35 -0600)]
nvmecontrol: Create letoh to generically convert to host order

Using _Generic, create letoh which will generically convert uintXX_t
types from little endian to host, regardless of the size. This name has
been floated as a possible addition to endian.h.

Sponsored by: Netflix
Discussed with: jhb
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44649

7 weeks agoarm_kernel_bothdr.awk: Update to latest ota
Warner Losh [Mon, 15 Apr 2024 21:07:46 +0000 (15:07 -0600)]
arm_kernel_bothdr.awk: Update to latest ota

The latest ota is the first one in FreeBSD that treats 0 + "0xf" as
being '0' instead of '15'. Don't use this old trick anymore to convert
from hexidecimal to a number. Write a function to do that instead. This
fixes kernel.bin building on arm*. awk on 14 doesn't need this, but to
build FreeBSD stable/14's kernel.bin on 15 we'll need it, so fast MFC.

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision:  https://reviews.freebsd.org/D44801

7 weeks agocp: Use warnc().
Dag-Erling Smørgrav [Wed, 17 Apr 2024 02:07:20 +0000 (04:07 +0200)]
cp: Use warnc().

MFC after: 1 week
Sponsored by: Klara, Inc.

7 weeks agoinstall: Assorted nitpickery.
Dag-Erling Smørgrav [Wed, 17 Apr 2024 01:36:42 +0000 (03:36 +0200)]
install: Assorted nitpickery.

* Use `errc()` instead of manually setting `errno` before calling `err()`.
* Change one warning into a fatal error.
* Drop some unnecessary casts.
* `strlcat()` bounds checks were off-by-one.  This does not matter in
  practice because the subsequent code renders an overrun harmless.
* We were passing `SSIZE_MAX` to `copy_file_range()` instead of the
  requested size.  This only matters if we're asked to install a file
  which is still being written to while we are copying it.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44810

7 weeks agoinstall: Remove the mmap(2) option.
Dag-Erling Smørgrav [Wed, 17 Apr 2024 01:36:31 +0000 (03:36 +0200)]
install: Remove the mmap(2) option.

We already removed it from cp(1) over a year ago but never followed up
here.  Do so now, for the same reasons: significant complexity for
little to no benefit.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44809

7 weeks agocp: Additional sanity check.
Dag-Erling Smørgrav [Wed, 17 Apr 2024 01:36:26 +0000 (03:36 +0200)]
cp: Additional sanity check.

Once we've successfully opened the file we've been asked to copy, check
that it's of the same type as FTS told us it was.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D44806

7 weeks agocp: Clarify an obscure comment.
Dag-Erling Smørgrav [Wed, 17 Apr 2024 01:36:22 +0000 (03:36 +0200)]
cp: Clarify an obscure comment.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44805

7 weeks agoacpi_battery: avoid divide-by-zero when no devices have capacity info
Josef 'Jeff' Sipek [Tue, 16 Apr 2024 23:01:28 +0000 (19:01 -0400)]
acpi_battery: avoid divide-by-zero when no devices have capacity info

On laptops with builtin batteries, disconnecting the battery may show up
as a battery without any capacity information. (The theory is that one
is disconnecting the cells but the electronics identifying the battery
are still connected.) As a result, the loop over all batteries in
acpi_battery_get_battinfo results in total_lfcap == 0.

So, just check that total_lfcap is non-zero to avoid a division by zero
(triggerable by sysctl hw.acpi.battery).

Reported by: Stefano Marinelli
Tested by: Stefano Marinelli
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44818

7 weeks agoexports.5: Clarify that exported dirs should be local mount points
Mark Johnston [Tue, 16 Apr 2024 22:25:57 +0000 (18:25 -0400)]
exports.5: Clarify that exported dirs should be local mount points

If not, then in general the entire filesystem containing the exported
directory is accessiable.  This may be surprising, so try to make it
more clear.

Reviewed by: rmacklem, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44614

7 weeks agoexports.5: Update an example to use service(8)
Mark Johnston [Tue, 16 Apr 2024 22:25:19 +0000 (18:25 -0400)]
exports.5: Update an example to use service(8)

MFC after: 1 week

7 weeks agolibarchive: merge from vendor branch
Martin Matuska [Tue, 16 Apr 2024 21:39:31 +0000 (23:39 +0200)]
libarchive: merge from vendor branch

Libarchive 3.7.3

New features:
  #1941 uudecode filter: support file name and file mode in raw mode
  #1943 7-zip reader: translate Windows permissions into UNIX
        permissions
  #1962 zstd filter now supports the "long" write option
  #2012 add trailing letter b to bsdtar(1) substitute pattern
  #2031 PCRE2 support
  #2054 add support for long options "--group" and "--owner" to tar(1)

Security fixes:
  #2101 Fix possible vulnerability in tar error reporting introduced
        in f27c173

Important bugfixes:
  #1974 ISO9660: preserve the natural order of links
  #2105 rar5: fix infinite loop if during rar5 decompression the last
        block produced no data
  #2027 xz filter: fix incorrect eof at the end of an lzip member
  #2043 zip: fix end-of-data marker processing when decompressing zip
        archives

PR: 278315 (exp-run)
MFC after: 1 week

7 weeks agolibc/arm: export __signalcontext not _signalcontext
Brooks Davis [Tue, 16 Apr 2024 17:05:16 +0000 (18:05 +0100)]
libc/arm: export __signalcontext not _signalcontext

The former exists and architectures other than aarch64 and riscv provide
it.  The later does not exist.

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

7 weeks agolibcxxrt: don't export nonexistant symbols
Brooks Davis [Tue, 16 Apr 2024 17:04:16 +0000 (18:04 +0100)]
libcxxrt: don't export nonexistant symbols

Remove version entries that we don't build.

Add an arm specific Version.map and for other targets run the files
through sed to handle int vs long in new and delete.

Ideally we'd use the SYMBOL_MAPS functionality to preprocess with cpp,
but it doesn't currently handle C++ symbols so be annoyingly duplicative
for now.

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

7 weeks agolibgcc_s: exclude symbols not present on some arches
Brooks Davis [Tue, 16 Apr 2024 17:03:42 +0000 (18:03 +0100)]
libgcc_s: exclude symbols not present on some arches

arm, aarch64, and riscv lack some/all frame_info interfaces.
arm and powerpc lack some numeric functions.

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

7 weeks agolibgcc_s: only export 128-bit int APIs when available
Brooks Davis [Tue, 16 Apr 2024 17:03:21 +0000 (18:03 +0100)]
libgcc_s: only export 128-bit int APIs when available

These interfaces are only compiled when the platform supports 128-bit
ints.  Use a CRT_HAS_128BIT guard similar to the one used in the
compiler_rt sources.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D44323

7 weeks agolibgcc_s: only export 128-bit long double when available
Brooks Davis [Tue, 16 Apr 2024 17:02:55 +0000 (18:02 +0100)]
libgcc_s: only export 128-bit long double when available

These functions are only available on aarch64 and riscv so only try to
export them on those architectures.

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

7 weeks agolibrpcsec_gss: don't export non-existant symbols
Brooks Davis [Tue, 16 Apr 2024 17:02:14 +0000 (18:02 +0100)]
librpcsec_gss: don't export non-existant symbols

rpc_gss_mesh_to_oid was never implemented.

This doesn't seem to be any reason why we would need to export the _stub
functions, but it's also a little unclear to me why the linker thinks
they aren't present.  Perhaps they should be static.

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

7 weeks agolibc: don't try to export __sF
Brooks Davis [Tue, 16 Apr 2024 17:01:54 +0000 (18:01 +0100)]
libc: don't try to export __sF

This symbol has been static since 2008 (commit 1e98f88776fc).

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

7 weeks agolibc: don't try to export _nsdbtdump
Brooks Davis [Tue, 16 Apr 2024 17:01:45 +0000 (18:01 +0100)]
libc: don't try to export _nsdbtdump

It is only present when compiling nsdispatch.c with -D_NSS_DEBUG and we
provide no mechanism to do so.

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

7 weeks agolibc: don't try to export mexitcount
Brooks Davis [Tue, 16 Apr 2024 17:01:35 +0000 (18:01 +0100)]
libc: don't try to export mexitcount

This requires that mcount.c be compiled with -DGUPROF and we provide no
mechanism to do so.

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

7 weeks agolibc: don't try to export mpool_stat
Brooks Davis [Tue, 16 Apr 2024 17:01:25 +0000 (18:01 +0100)]
libc: don't try to export mpool_stat

This requires that mpool.c be compiled with -DSTATISTICS and we provide
no mechanism to do this.

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

7 weeks agolibc: only export hesiod symbols when enabled
Brooks Davis [Tue, 16 Apr 2024 17:00:54 +0000 (18:00 +0100)]
libc: only export hesiod symbols when enabled

Create a seperate symbol file for hesiod and conditionally include it.
This allows linkage with --no-undefined-version.

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

7 weeks agozfs: merge openzfs/zfs@90ba19eb7
Martin Matuska [Tue, 16 Apr 2024 20:52:34 +0000 (22:52 +0200)]
zfs: merge openzfs/zfs@90ba19eb7

Notable upstream pull request merges:
 #15784 90ba19eb7b Do no use .cfi_negate_ra_state within the assembly
                   on Arm64
 #15942 b6bbaa8372 Give a better message from 'zpool get' with invalid
                   pool name
 #15943 ca678bc0bc Makefile.bsd: sort and cleanup source file list
 #15953 fa480fe5ba zinject: show more device fault fields
 #15983 30c4eba4ea Fix panics when truncating/deleting files
 #15992 99741bde59 zvol: use multiple taskq
 #16015 a100a195fa Add support for zfs mount -R <filesystem>
 #16022 5e5fd0a178 Speculative prefetch for reordered requests
 #16040 997f85b4d3 L2ARC: Relax locking during write
 #16042 b12738182c Improve dbuf_read() error reporting
 #16051 a9a4290173 xdr: header cleanup
 #16052 eeca9a91d6 Fix read errors race after block cloning
 #16057 aa5445c28b Remove db_state DB_NOFILL checks from syncing context
 #16061 76d1dde94c zinject: inject device errors into ioctls
 #16072 9e63631dea Small fix to prefetch ranges aggregation
 #16077 44f337be30 Illumos#16463 zfs_ioc_recv leaks nvlist
 #16085 4725e543be zinject: "no-op" error injection
 #16086 c6da985e28 Add the BTI elf note to the AArch64 SHA2 assembly

Obtained from: OpenZFS
OpenZFS commit: 90ba19eb7b81f0225e63bedfb902000d23383921

7 weeks agoiflib: Correct indentation according to style(9)
Stephen J. Kiernan [Tue, 16 Apr 2024 18:35:57 +0000 (14:35 -0400)]
iflib: Correct indentation according to style(9)

The indentation style for the SYSCTL_* macros used was not matching KNF.

Reported by: jhb
Differential Revision: https://reviews.freebsd.org/D44811

7 weeks agomfc-candidates: fix output order with incorrect commit dates
Ed Maste [Tue, 16 Apr 2024 15:41:05 +0000 (11:41 -0400)]
mfc-candidates: fix output order with incorrect commit dates

Previously we obtained the list of MFC candidate hashes (i.e., those
commits only in the mfc-from branch), removed the already-merged
commits based on "cherry picked from" commit message entries, and then
printed the list sorted by commit time.  This is usually the correct
order, but it is not when commits have non-monotonically-increasing
commit times.  This is unfortunately the case for a number of commits in
our tree.  This made it difficult to merge some groups of dependent
commits in the correct order.

Instead, leave the from-list in git rev-parse order, and move the
matching logic to a new lua script.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44808

7 weeks agolibc: INTERPOS_SYS macro for interposed syscalls
Brooks Davis [Tue, 16 Apr 2024 16:48:08 +0000 (17:48 +0100)]
libc: INTERPOS_SYS macro for interposed syscalls

This macro makes uses the __sys_<foo>_t typedefs from libsys.h to
greatly simplify calling functions in the interposing table.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44389

7 weeks agolib{c,rt}: use libsys.h for __sys_* declerations
Brooks Davis [Tue, 16 Apr 2024 16:48:07 +0000 (17:48 +0100)]
lib{c,rt}: use libsys.h for __sys_* declerations

Use the genreated source of truth for system call declerations.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44388

7 weeks agolibsys: add a libsys.h
Brooks Davis [Tue, 16 Apr 2024 16:48:07 +0000 (17:48 +0100)]
libsys: add a libsys.h

This declares an API for libsys which currently consists of
__sys_<foo>() declarations for system call stubs and function pointer
typedefs of the form __sys_<foo>_t.  The vast majority of the
implementation resides in a generated _libsys.h which ensures that all
system call stub declarations match syscalls.master.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44387

7 weeks agomakesyscalls: generate core libsys header
Brooks Davis [Tue, 16 Apr 2024 16:48:07 +0000 (17:48 +0100)]
makesyscalls: generate core libsys header

Create a header covering most of the "stable" libsys interfaces.
Specifically __sys_<foo> syscall stubs and __sys_<foo>_t typedefs for
those interfaces.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44386

7 weeks agomergemaster: postpone removal to FreeBSD 15
Ed Maste [Tue, 16 Apr 2024 14:19:14 +0000 (10:19 -0400)]
mergemaster: postpone removal to FreeBSD 15

Mergemaster has been deprecated for quite some time, but was not
removed prior to FreeBSD 14.0.  Update the deprecation notice in the man
page to reflect this.

PR: 274967
Reported by: naddy
Sponsored by: The FreeBSD Foundation

7 weeks agotzsetup: be explicit about *timezone* abbreviation
Ed Maste [Mon, 25 Mar 2024 20:25:23 +0000 (16:25 -0400)]
tzsetup: be explicit about *timezone* abbreviation

During the install process tzsetup asks a question like

    Does the abbreviation `EDT' look reasonable?

The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not.  A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.

Reviewed by: bapt, brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500

7 weeks agomv: Set file flags after setting file times
Ricardo Branco [Sat, 16 Mar 2024 17:13:10 +0000 (18:13 +0100)]
mv: Set file flags after setting file times

Some file flags prevent modification of file times, so they should be
set later.  This matches NetBSD's behaviour.

Reviewed by: markj
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1138

7 weeks agostress2: Add an option to exit on error
Peter Holm [Tue, 16 Apr 2024 08:22:03 +0000 (10:22 +0200)]
stress2: Add an option to exit on error

7 weeks agostress2: Add new unionfs test scenarios
Peter Holm [Tue, 16 Apr 2024 08:21:14 +0000 (10:21 +0200)]
stress2: Add new unionfs test scenarios

7 weeks agox86/xen: fix accounted interrupt time
Roger Pau Monné [Tue, 5 Mar 2024 13:15:03 +0000 (14:15 +0100)]
x86/xen: fix accounted interrupt time

The current addition to the interrupt nesting level in
xen_arch_intr_handle_upcall() needs to be compensated in
xen_intr_handle_upcall(), otherwise interrupts dispatched by the upcall handler
end up seeing a td_intr_nesting_level of 2 or more, which makes them assume
there's been an interrupt nesting.

Such extra interrupt nesting count lead to statclock() reporting idle time as
interrupt, as the call from interrupt context will always be seen as a nested
one (td->td_intr_nesting_level >= 2) due to the nesting count increase done by
both xen_arch_intr_handle_upcall() and intr_execute_handlers().

Fix this by adjusting the nested interrupt count before dispatching interrupts
from xen_intr_handle_upcall().

PR: 277231
Reported by: Matthew Grooms <mgrooms@shrew.net>
Fixes: af610cabf1f4 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter')
Sponsored by: Cloud Software Group
Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com>

7 weeks agotcp bbr: improve code consistency
Michael Tuexen [Mon, 15 Apr 2024 21:52:08 +0000 (23:52 +0200)]
tcp bbr: improve code consistency

Improve code consistency with the RACK stack.
Reviewed by: gallatin, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44800

7 weeks agosrc.libnames.mk: fix LIBPFCTL definition
Lexi Winter [Sun, 14 Apr 2024 10:37:46 +0000 (11:37 +0100)]
src.libnames.mk: fix LIBPFCTL definition

Following the convention used in the rest of this file, ${LIBPFCTLDIR}
should refer to the directory, and ${LIBPFCTL} to the library itself.

Instead, both values were assigned to ${LIBPFCTL}, and ${LIBPFCTLDIR} was
not set at all.

This appears to be a simple typo and not a deliberate choice, so fix it
by assigning the directory name to ${LIBPFCTLDIR} instead.

7 weeks agoDo no use .cfi_negate_ra_state within the assembly on Arm64
Tino Reichardt [Mon, 15 Apr 2024 20:56:10 +0000 (22:56 +0200)]
Do no use .cfi_negate_ra_state within the assembly on Arm64

Compiling openzfs on aarch64 with gcc-8 and gcc-9 is failing currently.
See issue #14965 for deeper context.

On platforms without pointer authentication, .cfi_negate_ra_state can be
defined to a no-op:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/aarch64-tdep.c#l1413

I have tested this on Arm64 FreeBSD 13.2 and AlmaLinux-8.

Reviewed-by: Andrew Turner <andrew.turner4@arm.com>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #14965
Closes #15784

7 weeks agoAdd the BTI elf note to the AArch64 SHA2 assembly
Andrew Turner [Mon, 15 Apr 2024 20:53:39 +0000 (21:53 +0100)]
Add the BTI elf note to the AArch64 SHA2 assembly

On ELF platforms there is a note to specify when an application or
library supports BTI. When linking one of these the linker needs
all input object files to have the note. If not it will not include
it in the output file.

Normally the compiler would generate it, but for assembly files we
need to do it our selves.

Add the note to the aarch64 sha256 and sha512 assembly files.

Tested by building with BTI enabled and using the -zbti-report=error
flag to lld that makes it an error if the note is missing.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Andrew Turner <andrew.turner4@arm.com>
Closes #16086