Commit graph

292182 commits

Author SHA1 Message Date
Mark Johnston 796bcf1845 cxgb: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston a866a40b9b 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
2024-06-02 19:38:40 -04:00
Mark Johnston 25b839dfd2 ata: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston a74b496507 ahci: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Mark Johnston 459dc61c8b arm: Convert drivers to use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
Jessica Clarke 3cc91b7751 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 2b7c1402f9.
2024-06-03 00:33:52 +01:00
Jessica Clarke a20a903b16 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:	4c0dfd5959 ("arm: fail early on gcc builds")
2024-06-03 00:16:58 +01:00
Jessica Clarke 25a33bfe9c 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:		96b676e999 ("Update ee(1) in the base system to version 1.5.0.")
MFC after:	1 week
2024-06-02 23:53:09 +01:00
Jessica Clarke 28aaa58fa6 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:	896e217a0e ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver")
2024-06-02 21:42:18 +01:00
Eugene Grosbein c2db3a0c7d rc.subr(8): fix debugging message after previous commit
Fixes:		32a579e4fc
2024-06-03 02:41:10 +07:00
Eugene Grosbein 32a579e4fc 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
2024-06-03 02:29:22 +07:00
Brooks Davis 39c4f65c72 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
2024-06-02 19:41:22 +01:00
Brooks Davis af8cafb2a3 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
2024-06-02 19:41:22 +01:00
Colin Percival e50fec56bf 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 a04ecddfc7.
2024-06-02 07:07:52 -07:00
Stefan Eßer 077f757d72 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
2024-06-02 14:07:52 +02:00
Alan Somers e461c7bc7d 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
2024-06-01 17:31:04 -06:00
John Baldwin c7c037fad1 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
2024-06-01 13:25:12 -07:00
John Baldwin 0f1d148cfd pci: Use kobj typedefs for new-bus method prototypes
Reviewed by:	kp, imp
Differential Revision:	https://reviews.freebsd.org/D45405
2024-06-01 13:24:29 -07:00
Alan Somers 9d449caddd 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
2024-06-01 12:40:19 -06:00
Mark Johnston 397e83df75 dtrace tests: Regenerate makefiles after commit d0b2dbfa0e 2024-06-01 11:16:39 -04:00
Mark Johnston cb6b5e8ab9 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
2024-06-01 11:16:33 -04:00
Mark Johnston 4bddff0833 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
2024-06-01 11:16:26 -04:00
Mark Johnston be2f92a96b 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
2024-06-01 11:16:18 -04:00
Mark Johnston 2468e20df4 boot/zfs: Sync the definition of dsl_dataset_phys with OpenZFS
No functional change intended.

MFC after:	1 week
2024-06-01 11:12:12 -04:00
Ed Maste 297bb39b6f 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
2024-06-01 11:09:30 -04:00
Alan Somers 4b72bab96e mdconfig: don't print NUL in the options list
Fixes:	b01988d5e5
Sponsored by: Axcient
Reviewed by: imp, Ricardo Branco
Pull Request: https://github.com/freebsd/freebsd-src/pull/1268
2024-06-01 08:08:16 -06:00
Ed Maste 166ec3e86a mitigations.7: uncomment reference to recently added section
A brief description of supervisor mode memory access protection was
added in 72ece341b4.  Uncomment the existing reference to this section
in the table of contents.

Fixes: 72ece341b4 ("mitigations.7: mention supervisor mode memory...")
Sponsored by:	The FreeBSD Foundation
2024-06-01 07:55:09 -04:00
Chuck Tuffli ce75bfcac9 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
2024-06-01 04:14:14 -07:00
Alan Cox 3dc2a88489 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
2024-05-31 16:54:27 -05:00
Alan Somers d1bd097d52 mdconfig: fix cleanup in the attach_size_rounddown test
MFC after:	1 week
MFC with:	ed59446b47
Sponsored by:	Axcient
2024-05-31 15:20:13 -06:00
Jessica Clarke fe2b60f87e 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:	aca928a50a ("zfs: merge openzfs/zfs@e2357561b")
2024-05-31 22:12:18 +01:00
Alexander Ziaee 9c0d6df100 man bluetooth/fwdownloaders: alignment nits, SPDX
MFC after: 3 days

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1267
2024-05-31 14:26:09 -06:00
Jessica Clarke a5ae2d2ab4 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.
2024-05-31 20:54:59 +01:00
Warner Losh d37eb51047 contrib: Remove various $FreeBSD$ tags not upstream
Sponsored by:		Netflix
2024-05-31 13:49:17 -06:00
Warner Losh d0a9cc17ba 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
2024-05-31 13:45:26 -06:00
Ed Maste 72ece341b4 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
2024-05-31 15:35:56 -04:00
Konstantin Belousov 164fdee111 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
2024-05-31 22:10:39 +03:00
Konstantin Belousov 1eb7099eac 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
2024-05-31 22:10:39 +03:00
Warner Losh 6e0278408e 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: 2e30926a68
Sponsored by: Netflix
2024-05-31 11:59:24 -06:00
Alexander Ziaee 2c901189bb 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
2024-05-31 11:40:44 -06:00
Warner Losh 2e30926a68 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
2024-05-31 10:53:39 -06:00
Warner Losh a8fe2d331b 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
2024-05-31 10:53:39 -06:00
Dmitry Lukhtionov 9b8db66402 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.
2024-05-31 09:19:54 -07:00
Warner Losh cab9ccf3ff wpa: Diff reduction with upstream
I inadvertantly added gratuitous changes to upstream. Revert the
gratuitous parts of 676041c41b

Suggested by: cy
Fixes: 676041c41b
Sponsored by: Netflix
2024-05-31 10:02:37 -06:00
Warner Losh e03e8b0774 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
2024-05-31 08:45:33 -06:00
Val Packett 108de78451 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:		155f15118a ("clock_gettime: Add Linux aliases for CLOCK_*")
Fixes:		25ada63736 ("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
2024-05-31 08:45:02 -06:00
Warner Losh 676041c41b 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
2024-05-31 08:44:55 -06:00
Martin Matuska aca928a50a 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:	e2357561b9
2024-05-31 11:26:50 +02:00
Warner Losh d28bbfa271 localedef: Bootstrap better
Declare these functions in a macro-safe way instead of relying on
ifdefs.

Sponsored by:		Netflix
2024-05-30 21:59:15 -06:00
Kevin Lo 345fd21a6a Add a new USB ID for Xiaomi mini USB WiFi 2024-05-31 09:40:03 +08:00