]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoproc: Relax proc_rwmem()'s assertion on the process hold count
Mark Johnston [Tue, 1 Mar 2022 16:48:39 +0000 (11:48 -0500)]
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

2 years agozfs: Update test format strings to match variable typtes
Ed Maste [Mon, 28 Feb 2022 01:11:20 +0000 (20:11 -0500)]
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

2 years agoath: Suppress set but unused warnings
Warner Losh [Tue, 1 Mar 2022 00:26:00 +0000 (17:26 -0700)]
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

2 years agog_part: Allow attributes to be querried
Warner Losh [Mon, 28 Feb 2022 21:28:51 +0000 (14:28 -0700)]
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

2 years agoAdd USB UEFI locator support
Warner Losh [Mon, 28 Feb 2022 21:28:46 +0000 (14:28 -0700)]
Add USB UEFI locator support

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D32788

2 years agoacpi: Allow matching based on locators
Warner Losh [Mon, 28 Feb 2022 21:28:40 +0000 (14:28 -0700)]
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

2 years agoacpi hints: Abstract out acpi_hint_device_matches_resources
Warner Losh [Mon, 28 Feb 2022 21:28:33 +0000 (14:28 -0700)]
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

2 years agoacpi_hint_device_unit: matches is a bool, make it one
Warner Losh [Mon, 28 Feb 2022 21:28:26 +0000 (14:28 -0700)]
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

2 years agopci: Add arbitrary locator support to pci.
Warner Losh [Mon, 28 Feb 2022 21:28:20 +0000 (14:28 -0700)]
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

2 years agobus: Create dev_wired_cache
Warner Losh [Mon, 28 Feb 2022 21:28:01 +0000 (14:28 -0700)]
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

2 years agopci: switch logic a little
Warner Losh [Mon, 28 Feb 2022 21:27:55 +0000 (14:27 -0700)]
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

2 years agoAdd UEFI locator for bus_get_device_path, pci acpi
Warner Losh [Mon, 28 Feb 2022 21:27:48 +0000 (14:27 -0700)]
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

2 years agobus: Add ACPI locator support
Warner Losh [Mon, 28 Feb 2022 21:27:42 +0000 (14:27 -0700)]
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

2 years agodevctl: add getpath command
Warner Losh [Mon, 28 Feb 2022 21:27:35 +0000 (14:27 -0700)]
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

2 years agolibdevctl: Add devctl_getpath
Warner Losh [Mon, 28 Feb 2022 21:27:28 +0000 (14:27 -0700)]
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

2 years agodevctl: Add DEV_GET_PATH
Warner Losh [Mon, 28 Feb 2022 21:27:20 +0000 (14:27 -0700)]
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

2 years agobus: Introduce the bus interface get_device_path
Warner Losh [Mon, 28 Feb 2022 21:27:09 +0000 (14:27 -0700)]
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

2 years agodevctl2: Change to 644 protections
Warner Losh [Mon, 28 Feb 2022 21:26:19 +0000 (14:26 -0700)]
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

2 years agossh: correct configure option name
Ed Maste [Tue, 1 Mar 2022 14:35:46 +0000 (09:35 -0500)]
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: 87152f340549 ("ssh: disble internal security key...")
Sponsored by: The FreeBSD Foundation

2 years agoriscv: Add support for enabling SV48 mode
Mark Johnston [Tue, 1 Mar 2022 14:07:14 +0000 (09:07 -0500)]
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

2 years agoriscv: Add support for dynamically allocating L1 page table pages
Mark Johnston [Tue, 1 Mar 2022 14:06:57 +0000 (09:06 -0500)]
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

2 years agoriscv: Handle four-level page tables in various pmap traversal routines
Mark Johnston [Tue, 1 Mar 2022 14:06:42 +0000 (09:06 -0500)]
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

2 years agoriscv: Maintain the allpmaps list only in SV39 mode
Mark Johnston [Tue, 1 Mar 2022 14:06:31 +0000 (09:06 -0500)]
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

2 years agoriscv: Add pmap helper functions required by four-level page tables
Mark Johnston [Tue, 1 Mar 2022 14:06:15 +0000 (09:06 -0500)]
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

2 years agoriscv: Try to improve the comments for locore's page table setup
Mark Johnston [Tue, 1 Mar 2022 14:06:03 +0000 (09:06 -0500)]
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

2 years agoriscv: Conditionally modify the ELF64 sysentvec for SV48
Mark Johnston [Tue, 1 Mar 2022 14:05:02 +0000 (09:05 -0500)]
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

2 years agoriscv: Define a SV48 memory map
Mark Johnston [Tue, 1 Mar 2022 14:04:38 +0000 (09:04 -0500)]
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

2 years agoriscv: Add various pmap definitions needed to support SV48 mode
Mark Johnston [Tue, 1 Mar 2022 14:04:01 +0000 (09:04 -0500)]
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

2 years agoriscv: Use generic CSR macros for writing SATP
Mark Johnston [Tue, 1 Mar 2022 14:03:44 +0000 (09:03 -0500)]
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

2 years agoriscv: Rename struct pmap's pm_l1 field to pm_top
Mark Johnston [Tue, 1 Mar 2022 14:03:30 +0000 (09:03 -0500)]
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

2 years agorip: Fix a -Wunused-but-set-variable warning
Mark Johnston [Tue, 1 Mar 2022 14:01:24 +0000 (09:01 -0500)]
rip: Fix a -Wunused-but-set-variable warning

Fixes: 81728a538d24 ("Split rtinit() into multiple functions.")
Reviewed by: imp, melifaro
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34395

2 years agox86: Probe the TSC frequency earlier
Mark Johnston [Tue, 1 Mar 2022 14:39:35 +0000 (09:39 -0500)]
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

2 years agoi386: Call clock_init() after finishidentcpu()
Mark Johnston [Tue, 1 Mar 2022 14:00:05 +0000 (09:00 -0500)]
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

2 years agormlock: Add required compiler barriers to _rm_runlock()
Mark Johnston [Tue, 1 Mar 2022 13:55:43 +0000 (08:55 -0500)]
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

2 years agoopenssh: Add a note to check for deprecated and removed config options
Mark Johnston [Tue, 1 Mar 2022 14:36:23 +0000 (09:36 -0500)]
openssh: Add a note to check for deprecated and removed config options

Suggested by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agorelease: Remove references to ChallengeResponseAuthentication
Mark Johnston [Tue, 1 Mar 2022 13:54:55 +0000 (08:54 -0500)]
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

2 years agodiff: Use start of change when searching for function
Tom Jones [Tue, 1 Mar 2022 13:23:25 +0000 (13:23 +0000)]
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

2 years agoAdd casts to printf statements to keep armv6, armv7, and powerpc
Kirk McKusick [Tue, 1 Mar 2022 03:28:02 +0000 (19:28 -0800)]
Add casts to printf statements to keep armv6, armv7, and powerpc
builds happy.

2 years agoCreate a new GEOM utility, gunion(8).
Kirk McKusick [Tue, 1 Mar 2022 00:36:08 +0000 (16:36 -0800)]
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

2 years agovmm: fix "set but not used" warnings
Robert Wing [Tue, 1 Mar 2022 00:09:32 +0000 (15:09 -0900)]
vmm: fix "set but not used" warnings

2 years agovmm: fix "set but not used" warnings
Robert Wing [Mon, 28 Feb 2022 23:55:37 +0000 (14:55 -0900)]
vmm: fix "set but not used" warnings

2 years agovmm: fix "set but not used" warnings
Robert Wing [Mon, 28 Feb 2022 23:46:08 +0000 (14:46 -0900)]
vmm: fix "set but not used" warnings

2 years agodtc: Sync with upstream version e9a77451cdd8
Jessica Clarke [Mon, 28 Feb 2022 22:37:47 +0000 (22:37 +0000)]
dtc: Sync with upstream version e9a77451cdd8

1c231509cf88 ("Validate integers fit in cells") is the only change
missing from our copy.

Reviewed by: manu, imp
Differential Revision: https://reviews.freebsd.org/D34368

2 years agorelease: Add support for building on non-FreeBSD
Jessica Clarke [Mon, 28 Feb 2022 22:37:37 +0000 (22:37 +0000)]
release: Add support for building on non-FreeBSD

This requires two sets of changes. Firstly, for non-FreeBSD, we do not
know where tools are in PATH (and it is likely that some are not in
system directories and have been built as bootstrap tools during the
build), so we should leave PATH alone and trust the user. Secondly,
makefs needs a master.passwd for building images from a METALOG file, so
pass the directory in the image tree to makefs's -N option in order to
pick up a valid FreeBSD master.passwd; this is unnecessary on FreeBSD
(except in the edge case of building an image that refers to users or
groups not present in the host's database, which is unlikely but
technically possible) but harmless so can be done unconditionally.

Reviewed by: brooks, emaste, gjb
Differential Revision: https://reviews.freebsd.org/D34001

2 years agoinstall-boot.sh: Avoid - in function names for POSIX compatibility
Jessica Clarke [Mon, 28 Feb 2022 22:37:21 +0000 (22:37 +0000)]
install-boot.sh: Avoid - in function names for POSIX compatibility

FreeBSD sh supports this but other common POSIX shells do not; in
particular, dash does not, unlike bash and zsh. This allows the script
to be used on non-FreeBSD systems for release media building.

Reviewed by: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D34000

2 years agorelease: Support -DNO_ROOT image building
Jessica Clarke [Mon, 28 Feb 2022 22:37:03 +0000 (22:37 +0000)]
release: Support -DNO_ROOT image building

This requires a bunch of METALOG mangling to include the files we inject
into the tree. The mkisoimages.sh and make-memstick.sh scripts are now
called with the current directory inside the tree so that the relative
paths in the METALOG match up with the current directory. The scripts do
not require this when not using a METALOG, but for simplicity we always
do so. The Makefile mangles the real METALOG created from the install,
as those files are shared across all uses of the tree, but the shell
scripts create a temporary copy of the METALOG that they mangle as their
tree modifications are specific to that image. We also need to pass -D
to makefs to turn any duplicate METALOG entry errors into warnings, as
we have many (harmless) instances of those.

Whilst dvd1.iso should work, the !NOPKG code will need more work to
support this.

All media will also lack mergemaster and etcupdate trees, since more
work is needed to add -DNO_ROOT modes to them. Users of install media
built this way will have to manually bootstrap them.

Reviewed by: brooks, gjb
Differential Revision: https://reviews.freebsd.org/D33999

2 years agomkisoimages.sh: Avoid creating temporary files in the current directory
Jessica Clarke [Mon, 28 Feb 2022 22:36:51 +0000 (22:36 +0000)]
mkisoimages.sh: Avoid creating temporary files in the current directory

Currently the current directory is the parent of the rootfs directory,
but this will change in order to support NO_ROOT builds that use a
metalog manifest, since those need to have the current directory be the
rootfs itself in order for the relative paths to be correct, and we do
not want the non-METALOG case (which passes the directory to makefs) to
pick up leftover temporary .img files from a previous failed build.

Reviewed by: brooks, emaste, gjb
Differential Revision: https://reviews.freebsd.org/D33998

2 years agoFix hand-rolled METALOG entries for installconfig during distributeworld
Jessica Clarke [Mon, 28 Feb 2022 22:36:39 +0000 (22:36 +0000)]
Fix hand-rolled METALOG entries for installconfig during distributeworld

During distributeworld we call distribute on subdirectories, which in
turn calls installconfig. However, this recursive installconfig call
appends the distribution name (in these cases, "base") to DESTDIR. For
install(1) this works fine as its -D argument comes from the top-level
Makefile.inc1, which passes the original DESTDIR, thereby resulting in
the METALOG entry having the distribution name as a prefix representing
its true installed path relative to the root, but for the hand-rolled
entries they do not use install(1) and thus do not have access to what
the original DESTDIR was, resulting in the METALOG missing this prefix.

Thus, pass down the name of the distribution via a new variable DISTBASE
(chosen as Makefile.inc1 already uses that to convey this exact same
information to etc's distrib-dirs during distributeworld) and prepend
this to the handful of manually-generated METALOG entries. For the
installworld case this variable will be empty and so this behaves as
before.

Note that we need to be careful to avoid double slashes in the METALOG;
distributeworld uses find | awk to split the single METALOG up into
multiple dist.meta files, and this relies on the paths in the METALOG
having the exact prefix ./dist (or ./dist/usr/lib/debug).

Reviewed by: brooks, emaste
Differential Revision: https://reviews.freebsd.org/D33997

2 years agoAdd a manual page for boottrace(4)
Mateusz Piotrowski [Mon, 28 Feb 2022 21:51:03 +0000 (22:51 +0100)]
Add a manual page for boottrace(4)

Reviewed by: mhorne, pauamma_gundo.com
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc
Differential Revision: https://reviews.freebsd.org/D33275

2 years agoipfilter: Print protocol when listing NAT table mappings
Cy Schubert [Mon, 28 Feb 2022 19:43:33 +0000 (11:43 -0800)]
ipfilter: Print protocol when listing NAT table mappings

NAT table mappings list only the source and destination IP, the source
and destinaion port numbers, and their mappings. But the protocol is not
listed. Now that Facebook and Google use QUIC, seeing port 443 in in a
list of active NAT sessions could mean 443/tcp or 443/udp. This patch
adds the protocol to the listing to aid in determining whether HTTPS is
TCP or QUIC in a NAT mapping listing. This also helps differentiatinete
between other protocols such as ICMP, ESP, and AH in ipnat list of active
sessions.

MFC after: 1 week

2 years agoReport I/O stats from the CAM_IOSCHED_DYNAMIC extension
Warner Losh [Mon, 28 Feb 2022 17:17:06 +0000 (10:17 -0700)]
Report I/O stats from the CAM_IOSCHED_DYNAMIC extension

Report, on a periodic basis, the I/O latencies the CAM I/O scheduler
computes. These times are only for the hardware portion of the I/O as
measured from the time the operation is scheduled with the SIM using
xpt_action() until the SIM reports it has completed with xpt_dine(). Any
time the I/O operation spends in a software queue is no included.

The P50 (median), P90, P99 and P99.9 statistics about the latency of
each of the read, write and trim operations that completed during the
polling interval are reported. If there are fewer than 2, 10, 100 or
1000 operations during the polling interval, no statistic is reported
and a single dash '-' is displayed.

The read, write and trim commands (either on the command line or at run
time) toggle display of these operations. The color command toggles
color (it defaults to on, like gstat). When color is enabled, unknown
statistics are reported in blue, high latency for a statistics is
reported in red, medium in magenta and low in green (as with gstat). The
med= and hi= commands can set these latency thresholds.

Limitations: The entire sysctl space for all the devices is walked for
each polling period. This should be optimized to remember the OIDs and
only do such polling with the xpt generation changes. There is also no
way to filter devices displayed. This command only works on physical
devies that are connected to SCSI, ATA or NVME sims as those are the
only ones that are instrumented in the CAM I/O scheduler (the
CAM_IOSCHED_DYNAMIC option must be in the kernel, and the dynamic
scheduler can't be disabled).

MFC After: 1 month
Relnotes: yes
Sponsored by: Netflix
Reviewed by: pauamma_gundo.com, chs
Differential Revision: https://reviews.freebsd.org/D34259

2 years agobwn: Remove useless variable
Warner Losh [Mon, 28 Feb 2022 17:14:04 +0000 (10:14 -0700)]
bwn: Remove useless variable

type is a write-only variable. Eliminate it.

Sponsored by: Netflix

2 years agobnxt: Remove dead write to cp_ring_id
Warner Losh [Mon, 28 Feb 2022 17:13:27 +0000 (10:13 -0700)]
bnxt: Remove dead write to cp_ring_id

Since this is read from memory, reading it and then ignoring it is dead
code...

Sponsored by: Netflix

2 years agoaxgbe_setup_sysctl is a nop, remove it and the call to it.
Warner Losh [Mon, 28 Feb 2022 17:12:27 +0000 (10:12 -0700)]
axgbe_setup_sysctl is a nop, remove it and the call to it.

Should we need something like this in the future, we can add it back.

Sponsored by: Netflix

2 years agocdce: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 16:08:55 +0000 (11:08 -0500)]
cdce: Fix a -Wunused-but-set-variable warning

MFC after: 1 week

2 years agoaxe: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 16:07:19 +0000 (11:07 -0500)]
axe: Fix a -Wunused-but-set-variable warning

MFC after: 1 week

2 years agopci: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 15:54:42 +0000 (10:54 -0500)]
pci: Fix a -Wunused-but-set-variable warning

MFC after: 1 week

2 years agoaxge: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 15:54:32 +0000 (10:54 -0500)]
axge: Fix a -Wunused-but-set-variable warning

MFC after: 1 week

2 years agobhnd: Fix some -Wunused-but-set-variable warnings
Mark Johnston [Mon, 28 Feb 2022 15:54:25 +0000 (10:54 -0500)]
bhnd: Fix some -Wunused-but-set-variable warnings

MFC after: 1 week

2 years agoiwm: Fix -Wunused-but-set-variable warnings
Mark Johnston [Mon, 28 Feb 2022 15:54:15 +0000 (10:54 -0500)]
iwm: Fix -Wunused-but-set-variable warnings

MFC after: 1 week

2 years agoAdd ggated rc script
Alan Somers [Mon, 28 Feb 2022 04:14:52 +0000 (21:14 -0700)]
Add ggated rc script

Reviewed by: asomers, peterj
Submitted by: Johannes Totz <jo@bruelltuete.com>
Differential Revision: https://reviews.freebsd.org/D31709

2 years agoRemove prototype of x86emu_init_default.
Xin LI [Sun, 27 Feb 2022 23:11:17 +0000 (15:11 -0800)]
Remove prototype of x86emu_init_default.

It's removed in 3219f535d98a (r198251) as part of code refactor.

MFC after: 2 weeks

2 years agontp: disable format string warnings in libopts
Ed Maste [Sun, 27 Feb 2022 19:21:12 +0000 (14:21 -0500)]
ntp: disable format string warnings in libopts

libopts uses generated format string tables that contain embedded NULs.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34386

2 years agovchiq: Add compat string for rpi4
Marco Devesas Campos [Sun, 27 Feb 2022 16:37:56 +0000 (09:37 -0700)]
vchiq: Add compat string for rpi4

The RPi 4 has a newer vchiq compatible device, add it to the list.

Reviewed by: imp

2 years agolibefivar: Apply uncrustify changes
Jose Luis Duran [Thu, 24 Feb 2022 01:23:57 +0000 (22:23 -0300)]
libefivar: Apply uncrustify changes

Apply uncrustify changes to .c/.h files.

Reduce the diffs with EDK2 to aid with future merges.  The
unconventional way we've imported this code makes using a vendor branch
to manage it at the very least tricky. Update FreeBSD-update to reflect
the slight shift in advise.

Reviewed by: imp
Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Obtained from: https://github.com/tianocore/edk2/commit/2f88bd3a1296c522317f1c21377876de63de5be7
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Change OPTIONAL keyword usage style
Jose Luis Duran [Fri, 25 Feb 2022 14:14:57 +0000 (11:14 -0300)]
libefivar: Change OPTIONAL keyword usage style

Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=3760
Obtained from: https://github.com/tianocore/edk2/commit/d0e2f8232a26453fc0191629ed44ff2a46ea073e
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Replace BSD License with BSD+Patent License
Jose Luis Duran [Thu, 24 Feb 2022 00:54:02 +0000 (21:54 -0300)]
libefivar: Replace BSD License with BSD+Patent License

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1373
Obtained from: https://github.com/tianocore/edk2/commit/9344f0921518309295da89c221d10cbead8531aa
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Check Length para before use in DevPathToTextUsbWWID
Jose Luis Duran [Wed, 23 Feb 2022 20:16:15 +0000 (17:16 -0300)]
libefivar: Check Length para before use in DevPathToTextUsbWWID

In function DevPathToTextUsbWWID, the Length parameter is used
without check. This patch is to add check before using it.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1336
Obtained from: https://github.com/tianocore/edk2/commit/d8e702693a8c292220131dc4234a36e2c9fff614
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Fix incorrect check for DisplayOnly text format in AcpiEx
Jose Luis Duran [Thu, 24 Feb 2022 00:47:18 +0000 (21:47 -0300)]
libefivar: Fix incorrect check for DisplayOnly text format in AcpiEx

Text format for AcpiEx device path in UEFI Spec:
AcpiEx(HID,CID,UID,HIDSTR,CIDSTR,UIDSTR)
AcpiEx(HID|HIDSTR,(CID|CIDSTR,UID|UIDSTR))(Display Only)

When convert device path to text for AcpiEx device path,
current code check AllowShortcuts parameter to convert
the device path to DisplayOnly text format(shorter text
representation) by mistake.
It should check DisplayOnly parameter.

This commit is to fix this issue.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1312
Obtained from: https://github.com/tianocore/edk2/commit/e9ab1635a2cfa1cb588996dcd5cc157fb44decb1
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Handle AcpiExp device path when optional para is not specified
Jose Luis Duran [Wed, 23 Feb 2022 17:04:02 +0000 (14:04 -0300)]
libefivar: Handle AcpiExp device path when optional para is not specified

AcpiExp text device path: AcpiExp(HID,CID,UIDSTR)
And according to UEFI spec, the CID parameter is optional
and has a default value of 0. But current implementation
miss to check following cases for the AcpiExp.
FromText: when text device is AcpiExp(HID,,UIDSTR)/AcpiExp(HID,0,UIDSTR)
ToText: when the CID is 0 in the node structure

This commit is to do the enhancement.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1243
Obtained from: https://github.com/tianocore/edk2/commit/a8b5750901faa63ff5570634851e648b8e335e5a
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Handle USBxxx device path when optional para is not specified
Jose Luis Duran [Fri, 25 Feb 2022 17:54:51 +0000 (14:54 -0300)]
libefivar: Handle USBxxx device path when optional para is not specified

According to UEFI spec,
for the Messaging Device Path with USB Class SubType, some paras
are optional in the text device path.
Take UsbClass(VID,PID,Class,SubClass,Protocol) for example,
The VID is an integer between 0 and 65535 and is optional. The
default value is 0xFFFF.
The PID is an integer between 0 and 65535 and is optional. The
default value is 0xFFFF.
The Class is an integer between 0 and 255 and is optional. The
default value is 0xFF.
The SubClass is an integer between 0 and 255 and is optional. The
default value is 0xFF.
The Protocol is an integer between 0 and 255 and is optional. The
default value is 0xFF.
So if any the optional para is not specified in the text device,
we should set related para in the node structure to default value.

This commit is to do the enhancement for USB Class device path
when optional para is not specified.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1243
Obtained from: https://github.com/tianocore/edk2/commit/3874108034eb3f1d5d5180df33a5dfdd5fab5d25
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Handle Sata device path when optional para is not specified
Jose Luis Duran [Fri, 25 Feb 2022 17:48:26 +0000 (14:48 -0300)]
libefivar: Handle Sata device path when optional para is not specified

Sata device path format:Sata(HPN, PMPN, LUN)
According to UEFI Spec, the PMPN is an integer between
0 and 65535 and is optional. If not provided, the default is 0xFFFF.

This commit is to do the enhancement for Sata device path
when optional para is not specified.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1243
Obtained from: https://github.com/tianocore/edk2/commit/6d9b9bbb6148831de2ca545994f31e27b3d4c675
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Use VENDOR_DEVICE_PATH structure for Debug Port device path
Jose Luis Duran [Fri, 25 Feb 2022 17:35:58 +0000 (14:35 -0300)]
libefivar: Use VENDOR_DEVICE_PATH structure for Debug Port device path

When converting DebugPort device path from text,
current code use VENDOR_DEFINED_MESSAGING_DEVICE_PATH structure
for Debug port device node.
typedef struct {
  EFI_DEVICE_PATH_PROTOCOL  Header;
  EFI_GUID                  Guid;
  UINT8                     VendorDefinedData[1];
} VENDOR_DEFINED_MESSAGING_DEVICE_PATH;

And Debugport Device Path is a vendor-defined messaging
device path with no data, only a GUID. So it's better to
use VENDOR_DEVICE_PATH to create the Debug port device node.
typedef struct {
  EFI_DEVICE_PATH_PROTOCOL        Header;
  EFI_GUID                        Guid;
} VENDOR_DEVICE_PATH;

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1229
Obtained from: https://github.com/tianocore/edk2/commit/9343d0a1cd09544686b14dba5b428d7bc811f6b9
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Add PciRoot/PcieRoot text for ACPI Expanded Device Path
Jose Luis Duran [Wed, 23 Feb 2022 16:50:19 +0000 (13:50 -0300)]
libefivar: Add PciRoot/PcieRoot text for ACPI Expanded Device Path

According to UEFI spec,for ACPI Expanded Device Path
when HID=PNP0A03 or CID=PNP0A03 and HID != PNP0A08,
the device path node can be displayed as: PciRoot(UID|UIDSTR)
When HID=PNP0A08 or CID=PNP0A08, the device path node can be
displayed as: PcieRoot(UID|UIDSTR). But current code miss the
code logic.

This commit is to do the enhancement.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1228
Obtained from: https://github.com/tianocore/edk2/commit/78af0984b45a780e45d57c22c85a1f594b969212
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Correct condition check for AcpiExp text format
Jose Luis Duran [Wed, 23 Feb 2022 16:38:58 +0000 (13:38 -0300)]
libefivar: Correct condition check for AcpiExp text format

According to UEFI Spec, for ACPI Expanded Device Path,
when HIDSTR=empty, CIDSTR=empty, UID STR!=empty,
the ACPI Expanded Device Path node can be displayed as
AcpiExp(HID,CID,UIDSTR) format.
And if UID is 0 and UIDSTR is empty, then use AcpiEx format.

This patch is to correct the condition check to follow UEFI
Spec when convert the device path node to the AcpiExp text
format.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1226
Obtained from: https://github.com/tianocore/edk2/commit/fb4bea551e5b7e16e54676bca3d1ccde65f57c77
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Correct the string order of ACPI Expanded Device Path
Jose Luis Duran [Wed, 23 Feb 2022 16:45:14 +0000 (13:45 -0300)]
libefivar: Correct the string order of ACPI Expanded Device Path

According to UEFI Spec, ACPI Expanded Device Path can be display
AcpiEx(HID|HIDSTR,(CID|CIDSTR,UID|UIDSTR)), but current code display
UID|UIDSTR before CID|CIDSTR.
This patch is to fix this issue.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1227
Obtained from: https://github.com/tianocore/edk2/commit/05fe7525896cee197cfed98154955dbaa60d6357
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Clean up source files
Jose Luis Duran [Fri, 25 Feb 2022 14:03:55 +0000 (11:03 -0300)]
libefivar: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Adapted according to FreeBSD-update instructions, with the sole purpose
of reducing the differences with upstream sources.

Obtained from: https://github.com/tianocore/edk2/commit/9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Fix iSCSI.Lun byte order issue
Jose Luis Duran [Wed, 23 Feb 2022 20:42:01 +0000 (17:42 -0300)]
libefivar: Fix iSCSI.Lun byte order issue

Obtained from: https://github.com/tianocore/edk2/commit/19f21ed91652d2a5160426ad8ca9219728d85aec
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Fix byte orders of iSCSI.Lun
Jose Luis Duran [Thu, 24 Feb 2022 01:55:30 +0000 (22:55 -0300)]
libefivar: Fix byte orders of iSCSI.Lun

Per UEFI spec, iSCSI.Lun is a 8-byte array with byte #0 in the left.
It means "0102030405060708" should be converted to:
    UINT8[8] = {01, 02, 03, 04, 05, 06, 07, 08}
or  UINT64 = {0807060504030201}

Today's implementation wrongly uses the reversed order.

Obtained from: https://github.com/tianocore/edk2/commit/d0196be1e39c419223738d7181d4a5d8972792d0
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Fix bug when converting iSCSI node
Jose Luis Duran [Thu, 24 Feb 2022 01:46:19 +0000 (22:46 -0300)]
libefivar: Fix bug when converting iSCSI node

If protocol string is not specified, default TCP(0) should be used.
Today's implementation wrongly sets to 1 for this case.

Obtained from: https://github.com/tianocore/edk2/commit/e6c80aea71c7b7c6c22ed779d23bf7877a97e68d
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Add DevPathFromTextDns and DevPathToTextDns libraries
Jose Luis Duran [Thu, 24 Feb 2022 00:39:13 +0000 (21:39 -0300)]
libefivar: Add DevPathFromTextDns and DevPathToTextDns libraries

V3:
* Fix the bug in DevPathFromTextDns()

V2:
* Add no IP instance case check.

Obtained from: https://github.com/tianocore/edk2/commit/9b9d0655c1547384c2b34cea94eab4b8b83bd1b9
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Add BluetoothLe device path node support
Jose Luis Duran [Wed, 23 Feb 2022 20:55:23 +0000 (17:55 -0300)]
libefivar: Add BluetoothLe device path node support

Obtained from: https://github.com/tianocore/edk2/commit/ff5623e990782ad62c5f6943087ebafb17afe8ba
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Reverse the byte order of BD_ADDR for Bluetooth
Jose Luis Duran [Thu, 24 Feb 2022 00:03:10 +0000 (21:03 -0300)]
libefivar: Reverse the byte order of BD_ADDR for Bluetooth

For the following two functions:
DevPathFromTextBluetooth()
DevPathToTextBluetooth()

The Bluetooth device address "UINT8  Address[6]" is displayed with the
order from Address[5] to Address[0]. This commit reverses the order.

Obtained from: https://github.com/tianocore/edk2/commit/4fc8277133fb011d028b4e0a42444ab6f552d0b9
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Refine the DevPathFromTextiSCSI protocol parsing
Jose Luis Duran [Thu, 24 Feb 2022 01:43:27 +0000 (22:43 -0300)]
libefivar: Refine the DevPathFromTextiSCSI protocol parsing

For current iSCSI protocol parsing, UINT16 truncation may be happened. Since
the Spec already have declaimed that 0 is TCP Protocol and 1+ is reserved, the
parsing can be refined as below:

  if (StrCmp (ProtocolStr, L"TCP") == 0) {
    ISCSIDevPath->NetworkProtocol = 0;
  } else {
    //
    // Undefined and reserved.
    //
    ISCSIDevPath->NetworkProtocol = 1;
  }

Obtained from: https://github.com/tianocore/edk2/commit/7571a1c191e19b48d33a33c8b7763b49999700ee
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Fix FromText bug for multi-instance devicepath
Jose Luis Duran [Fri, 25 Feb 2022 14:39:12 +0000 (11:39 -0300)]
libefivar: Fix FromText bug for multi-instance devicepath

UefiDevicePathLibConvertTextToDevicePath correctly detects when it
has hit a ',' splicing together multiple paths. However, the code
that tries to cope with it:
{code}
if (IsInstanceEnd) {
  DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (
                                   END_DEVICE_PATH_LENGTH);
  ASSERT (DeviceNode != NULL);
  SetDevicePathEndNode (DeviceNode);

  NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode);
  FreePool (DevicePath);
  FreePool (DeviceNode);
  DevicePath = NewDevicePath;
}
{code}
causes a problem. The END node that's appended it the node for the
entire list. So when the node is appended in AppendDevicePathNode,
it winds up disappearing. This leads to the path
'PciRoot(0x0),PciRoot(0x0)' parsing as if 'PciRoot(0x0)/PciRoot(0x0)'
were specified. These are two very different things.

NOTE:
This fix was already committed.  It has been included with the sole
intention of reducing diffs with upstream.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=419
Obtained from: https://github.com/tianocore/edk2/commit/647636e1750b07110ed807f455cb9c8b7d089f75
Pull Request: https://github.com/freebsd/freebsd-src/pull/581

2 years agolibefivar: Fix the wrong MAC address length
Jose Luis Duran [Fri, 25 Feb 2022 14:47:53 +0000 (11:47 -0300)]
libefivar: Fix the wrong MAC address length

Network interface type should be checked before the conversion between
text device path node and MAC device path. Otherwise, the MAC text string
can't be converted to the representation of a device node, which leads to
the series failure of network HII configuration(e.g. IP, VLAN, HTTP Boot
configuration in Network Device List).

Obtained from: https://github.com/tianocore/edk2/commit/2d67f2bae32040c77af8097a8ef1be272cb00e28
Pull Request: https://github.com/freebsd/freebsd-src/pull/581

2 years agoGitHub: Add libefivar's path to CODEOWNERS
Jose Luis Duran [Thu, 24 Feb 2022 17:31:44 +0000 (14:31 -0300)]
GitHub: Add libefivar's path to CODEOWNERS

Code owners are automatically requested for review when someone opens a
pull request that modifies code that they own.

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

Pull Request: https://github.com/freebsd/freebsd-src/pull/581

2 years agoofwdump.8: Remove references to eeprom(8)
Jose Luis Duran [Sat, 26 Feb 2022 17:58:46 +0000 (14:58 -0300)]
ofwdump.8: Remove references to eeprom(8)

Somehow missed in bc4fc770af61

Pull Request: https://github.com/freebsd/freebsd-src/pull/582

2 years agoEliminate curlen, it's set but never used
Warner Losh [Thu, 24 Feb 2022 23:32:42 +0000 (16:32 -0700)]
Eliminate curlen, it's set but never used

Sponsored by: Netflix

2 years agoApply lld fixes for internal errors building perl on 32-bit PowerPC
Dimitry Andric [Sun, 27 Feb 2022 12:53:19 +0000 (13:53 +0100)]
Apply lld fixes for internal errors building perl on 32-bit PowerPC

Merge commit f457863ae345 from llvm git (by Fangrui Song):

  [ELF] Support REL-format R_AARCH64_NONE relocation

  -fprofile-use=/-fprofile-sample-use= compiles may produce REL-format
  .rel.llvm.call-graph-profile even if the prevailing format is RELA on AArch64.
  Add R_AARCH64_NONE to getImplicitAddend to fix this linker error:

  ```
  ld.lld: error: internal linker error: cannot read addend for relocation R_AARCH64_NONE
  PLEASE submit a bug report to https://crbug.com and run tools/clang/scripts/process_crashreports.py (only works inside Google) which will upload a report and include the crash backtrace.
  ```

Merge commit 53fc5d9b9a01 from llvm git (by Fangrui Song):

  [ELF] Support R_PPC_NONE/R_PPC64_NONE in getImplicitAddend

  Similar to f457863ae345d2635026501f5383e0e625869639

Merge commit 767e64fc11d7 from llvm git (by Fangrui Song):

  [ELF] Support some absolute/PC-relative relocation types for REL format

  ctfconvert seems to use REL-format `.rel.SUNW_dof` for 32-bit architectures.
  ```
  Binary file usr/ports/lang/perl5.32/work/perl-5.32.1/dtrace_mini.o matches
  [alfredo.junior@dell-a ~/tmp/llvm-bug]$ readelf -r dtrace_mini.o

  Relocation section (.rel.SUNW_dof):
  r_offset r_info   r_type              st_value st_name
  00000184 0000281a R_PPC_REL32         00000000 $dtrace1772974259.Perl_dtrace_probe_load
  ```

  Support R_PPC_REL32 to fix `ld.lld: error: drti.c:(.SUNW_dof+0x4E4): internal linker error: cannot read addend for relocation R_PPC_REL32`.
  While here, add some common relocation types for AArch64, PPC, and PPC64.
  We perform minimum tests.

  Reviewed By: adalava, arichardson

  Differential Revision: https://reviews.llvm.org/D120535

Requested by: alfredo
MFC after: 3 days

2 years agoposixshm: Add a -j option to posixshmcontrol ls, to specify a jail
Jamie Gritton [Sun, 27 Feb 2022 01:45:28 +0000 (17:45 -0800)]
posixshm: Add a -j option to posixshmcontrol ls, to specify a jail
PR: 257556
Reported by: grembo@

2 years agoDefault to always accepting the PHY that's present. Linux did
Scott Long [Sun, 27 Feb 2022 01:29:08 +0000 (18:29 -0700)]
Default to always accepting the PHY that's present.  Linux did
something similar a while back, and there are devices in the wild
that otherwise won't attach.  This patch is temporary until the
PHY code is further cleared up.

Obtained from: grehan

2 years agoFix "set but not used" in the mrsas driver. Remove dead code.
Scott Long [Sat, 26 Feb 2022 19:21:11 +0000 (12:21 -0700)]
Fix "set but not used" in the mrsas driver.  Remove dead code.

2 years agoFix "set but not used" in the mvs driver. Remove dead code.
Scott Long [Sat, 26 Feb 2022 19:18:42 +0000 (12:18 -0700)]
Fix "set but not used" in the mvs driver.  Remove dead code.

2 years agoFix "set but not used" in the bfe driver. Remove dead code.
Scott Long [Sat, 26 Feb 2022 19:14:22 +0000 (12:14 -0700)]
Fix "set but not used" in the bfe driver.  Remove dead code.

2 years agoFix "set but not used" in the siis driver.
Scott Long [Sat, 26 Feb 2022 18:46:53 +0000 (11:46 -0700)]
Fix "set but not used" in the siis driver.

2 years agoThe TWE driver should have been marked with gone_in for FreeBSD 13.x,
Scott Long [Sat, 26 Feb 2022 18:40:17 +0000 (11:40 -0700)]
The TWE driver should have been marked with gone_in for FreeBSD 13.x,
but was missed.  Mark it for gone_in 14.0.  The hardware hasn't been
produced or supported in over 20 years, and even back then it was
known to be electrically unreliable and prone to catastrophic failure.

2 years agoFix "set but not used" in twe.
Scott Long [Sat, 26 Feb 2022 18:16:31 +0000 (11:16 -0700)]
Fix "set but not used" in twe.

2 years agoFix "set but not used" for real in the ciss driver.
Scott Long [Sat, 26 Feb 2022 18:07:05 +0000 (11:07 -0700)]
Fix "set but not used" for real in the ciss driver.

2 years agoExpand __diagused to include the KTR kernel diagnostic option.
Scott Long [Sat, 26 Feb 2022 18:01:54 +0000 (11:01 -0700)]
Expand __diagused to include the KTR kernel diagnostic option.