]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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>

6 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

6 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.

6 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

6 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

6 weeks agozinject: "no-op" error injection
Rob N [Mon, 15 Apr 2024 20:52:20 +0000 (06:52 +1000)]
zinject: "no-op" error injection

When injected, this causes the matching IO to appear to succeed, but the
actual work is never submitted to the physical device. This can be used
to simulate a write-back cache servicing a write, but the backing device
has failed and the cache cannot complete the operation in the
background.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16085

6 weeks agozts: allow running a single test by name only
Rob N [Mon, 15 Apr 2024 20:44:12 +0000 (06:44 +1000)]
zts: allow running a single test by name only

Specifying a single test is kind of a hassle, because the full relative
path under the test suite dir has to be included, but it's not always
clear what that path even is.

This change allows `-t` to take the name of a single test instead of a
full path. If the value has no `/` characters, we search for a file of
that name under the test root, and if found, use that as the full test
path instead.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Akash B <akash-b@hpe.com>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16088

6 weeks agosys/acl.h: reduce header pollution
Brooks Davis [Mon, 15 Apr 2024 16:55:07 +0000 (17:55 +0100)]
sys/acl.h: reduce header pollution

In commit d1dfd921774f0 the acl allocator was switched from malloc(9) to
uma(9) and done in a way required vm/uma.h and prerequisites.  This added
considerable header pollution to sys/sysproto.h.  The uma details were
hidden in commit b998d381f2868, but the header pollution remained.  Add
less broad includes as required to keep the header self contained.

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

6 weeks agoacl_to_text: include sys/param.h for MAXLOGNAME
Brooks Davis [Mon, 15 Apr 2024 16:54:53 +0000 (17:54 +0100)]
acl_to_text: include sys/param.h for MAXLOGNAME

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

6 weeks agosysproto.h: sys/acl.h -> sys/types.h
Brooks Davis [Mon, 15 Apr 2024 16:54:28 +0000 (17:54 +0100)]
sysproto.h: sys/acl.h -> sys/types.h

In sysproto.h, stop including sys/acl.h as syscall defintions now use
__acl* types from sys/_types.h.  Add sys/types.h to provide types
previously provided by sys/param.h (via sys/acl.h).

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

6 weeks agosys/_{cpu,domain}set.h: don't require sys/param.h
Brooks Davis [Mon, 15 Apr 2024 16:53:39 +0000 (17:53 +0100)]
sys/_{cpu,domain}set.h: don't require sys/param.h

Add machine/param.h for MAXCPU and MAXMEMDOM in the _KERNEL case of
sys/_cpuset.h and sys/_domainset.h, making them more self contained.

This eliminates the need to include sys/param.h before sys/cpuset.h and
sys/domainset.h.

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

6 weeks agoReduce reliance on sys/sysproto.h pollution
Brooks Davis [Mon, 15 Apr 2024 16:53:05 +0000 (17:53 +0100)]
Reduce reliance on sys/sysproto.h pollution

Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed.

sys/sysproto.h currently includes sys/acl.h which currently includes
sys/param.h, sys/queue.h, and vm/uma.h which in turn bring in
sys/errno.h sys/malloc.h.

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

6 weeks agosys/malloc.h: move sys/proc.h MALLOC_DECLAREs here
Brooks Davis [Mon, 15 Apr 2024 16:52:40 +0000 (17:52 +0100)]
sys/malloc.h: move sys/proc.h MALLOC_DECLAREs here

This avoids the need to explicitly include sys/malloc.h before
sys/proc.h.

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

6 weeks agoLinuxKPI: add __counted_by() and __nonstring
Bjoern A. Zeeb [Tue, 2 Apr 2024 09:41:54 +0000 (09:41 +0000)]
LinuxKPI: add __counted_by() and __nonstring

Add checks for __counted_by(_x) and __nonstring as and depending
on compiler support enable the attribute/feature.

This is needed to make mtk76 and ath1xk drivers compile.

Sposnored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste, dim
Differential Revision: https://reviews.freebsd.org/D44587

6 weeks agogit/mfc-candidates.sh: allow comments in exclude file
Bjoern A. Zeeb [Tue, 28 Nov 2023 19:09:07 +0000 (19:09 +0000)]
git/mfc-candidates.sh: allow comments in exclude file

As branches ages, the list of unmerged or unmergable changes may grow
longer.  In some cases it is helpful to group and or annotate them
in an exclude file.  Filtering out lines starting with "#" allows adding
comment lines to aid tracking.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42790

6 weeks agoLinuxKPI: 802.11: disable early queue wakeup workaround; better classify
Bjoern A. Zeeb [Fri, 16 Feb 2024 21:14:02 +0000 (21:14 +0000)]
LinuxKPI: 802.11: disable early queue wakeup workaround; better classify

We used to call lkpi_wake_tx_queues() for all queues early on in order
to make sure they are ready.  Turns out whatever logic in iwlwifi
startup is working correctly these days under LinuxKPI so this is no
longer needed.  As the comment indicated the "workaround" did not
always work.  Disable it for now.

The second part of the improvement is to properly classify Non-QOS
non-data frames (mgmt and ctl frames for now, unless we have to be
even more careful in the future about certain sub-types) as TID 7/VO.
Contrary to net80211 we must not promote PAE frames.

PR: 274382
MFC after: 3 day
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43944

6 weeks agonet80211: amrr_init: change order of commands
Bjoern A. Zeeb [Mon, 5 Feb 2024 14:48:08 +0000 (14:48 +0000)]
net80211: amrr_init: change order of commands

First run the KASSERT before trying to do the free operation.
Better for reporting and debugging.
Add a guard setting the value to NULL afterwards.  NULL pointers
are a lot easier to test for.

MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43751

6 weeks agoLinuxKPI: 802.11: remove unneeded re-lookup in lkpi_80211_txq_tx_one()
Bjoern A. Zeeb [Sun, 18 Feb 2024 18:07:00 +0000 (18:07 +0000)]
LinuxKPI: 802.11: remove unneeded re-lookup in lkpi_80211_txq_tx_one()

Given we are passed the lsta in as a function argument there is no
need to re-lookup the sta by ni and possibly not find it.
We know the sta and ni from the lsta and whether it is uploaded to
firmware or not we can check directly from the local lsta flag.

MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43965

6 weeks agoLinuxKPI: add devm_kfree()
Bjoern A. Zeeb [Tue, 2 Apr 2024 09:45:43 +0000 (09:45 +0000)]
LinuxKPI: add devm_kfree()

mt76 calls devm_kfree() directly, so alias it to our
lkpi_devm_kmalloc_release() function.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44589

6 weeks agoMerge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):
Dimitry Andric [Mon, 15 Apr 2024 16:24:39 +0000 (18:24 +0200)]
Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):

  [SimplifyCFG] Fix crash when there is unreachable large index (#88616)

  The large case index out of scope is dead code, but it is still be
  created for TableContents in SwitchLookupTable::SwitchLookupTable,
  so make sure the table size after growing should not get smaller.

  Fix https://github.com/llvm/llvm-project/issues/88607

This should fix "Assertion failed: (idx < size()), function operator[]"
when building the science/dynare port.

PR: 276104, 278320
Reported by: yuri
MFC after: 1 month

6 weeks agoLinuxKPI: napi_schedule() requires return value, implement napi_is_scheduled()
Bjoern A. Zeeb [Sun, 31 Mar 2024 17:27:45 +0000 (17:27 +0000)]
LinuxKPI: napi_schedule() requires return value, implement napi_is_scheduled()

A newer version of iwlwifi requires a return value from napi_schedule();
unclear if the function always should have been bool. Add the bool to test
based on the napi_schedule_prep() result.

Also add napi_is_scheduled() for rtw89.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste (previous version)
Differential Revision: https://reviews.freebsd.org/D44591

6 weeks agoLinuxKPI: sk_buff: implement skb_queue_splice_tail_init()
Bjoern A. Zeeb [Tue, 2 Apr 2024 09:17:31 +0000 (09:17 +0000)]
LinuxKPI: sk_buff: implement skb_queue_splice_tail_init()

Implement skb_queue_splice_tail_init() and SKB_DATA_ALIGN() as
needed by the mt76 wireless driver.

Sponsord by: The FreeBD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44590

6 weeks agoiflib: Fix compiler warnings
Stephen J. Kiernan [Wed, 3 Apr 2024 20:21:55 +0000 (16:21 -0400)]
iflib: Fix compiler warnings

Some of the QUAD sysctls are actually for unsigned quad values.
Switch to using UQUAD instead, as that is meant for unsigned.

Reviewed by: erj, jhb
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44620

6 weeks agosnd_hda: fix "duplicated free" on module unloading
Michael Zhilin [Sat, 13 Apr 2024 09:59:24 +0000 (12:59 +0300)]
snd_hda: fix "duplicated free" on module unloading

This is trivial fix of hdacc_detach to avoid duplicated free on snd_hda
unloading.

The first try of detaching (kldunload) may results into "device busy" error,
but codec->fgs is freed by detach. Second try attempts to free codec->fgs again
and system panicks.

Here is example:

pcm0: unregister: channel pcm0:virtual:dsp0.vp0 busy (pid 3428)
pulseaudio[3428] [oss] module-oss.c: DSP shutdown.
pcm0: detached
hdaa0: detached
panic: Duplicate free of 0xfffff80412ee7d20 from zone 0xfffffe006bc0ba00
(malloc-32) slab 0xfffff80412ee7fc8(105)
cpuid = 6
time = 1712999565
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0202f859e0
vpanic() at vpanic+0x135/frame 0xfffffe0202f85b10
panic() at panic+0x43/frame 0xfffffe0202f85b70
uma_dbg_free() at uma_dbg_free+0x105/frame 0xfffffe0202f85b90
uma_zfree_arg() at uma_zfree_arg+0x95/frame 0xfffffe0202f85be0
free() at free+0xa1/frame 0xfffffe0202f85c20
hdacc_detach() at hdacc_detach+0x2f/frame 0xfffffe0202f85c40
device_detach() at device_detach+0x197/frame 0xfffffe0202f85c80
devclass_driver_deleted() at devclass_driver_deleted+0x66/frame 0xfffffe0202f85c
devclass_delete_driver() at devclass_delete_driver+0x81/frame 0xfffffe0202f85d00
driver_module_handler() at driver_module_handler+0xff/frame 0xfffffe0202f85d50
module_unload() at module_unload+0x32/frame 0xfffffe0202f85d70
linker_file_unload() at linker_file_unload+0x1eb/frame 0xfffffe0202f85db0
kern_kldunload() at kern_kldunload+0x18e/frame 0xfffffe0202f85e00
amd64_syscall() at amd64_syscall+0x153/frame 0xfffffe0202f85f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0202f85f30

MFC after:              3 days
Reviewed by:            markj, christos
Differential Revision:  https://reviews.freebsd.org/D44778
Sponsored by:           Postgres Professional

6 weeks agosnd_hda: Add the full Intel Meteor/Arrow/Lunar Lake HD Audio PCI IDs
Michael Zhilin [Sat, 13 Apr 2024 09:57:59 +0000 (12:57 +0300)]
snd_hda: Add the full Intel Meteor/Arrow/Lunar Lake HD Audio PCI IDs

This is based off the Linux file sound/hda/intel-dsp-config.c.

Tested on:              Lenovo Thinkbook 16 G6+ IMH
MFC after:              3 days
Reviewed by:            markj, christos
Differential Revision:  https://reviews.freebsd.org/D44777
Sponsored by:           Postgres Professional

6 weeks agorelease: Build dvd image before staging pkgs
Colin Percival [Sun, 14 Apr 2024 22:31:26 +0000 (15:31 -0700)]
release: Build dvd image before staging pkgs

This missing dependency is only visible with -jN (which was otherwise
broken until recently) and only when building DVD images (which aren't
included in weekly snapshots and thereby slipped past testing).

MFC after: 3 days

6 weeks agoMakefile.vm: Set CLEANDIRS correctly for vm-image
Colin Percival [Sun, 14 Apr 2024 22:27:19 +0000 (15:27 -0700)]
Makefile.vm: Set CLEANDIRS correctly for vm-image

With multiple filesystems and disk image formats, we now use different
staging directories; we need to include them all in CLEANDIRS.

Fixes: 97bd53ef4d20b "Makefile.vm: Fix duplicate rc.conf files"
MFC after: 3 days

6 weeks agorelease: Use the ABI of the target release to fetch packages
John Baldwin [Sat, 13 Apr 2024 21:16:01 +0000 (14:16 -0700)]
release: Use the ABI of the target release to fetch packages

- Point --rootdir at the installed destdir in the dvd tree.  This
  causes pkg to determine the ABI from the installed destdir instead
  of the host's binaries.  Previously the result was that packages
  for the host's ABI were always downloaded breaking cross-releases
  (e.g. arm64 releases built on an amd64 host included amd64
  packages on the DVD ISO image rather than arm64 packages).  This
  also handles version mismatches, and I tested this by cross-building
  a 15.x arm64 release on a 14.x amd64 host.

- As a result, pkg now does a chdir(3) to the rootdir before running,
  so the -o argument to fetch needs to be updated to be relative to
  rootdir instead of the CWD as make runs.

- Add a new ROOTDIR variable to limit references to "dvd" to one
  place.  Ideally ROOTDIR would be an argument to this script so
  that it didn't really know about the dvd layout at all.

- While here, simplify creation of symlinks by just using a longer
  path to the link name instead of using 'cd' in the shell before
  invoking ln(1).  Also use ln -sf to create the pkg.pkg symlink
  rather than rm + ln.

PR: 278273
Reported by: gatekeeper <tiago.gasiba@gmail.com>
Reviewed by: imp, delphij
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44749

6 weeks agocloudware: allow disk format to be a list
Colin Percival [Sun, 14 Apr 2024 17:44:07 +0000 (10:44 -0700)]
cloudware: allow disk format to be a list

Make basic-cloudinit available both in qcow2 and raw formats

MFC After: 3 days
Co-Authored-By: bapt
Sponsored by: OVHCloud (original patch from bapt)
Differential Revision: https://reviews.freebsd.org/D44747

6 weeks agonet8011: radiotap: add more EHT constants
Bjoern A. Zeeb [Tue, 2 Apr 2024 23:34:22 +0000 (23:34 +0000)]
net8011: radiotap: add more EHT constants

MFC after: 3 days

6 weeks agofreebsd-update: Add check for kernel modules
Fernando Apesteguía [Wed, 19 Apr 2023 16:08:47 +0000 (18:08 +0200)]
freebsd-update: Add check for kernel modules

People get confused when some software (VirtualBox, etc) does not work as
expected (or at all) after a major upgrade.

We have a nice way to deal with this when using sources, namely including
PORTS_MODULES in /etc/make.conf, but we lack something similar for binary
updates.

This patch retrieves a list of kernel modules installed from packages and
advises the user to recompile from ports to avoid problems.

Approved by: zlei@
Differential Revision: https://reviews.freebsd.org/D39695

6 weeks agosanitizers: mark __elf_aux_vector as weak, to allow linking without libsys
Dimitry Andric [Sun, 14 Apr 2024 17:38:42 +0000 (19:38 +0200)]
sanitizers: mark __elf_aux_vector as weak, to allow linking without libsys

After libsys was introduced, linking sanitized programs started failing
with:

  # c++ -fsanitize=address main.cc
  ld: error: undefined symbol: __elf_aux_vector
  >>> referenced by sanitizer_linux_libcdep.cpp:950 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:950)
  >>>     sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

Mark __elf_aux_vector as weak in the internal sanitizer declaration, so
the linker will accept it at link time. The dynamic linker will then
take care of the symbol at run time.

Suggestion by: brooks
PR: 276104, 277393
MFC after: 1 month

6 weeks agombuf: restore m_uiotombuf() feature of returning a zero length mbuf
Gleb Smirnoff [Sun, 14 Apr 2024 17:21:07 +0000 (10:21 -0700)]
mbuf: restore m_uiotombuf() feature of returning a zero length mbuf

PR: 278340
Fixes: aba79b0f4a3f69f070ace6effd5700d65226bd20

6 weeks agotests/unix_stream: test that send(2) of zero bytes is successful
Gleb Smirnoff [Sun, 14 Apr 2024 17:19:20 +0000 (10:19 -0700)]
tests/unix_stream: test that send(2) of zero bytes is successful

Put this simple test into an existing file.  We don't have a designated
file for all unix/stream tests.  There is extensive unix_seqpacket_test,
but (at least right now) unix/seqpacket is not a superset of unix/stream,
but a different implementation.  We have one file that does one test for
unix/stream - unix_socketpair_test.  So rename it to unix_stream and start
collecting all unix/stream tests in it.

6 weeks agoObsoleteFiles.inc: fix timestamps of the recent entries
Gleb Smirnoff [Sun, 14 Apr 2024 17:19:20 +0000 (10:19 -0700)]
ObsoleteFiles.inc: fix timestamps of the recent entries

6 weeks agoamdsmn(4), amdtemp(4): add support for AMD Family 19h Models 10h-1Fh.
Xin LI [Sun, 14 Apr 2024 07:45:17 +0000 (00:45 -0700)]
amdsmn(4), amdtemp(4): add support for AMD Family 19h Models 10h-1Fh.

Tested on AMD Threadripper 7960X.

PR: kern/278311
Tested by: jbo
MFC after: 1 week

6 weeks agodaemon: fix -R to enable supervision mode
Mathieu [Sun, 14 Apr 2024 03:10:06 +0000 (22:10 -0500)]
daemon: fix -R to enable supervision mode

If we're doing restarts, then we must supervise -- the 'R' case simply
got missed.

PR: 278342
Fixes: f907027b49d ("daemon: set supervise_enabled during [..]")

6 weeks agosys: Retire the ISCSI_INITIATOR_DEBUG option
John Baldwin [Sun, 14 Apr 2024 02:16:13 +0000 (19:16 -0700)]
sys: Retire the ISCSI_INITIATOR_DEBUG option

This was used by the old iSCSI initiator, not the current one.

Reported by: trasz

6 weeks agox86 NOTES: Move shared options from amd/i386 NOTES to x86 NOTES
John Baldwin [Sun, 14 Apr 2024 02:12:07 +0000 (19:12 -0700)]
x86 NOTES: Move shared options from amd/i386 NOTES to x86 NOTES

While here, reorder some of the entries using headers more aligned
with sys/conf/NOTES.  Also add a pointer from the amd64/i386 NOTES
files to x86 NOTES.

The "extra" ACPI device drivers were only present in i386 NOTES
previously.

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

6 weeks agoNOTES: Move ENABLE_ALART option to MI NOTES next to intpm device
John Baldwin [Sun, 14 Apr 2024 02:11:49 +0000 (19:11 -0700)]
NOTES: Move ENABLE_ALART option to MI NOTES next to intpm device

This option is for this driver.

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

6 weeks agox86 NOTES: Move NKPT and PMAP_SHPGPERPROC options to VM OPTIONS section
John Baldwin [Sun, 14 Apr 2024 02:11:21 +0000 (19:11 -0700)]
x86 NOTES: Move NKPT and PMAP_SHPGPERPROC options to VM OPTIONS section

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

6 weeks agox86 NOTES: Remove some obsolete comments
John Baldwin [Sun, 14 Apr 2024 02:11:06 +0000 (19:11 -0700)]
x86 NOTES: Remove some obsolete comments

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

6 weeks agoi386: Use DEV_HYPERV to enable HyperV APIC vector
John Baldwin [Sun, 14 Apr 2024 02:10:44 +0000 (19:10 -0700)]
i386: Use DEV_HYPERV to enable HyperV APIC vector

This avoids requiring both 'device hyperv' and 'options HYPERV' for
kernel configs.  Instead, just 'device hyperv' can now be used
matching the kernel configuration used for amd64.

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

6 weeks agoNOTES: Move the VirtIO entries to the MI NOTES file
John Baldwin [Sun, 14 Apr 2024 02:10:27 +0000 (19:10 -0700)]
NOTES: Move the VirtIO entries to the MI NOTES file

While here, add virtio_gpu

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

6 weeks agofiles: Sort the VirtIO device entries
John Baldwin [Sun, 14 Apr 2024 02:10:14 +0000 (19:10 -0700)]
files: Sort the VirtIO device entries

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

6 weeks agoNOTES: Move safe(4) to the MI NOTES file
John Baldwin [Sun, 14 Apr 2024 02:09:57 +0000 (19:09 -0700)]
NOTES: Move safe(4) to the MI NOTES file

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

6 weeks agoNOTES: Move IEEE80211_DEBUG_REFCNT to the MI NOTES file
John Baldwin [Sun, 14 Apr 2024 02:09:38 +0000 (19:09 -0700)]
NOTES: Move IEEE80211_DEBUG_REFCNT to the MI NOTES file

This option is not specific to amd64

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

6 weeks agosound: Remove leftover references to snd_clone
Christos Margiolis [Sat, 13 Apr 2024 17:12:27 +0000 (19:12 +0200)]
sound: Remove leftover references to snd_clone

The snd_clone framework does not exist as of
e8c0d15a64fadb4a330f2da7244becaac161bb70 ("sound: Get rid of snd_clone
and use DEVFS_CDEVPRIV(9)"), so remove leftover references to it from
unit.c.

Sponsored by: The FreeBSD Foundation
MFC after: 2 months
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44758

6 weeks agonullfs: Show correct exported flag.
Dag-Erling Smørgrav [Sat, 13 Apr 2024 15:20:49 +0000 (17:20 +0200)]
nullfs: Show correct exported flag.

MFC after: 3 days
Reviewed by: allanjude, kib
Differential Revision: https://reviews.freebsd.org/D44773

7 weeks agoRevert commit 925a11a5f221 from llvm-project (by Nikolas Klauser):
Dimitry Andric [Sat, 13 Apr 2024 08:44:26 +0000 (10:44 +0200)]
Revert commit 925a11a5f221 from llvm-project (by Nikolas Klauser):

  [libc++] Simplify is_convertible

  GCC 13 has added __is_convertible(), so we don't need to keep the fallback implementation around.

  Reviewed By: #libc, Mordante

  Spies: Mordante, libcxx-commits

  Differential Revision: https://reviews.llvm.org/D157939

This should allow buildworld with gcc 12 to work again.

PR: 276104
MFC after: 1 month

7 weeks agorelease: Fix powerpc boot block uudecoding
Colin Percival [Sat, 13 Apr 2024 00:50:15 +0000 (17:50 -0700)]
release: Fix powerpc boot block uudecoding

Confusingly, uuencode writes to stdout by default, but uudecode does not.

Fixes: 6c3e01bf8578 "release: Randomize powerpc boot block file name"
MFC after: 3 days

7 weeks agozfsd: fix unit tests after 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe
Alan Somers [Wed, 10 Apr 2024 20:55:03 +0000 (14:55 -0600)]
zfsd: fix unit tests after 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe

Reported by: markj
MFC after: 1 week
MFC with: 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe
Sponsored by: Axcient
Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com>
Differential Revision: https://reviews.freebsd.org/D44744

7 weeks agoLinuxKPI: add dev_alloc_pages()
Bjoern A. Zeeb [Tue, 2 Apr 2024 09:44:29 +0000 (09:44 +0000)]
LinuxKPI: add dev_alloc_pages()

Add dev_alloc_pages() though it seems a weird KPI, not passing a dev
despite its name.  Used by updated wireless driver.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44588

7 weeks agoLinuxKPI: add BITS_TO_BYTES()
Bjoern A. Zeeb [Tue, 2 Apr 2024 23:48:05 +0000 (23:48 +0000)]
LinuxKPI: add BITS_TO_BYTES()

Just like BITS_TO_LONG() ... used in rtw89.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44603

7 weeks agoLinuxKPI: implement memzero_explicit()
Bjoern A. Zeeb [Tue, 2 Apr 2024 09:30:49 +0000 (09:30 +0000)]
LinuxKPI: implement memzero_explicit()

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44586

7 weeks agoLinuxKPI: add further constants to pci.h
Bjoern A. Zeeb [Sun, 31 Mar 2024 17:26:29 +0000 (17:26 +0000)]
LinuxKPI: add further constants to pci.h

Updated wireless drivers require more knowledge about PCI (BAR) bits.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D44573

7 weeks agokldxref: Prefer sys/cdefs.h __unreachable over the builtin
Collin Funk [Fri, 12 Apr 2024 22:38:19 +0000 (16:38 -0600)]
kldxref: Prefer sys/cdefs.h __unreachable over the builtin

The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/1117

7 weeks agodaemon: Prefer sys/cdefs.h __unreachable over the builtin
Collin Funk [Fri, 12 Apr 2024 22:38:18 +0000 (16:38 -0600)]
daemon: Prefer sys/cdefs.h __unreachable over the builtin

The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/1117

7 weeks agonproc: Prefer sys/cdefs.h __unreachable over the builtin
Collin Funk [Fri, 12 Apr 2024 22:38:18 +0000 (16:38 -0600)]
nproc: Prefer sys/cdefs.h __unreachable over the builtin

The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, freebsd@igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/1117

7 weeks agolibc(bt_utils.c): fix "contiguous" spelling
rilysh [Tue, 13 Feb 2024 08:48:39 +0000 (14:18 +0530)]
libc(bt_utils.c): fix "contiguous" spelling

From "contigous" to "contiguous".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119

7 weeks agolibc(bt_seq.c): fix "uninitialized" spelling
rilysh [Tue, 13 Feb 2024 08:47:03 +0000 (14:17 +0530)]
libc(bt_seq.c): fix "uninitialized" spelling

From "unitialized" to "uninitialized".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119

7 weeks agolibc(xdr_reference.c): fix "referenced" spelling
rilysh [Fri, 12 Apr 2024 22:32:06 +0000 (16:32 -0600)]
libc(xdr_reference.c): fix "referenced" spelling

From "referneced" to referenced".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119

7 weeks agolibc(xdr.c): fix "discriminated" spelling
rilysh [Fri, 12 Apr 2024 22:32:06 +0000 (16:32 -0600)]
libc(xdr.c): fix "discriminated" spelling

From "descriminated" to "discriminated".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119

7 weeks agolibc(inet_net_pton.c): fix "Fiery" spelling
rilysh [Fri, 12 Apr 2024 22:32:05 +0000 (16:32 -0600)]
libc(inet_net_pton.c): fix "Fiery" spelling

From "Firey" to "Fiery".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119

7 weeks agolibc(localeconv.c): fix "appropriate" spelling
rilysh [Fri, 12 Apr 2024 22:32:05 +0000 (16:32 -0600)]
libc(localeconv.c): fix "appropriate" spelling

From "approprate" to "appropriate".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119

7 weeks agostyle.mdoc.5: maintenence
Alexander Ziaee [Fri, 12 Apr 2024 22:28:12 +0000 (16:28 -0600)]
style.mdoc.5: maintenence

- description: increase visibility by s/file/manual page/
- examples: s/No Doing Something/Doing Something/
- examples: remove depreciated .Li macro
- examples: remove extra newline (one display block)
- see also: link roff language reference for mandoc

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1130

7 weeks agomsun: Fix math error in comment explaining y reduction
Henri Chataing [Fri, 12 Apr 2024 22:08:01 +0000 (16:08 -0600)]
msun: Fix math error in comment explaining y reduction

x = k + y for some integer k and |y| < 1/2
exp2(x) = exp2(k + y) = exp2(k) * exp2(y)
which can be written as 2**k * exp2(y)

The original had x = 2**k + y, which is has an extra 2** in it which
isn't correct.

Confirmed by forumula 2 in Gal and Bachelis referenced in the comments
for the source of this method
https://dl.acm.org/doi/pdf/10.1145/103147.103151

The actual code is correct.

Reviewed by: imp (who added s_exp2.c and wrote the commit message)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1127

7 weeks agogenet: add module (if_genet.ko)
Lexi Winter [Fri, 12 Apr 2024 21:41:11 +0000 (15:41 -0600)]
genet: add module (if_genet.ko)

The driver already had the appropriate module macros, it just wasn't
hooked into the build system.

Since this device is specific to the Raspberry Pi 4, only build it for
AArch64.

Reviewed by: imp, emaste (earlier version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1139

7 weeks agofiles.x86: Pull in some more duplicate lines from files.{amd64,i386}
John Baldwin [Fri, 12 Apr 2024 21:35:45 +0000 (14:35 -0700)]
files.x86: Pull in some more duplicate lines from files.{amd64,i386}

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

7 weeks agodefaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths
John Baldwin [Fri, 12 Apr 2024 21:35:23 +0000 (14:35 -0700)]
defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths

Commit 99132daf6f70cb0cc969c555d3612547fa3cf1db prepends /usr/lib32 to
the list of paths in ldconfig32_paths since it is a standard library
path in ld-elf32.so.1.  Remove /usr/lib32 from the value in rc.conf so
that it is not listed twice.

Reviewed by: olce, kib
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D44752

7 weeks agorc.d/ldconfig: Compute ldconfig paths in a function
Konrad Witaszczyk [Fri, 12 Apr 2024 21:34:59 +0000 (14:34 -0700)]
rc.d/ldconfig: Compute ldconfig paths in a function

Move logic that computes paths passed to ldconfig(8) to a
ldconfig_paths() function that can be called for multiple ABIs.

Reviewed by: olce, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D44751

7 weeks agolibc: Remove support for pre-C99 C standards
Minsoo Choo [Fri, 12 Apr 2024 19:05:09 +0000 (12:05 -0700)]
libc: Remove support for pre-C99 C standards

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

7 weeks agosound: Update some LICENSE headers
Christos Margiolis [Fri, 12 Apr 2024 18:34:27 +0000 (20:34 +0200)]
sound: Update some LICENSE headers

The following commits introduced substantial changes to pcm/dsp.c,
pcm/sndstat.c and pcm/sound.c.

9da3b645dbaaad724d524727d003fed7be05ff7c ("sound: Move
sndstat_prepare_pcm() to pcm/sndstat.c and remove
sndstat_entry->handler")
e8c0d15a64fadb4a330f2da7244becaac161bb70 ("sound: Get rid of snd_clone
and use DEVFS_CDEVPRIV(9)")

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

7 weeks agomath: Add long double constant definitions
Collin Funk [Fri, 12 Apr 2024 17:12:59 +0000 (11:12 -0600)]
math: Add long double constant definitions

These constants are GNU libc extensions that are likely to be adopted
by the next POSIX revision [1]. The definitions can be verified in
a PARI-GP shell session:

* M_El: exp (1)
* M_LOG2El: log (exp (1)) / log (2)
* M_LOG10El: log (exp (1)) / log (10)
* M_LN2l: log (2)
* M_LN10l: log (10)
* M_PIl: Pi
* M_PI_2l: Pi / 2
* M_PI_4l: Pi / 4
* M_1_PIl: 1 / Pi
* M_2_PIl: 2 / Pi
* M_2_SQRTPIl: 2 / sqrt (Pi)
* M_SQRT2l: sqrt (2)
* M_SQRT1_2l: 1 / sqrt (2)

[1] https://austingroupbugs.net/view.php?id=828

Put these behind __BSD_VISIBLE || __XSI_VISIBLE >= 800 to future-proof
these changes. They shouldn't be defined at lower levels of XSI, but don't
have other XSI 800 stuff in place yet.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, allanjude
Pull Request: https://github.com/freebsd/freebsd-src/pull/1121

7 weeks agorelease: Randomize powerpc boot block file name
Colin Percival [Fri, 12 Apr 2024 17:42:05 +0000 (10:42 -0700)]
release: Randomize powerpc boot block file name

With parallel builds enabled, we can end up building multiple ISOs at
once, which causes problems if mkisoimages.sh uses a consistent file
name "/tmp/hfs-boot-block".

MFC after: 3 days

7 weeks agorelease: Support r/o /usr/ports for cloudware
Colin Percival [Fri, 12 Apr 2024 17:20:25 +0000 (10:20 -0700)]
release: Support r/o /usr/ports for cloudware

Set WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles when building tools
needed for uploading cloudware images.

While I'm here, adjust the bsdec2-image-upload build target to match
the style used by the Azure/GCE/Vagrant Makefiles.

MFC after: 3 days

7 weeks agoinstall: Don't skip syncing in the common case.
Dag-Erling Smørgrav [Fri, 12 Apr 2024 17:30:55 +0000 (19:30 +0200)]
install: Don't skip syncing in the common case.

In `copy()`, if no digest was requested (which is the common case), we
use `copy_file_range()` to avoid needlessly copying the contents of the
file into user space and back.  When `copy_file_range()` returns
successfully (which, again, is the common case), we simply return, and
therefore never get to the point where we call `fsync()` if the `-S`
option was specified.  Fix this.

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

7 weeks agoinstall: Simplify path construction.
Dag-Erling Smørgrav [Fri, 12 Apr 2024 17:30:52 +0000 (19:30 +0200)]
install: Simplify path construction.

There's no need to copy the path twice to split it into base and dir.
We simply call `basename()` first, then handle the two trivial cases in
which it isn't safe to call `dirname()`.

While here, add an early check that the destination is not an empty
string.  This would always fail eventually, so it may as well fail
right away.  Also add a test case for this shortcut.

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

7 weeks agoinstall: Always use a temporary file.
Dag-Erling Smørgrav [Fri, 12 Apr 2024 17:30:48 +0000 (19:30 +0200)]
install: Always use a temporary file.

Previously, we would only use a temporary file if explicitly asked to
with the `-S` option, and even then, only if the target file already
existed.  This meant that an outside observer looking for the target
file might see a partial file, and might see the file disappear and
then reappear.

With this patch, we always use a temporary file, ensuring atomicity.
The downside is slightly increased disk usage.  The upside is never
having to worry about, for instance, cron jobs randomly failing if
they happen to run simultaneously with `make installworld`.

The `-S` option is retained, partly for compatibility, and partly
to control the use of `fsync(2)`, which has a non-negligible cost
(approximately 10% increase in wall time for `make installworld`).

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: 0mp, brooks, imp, markj
Differential Revision: https://reviews.freebsd.org/D44742

7 weeks agoefidev: Allow for optionally including efidev and efirtc into the kernel
Stephen J. Kiernan [Wed, 10 Apr 2024 21:44:59 +0000 (17:44 -0400)]
efidev: Allow for optionally including efidev and efirtc into the kernel

Require both "efirt" and "efidev" in order to build in efidev
Require both "efirt" and "efirtc" in order to build in efirtc

Update FIRECRACKER, GENERIC, and NOTES for amd64
Update NOTES and std.arm for arm64

Reviewed by: imp
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44745

7 weeks agoibcore: Remove the use of NULL_IB_OBJECT
Ka Ho Ng [Fri, 12 Apr 2024 16:57:35 +0000 (16:57 +0000)]
ibcore: Remove the use of NULL_IB_OBJECT

LinuxKPI's XArray implementation accepts NULL as an input as of the
following commit:
 - linuxkpi: Accept NULL as a value in linux_xarray (3102ea3b15b6)

Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44533

7 weeks agouart_snps: Register a device xref for UARTs
Ka Ho Ng [Fri, 12 Apr 2024 16:56:42 +0000 (16:56 +0000)]
uart_snps: Register a device xref for UARTs

This is useful for other drivers to be able to find the UART (such as
the case of UARTs where hardware flow control lines are handled by
another device.)

Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44532

7 weeks agointro.1: 2024 edition
Alexander Ziaee [Fri, 12 Apr 2024 16:57:54 +0000 (10:57 -0600)]
intro.1: 2024 edition

Modernize intro.1, attempting to preserve style and brevity,
including a paragraph about installing more commands, a FILES
section explaining where the commands are located and why, and
adding section number to HISTORY for clarity.

Advances: #248562
Reviewed by: imp, mhrone
Pull Request: https://github.com/freebsd/freebsd-src/pull/1136

7 weeks agosys/netinet6/in6_pcb.c: fix compile without INET
Lexi Winter [Fri, 12 Apr 2024 16:54:24 +0000 (10:54 -0600)]
sys/netinet6/in6_pcb.c: fix compile without INET

in6_mapped_sockaddr() and in6_mapped_peeraddr() both define a local
variable named 'inp', but in the non-INET case, this variable is set
and never used, causing a compiler error:

/src/freebsd/src/lf/sys/netinet6/in6_pcb.c:547:16: error:
variable 'inp' set but not used [-Werror,-Wunused-but-set-variable]
  547 |         struct  inpcb *inp;
      |                        ^
/src/freebsd/src/lf/sys/netinet6/in6_pcb.c:573:16: error:
variable 'inp' set but not used [-Werror,-Wunused-but-set-variable]
  573 |         struct  inpcb *inp;

Fix this by guarding all the INET-specific logic, including the variable
definition, behind #ifdef INET.

While here, tweak formatting in in6_mapped_peeraddr() so both functions
are the same.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1155