Commit graph

284726 commits

Author SHA1 Message Date
Mitchell Horne 651d1efd96 hier(7): adjust overlays/ subdirectory
Device tree overlays are installed in /boot/dtb/overlays by default.
Adjust the comment to mention fdt_overlays and loader.conf, but do not
repeat what is said in the parent directory's description.

PR:		261349
Reviewed by:	grahamperrin, kevans
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40785
2023-06-29 13:55:17 -03:00
Dmitry Chagin a18b956b73 libexecinfo: Enable backtrace_test.backtrace_fmt_basic on amd64 again
Due to unwind tables generation enabled after c969310c for csu.

PR:			241562, 246322, 246537
Reviewed by:		kib, ngie
Differential Revision:	https://reviews.freebsd.org/D40758
2023-06-29 19:53:07 +03:00
Dmitry Chagin c969310c99 csu: Implement _start using as to satisfy unwinders on x86_64
The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

This requires the crt code be built with unwind tables, for that remove
-fno-asynchronous-unwind-tables to enable unwind tables generation.

PR:			241562, 246322, 246537
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40780
2023-06-29 19:34:39 +03:00
Dag-Erling Smørgrav c09909ed88 libstdbuf: Add proper SEE ALSO section.
Sponsored by:	Klara, Inc.
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D40800
2023-06-29 16:23:45 +00:00
Dag-Erling Smørgrav 78baa63209 stdbuf: Code cleanup.
* Factor out path-setting code.
* Normalize usage().
* Remove unnecessary switch case.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40799
2023-06-29 15:30:05 +00:00
Warner Losh 319d2bf407 atkbc: Better test for old chromebooks
Older Chromebooks have issues in their embedded controller (EC) firmware
which need working around in atkbd and atkbdc. On these systems, rather
than use a standard EC, Google used their own arm-based EC. For a while,
its firmware incorrectly implemented the i8042, requiring workaroundsd
in the driver.

Implement a heuristic recommended by MrChromebox <mrchromebox@gmail.com>
to detect them: If the bios.version starts with Google_, or the maker is
either Google or GOOGLE, assume that it's a chromebook with the affected
bios. While this isn't strictly true, the number of updated systems
without the bug is very small and this will exclude all the non-Google
coreboot user that use a standard EC. There's no simple way to test the
hardware to see if it's implemented with the buggy EC.

Sponsored by:		Netflix
Reviewed by:		jon@thesoo.org, MrChromebox
Differential Revision:	https://reviews.freebsd.org/D40789
2023-06-29 08:34:47 -06:00
Dag-Erling Smørgrav b5b9eaa962 Restore and document -ps / -nps option.
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com, pstef, kevans
Differential Revision:	https://reviews.freebsd.org/D40788
2023-06-29 13:59:49 +00:00
Michael Tuexen 81b4bf0895 man: improve man pages for dtrace_sctp and dtrace_tcp
Reviewed by:		manpages
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40796
2023-06-29 14:59:51 +02:00
Yuri Pankov 24ec316c13 Correctly spell illumos (all lowercase) in man pages
From illumos FAQ:

    "illumos (pronounced i-llu-MOS and written in lowercase)"
2023-06-29 13:14:45 +02:00
Piotr Kubaj fd774e065c gdtoa: fix endianness issue on powerpc64le
The current code assumes running on big-endian, which causes issues with
e.g. strtod() as reported on https://github.com/ocaml/ocaml/pull/10837#issuecomment-1605346422
This is probably a leftover from when powerpc64le was introduced.

Approved by:	jhibbits (on IRC)
2023-06-29 01:45:50 +02:00
Martin Matuska 7b5e687355 zfs: merge openzfs/zfs@a9d6b0690
Notable upstream pull request merges:
  #14925 Another set of vdev queue optimizations
  #14964 Use big transactions for small recordsize writes
  #14999 ZIL: Fix another use-after-free

Obtained from:	OpenZFS
OpenZFS commit:	a9d6b0690b
2023-06-29 01:39:52 +02:00
Alfonso Gregory 27cebb4eac newfs: nextnum should be a u_int32_t, not an int
The function that uses nextnum expects to return a u_int32_t, not a mere
int, so let's make nextnum a u_int32_t instead.

Note: retained current u_int32_t style, since the rest of the file uses
it.

Reviewed by: imp, mckusick
Pull Request: https://github.com/freebsd/freebsd-src/pull/734
2023-06-28 16:26:06 -06:00
Alfonso Gregory 430168942f newfs: prefer unsigned index over signed
We can just use a for loop starting at 0 instead of a while loop
starting at -1.

Reviewed by: imp, mckusick
Pull Request: https://github.com/freebsd/freebsd-src/pull/733
2023-06-28 16:18:47 -06:00
Warner Losh 31b3e4f1b4 atkbdc: Minor style nits
'char* ' -> 'char *', per style(9)

Sponsored by:		Netflix
2023-06-28 16:18:47 -06:00
Mark Johnston 00bcb77ebc arm64: Make register definitions const
No functional change intended.

Reviewed by:	andrew
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Sponsored by:	Klara, Inc. (hardware)
Differential Revision:	https://reviews.freebsd.org/D40502
2023-06-28 16:29:49 -04:00
Mark Johnston fbec1f9195 arm64: Add a masked get_kernel_reg()
This lets consumers fetch the value of a system register and apply a
mask over individual fields.  That is, each field in the returned value
will be the "smaller" of the two provided by "mask" and the value saved
in kern_cpu_desc.  This will be used by vmm to sanitize host system
register fields.

Reviewed by:	andrew
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Sponsored by:	Klara, Inc. (hardware)
Differential Revision:	https://reviews.freebsd.org/D40500
2023-06-28 16:29:49 -04:00
Mark Johnston 258a0d760a ctfconvert: Integer encoding types are unsigned
Before this change, encodings in the user-defined range were being
sign-extended.

MFC after:	1 week
Sponsored by:	Innovate UK
2023-06-28 16:29:49 -04:00
Mark Johnston f4841d8af0 bhyve: Rename a pci_cfgrw() parameter
pci_cfgrw() may be called via a write to the extended config space,
which is memory-mapped.  In this case, the name "eax" is misleading.
Give it a more generic name.  No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40732
2023-06-28 16:29:49 -04:00
Mark Johnston 13013d266e bhyve: Stop calling pci_lintr_request() in the NVMe device model
The device model effectively assumes that MSI-X is enabled (it never
asserts the legacy interrupt), so any guest which relies on being able
to use the legacy PCI interrupt will fail.

The WIP arm64 port does not implement legacy PCI interrupts, but NVMe
emulation is potentially useful there.  Simply remove the call.

Reviewed by:	corvink, chuck, jhb
Tested by:	chuck
MFC after:	1 month
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40731
2023-06-28 16:29:49 -04:00
John Baldwin d036adc4e9 bsd.sys.mk: Re-enable -Wunused-but-set-variable for clang 13+.
Reviewed by:	dim, emaste
Differential Revision:	https://reviews.freebsd.org/D40674
2023-06-28 12:27:43 -07:00
Ed Maste ab2f6ae8d1 login.conf: document how to specify env var values with commas
As of f32db40650 quotes may be used to specify login class
capabilities that include commas.  This is true in general but is
particularly relevant for setenv, a comma-separated list of environment
variables and values, so mention it there.

PR:		236204
Sponsored by:	The FreeBSD Foundation
2023-06-28 15:02:14 -04:00
John Baldwin 39240ddf85 bsd.sys.mk: Stop muting -Wunused-but-set-variable for GCC.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40662
2023-06-28 11:13:58 -07:00
John Baldwin a80e5bdff5 camdd: Remove some dead code but also make -E functional.
- Pass down the top-level arglist from main down to camdd_rw and use
  it in place of the hardcoded CAMDD_ARG_ERR_RECOVER when calling
  camdd_probe_pass.  This now disables error recovery by default
  unless -E is specified.

- Use the return value of parse_btl to determine if an explicit LUN
  was specified.

- Remove most CAMDD_ARG_* flags that are only set and never checked.
  CAMDD_ARG_VERBOSE remains, but could perhaps be removed (and possibly
  -v should be removed as well since it is currently a no-op).

Reported by:	clang -Wunused-but-set-variable (arglist in main)
Differential Revision:	https://reviews.freebsd.org/D40666
2023-06-28 11:12:50 -07:00
John Baldwin 2309909919 bsdinstall: Handle errors from geom_gettree.
geom_gettree probably never fails, and if it does there isn't much of
a fallback other than aborting partitioning.  However, a few places
were checking the return value and not doing anything with it
triggering a unused-but-set-variable warning.  Checking the errors
resolves the warning.

While here, check for errors in other places that weren't checking for
them at all, remove a spurious double call (the second call overwrote
the mesh structure leaking all the pointers from the first), and close
a few resource leaks on error paths.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D40779
2023-06-28 11:11:00 -07:00
John Baldwin 78cb8841f0 mrsas: Use mrsas_sge64 instead of iovec for the S/G list for passthru.
The DMA scatter/gather list for mrsas passthrough ioctl commands is
stored in a SGL at the end of the DCMD frame.  Given the SGL member at
the end of the DCMD frame it seems likely this S/G list is formatted
as a fixed-width structure such as the type mrsas_sge64 and not as a
iovec which contains a kernel pointer and length that vary with the
native architecture size.

Reviewed by:	imp
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D40727
2023-06-28 11:10:05 -07:00
Alan Cox 3767de8397 arm64 pmap: Tidy up pmap_promote_l2() calls
Since pmap_ps_enabled() is true by default, check it inside of
pmap_promote_l2() instead of at every call site.

Modify pmap_promote_l2() to return true if the promotion succeeded and
false otherwise.

(A similar change was applied to the amd64 pmap in 0d2f98c2f092.)

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D40781
2023-06-28 12:46:15 -05:00
Jon Hopper 599a4548f8 Adds support for Purism coreboot keyboards
On Purism coreboot systems the quirks mode in atkbdc prevents built in
Keyboard from being used. Add quirk to prevent that.

MFC After:		2 weeks
PR:			271737
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D40405
2023-06-28 11:19:24 -06:00
Andrew Turner 9beb195fd9 Continue searching for an irq map from the start
When searching for a free irq map location continue the search from the
beginning of the list. There may be holes in the map before
irq_map_first_free_idx, e.g. when removing an entries in order will
increase the index past the current free entry.

PR:		271990
Reviewed by:	mhorne
Sponsored by:	Arm Ltd

Differential Revision:	https://reviews.freebsd.org/D40768
2023-06-28 18:03:08 +01:00
Andrew Turner 1e0ba9d43c Hide irq_next_free, it's not used out of this file
Reviewed by:	mhorne
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D40767
2023-06-28 18:03:08 +01:00
Benedict Reuschling 7776cec946 Add quotes around variables and replace backticks with $()
The quotes are added to prevent word splits and globbing. Some
whitespaces were also removed after variables.

Approved by:	imp
Differential Revision: https://reviews.freebsd.org/D40726
2023-06-28 16:48:39 +00:00
Mitchell Horne acdf666147 hier(7): tweak /media description
It comes as an empty directory by default. While here, use a serial
(Oxford) comma, per the FDP Primer.

PR:		261349
Reported by:	karels
Reviewed by:	grahamperrin, karels
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40774
2023-06-28 13:22:30 -03:00
Randall Stewart 96eb0d90cd tcp: With the right options in the kernel cc_cubic stays in slowstart always.
So this is a subtle bug I have found in cubic. If you compile a number of options into the kernel (accounting and tracking) then
all of the kernel code "knows" the proper offset of t_rttupdatecnt however cubic does not see the options (and htcp too) and thus
will look for the count in the wrong place seeing 0. Which then means it never builds an MIN RTT which then means it
always hangs in slowstart.

The solution is to put all options that effect tcpcb size into the opt_global.h so that the kernel
has a consistent view of the tcpcb size.

Reviewed by: tuexen, rscheff
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D40761
2023-06-28 11:18:47 -04:00
Andrey V. Elsukov 0cd2d88d8d carp: use nd6log() macro to log debug messages
Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2023-06-28 13:27:37 +03:00
Graham Perrin 6927176113 bectl(8): clarifications, expansion
Reviewed-by:  imp
Pull-request: https://github.com/freebsd/freebsd-src/pull/728
2023-06-28 03:05:26 +01:00
Bjoern A. Zeeb 1b18fb7faa LinuxKPI: list.h add list_count_nodes()
Implement list_count_nodes() using a simple loop.  This is needed by
an updated wireless driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D40757
2023-06-28 01:32:29 +00:00
Alexander Motin a9d6b0690b
ZIL: Fix another use-after-free.
lwb->lwb_issued_txg can not be accessed after lwb_state is set to
LWB_STATE_FLUSH_DONE and zl_lock is dropped, since the lwb may be
freed by zil_sync().  We must save the txg number before that.

This is similar to the 55b1842f92, but as I see the bug is not new.
It existed for quite a while, just was not triggered due to smaller
race window.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14988
Closes #14999
2023-06-27 17:03:37 -07:00
Alexander Motin b0cbc1aa9a
Use big transactions for small recordsize writes.
When ZFS appends files in chunks bigger than recordsize, it borrows
buffer from ARC and fills it before opening transaction.  This
supposed to help in case of page faults to not hold transaction open
indefinitely.  The problem appears when recordsize is set lower than
default 128KB. Since each block is committed in separate transaction,
per-transaction overhead becomes significant, and what is even worse,
active use of of per-dataset and per-pool locks to protect space use
accounting for each transaction badly hurts the code SMP scalability.
The same transaction size limitation applies in case of file rewrite,
but without even excuse of buffer borrowing.

To address the issue, disable the borrowing mechanism if recordsize
is smaller than default and the write request is 4x bigger than it.
In such case writes up to 32MB are executed in single transaction,
that dramatically reduces overhead and lock contention.  Since the
borrowing mechanism is not used for file rewrites, and it was never
used by zvols, which seem to work fine, I don't think this change
should create significant problems, partially because in addition to
the borrowing mechanism there are also used pre-faults.

My tests with 4/8 threads writing several files same time on datasets
with 32KB recordsize in 1MB requests show reduction of CPU usage by
the user threads by 25-35%.  I would measure it in GB/s, but at that
block size we are now limited by the lock contention of single write
issue taskqueue, which is a separate problem we are going to work on.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14964
2023-06-27 17:00:30 -07:00
Laevos bc9d0084ea
Remove unnecessary commas in zpool-create.8
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Laevos <5572812+Laevos@users.noreply.github.com>
Closes #15011
2023-06-27 16:58:32 -07:00
Jessica Clarke 91d7edd549 Generalise libcompat to be a list rather than a single option
Whilst the kernel can support any number of COMPAT_FOO, world can only
build a single libfoo. Upstream this isn't such an issue, since the only
option is lib32 anyway, but downstreams, such as CheriBSD, may wish to
support multiple at the same time. Thus, adjust the top-level Makefiles
to turn _LIBCOMPAT into a _LIBCOMPATS list that gets iterated over, and
adjust bsd.compat.mk to support this use-case.

For the normal NEED_COMPAT/WANT_COMPAT case, LIBCOMPATFOO remain set and
refer to the requested compat's, preserving the current interface. For
the top-level Makefiles those variables are no longer set (since there
is no longer "the" compat) and only the per-compat ones are available.

Reviewed by:	brooks, jhb, imp
Differential Revision:	https://reviews.freebsd.org/D40571
2023-06-28 00:10:49 +01:00
Jessica Clarke 10afc5eada Makefile.libcompat: Handle MK_FOO varying for native and compat arches
Currently Makefile.libcompat queries a few MK_FOO variables to determine
what is being built. However, it is plausible (and indeed, downstream
in CheriBSD, this is the case) that these may vary between the native
and the compat architecture. In order to correctly determine their
values for the compat architecture, we need to defer their evaluation
until we are in the compat sub-make where src.opts.mk will give us the
right value for the compat MACHINE_ARCH.

Reviewed by:	brooks, jhb, imp
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D40570
2023-06-28 00:10:30 +01:00
Jessica Clarke 5ed8515151 Makefile.libcompat: Remove unused _LC_INCDIRS
This is no longer referenced as of commit 724123b9f4 ("libcompat: Use
WORLDTMP sysroot").

Reviewed by:	brooks, jhb, imp
Differential Revision:	https://reviews.freebsd.org/D40569
2023-06-28 00:09:44 +01:00
Jessica Clarke 9b3bce2074 usb: Fixed botched spacing
Fixes:	d3a83456e1 ("Add vendor id for Quectel USB modem and align with quectel marketing names.")
2023-06-28 00:07:54 +01:00
Gabriele Laganà d3a83456e1 Add vendor id for Quectel USB modem and align with quectel marketing names.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/750
2023-06-27 16:35:20 -06:00
Igor Ostapenko 7b5a1c39f1 vfs: bring vfs_lookup() description comment up to date
Signed-off-by: Igor Ostapenko <pm@igoro.pro>
Reviewed by: imp, mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/737
2023-06-27 16:34:02 -06:00
Igor Ostapenko 5958cd88f2 vfs: fix description comment of vfs_lookup()
Signed-off-by: Igor Ostapenko <pm@igoro.pro>
Reviewed by: imp, mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/737
2023-06-27 16:33:25 -06:00
Alfonso Gregory 21c32cebf8 ifconfig: skip calling fnmatch once the result no longer matters
Because fnmatch has no side effects, we can safely avoid calling fnmatch
if the end result does not matter anyway (the compiler cannot see this,
so it calls fnmatch in the event it has side-effects).

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/747
2023-06-27 16:28:44 -06:00
Konstantin Belousov ef747607ea vm_fault: move FAULT_* return codes out of range for Mach errors
This way a possible clash between FAULT_* and KERN_* numbering is
avoided, and panics checks for fault_status confusion become more
efficient.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40771
2023-06-28 00:03:14 +03:00
Simon J. Gerraty 148ee84570 Merge bmake-20230622
Merge commit '3e39ce563b9ba25883e5aa37d9799eda9e57c1e0'
2023-06-27 13:57:58 -07:00
Simon J. Gerraty 3e39ce563b Import bmake-20230622
Relevant/interesting changes:

	o optimize string matching for ':M' and ':N'
	o warn about malformed patterns in ':M', ':N' and '.if make(...)'
	o allow guards to be targets as well as variables
	The guard targets may include variable references like
	__${.PARSEDIR:tA}/${.PARSEFILE}__
	o optimization for makefiles protected from multiple-inclusion
	skip even opening the file after first include.
	o var.c: do not allow delete of readOnly variable
	o parse.c: .break takes no args
2023-06-27 13:29:43 -07:00
Graham Perrin b374a3921d hier(7): fix inline markup for a variable
I mistakenly preceded macro  Va  with macro  It  in
8ff26f2cb5

https://bugs.freebsd.org/261349

PR:                      261349
Approved by:             emaste, imp, mhorne
Fixes: 6469f9c hier(7): improvement, modernisation
2023-06-27 20:22:32 +01:00