Commit graph

292291 commits

Author SHA1 Message Date
Mark Johnston 542f9494b7 proto: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 66d2d42a1f uart: Use device_set_descf()
No functional change intended.

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

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston de140d60d5 virtio: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston bad36a4998 acpi: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 801b12ba89 qlnx: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 17bfbc400f siis: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston 54482989d3 etherswitch: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:41 -04:00
Mark Johnston a1b8445115 cxgbe: Use device_set_descf()
No functional change intended.

MFC after:	1 week
2024-06-02 19:38:40 -04:00
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