]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 hours agosqlite3: Vendor import of sqlite3 3.46.0 main
Cy Schubert [Mon, 3 Jun 2024 01:40:14 +0000 (18:40 -0700)]
sqlite3: Vendor import of sqlite3 3.46.0

Release notes at https://www.sqlite.org/releaselog/3_46_0.html.

Obtained from: https://www.sqlite.org/2024/sqlite-autoconf-3460000.tar.gz

Merge commit '259d29fd8c012d4392fa59ff803b691ead5b304d' into main

11 hours agosqlite3: Vendor import of sqlite3 3.45.1
Cy Schubert [Mon, 3 Jun 2024 01:33:10 +0000 (18:33 -0700)]
sqlite3: Vendor import of sqlite3 3.45.1

Release notes at https://www.sqlite.org/releaselog/3_46_0.html.

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3460000.tar.gz

13 hours agoproto: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:58:30 +0000 (18:58 -0500)]
proto: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agouart: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:55:00 +0000 (18:55 -0500)]
uart: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agomvs: Use device_set_desc(f)()
Mark Johnston [Sun, 4 Feb 2024 23:53:28 +0000 (18:53 -0500)]
mvs: Use device_set_desc(f)()

No functional change intended.

MFC after: 1 week

13 hours agovirtio: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:52:23 +0000 (18:52 -0500)]
virtio: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agoacpi: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:51:27 +0000 (18:51 -0500)]
acpi: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agoqlnx: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:46:51 +0000 (18:46 -0500)]
qlnx: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agosiis: Use device_set_desc(f)()
Mark Johnston [Sun, 4 Feb 2024 23:44:11 +0000 (18:44 -0500)]
siis: Use device_set_desc(f)()

No functional change intended.

MFC after: 1 week

13 hours agoetherswitch: Use device_set_desc(f)()
Mark Johnston [Sun, 4 Feb 2024 23:41:22 +0000 (18:41 -0500)]
etherswitch: Use device_set_desc(f)()

No functional change intended.

MFC after: 1 week

13 hours agocxgbe: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:38:04 +0000 (18:38 -0500)]
cxgbe: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agocxgb: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:36:54 +0000 (18:36 -0500)]
cxgb: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agobhnd: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:35:02 +0000 (18:35 -0500)]
bhnd: Use device_set_descf()

Here we are in a device probe routine with no locks held.  M_WAITOK
allocations are ok.  No functional change intended.

MFC after: 1 week

13 hours agoata: Use device_set_descf()
Mark Johnston [Sun, 4 Feb 2024 23:33:05 +0000 (18:33 -0500)]
ata: Use device_set_descf()

No functional change intended.

MFC after: 1 week

13 hours agoahci: Use device_set_desc(f)()
Mark Johnston [Sun, 4 Feb 2024 23:32:53 +0000 (18:32 -0500)]
ahci: Use device_set_desc(f)()

No functional change intended.

MFC after: 1 week

13 hours agoarm: Convert drivers to use device_set_desc(f)()
Mark Johnston [Sun, 4 Feb 2024 23:23:00 +0000 (18:23 -0500)]
arm: Convert drivers to use device_set_desc(f)()

No functional change intended.

MFC after: 1 week

13 hours agoRevert "src.sys.obj.mk: Export OBJTOP"
Jessica Clarke [Sun, 2 Jun 2024 23:33:52 +0000 (00:33 +0100)]
Revert "src.sys.obj.mk: Export OBJTOP"

Unfortunately this results in make universe's environment, i.e.
corresponding to the host, being used for every one of its sub-makes, so
they're in the wrong place and trample over each other.

This reverts commit 2b7c1402f96be2d2986738e32706dab7b5691ef0.

13 hours agoMakefile.inc1: Allow showconfig and test-system-* if (X)CC is GCC
Jessica Clarke [Sun, 2 Jun 2024 23:16:58 +0000 (00:16 +0100)]
Makefile.inc1: Allow showconfig and test-system-* if (X)CC is GCC

This case gets hit in make universe on Linux, since we will first run
make test-system-compiler to determine whether to use the system or
universe toolchain, during which time CC is the host's, GCC, and XCC
isn't set, so defaults to the same.

Fixes: 4c0dfd5959bd ("arm: fail early on gcc builds")

13 hours agoee: Fix use of uninitialised pointer in ispell_op
Jessica Clarke [Sun, 2 Jun 2024 22:53:09 +0000 (23:53 +0100)]
ee: Fix use of uninitialised pointer in ispell_op

This used to be name = mktemp followed by fd = open downstream,
replacing upstream's crude PID-based sprintf, but in 1.4.7 this was
changed upstream to this buggy code, which we then picked up in the
1.5.0 import. Presumably nobody's actually used ee's ispell function
in the past 15 years; that or it's just ended up using junk file names
as temporary files if name's happened to be a valid address to something
that can be interpreted as a string.

Reported by: Dapeng Gao <dapeng.gao@cl.cam.ac.uk>
Fixes: 96b676e99984 ("Update ee(1) in the base system to version 1.5.0.")
MFC after: 1 week

16 hours agofu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence
Jessica Clarke [Sun, 2 Jun 2024 20:42:18 +0000 (21:42 +0100)]
fu740_pci_dw: Fix PERST delay and keep asserted for rest of reset sequence

DELAY takes microseconds not milliseconds, so 100 was too low. Moreover,
when enabling hw.pci.clear_pcib, PCI emeration would still stop at one
of the first bridges, but by asserting PERST for the rest of the reset
sequence that appears to be reliably addressed.

Fixes: 896e217a0eae ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver")

17 hours agorc.subr(8): fix debugging message after previous commit
Eugene Grosbein [Sun, 2 Jun 2024 19:41:10 +0000 (02:41 +0700)]
rc.subr(8): fix debugging message after previous commit

Fixes: 32a579e4fc69a65e8901111ad5f65ec56a97dfab

17 hours agorc.subr(8): introduce ${name}_offcmd
Eugene Grosbein [Sun, 2 Jun 2024 19:13:42 +0000 (02:13 +0700)]
rc.subr(8): introduce ${name}_offcmd

New variable ${name}_offcmd may be used to supply commands
executed if named service is not enabled. Previously start_precmd
could be used for such a task but now rc.subr(8) does not call it
if a service is not enabled.

Fix devd startup script to use it instead of start_precmd.

PR: 279198
MFC after: 2 weeks
Reported by: Dmitry S. Lukhtionov
Tested by: Dmitry S. Lukhtionov

18 hours agostddef.h/stdlib.h: Remove unused rune_t
Brooks Davis [Sun, 2 Jun 2024 18:39:30 +0000 (19:39 +0100)]
stddef.h/stdlib.h: Remove unused rune_t

This non-standard type is unused in the base system (__ct_rune_t or
__rune_t are used instead) and ports.  It has been around as long as our
current source repo, but we have avoided using it.  In sys/_types.h
where the __*rune_t typedefs are defined, the following appears in a
comment:

    NOTE: rune_t is not covered by ANSI nor other standards, and should
    not be instantiated outside of lib/libc/locale.  Use wchar_t.

The definition of this unused type meant we gratutiously differed from
standards compliant stddef.h/stdlib.h.

PR: 279357 (exp-run by antoine)

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

18 hours agoiovec: macros to manipulate len and base together
Brooks Davis [Sun, 2 Jun 2024 18:36:55 +0000 (19:36 +0100)]
iovec: macros to manipulate len and base together

A set of convenience macros to initialize struct iovec's and increment
the base and length together.

IOVEC_INIT - sets iov_base and iov_len
IOVEC_INIT_CSTR - takes a string and sets iov_len to strlen + 1
IOVEC_INIT_OBJ - takes an object and sets iov_len to sizeof obj
IOVEC_ADVANCE - increments iov_base and decrements iov_len

On CheriBSD these present the opportunity to insert more precise bounds
on some objects and hide differences in casts in hybrid kernels (where
some, but not all pointers are capabilities and require annotation).
Here in FreeBSD the resulting code is tidier, particularly in the
IOVEC_ADVANCE case where the need to cast iov_base to (char *) is
avoided.

Reviewed by: kib
Feedback from: des, jrtc27
MFC after: 1 week
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D45422

22 hours agoRevert "release/Makefile.vm: Use qemu-user-static-devel"
Colin Percival [Sun, 2 Jun 2024 14:07:03 +0000 (07:07 -0700)]
Revert "release/Makefile.vm: Use qemu-user-static-devel"

This breaks the weekly snapshot builds.  We'll try again once Warner has
some time to debug the qemu-user-static-devel port.

This reverts commit a04ecddfc721427fd97fd1fcc27492ebd19ad183.

24 hours agonewfs_msdos: align data area to VM page boundary by default
Stefan Eßer [Sun, 2 Jun 2024 12:07:52 +0000 (14:07 +0200)]
newfs_msdos: align data area to VM page boundary by default

Without alignment, the data area will not be aligned with the buffer
cache, leading to overhead, higher write multiplication on SSD devices
and issues with very large cluster sizes (see PR 277414).

The -A option used to align the start of the root directory to a
multiple of the cluster size, which happens to align the start of the
data area with a buffer page boundary in case of large clusters and
the default number of directory entries (512 entries requiring 16 KB
for FAT12 or FAT16, FAT32 puts the root directory into the data area).

This commit aligns the start of the data area with the page size, if
neither -A nor -r is used. It changes -A to align the start of the
data area (end of the root directory) to a multiple of the cluster
size, since this is the alignment that prevents write multiplication
due to clusters crossing erase block boundaries of a SSD device.
The -r option is unchanged and will prevent any automatic alignment
from occuring.

Approved by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45436

37 hours agomdconfig: remove the "cluster" option.
Alan Somers [Sat, 1 Jun 2024 18:38:16 +0000 (12:38 -0600)]
mdconfig: remove the "cluster" option.

It's never had any effect.  The kernel ignores it.  Remove it from the
documentation.  But continue to parse it on the command line, for
backwards-compatibility.

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

40 hours agobhnd: Remove orphaned driver for the BHND USB core
John Baldwin [Sat, 1 Jun 2024 20:25:12 +0000 (13:25 -0700)]
bhnd: Remove orphaned driver for the BHND USB core

This was only connected to the build for MIPS and has been
disconnected from the build since MIPS was removed.

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

40 hours agopci: Use kobj typedefs for new-bus method prototypes
John Baldwin [Sat, 1 Jun 2024 20:24:29 +0000 (13:24 -0700)]
pci: Use kobj typedefs for new-bus method prototypes

Reviewed by: kp, imp
Differential Revision: https://reviews.freebsd.org/D45405

42 hours agomd: round-trip the MUSTDEALLOC and RESERVE options
Alan Somers [Sat, 1 Jun 2024 18:00:03 +0000 (12:00 -0600)]
md: round-trip the MUSTDEALLOC and RESERVE options

If those options are requested when the device is created, ensure that
they will be reported by MDIOCQUERY.

MFC after: 2 weeks
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1270

45 hours agodtrace tests: Regenerate makefiles after commit d0b2dbfa0ecf
Mark Johnston [Sat, 1 Jun 2024 15:16:39 +0000 (11:16 -0400)]
dtrace tests: Regenerate makefiles after commit d0b2dbfa0ecf

45 hours agodtrace tests: Fix loading of the test kernel module
Mark Johnston [Sat, 1 Jun 2024 15:16:33 +0000 (11:16 -0400)]
dtrace tests: Fix loading of the test kernel module

The old way is racy and can cause two instances, running in parallel, to
attempt to load dtrace_test, and only one will succeed.  This caused
errors when running dtrace tests in parallel.

MFC after: 1 week

45 hours agolibdtrace: Work around a warning from flex
Mark Johnston [Sat, 1 Jun 2024 15:16:26 +0000 (11:16 -0400)]
libdtrace: Work around a warning from flex

When compiling dt_lex.l, flex produces warnings of the form:

  dt_lex.l:413: warning, trailing context made variable due to preceding '|' action
  dt_lex.l:412: warning, dangerous trailing context
  dt_lex.l:412: warning, dangerous trailing context

Here, trailing context refers to the use of "$", which expands to "/\n".

The meaning behind these warnings is described in the first two
paragraphs of the flex manual's DEFICIENCIES/BUGS section:

  Some trailing context patterns cannot be properly matched and generate
  warning messages ("dangerous trailing context").  These are patterns
  where the ending of the first part of the rule matches the beginning of
  the second part, such as "zx*/xy*", where the 'x*' matches the 'x' at
  the beginning of the trailing context.  (Note that the POSIX draft
  states that the text matched by such patterns is undefined.)

  For some trailing context rules, parts which are actually fixed-length
  are not recognized as such, leading to the above mentioned performance
  loss.  In particular, parts using '|' or {n} (such as "foo{3}") are
  always considered variable-length.

Here, the warnings appear to be bogus in this case.  The lexer has no
problem matching either of the referenced patterns, e.g.,

  printf("foobar

or

  # 1 "asdfasdf

Introduce a small amount of code duplication to silence the warning.

MFC after: 2 weeks

45 hours agomakefs/zfs: Add a helper function for adding ZAP entries
Mark Johnston [Sat, 1 Jun 2024 15:16:18 +0000 (11:16 -0400)]
makefs/zfs: Add a helper function for adding ZAP entries

Some ZAPs are used to represent sets, in which keys and values are the
same.  Add a helper function for this case.  No functional change
intended.

MFC after: 1 week

45 hours agoboot/zfs: Sync the definition of dsl_dataset_phys with OpenZFS
Mark Johnston [Sat, 4 May 2024 16:12:21 +0000 (12:12 -0400)]
boot/zfs: Sync the definition of dsl_dataset_phys with OpenZFS

No functional change intended.

MFC after: 1 week

45 hours agomitigations.7: move SSP documentation from security.7 to here
Ed Maste [Sat, 1 Jun 2024 12:07:38 +0000 (08:07 -0400)]
mitigations.7: move SSP documentation from security.7 to here

Stack Smashing Protection (SSP) is a software vulnerability mitigation,
and fits with this page.  Add a note to the beginning of security.7
providing a more explicit cross reference to mitigations.7.

Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45435

46 hours agomdconfig: don't print NUL in the options list
Alan Somers [Fri, 31 May 2024 21:13:03 +0000 (15:13 -0600)]
mdconfig: don't print NUL in the options list

Fixes: b01988d5e570
Sponsored by: Axcient
Reviewed by: imp, Ricardo Branco
Pull Request: https://github.com/freebsd/freebsd-src/pull/1268

2 days agomitigations.7: uncomment reference to recently added section
Ed Maste [Sat, 1 Jun 2024 11:52:31 +0000 (07:52 -0400)]
mitigations.7: uncomment reference to recently added section

A brief description of supervisor mode memory access protection was
added in 72ece341b427.  Uncomment the existing reference to this section
in the table of contents.

Fixes: 72ece341b427 ("mitigations.7: mention supervisor mode memory...")
Sponsored by: The FreeBSD Foundation

2 days agonvme: Change namespace device name
Chuck Tuffli [Sat, 1 Jun 2024 11:08:24 +0000 (04:08 -0700)]
nvme: Change namespace device name

Changes the device name for NVMe and NVMe-oF namespaces from using "ns"
to "n" to be more compatible with other operating systems. For example,
a device which was previously /dev/nvme0ns1 is now /dev/nvme0n1.

Preserves the existing functionality by creating alias from nvmeXnY to
nvmeXnsY.

Reviewed by: imp
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D45414

2 days agoarm64 pmap: Convert panic()s to KASSERT()s
Alan Cox [Fri, 31 May 2024 17:22:14 +0000 (12:22 -0500)]
arm64 pmap: Convert panic()s to KASSERT()s

There is no reason for the ATTR_SW_NO_PROMOTE checks in
pmap_update_{entry,strided}() to be panic()s instead of KASSERT()s.

Requested by: markj
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45424

2 days agomdconfig: fix cleanup in the attach_size_rounddown test
Alan Somers [Fri, 31 May 2024 21:18:25 +0000 (15:18 -0600)]
mdconfig: fix cleanup in the attach_size_rounddown test

MFC after: 1 week
MFC with: ed59446b47095fc20c1f77e832286f5b953cd289
Sponsored by: Axcient

2 days agoopenzfs: Fix mismerge breaking macOS bootstrap
Jessica Clarke [Fri, 31 May 2024 21:12:18 +0000 (22:12 +0100)]
openzfs: Fix mismerge breaking macOS bootstrap

Upstream added the libspl_gettid implementation for macOS and when
merging back to FreeBSD this resulted in two copies of the same code.
Delete this second copy, restoring the file to be the same as upstream.

Fixes: aca928a50a42 ("zfs: merge openzfs/zfs@e2357561b")

2 days agoman bluetooth/fwdownloaders: alignment nits, SPDX
Alexander Ziaee [Fri, 31 May 2024 19:27:58 +0000 (15:27 -0400)]
man bluetooth/fwdownloaders: alignment nits, SPDX

MFC after: 3 days

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

2 days agomitigations.7: Document riscv's SM[AE]P equivalents
Jessica Clarke [Fri, 31 May 2024 19:54:59 +0000 (20:54 +0100)]
mitigations.7: Document riscv's SM[AE]P equivalents

Its base privileged architecture provides these. Read/write is
toggleable via the SUM bit, so use that as its feature name. Execute is
always-on so has no name.

2 days agocontrib: Remove various $FreeBSD$ tags not upstream
Warner Losh [Fri, 31 May 2024 19:49:17 +0000 (13:49 -0600)]
contrib: Remove various $FreeBSD$ tags not upstream

Sponsored by: Netflix

2 days agosys/contrib: Mop up $FreeBSD$ tags
Warner Losh [Fri, 31 May 2024 19:44:14 +0000 (13:44 -0600)]
sys/contrib: Mop up $FreeBSD$ tags

Mop up left-over $FreeBSD$ tags that aren't in upstream and were added
for the previous $FreeBSD$ checker.

Sponsored by: Netflix

2 days agomitigations.7: mention supervisor mode memory access protections
Ed Maste [Fri, 31 May 2024 14:13:11 +0000 (10:13 -0400)]
mitigations.7: mention supervisor mode memory access protections

Reviewed by: imp (earlier), olce (earlier), kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45420

2 days agoIntel DMAR: remove the 'dev' member
Konstantin Belousov [Thu, 30 May 2024 14:05:22 +0000 (17:05 +0300)]
Intel DMAR: remove the 'dev' member

It duplicates iommu.dev, and was forgotten when struct iommu was split
out from dmar.

Sponsored by: The FreeBSD Foundation
Sponsored by: AMD dvanced Micro Devices (AMD)
MFC after: 1 week

2 days agoacpidump: improve length calculation for several IVHD elements
Konstantin Belousov [Thu, 30 May 2024 15:21:59 +0000 (18:21 +0300)]
acpidump: improve length calculation for several IVHD elements

Use sizeofs of structures corresponding to the parsed device entry.
This does not change the calculation, but fixes logical inconsistency.

Sponsored by: The FreeBSD Foundation
Sponsored by: Advanced Micro Devices (AMD)
MFC after: 1 week

2 days agosys/unistd.h: Use correct POSIX_VERION of 200809L
Warner Losh [Fri, 31 May 2024 17:59:24 +0000 (11:59 -0600)]
sys/unistd.h: Use correct POSIX_VERION of 200809L

200809L was tested, but I recreated the patch rather than using the
actual patch and typo'd to 200808 by mistake. Also, the PR in original
was the patch ID not the bug ID.

Pr Exp Run: 277915
Fixes: 2e30926a680d
Sponsored by: Netflix

2 days agoman bluetooth/fwdownloaders: terse descriptions
Alexander Ziaee [Fri, 31 May 2024 12:13:54 +0000 (08:13 -0400)]
man bluetooth/fwdownloaders: terse descriptions

+ descriptions no longer wrap on a standard console, no keywords removed
+ more consistent language with other firmware tooling manuals

MFC after: 3 days
Reviewed by: imp (bumped date for Nd changes)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1266

2 days agoFreeBSD bump POSIX_VERISON to 200809L
Warner Losh [Fri, 31 May 2024 15:31:52 +0000 (09:31 -0600)]
FreeBSD bump POSIX_VERISON to 200809L

FreeBSD now provides the overwhelming majority of the new interfaces for
POSIX_VERSION 200809 (aka POSIX.1-2017 aka IEEE Std 1003.1™-2017, The
Open Group Technical Standard Base Specifications, Issue 7 and IEEE Std
1003.1™-2017 (Revision of IEEE Std 1003.1-2008))

Exp Run PR: 249444
Sponsored by: Netflix

2 days agoposix_async: FreeBSD also defines {make|swap|get|set}context
Warner Losh [Fri, 31 May 2024 15:29:02 +0000 (09:29 -0600)]
posix_async: FreeBSD also defines {make|swap|get|set}context

FreeBSD also defines {make|swap|get|set}context for backward
compatibility, despite also exposing POSIX_VERSION 200809L in FreeBSD
15-current.

FreeBSD has defined these interfaces since FreeBSD 4.7, released over 20
years ago, so no further nuance in FreeBSD version number is necessary.

Pull Request: https://github.com/openssl/openssl/pull/23885
Sponsored by: Netflix

2 days agonetgraph: provide separate malloc type for nodes that are missing it
Dmitry Lukhtionov [Fri, 31 May 2024 16:19:54 +0000 (09:19 -0700)]
netgraph: provide separate malloc type for nodes that are missing it

The kernel option NG_SEPARATE_MALLOC helps to debug memory leaks in
netgraph(4).  Several nodes were missing the support.

2 days agowpa: Diff reduction with upstream
Warner Losh [Fri, 31 May 2024 16:02:37 +0000 (10:02 -0600)]
wpa: Diff reduction with upstream

I inadvertantly added gratuitous changes to upstream. Revert the
gratuitous parts of 676041c41ba5

Suggested by: cy
Fixes: 676041c41ba5
Sponsored by: Netflix

2 days agosys/param.h: Bump FreeBSD_version to 1500019 for CLOCK_ define changes
Warner Losh [Fri, 31 May 2024 14:45:33 +0000 (08:45 -0600)]
sys/param.h: Bump FreeBSD_version to 1500019 for CLOCK_ define changes

Redefining CLOCK_BOOTTIME from CLOCK_UPTIME to CLOCK_MONOTONIC is an
interesting event, create a FreeBSD_version for it.

Sponsored by: Netflix

2 days agoRedefine CLOCK_BOOTTIME to alias CLOCK_MONOTONIC, not CLOCK_UPTIME
Val Packett [Fri, 31 May 2024 14:45:02 +0000 (08:45 -0600)]
Redefine CLOCK_BOOTTIME to alias CLOCK_MONOTONIC, not CLOCK_UPTIME

The suspend-awareness situation with monotonic clocks across platforms
is kind of a mess, let's try not making it worse.

On Linux, CLOCK_MONOTONIC does NOT count suspended time, and
CLOCK_BOOTTIME was introduced to INCLUDE suspended time.

On OpenBSD, CLOCK_MONOTONIC DOES count suspended time, and CLOCK_UPTIME
was introduced to EXCLUDE suspended time.

On macOS, it's the same as OpenBSD, but with CLOCK_UPTIME_RAW.

Right now, we do not have a monotonic clock that counts suspended time.
We have CLOCK_UPTIME as a distinct ID alias, and CLOCK_BOOTTIME as a
preprocessor alias, both being effectively `CLOCK_MONOTONIC` for now.

When we introduce a suspend-aware clock in the future, it would make a
lot more sense to do it the OpenBSD/macOS way, i.e. to make
CLOCK_MONOTONIC include suspended time and make CLOCK_UPTIME exclude it,
because that's what the name CLOCK_UPTIME implies: a deviation from the
default intended for the uptime command to allow it to only show the
time the system was actually up and not suspended.

Let's change the define right now to make sure software using the define
would not end up using the ID of the wrong clock in the future, and fix
the IDs in the Linux compat code to match the expected changes too.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1824084
for more discussion.

Fixes: 155f15118a77 ("clock_gettime: Add Linux aliases for CLOCK_*")
Fixes: 25ada637362d ("Map Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.")
Sponsored by: https://www.patreon.com/valpackett
Reviewed by: kib, imp
Differential Revision: https://reviews.freebsd.org/D39270

2 days agoWPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same
Warner Losh [Fri, 31 May 2024 14:44:55 +0000 (08:44 -0600)]
WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same

Historically, these have been differnet values, and only one was defined
or they were defined as different values. Now that they are about to be
the same value, add #ifdef to cope.

Sponsored by: Netflix
Reviewed by: olce, val_packett.cool, adrian
Differential Revision: https://reviews.freebsd.org/D45418

3 days agozfs: merge openzfs/zfs@e2357561b
Martin Matuska [Fri, 31 May 2024 07:31:58 +0000 (09:31 +0200)]
zfs: merge openzfs/zfs@e2357561b

Notable upstream pull request merges:
 #15940 41ae864b6 Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN
 #16128 5137c132a zpool import output is not formated properly
 #16138 efbef9e6c FreeBSD: Add zfs_link_create() error handling
 #16146 04bae5ec9 Disable high priority ZIO threads on FreeBSD and Linux
 #16151 cc3869153 zfs_ioc_send: use a dedicated taskq thread for send
 #16151 adda768e3 spa: remove spa_taskq_dispatch_sync()
 #16151 515c4dd21 spa: flatten spa_taskq_dispatch_ent()
 #16151 0a543db37 spa_taskq_dispatch_ent: simplify arguments
 #16153 975a13259 Add support for parallel pool exports
 #16153 89acef992 Simplified the scope of the namespace lock
 #16159 136c05321 ZAP: Fix leaf references on zap_expand_leaf() errors
 #16162 af5dbed31 Fix scn_queue races on very old pools
 #16165 3400127a7 Fix ZIL clone records for legacy holes
 #16167 414acbd37 Unbreak FreeBSD cross-build on MacOS broken in 051460b8b
 #16172 eced2e2f1 libzfs: Fix mounting datasets under thread limit pressure
 #16178 b64afa41d Better control the thread pool size when mounting datasets
 #16181 fa99d9cd9 zfs_dbgmsg_print: make FreeBSD and Linux consistent
 #16191 e675852bc dbuf: separate refcount calls for dbuf and dbuf_user
 #16198 a043b60f1 Correct level handling in zstream recompress
 #16204 34906f8bb zap: reuse zap_leaf_t on dbuf reuse after shrink
 #16206 d0aa9dbcc Use memset to zero stack allocations containing unions
 #16207 8865dfbca Fix assertion in Persistent L2ARC
 #16208 08648cf0d Allow block cloning to be interrupted by a signal
 #16210 e2357561b FreeBSD: Add const qualifier to members of struct
        opensolaris_utsname
 #16214 800d59d57 Some improvements to metaslabs eviction
 #16216 02c5aa9b0 Destroy ARC buffer in case of fill error
 #16225 01c8efdd5 Simplify issig()

Obtained from: OpenZFS
OpenZFS commit: e2357561b9499296bff758afe4868dbc39735675

3 days agolocaledef: Bootstrap better
Warner Losh [Mon, 27 May 2024 17:07:26 +0000 (11:07 -0600)]
localedef: Bootstrap better

Declare these functions in a macro-safe way instead of relying on
ifdefs.

Sponsored by: Netflix

3 days agoAdd a new USB ID for Xiaomi mini USB WiFi
Kevin Lo [Fri, 31 May 2024 01:40:03 +0000 (09:40 +0800)]
Add a new USB ID for Xiaomi mini USB WiFi

3 days agosmbus manuals: include term SMBus in description
Alexander Ziaee [Thu, 30 May 2024 21:58:20 +0000 (17:58 -0400)]
smbus manuals: include term SMBus in description

Fixes: 5ad3b09f2fe9 (smb: distinguishable descriptions)
MFC after: 3 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/

3 days agosmbfs manuals: describe consistently
Alexander Ziaee [Thu, 30 May 2024 21:37:15 +0000 (17:37 -0400)]
smbfs manuals: describe consistently

MFC after: 3 days

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

3 days agoLinuxKPI: remove extern from function declarations
Bjoern A. Zeeb [Mon, 27 May 2024 19:49:45 +0000 (19:49 +0000)]
LinuxKPI: remove extern from function declarations

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste (earlier version, found another two)
Differential Revision: https://reviews.freebsd.org/D45386

3 days agotcp: remove unused code in tcp_usr_attach
Michael Tuexen [Thu, 30 May 2024 19:23:45 +0000 (21:23 +0200)]
tcp: remove unused code in tcp_usr_attach

pr_attach is only called on a socket (so) with so->so_listen != NULL
via sonewconn. However, sonewconn is not called from the TCP code.
The listening sockets are handled in tcp_syncache.c without using
sonewconn. Therefore, the code removed is never executed.
No functional change intended.

Reviewed by: rrs, peter.lei_ieee.org
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45412

3 days agorelease/Makefile.vm: Use qemu-user-static-devel
Colin Percival [Thu, 30 May 2024 16:48:40 +0000 (09:48 -0700)]
release/Makefile.vm: Use qemu-user-static-devel

This is a newer version of the qemu-user-static code, which is very
much out of date.

Requested by: imp

3 days agoFreeBSD: Add const qualifier to members of struct opensolaris_utsname
Zhenlei Huang [Thu, 30 May 2024 16:58:20 +0000 (00:58 +0800)]
FreeBSD: Add const qualifier to members of struct opensolaris_utsname

These members have directly references to the global variables
exposed by the kernel. They are not going to be changed by this
kernel module.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Zhenlei Huang <zlei@FreeBSD.org>
Closes #16210

3 days agoMerge commit 9f85bc834b07 from llvm-project (by Nikita Popov):
Dimitry Andric [Thu, 30 May 2024 15:35:15 +0000 (17:35 +0200)]
Merge commit 9f85bc834b07 from llvm-project (by Nikita Popov):

  [PPCMergeStringPool] Only replace constant once (#92996)

  In #88846 I changed this code to use RAUW to perform the replacement
  instead of manual updates -- but kept the outer loop, which means we try
  to perform RAUW once per user. However, some of the users might be freed
  by the RAUW operation, resulting in use-after-free.

  The case where this happens is constant users where the replacement
  might result in the destruction of the original constant.

  Fixes https://github.com/llvm/llvm-project/issues/92991.

This fixes a possible crash when building crypto/openssh/sshkey.c for
PowerPC targets.

Reported by: cperciva
PR: 276104
MFC after: 3 days

4 days agonextboot: Permit ZFS boot filesystems mounted at the pool's root
John Baldwin [Thu, 30 May 2024 12:44:55 +0000 (05:44 -0700)]
nextboot: Permit ZFS boot filesystems mounted at the pool's root

This restores nextboot -k on ZFS setups where /boot is on the root
dataset of a pool.

Reviewed by: jrtc27, glebius
Fixes: 0c3ade2cf13d nextboot: fix nextboot -k on ZFS
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45306

4 days agopw userdel: destroy home dataset if empty
Mike Karels [Wed, 29 May 2024 23:55:14 +0000 (18:55 -0500)]
pw userdel: destroy home dataset if empty

When removing a user's home directory, if the directory is a ZFS
dataset, it cannot be removed.  If the directory has been emptied,
use "zfs destroy" to destroy it.  This complements the automatic
dataset creation in adduser.  Note that datasets within the directory
and snapshots are not handled, as the complete path is not constructed.

While here, add waitpid() calls to rmat() and pw_user_del().

Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D45348

4 days agozpool import output is not formated properly.
Pawel Jakub Dawidek [Wed, 29 May 2024 20:34:59 +0000 (13:34 -0700)]
zpool import output is not formated properly.

The 'zpool status' output assumes that the longest prefix is six
character long plus colon plus space, eg. 'status: ', 'action: '
or 'config: ' (so eight in total). This works well even when we have
messages that requires more than one line, as '\t' is exactly eight
characters, just like the longest prefix.

The 'zpool import' output is a bit different, as it may display the
comment pool property, then the longest prefix is 'comment: ', which is
nine characters long, not eight.
All the prefixes were given an extra space in front, but:
- 'status: ' did not get an extra space.
- Messages that require more than one line should use nine spaces of
  indentation, not eight.
- The extra space in front looks redundant if there is no comment
  property set on the given pool.

Fix it by adding an extra space to all prefixes, but only if the comment
property is defined. Also, when we need to continue the message in a new
line, use '\t ' for indentation.

While here, apply small corrections to a couple messages.

Before:

   pool: tank
     id: 7412636063178848859
  state: ONLINE
status: Some supported features are not enabled on the pool.
(Note that they may be intentionally disabled if the
'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identif[...]
some features will not be available without an explicit 'zp[...]
comment: Example comment.
 config:

bclone      ONLINE
  ada0      ONLINE

After:

  pool: tank
    id: 10180960571062436759
 state: ONLINE
status: Some supported features are not enabled on the pool.
(Note that they may be intentionally disabled if the
'compatibility' property is set.)
action: The pool can be imported using its name or numeric identifi[...]
some features will not be available without an explicit 'zp[...]
config:

tank        ONLINE
  ada3      ONLINE

   pool: dozer
     id: 11028319538368222579
  state: ONLINE
 status: Some supported features are not enabled on the pool.
 (Note that they may be intentionally disabled if the
 'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identif[...]
 some features will not be available without an explicit 'z[...]
comment: Example comment.
 config:

dozer       ONLINE
  ada1      ONLINE

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Dawidek <pawel@dawidek.net>
Closes #16128

4 days agobhyve: correctly remove a memory mapping
Pierre Pronchery [Wed, 29 May 2024 18:00:02 +0000 (20:00 +0200)]
bhyve: correctly remove a memory mapping

In a normal code path while setting up GPU passthrough, the size
parameter to munmap() is wrong and its operation not checked for errors,
therefore leaking resources.

Reported by: Coverity Scan
CID: 1519830
Sponsored by: The FreeBSD Foundation

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

4 days agoexport $autoboot var when running from $boottrace_cmd
Alex Samorukov [Tue, 28 May 2024 14:45:30 +0000 (16:45 +0200)]
export $autoboot var when running from $boottrace_cmd

At the moment, if bootrace profiling is enabled, autoboot is not
exported to the rc scripts. This causes fsck to not check the root
filesystem.  To fix this, pass _boot, rc_fast and autoboot to the
boottrace process to mimic what diretly sourcing the rc.d scripts.

PR: 278993
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1261

4 days agospl: fix compilation without HAVE_BACKTRACE
Martin Matuška [Wed, 29 May 2024 17:51:01 +0000 (19:51 +0200)]
spl: fix compilation without HAVE_BACKTRACE

The __maybe_unused macro is defined in spl/sys/debug.h

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Martin Matuska <mm@FreeBSD.org>
Closes #16229

4 days agoSimplify issig().
Pawel Jakub Dawidek [Wed, 29 May 2024 17:49:11 +0000 (10:49 -0700)]
Simplify issig().

We always call it twice with JUSTLOOKING and then FORREAL.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #16225

4 days agozed: Add deadman-slot_off.sh zedlet
Brian Behlendorf [Wed, 29 May 2024 17:46:41 +0000 (10:46 -0700)]
zed: Add deadman-slot_off.sh zedlet

Optionally turn off disk's enclosure slot if an I/O is hung
triggering the deadman.

It's possible for outstanding I/O to a misbehaving SCSI disk to
neither promptly complete or return an error.  This can occur due
to retry and recovery actions taken by the SCSI layer, driver, or
disk.  When it occurs the pool will be unresponsive even though
there may be sufficient redundancy configured to proceeded without
this single disk.

When a hung I/O is detected by the kmods it will be posted as a
deadman event.  By default an I/O is considered to be hung after
5 minutes.  This value can be changed with the zfs_deadman_ziotime_ms
module parameter.  If ZED_POWER_OFF_ENCLOSURE_SLOT_ON_DEADMAN is set
the disk's enclosure slot will be powered off causing the outstanding
I/O to fail.  The ZED will then handle this like a normal disk failure.
By default ZED_POWER_OFF_ENCLOSURE_SLOT_ON_DEADMAN is not set.

As part of this change `zfs_deadman_events_per_second` is added
to control the ratelimitting of deadman events independantly of
delay events.  In practice, a single deadman event is sufficient
and more aren't particularly useful.

Alphabetize the zfs_deadman_* entries in zfs.4.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #16226

4 days agorc: improve NAME_setup handling
Franco Fichtner [Fri, 24 May 2024 16:38:56 +0000 (18:38 +0200)]
rc: improve NAME_setup handling

Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd may use configuration checks and blocks setup
from doing its designated work (e.g. nginx).  In moving
the invoke of the setup script in front allows us to
provide custom scripts for config file generation and
fixing prior to precmd checking configuration integrity.

Also introduce _run_rc_setup to separate the launcher
from the main one.  Let it run correctly in the case
of restart_precmd and block further execution as
would be the case in start due to the internal plumbing
of restart being split into calling stop and start
afterwards.

Differential-Revsiion: https://reviews.freebsd.org/D36259
Signed-off-by: Franco Fichtner <franco@opnsense.org>
Reviewed by: imp, oshogbo
Pull Request: https://github.com/freebsd/freebsd-src/pull/1258

4 days agoRevert "checkstyle9.pl: Add check for missing space between ) {"
Warner Losh [Wed, 29 May 2024 17:15:24 +0000 (11:15 -0600)]
Revert "checkstyle9.pl: Add check for missing space between ) {"

This reverts commit 6bad7d2486b373015db5917d7a9641266861c607.

Turns out this special case wasn't necessary, and this was already
detected and due to another error (running the script got dropped
from my experimental scripts), I hadn't noticed.

Sponsored by: Netflix

4 days agopuc: Make kernel module working
Emmanuel Vadot [Wed, 29 May 2024 17:07:51 +0000 (19:07 +0200)]
puc: Make kernel module working

We need uart_bus_puc.c in the module for it to work.

Sponsored by: Beckhoff Automation GmbH & Co. KG

4 days agoRevert "files: make uart_bus_puc.c not depend on puc"
Emmanuel Vadot [Wed, 29 May 2024 17:06:41 +0000 (19:06 +0200)]
Revert "files: make uart_bus_puc.c not depend on puc"

This reverts commit 114ab149e23e11760a2a41a773a786b97980616a.

This doesn't work, no idea how I tested this at the time but clearly the wrong way.

4 days agoLINT: Don't build bnxt on 32-bit platforms
Warner Losh [Wed, 29 May 2024 16:50:27 +0000 (10:50 -0600)]
LINT: Don't build bnxt on 32-bit platforms

Sponsored by: Netflix
Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
4 days agocheckstyle9.pl: Add check for missing space between ) {
Warner Losh [Wed, 29 May 2024 15:59:27 +0000 (09:59 -0600)]
checkstyle9.pl: Add check for missing space between ) {

Sponsored by: Netflix

4 days agoSome improvements to metaslabs eviction
Alexander Motin [Wed, 29 May 2024 15:53:31 +0000 (11:53 -0400)]
Some improvements to metaslabs eviction

- Add old eviction for special and dedup metaslab classes. Those
vdevs may be potentially big and fragmented with large metaslabs,
while their asynchronous write pattern is not really different
from normal class. It seems an omission to not evict old metaslabs
from them.
 - If we have metaslab preload enabled, which means we are not too
low on memory, do not evict active metaslabs even if they are not
used for some time.  Eviction of active metaslabs means we won't
be able to write anything until we load them, that may take some
time, that is straight opposite to metaslab preload goals.  For
small systems the memory saving should be less important after
recent reduction in number of allocators and so open metaslabs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16214

4 days agominor style tweak.
Warner Losh [Wed, 29 May 2024 15:53:20 +0000 (09:53 -0600)]
minor style tweak.

checkstyle9 doesn't check for this construct...

Fixes: 6d849754b996
4 days agoFix bnxt build in LINT
Warner Losh [Wed, 29 May 2024 15:45:47 +0000 (09:45 -0600)]
Fix bnxt build in LINT

LINT includes bnxt_re driver. Adjust the path in files, add missing
files and add a new BNXT_C to build (which thinly wraps OFED version
with bnxt specicif stuff).

Sponsored by: Netflix
Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
4 days agoloader: Fix G overflowing for G(4) on 32-bit builds
Ahmad Khalifa [Wed, 29 May 2024 14:30:59 +0000 (08:30 -0600)]
loader: Fix G overflowing for G(4) on 32-bit builds

Prevent G(4) and over from overflowing for 32-bit builds.

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

4 days agoloader: Allow overriding NEWVERSWHAT
Ahmad Khalifa [Wed, 29 May 2024 14:28:13 +0000 (08:28 -0600)]
loader: Allow overriding NEWVERSWHAT

This can be useful when making alternate versions of the loader.

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

4 days agolinux: implement PR_CHILD_SET_SUBREAPER
Son Phan Trung [Tue, 28 May 2024 09:51:16 +0000 (16:51 +0700)]
linux: implement PR_CHILD_SET_SUBREAPER

Reviewed by: imp, dchagin
Pull Request: https://github.com/freebsd/freebsd-src/pull/1260

5 days agolibutil: move ftime to libutil
Mariusz Zaborski [Wed, 29 May 2024 12:32:16 +0000 (14:32 +0200)]
libutil: move ftime to libutil

It seems that there are still some applications that use ftime(3)
(for example, science/siconos and sysutils/lcdproc). The issue
is that we don't build libcompat as a shared library anymore.
The easiest solution is to move it to libutil, until we
deprecate it for good.

This solution was proposed by kib@ in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.

PR: 257789
MFC after: 1 month
Reviewed by: kib (ages ago)
Differential Revision: https://reviews.freebsd.org/D39994

5 days agocsh: Remove hardlink /.cshrc
Emmanuel Vadot [Mon, 27 May 2024 13:12:18 +0000 (15:12 +0200)]
csh: Remove hardlink /.cshrc

Remove this historical artifact.
csh will try to use /.csrch if the user has no home directory defined which
is rather unlikely (To be exact if the concatenation of $HOME and "/.cshrc"
fail which is the same thing).

Also, with this change pkg will happily handle 3way merge for /root/.cshrc

Differential Revision: https://reviews.freebsd.org/D45382
Reviewed by: emaste, imp
Sponsored by: Beckhoff Automation GmbH & Co. KG

5 days agopf tests: test longer anchor names
Kristof Provost [Fri, 24 May 2024 12:50:53 +0000 (14:50 +0200)]
pf tests: test longer anchor names

PR: 279225
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

5 days agopfctl: fix recursive printing of nat anchors
Kristof Provost [Tue, 28 May 2024 14:26:28 +0000 (16:26 +0200)]
pfctl: fix recursive printing of nat anchors

Similar to the preceding fix for rules, ensure that we
recursively list wildcard anchors for nat rules.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

5 days agopf: fix incorrect anchor_call to userspace
Kristof Provost [Fri, 24 May 2024 11:20:12 +0000 (13:20 +0200)]
pf: fix incorrect anchor_call to userspace

777a4702c changed how we copy out the anchor_call string, and
incorrectly limited it to 8 (4 on 32-bit systems) bytes. Fix that so we
get the full anchor path, rather than just the first few characters.

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

5 days agolibpfctl: add pfctl_get_rule_h()
Kristof Provost [Fri, 24 May 2024 11:15:12 +0000 (13:15 +0200)]
libpfctl: add pfctl_get_rule_h()

Add a handle variant of pfctl_get_rule(). This converts us from using
the nvlist variant to the netlink variant, and also moves us closer to a
world where all libpfctl functions take the handle.

While here have pfctl use the new function.

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

5 days agolinux: allow RTM_GETADDR without full ifaddrmsg argument
Gleb Smirnoff [Tue, 28 May 2024 20:13:08 +0000 (13:13 -0700)]
linux: allow RTM_GETADDR without full ifaddrmsg argument

Even modern glibc uses truncated argument for RTM_GETADDR when it wants to
list all addresses in a system.  See
sysdeps/unix/sysv/linux/ifaddrs.c:__netlink_sendreq().  It sends a one
char payload.  Linux kernel allows that as long as given socket is not
marked as a 'strict'.  We have a similar flag in the general netlink code
and it is checked in
sys/netlink/netlink_message_parser.h:nl_parse_header().  If the flag is
not present, parser will allocate a temporary zeroed buffer to make the
message correct.  The checks added in b977dd1ea5fb blocked such message
before the parser.  My reading of glibc says that there are two types of
messages that are sent with __netlink_sendreq() - RTM_GETLINK and
RTM_GETADDR.  The RTM_GETLINK is binary compatible between Linux and
FreeBSD and thus doesn't need any ABI handler.

PR: 279012
Fixes: b977dd1ea5fbc2df3f1279330be4d089322eb2cf

5 days agosrc.sys.obj.mk: Export OBJTOP
Simon J. Gerraty [Tue, 28 May 2024 18:51:31 +0000 (11:51 -0700)]
src.sys.obj.mk: Export OBJTOP

If we had to set OBJTOP we want to .export it (if .MAKE.LEVEL > 0)
for the benefit of things like x!= ${.MAKE} -r ... and similar.

Without OBJTOP, the default MAKEOBJDIR setting will result in
attempting to use an objdir like /lib or /bin etc in some cases.

This patch is based on D30990
with the addition of the check for level > 0.

Reviewed by: jrtc27
Differential Revision:        <https://reviews.freebsd.org/D30990>

5 days agobnxt: Do not compile on 32-bit platforms
Mark Johnston [Tue, 28 May 2024 13:05:14 +0000 (09:05 -0400)]
bnxt: Do not compile on 32-bit platforms

The new bnxt_re driver doesn't compile on any of them (it uses writeq()
from the LinuxKPI, which isn't implemented there), and had already been
disconnected from the build on i386.

Reported by: Jenkins
Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")

5 days agobnxt_re: Explicitly cast pointer-to-integer conversions
Mark Johnston [Tue, 28 May 2024 13:04:21 +0000 (09:04 -0400)]
bnxt_re: Explicitly cast pointer-to-integer conversions

Reported by: Jenkins
Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")

6 days agolibc/tests: Fix installation without MK_TOOLCHAIN
Mark Johnston [Tue, 28 May 2024 12:24:43 +0000 (08:24 -0400)]
libc/tests: Fix installation without MK_TOOLCHAIN

There is some exotic conditional logic here to avoid building a
particular test if a certain UBSAN library isn't present in the
toolchain sysroot.  This causes build failures for me when doing an
"installworld WITHOUT_TOOLCHAIN=", which I do frequently during tests.

I believe the problem is that SYSROOT is unset during installworld, so
the build sees the host's copy of libclang_rt.ubsan_standalone.a and
then tries to install a binary that wasn't built during buildworld.  Try
to make the check a bit less fragile.

Reviewed by: dim
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45035

6 days agobnxt: Add a module makefile to fix the build
Mark Johnston [Tue, 28 May 2024 12:02:19 +0000 (08:02 -0400)]
bnxt: Add a module makefile to fix the build

Fixes: 35b53f8c989f ("bnxt_en: Add PFC, ETS & App TLVs protocols support")