Commit Graph

272882 Commits

Author SHA1 Message Date
Warner Losh
369216b039 ath: fix older clang build.
Define NO_WUNUSED_BUT_SET_VARIABLE for newer clang, and use it in ATH_C
to account for different clang versions. Use it in Makefiles as well.

Sponsored by:		Netflix
Reviewed by:		kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D34408
2022-03-01 22:55:34 -07:00
Warner Losh
3b17e19f02 bootstrap: bump minimum supported version
Bump the minimum supported version to build -current from to 11.3R in
preparation of removing support for older systems.  11.4R was selected
as the most recent version to go out of support.

Sponsored by:		Netflix
Reviewed by:		delphij, emaste
Differential Revision:	https://reviews.freebsd.org/D32444
2022-03-01 22:55:28 -07:00
Warner Losh
33550b4739 bootstrap: No need for kbdcontrol bootstrap anymore
We only need kbdcontrol when bootstrapping from FreeBSD 10 or
pre-FreeBSD 11.0 current. Since we can no longer build from these
versions of FreeBSD, remove the support for bootstrapping them.

Sponsored by:		Netflix
2022-03-01 22:55:24 -07:00
Warner Losh
d0e3860f70 heir: Document SYSROOT conventions
Define a place for sysroot trees to live. This assumes they come from
the base in some way, though there's not yet a build/install/etc sysroot
target. Include the FreeBSD version so multiple verrsions can be
installed on one system (it also includes the whole uname version, so
one could, in theory, install variants like CheriBSD or whatever on the
same system as FreeBSD). Use MACHINE.MACHINE_ARCH to be consistent with
the release practices, /usr/obj and other naming conventions.

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D33754
2022-03-01 17:00:40 -07:00
Alfonso S. Siciliano
912df915c2
wlanconfig: allow to enter WiFi details if no networks found
Improve the installer: wlanconfig allows user to enter WiFi details
if no networks found, useful to connect to a hidden SSID.

PR:			246192
Reported by:		emaste
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34149
2022-03-02 00:04:57 +01:00
Li-Wen Hsu
adce4585ca
Revert "Temporarily skip usr.bin.diff.diff_test.functionname in CI"
This reverts commit 85eeb6ea62.

The issue has been fixed by 4be7d087c2.

PR:		262086
2022-03-02 05:37:25 +08:00
Warner Losh
7dda139e6d ath: missed a chance to use ${ATH_C}
Fixes:		8881d206f4 (reviewed by scottl, markj in D34401)
Noticed by:	markj
Sponsored by:	Netflix
2022-03-01 14:00:14 -07:00
Mark Johnston
879b0604a8 proc: Remove assertion that P_WEXIT is not set in proc_rwmem()
exit1() sets P_WEXIT before waiting for holding threads to finish,
rather than after, so this assertion is racy.

Fixes:	12fb39ec3e ("proc: Relax proc_rwmem()'s assertion on the process hold count")
Reported by:	Jenkins
2022-03-01 15:09:45 -05:00
Mateusz Guzik
6882d53b7f zstd: build with C11
This enables thread-aware timers which in turn fixes benchmark result
reports.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D34238
2022-03-01 20:07:44 +00:00
Mark Johnston
3a56cfedbc fasttrap: Avoid creating WX mappings
fasttrap instruments certain instructions by overwriting them and
copying the original instruction to some per-thread scratch space which
is executed after the probe fires.  This trampoline jumps back to the
tracepoint after executing the original instruction.

The created mapping has both write and execute permissions, and so this
mechanism doesn't work when allow_wx is disabled.  Work around the
restriction by using proc_rwmem() to write to the trampoline.

Reviewed by:	vangyzen
Tested by:	Amit <akamit91@hotmail.com>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34304
2022-03-01 12:40:35 -05:00
Mark Johnston
83958173eb fasttrap: Assert that fasttrap_fork() successfully unmaps scratch space
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 12:40:35 -05:00
Mark Johnston
12fb39ec3e proc: Relax proc_rwmem()'s assertion on the process hold count
This reference ensures that the process and its associated vmspace will
not be destroyed while proc_rwmem() is executing.  If, however, the
calling thread belongs to the target process, then it is unnecessary to
hold the process.  In particular, fasttrap - a module which enables
userspace dtrace - may frequently call proc_rwmem(), and we'd prefer to
avoid the overhead of locking and bumping the hold count when possible.

Thus, make the assertion conditional on "p != curproc".  Also assert
that the process is not already exiting.  No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 12:40:35 -05:00
Ed Maste
f27fb06cad zfs: Update test format strings to match variable typtes
And drop stray 'd' from the end of some printed numbers.  I assume this
was the result of someone thinking u is a printf length modifier for d,
not a format specifier itself.

Reviewed by:	kevans, rew
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34387
2022-03-01 12:21:40 -05:00
Warner Losh
8881d206f4 ath: Suppress set but unused warnings
The ath driver has a lot of these warnings. It's an older driver, so
just supress these warnings until they can be fixed. They are a mix of
simple dead stores, debubgging output and stuff that would require
careful study to know if its safe to remove the access or not (there are
likely very few of the latter, but if there are any they are latent bugs
that compiler could optimize away). Since I have no ath hardware to test
on anymore, take the conservative approach.

Sponsored by:		Netflix
2022-03-01 08:06:42 -07:00
Warner Losh
094f1dc40e g_part: Allow attributes to be querried
Create g_part_getattr to allow gpart geoms to have their attributes queried.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D32782
2022-03-01 08:06:42 -07:00
Warner Losh
9c750429af Add USB UEFI locator support
Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32788
2022-03-01 08:06:42 -07:00
Warner Losh
dbee7944ba acpi: Allow matching based on locators
Allow wiring of unit numbers based any of the standard locators that
match.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32787
2022-03-01 08:06:42 -07:00
Warner Losh
6837d9d7e8 acpi hints: Abstract out acpi_hint_device_matches_resources
Abstract out acpi_hint_device_matches_resources from
acpi_hint_device_unit to simplify that code. Continue matching like
we've always matched: no functional change.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32786
2022-03-01 08:06:42 -07:00
Warner Losh
3278bf9268 acpi_hint_device_unit: matches is a bool, make it one
"matches" is used as a bool and doesn't need to count anything. Convert
it to a bool.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32785
2022-03-01 08:06:42 -07:00
Warner Losh
25670e4612 pci: Add arbitrary locator support to pci.
If the pciX:Y:Z and pciW:X:Y:Z 'at' locations don't work, allow try the
LOCATOR:PATH syntax. Use dev_wired_cache to generically look them up.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32784
2022-03-01 08:06:41 -07:00
Warner Losh
b36bd3a906 bus: Create dev_wired_cache
A simple cache to cache differnet locators to the same device.

Sponsored by:		Netflix
Changes Suggested by:	jhb
Differential Revision:	https://reviews.freebsd.org/D32783
2022-03-01 08:06:41 -07:00
Warner Losh
b029685a3a pci: switch logic a little
If we find a match, then assign it. Flip the logic in the if and assign
the unit rather than continuing if it doesn't match. Will make it easier
to expand to other matching schemes.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32779
2022-03-01 08:06:41 -07:00
Warner Losh
d0a20e401e Add UEFI locator for bus_get_device_path, pci acpi
Add a UEFI locator type. It prints the UEFI device names for a FreeBSD
device_t name. It works with PCI and ACPI device nodes. USB forthcoming.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32749
2022-03-01 08:06:41 -07:00
Warner Losh
cae7d9ec83 bus: Add ACPI locator support
Add support for printing ACPI paths. This is a bit of a degenerate case
for this interface since it's always just the device handle if the
device has one. But it is illustrtive of how to do this for a few nodes
in the tree.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32748
2022-03-01 08:06:41 -07:00
Warner Losh
f5366026ad devctl: add getpath command
Retrieves that path for a device. Different methods to enumerat the path
are supported, called locators.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32747
2022-03-01 08:06:41 -07:00
Warner Losh
b01f409ffe libdevctl: Add devctl_getpath
Helper routine to call the kernel to get a path to the named device.
Different path enumeration methods (called locators) can be used
for different path types depending on what the kernel implements.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32746
2022-03-01 08:06:41 -07:00
Warner Losh
38e942a345 devctl: Add DEV_GET_PATH
DEV_GET_PATH will get the path to a device based on different locators.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32745
2022-03-01 08:06:41 -07:00
Warner Losh
e19db70769 bus: Introduce the bus interface get_device_path
This returns the full path of a the child device requested. Since
there's different ways to recon the entire path, include a 'locator'
method. The default 'FreeBSD' method uses a filesystem-like path name
with each device to the root node separated by /. Other locators will be
UEFI, ACPI and fdt, though others are possible in the future. Make the
locator a string to allow maximum flexibility.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32744
2022-03-01 08:06:40 -07:00
Warner Losh
78408171bd devctl2: Change to 644 protections
We make sure that we check for device privs (usually meaning root or
better) for everything. To allow other functions that don't require
this, default to 644 protection.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32863
2022-03-01 08:06:40 -07:00
Ed Maste
f1421a8972 ssh: correct configure option name
The option is security-key-builtin not security-key-internal.  There is
no change to the generated config.h because the option defaults off
anyway.

MFC after:	3 days
Fixes:		87152f3405 ("ssh: disble internal security key...")
Sponsored by:	The FreeBSD Foundation
2022-03-01 09:41:51 -05:00
Mark Johnston
31218f3209 riscv: Add support for enabling SV48 mode
This increases the size of the user map from 256GB to 128TB.  The kernel
map is left unchanged for now.

For now SV48 mode is left disabled by default, but can be enabled with a
tunable.  Note that extant hardware does not implement SV48, but QEMU
does.

- In pmap_bootstrap(), allocate a L0 page and attempt to enable SV48
  mode.  If the write to SATP doesn't take, the kernel continues to run
  in SV39 mode.
- Define VM_MAX_USER_ADDRESS to refer to the SV48 limit.  In SV39 mode,
  the region [VM_MAX_USER_ADDRESS_SV39, VM_MAX_USER_ADDRESS_SV48] is not
  mappable.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34280
2022-03-01 09:39:44 -05:00
Mark Johnston
6ce716f7c3 riscv: Add support for dynamically allocating L1 page table pages
This is required in SV48 mode.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34279
2022-03-01 09:39:44 -05:00
Mark Johnston
1321117200 riscv: Handle four-level page tables in various pmap traversal routines
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34278
2022-03-01 09:39:44 -05:00
Mark Johnston
ceed61483c riscv: Maintain the allpmaps list only in SV39 mode
When four-level page tables are used, there is no need to distribute
updates to the top-level page to all pmaps.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34277
2022-03-01 09:39:44 -05:00
Mark Johnston
5cf3a8216e riscv: Add pmap helper functions required by four-level page tables
No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34276
2022-03-01 09:39:44 -05:00
Mark Johnston
4337979236 riscv: Try to improve the comments for locore's page table setup
No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34275
2022-03-01 09:39:44 -05:00
Mark Johnston
ecaf115434 riscv: Conditionally modify the ELF64 sysentvec for SV48
A sysinit determines whether the pmap has enabled SV48 mode and modifies
the corresponding fields which describe the user memory map.

Reviewed by:	kib, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34274
2022-03-01 09:39:43 -05:00
Mark Johnston
35d0f443cf riscv: Define a SV48 memory map
No functional change intended.

Reviewed by:	kib, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34273
2022-03-01 09:39:43 -05:00
Mark Johnston
59f192c507 riscv: Add various pmap definitions needed to support SV48 mode
No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34272
2022-03-01 09:39:43 -05:00
Mark Johnston
2e956c30ca riscv: Use generic CSR macros for writing SATP
Instead of having the one-off load_satp(), just use csr_write().  No
functional change intended.

Reviewed by:	alc, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34271
2022-03-01 09:39:43 -05:00
Mark Johnston
82f4e0d0f0 riscv: Rename struct pmap's pm_l1 field to pm_top
In SV48 mode, the top-level page will be an L0 page rather than an L1
page.  Rename the field accordingly.  No functional change intended.

Reviewed by:	alc, jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34270
2022-03-01 09:39:43 -05:00
Mark Johnston
9f70c04da4 rip: Fix a -Wunused-but-set-variable warning
Fixes:		81728a538d ("Split rtinit() into multiple functions.")
Reviewed by:	imp, melifaro
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34395
2022-03-01 09:39:43 -05:00
Mark Johnston
84369dd523 x86: Probe the TSC frequency earlier
This lets us use the TSC to implement early DELAY, limiting the use of
the sometimes-unreliable 8254 PIT.

PR:		262155
Reviewed by:	emaste
Tested by:	emaste, mike tancsa <mike@sentex.net>, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34367
2022-03-01 09:39:35 -05:00
Mark Johnston
c3d830cf7c i386: Call clock_init() after finishidentcpu()
In a subsequent commit clock_init() will attempt to determine the TSC
frequency, and this requires that CPU identification is finalized.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 09:38:45 -05:00
Mark Johnston
89ae8eb74e rmlock: Add required compiler barriers to _rm_runlock()
Also remove excessive whitespace in _rm_rlock().

Reviewed by:	jah, mjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34381
2022-03-01 09:38:45 -05:00
Mark Johnston
9340d69e57 openssh: Add a note to check for deprecated and removed config options
Suggested by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-03-01 09:38:44 -05:00
Mark Johnston
c1b656ac55 release: Remove references to ChallengeResponseAuthentication
This sshd_config keyword was replaced by KbdInteractiveAuthentication in
openssh 8.7, though ChallengeResponseAuthentication is silently accepted
as an alias.  However, this means that the code in ec2.conf which
modifies a commented-out line no longer does anything.  Apply a minimal
fix.

Reviewed by:	cperciva, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34400
2022-03-01 08:54:55 -05:00
Tom Jones
4be7d087c2 diff: Use start of change when searching for function
Use the start of change when searching for a function rather than the
start of the context. In short functions if this could result in search
for the function name starting from before the function definition.

PR:		262086
Reviewed by:	bapt, mckusick, mhorne
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34328
2022-03-01 13:27:21 +00:00
Kirk McKusick
3cf2f812f5 Add casts to printf statements to keep armv6, armv7, and powerpc
builds happy.
2022-02-28 19:28:02 -08:00
Kirk McKusick
c7996ddf80 Create a new GEOM utility, gunion(8).
The gunion(8) utility is used to track changes to a read-only disk on
a writable disk. Logically, a writable disk is placed over a read-only
disk. Write requests are intercepted and stored on the writable
disk. Read requests are first checked to see if they have been
written on the top (writable disk) and if found are returned. If
they have not been written on the top disk, then they are read from
the lower disk.

The gunion(8) utility can be especially useful if you have a large
disk with a corrupted filesystem that you are unsure of how to
repair. You can use gunion(8) to place another disk over the corrupted
disk and then attempt to repair the filesystem. If the repair fails,
you can revert all the changes in the upper disk and be back to the
unchanged state of the lower disk thus allowing you to try another
approach to repairing it. If the repair is successful you can commit
all the writes recorded on the top disk to the lower disk.

Another use of the gunion(8) utility is to try out upgrades to your
system. Place the upper disk over the disk holding your filesystem
that is to be upgraded and then run the upgrade on it. If it works,
commit it; if it fails, revert the upgrade.

Further details can be found in the gunion(8) manual page.

Reviewed by: Chuck Silvers, kib (earlier version)
tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D32697
2022-02-28 16:36:08 -08:00