]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agosctp: add some asserts, no functional changes intended
Michael Tuexen [Fri, 26 Nov 2021 11:19:33 +0000 (12:19 +0100)]
sctp: add some asserts, no functional changes intended

This might help in narrowing down
https://syzkaller.appspot.com/bug?id=fbd79abaec55f5aede63937182f4247006ea883b

2 years agopci_vendors: update to 2021-11-24
Baptiste Daroussin [Fri, 26 Nov 2021 07:52:20 +0000 (08:52 +0100)]
pci_vendors: update to 2021-11-24

2 years agoEC2: Turn off IPv6 DAD
Colin Percival [Tue, 23 Nov 2021 04:16:34 +0000 (20:16 -0800)]
EC2: Turn off IPv6 DAD

Disable Duplicate Address Detection in EC2 instances.  The networking
configuration in EC2, with IPv6 addresses assigned by DHCPv6 and
host egress filtering, makes "duplicate addresses" impossible.

This speeds up the boot process in EC2 by 2 seconds.

Reviewed by: kp, imp, bz
MFC after: 2 weeks
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33091

2 years agoetc/defaults/rc.conf: Add -i flag to rtsol/rtsold
Colin Percival [Mon, 22 Nov 2021 21:51:43 +0000 (13:51 -0800)]
etc/defaults/rc.conf: Add -i flag to rtsol/rtsold

This disables the random (between zero and one seconds) delay before
rtsol and rtsold send a a Router Solicitation packet.  This delay is
specified as a SHOULD by RFC 4861 for avoidance of network congestion,
but network speeds have increased enough in the 25 years since this
first appeared (in RFC 1970) that it seems unnecessary as a default
at this point.

This speeds up the FreeBSD boot process by an average of 500 ms.

Reviewed by: kp
MFC after: 1 week
Relnotes: yes
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D33089

2 years agoarch.7: update applicable FreeBSD versions to 12.0 and later
Ed Maste [Thu, 25 Nov 2021 18:50:03 +0000 (13:50 -0500)]
arch.7: update applicable FreeBSD versions to 12.0 and later

Information in this document is unchanged between 11.x and 12.x, but
this is intended to be a quick reference for supported architectures.
Also bump .Dd to cover recent changes including MIPS deprecation.

Sponsored by: The FreeBSD Foundation

2 years agohwpmc: Add IDs for Intel Comet/Ice/Tiger/Rocketlake CPUs.
Alexander Motin [Fri, 26 Nov 2021 00:17:58 +0000 (19:17 -0500)]
hwpmc: Add IDs for Intel Comet/Ice/Tiger/Rocketlake CPUs.

MFC after: 1 month

2 years agovfs: remove the unused thread argument from NDINIT*
Mateusz Guzik [Thu, 25 Nov 2021 21:43:06 +0000 (21:43 +0000)]
vfs: remove the unused thread argument from NDINIT*

See b4a58fbf640409a1 ("vfs: remove cn_thread")

Bump __FreeBSD_version to 1400043.

2 years agovfs: drop the always curthread argument from kern_alternate_path
Mateusz Guzik [Thu, 25 Nov 2021 21:42:42 +0000 (21:42 +0000)]
vfs: drop the always curthread argument from kern_alternate_path

2 years agolinux: remove the always curthread argument from lconvpath
Mateusz Guzik [Thu, 25 Nov 2021 21:42:13 +0000 (21:42 +0000)]
linux: remove the always curthread argument from lconvpath

2 years agolink_elf_obj: Process global ifunc relocs after other global relocs
Mark Johnston [Thu, 25 Nov 2021 21:52:17 +0000 (16:52 -0500)]
link_elf_obj: Process global ifunc relocs after other global relocs

This is needed to ensure that resolvers that reference global symbols
return correct results.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33120

2 years agork_spi: declare support for rk3328
Andriy Gapon [Thu, 25 Nov 2021 21:12:11 +0000 (23:12 +0200)]
rk_spi: declare support for rk3328

Tested on Rock64 using the onboard SPI flash.

MFC after: 1 week

2 years agopowerpc64: make autoboot possible on powernv machines
Alfredo Dal'Ava Junior [Fri, 26 Nov 2021 00:02:53 +0000 (21:02 -0300)]
powerpc64: make autoboot possible on powernv machines

It's required to specify a default boot option in order to make
petitboot's autoboot feature work.

Tested on Raptor Blackbird

Reviewed by: imp, luporl
MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D32838

2 years agopowerpc64le: fix boot when using QEMU PowerNV
Leandro Lupori [Thu, 25 Nov 2021 19:41:46 +0000 (16:41 -0300)]
powerpc64le: fix boot when using QEMU PowerNV

When using QEMU PowerNV with latest op-build release (v2.7), its
kexec transfers control to FreeBSD kernel in BE mode, causing an
instant exception on LE kernels. Make kboot able to detect and
swap endian to fix this.

Reviewed by: imp
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D33104

2 years agovt: export RGB offsets with FBIO_GETRGBOFFS
Leandro Lupori [Thu, 25 Nov 2021 18:54:11 +0000 (15:54 -0300)]
vt: export RGB offsets with FBIO_GETRGBOFFS

Add a new ioctl to vt to make it possible to export RGB offsets
set by vt drivers. This is needed to fix colors on X and Mesa
on some machines, especially on modern PowerPC64 BE ones.

With the appropriate changes in SCFB, to use this ioctl to find
out the correct RGB offsets, this fixes wrong colors on Talos II
and Blackbird, when used with their built-in video cards.

Reviewed by: alfredo
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D29000

2 years agoswap_pager: lock vnode in swapdev_strategy()
Konstantin Belousov [Wed, 24 Nov 2021 11:26:46 +0000 (13:26 +0200)]
swap_pager: lock vnode in swapdev_strategy()

VOP_STRATEGY() requires locked vnode.  Note that we lock the swap vnode
while pages are busy, but this would only cause real LoR if pages belong
to the swap vnode, which must not be the case for correct use.

Reported and tested by: peterj
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33119

2 years agoswapon: extend the region where the swap vnode is locked
Konstantin Belousov [Wed, 24 Nov 2021 03:06:02 +0000 (05:06 +0200)]
swapon: extend the region where the swap vnode is locked

to cover VOP_GETATTR() call in sys_swapon().  Move locking from inside
swapongeom() and swaponvp() into sys_swapon().

Reported by and tested by: peterj
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33119

2 years agoswap pager: lock vnode around VOP_CLOSE()
Konstantin Belousov [Tue, 23 Nov 2021 09:16:53 +0000 (11:16 +0200)]
swap pager: lock vnode around VOP_CLOSE()

Reported and tested by: peterj
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33119

2 years agoarch.7: move discontinued CPU archs to own table
Ed Maste [Thu, 25 Nov 2021 02:13:04 +0000 (21:13 -0500)]
arch.7: move discontinued CPU archs to own table

With MIPS' retirement we now have more discontinued architectures than
supported ones, making the table somewhat unclear.  Split the table in
two.

Reviewed by: allanjude
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33110

2 years agomake_dev.9: Fix a typo
Mark Johnston [Thu, 25 Nov 2021 16:32:30 +0000 (11:32 -0500)]
make_dev.9: Fix a typo

MFC after: 1 week

2 years agoagp: Handle multiple devices more gracefully
Mark Johnston [Thu, 25 Nov 2021 16:27:49 +0000 (11:27 -0500)]
agp: Handle multiple devices more gracefully

Currently agp(4) effectively assumes that only one driver instance
exists, as the generic attach routine attempts to create /dev/agpgart
and triggers a panic if it already exists.  Instead, handle this
situation by creating /dev/agpgart<unit> and making /dev/agpgart an
alias of /dev/agpgart0 for compatibility.

PR: 187015
Reviewed by: imp, kib
Tested by: Yoshihiro Ota <ota@j.email.ne.jp> (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33068

2 years agolibpmc: Update some x86 event definitions.
Alexander Motin [Thu, 25 Nov 2021 16:19:26 +0000 (11:19 -0500)]
libpmc: Update some x86 event definitions.

MFC after: 1 month

2 years agousb/u3g: Add support for Quectel EM05.
Hans Petter Selasky [Thu, 25 Nov 2021 14:27:50 +0000 (15:27 +0100)]
usb/u3g: Add support for Quectel EM05.

Pull Request: https://github.com/freebsd/freebsd-src/pull/565
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agommc: plug set-but-not-used vars
Mateusz Guzik [Thu, 25 Nov 2021 12:10:27 +0000 (12:10 +0000)]
mmc: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agostress2: Added an option to set the file size. Added missing error checks
Peter Holm [Thu, 25 Nov 2021 11:44:59 +0000 (12:44 +0100)]
stress2: Added an option to set the file size.  Added missing error checks

2 years agogeom_multipath: plug set-but-not-used vars
Mateusz Guzik [Thu, 25 Nov 2021 11:31:50 +0000 (11:31 +0000)]
geom_multipath: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agofdc: plug set-but-not-used vars
Mateusz Guzik [Thu, 25 Nov 2021 11:25:11 +0000 (11:25 +0000)]
fdc: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoamr.4: Remove man page
Warner Losh [Thu, 25 Nov 2021 09:49:15 +0000 (02:49 -0700)]
amr.4: Remove man page

Sponsored by: Netflix

2 years agopci: Don't try to read cfg registers of non-existing devices
Kornel Duleba [Tue, 23 Nov 2021 08:13:56 +0000 (09:13 +0100)]
pci: Don't try to read cfg registers of non-existing devices

Instead of returning 0xffs some controllers, such as Layerscape generate
an external exception when someone attempts to read any register
of config space of a non-existing device other than PCIR_VENDOR.
This causes a kernel panic.
Fix it by bailing during device enumeration if a device vendor register
returns invalid value. (0xffff)
Use this opportunity to replace some hardcoded values with a macro.

I believe that this change won't have any unintended side-effects since
it is safe to assume that vendor == 0xffff -> hdr_type == 0xffff.

Sponsored by: Alstom
Obtained from: Semihalf
Reviewed by: jhb
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D33059

2 years agoObsoleteFiles: Remove old CAM driver man pages
Warner Losh [Thu, 25 Nov 2021 07:22:08 +0000 (00:22 -0700)]
ObsoleteFiles: Remove old CAM driver man pages

Add the old man pages to ObsoleteFiles for amr, esp iir, mly and twa
that were slated to be removed before 13.0, but were overlooked.

Sponsored by: Netflix

2 years agotwa: Remove
Warner Losh [Thu, 25 Nov 2021 07:21:41 +0000 (00:21 -0700)]
twa: Remove

Belatedly remove twa(4). It was supposed to go before 13.0, but was
overlooked.

Sponsored by: Netflix
Relnotes: yes
Reviewed by: scottl
Differential Revision: https://reviews.freebsd.org/D33114

2 years agoesp: Remove
Warner Losh [Thu, 25 Nov 2021 07:21:24 +0000 (00:21 -0700)]
esp: Remove

Belatedly remove esp(4). It was tagged as gone in 13, but was overlooked
until now.

Sponsored by: Netflix
Reviewed by: scottl
Differential Revision: https://reviews.freebsd.org/D33115

2 years agoamr: remove
Warner Losh [Thu, 25 Nov 2021 07:20:51 +0000 (00:20 -0700)]
amr: remove

Belatedly remove amr(4). It was slated to depart before 13.0 but was
overlooked until now.

Sponsored by: Netflix
Relnotes: yes
Reviewed by: scottl
Differential Revision: https://reviews.freebsd.org/D33113

2 years agoiir: Remove
Warner Losh [Thu, 25 Nov 2021 07:20:31 +0000 (00:20 -0700)]
iir: Remove

Belatedly remove iir(4). It was slated to go before 13, but was
overlooked.

Sponsored by: Netflix
Relnotes: yes
Reviewed by: scottl
Differential Revision: https://reviews.freebsd.org/D33112

2 years agomly: Remove.
Warner Losh [Thu, 25 Nov 2021 07:20:10 +0000 (00:20 -0700)]
mly: Remove.

We'd said this was going away in 13, but was overlooked. Belatedly
remove.

Sponsored by: Netflix
Relnotes: yes
Reviewed by: scottl
Differential Revision: https://reviews.freebsd.org/D33111

2 years agoAPEI: Fix Generic Error Data Entry revision 3.0 handling.
Alexander Motin [Thu, 25 Nov 2021 04:03:20 +0000 (23:03 -0500)]
APEI: Fix Generic Error Data Entry revision 3.0 handling.

Since revision 3.0 this structure grown another field, breaking access
to the following data structures.  This change fixes the PCIe errors
decoding on newer systems.

MFC after: 2 weeks

2 years agoFix "set but not used" warnings in the ciss driver.
Scott Long [Thu, 25 Nov 2021 03:33:39 +0000 (03:33 +0000)]
Fix "set but not used" warnings in the ciss driver.

2 years agoFix "set but not used" warnings in the mpr driver. This fixes a minor
Scott Long [Thu, 25 Nov 2021 03:28:29 +0000 (03:28 +0000)]
Fix "set but not used" warnings in the mpr driver.  This fixes a minor
bug in error handling.

2 years agoFix "set but not used" warnings in the mps driver.
Scott Long [Thu, 25 Nov 2021 03:23:02 +0000 (03:23 +0000)]
Fix "set but not used" warnings in the mps driver.

2 years agoFix "set but not used" warnings in CAM.
Scott Long [Thu, 25 Nov 2021 03:17:54 +0000 (03:17 +0000)]
Fix "set but not used" warnings in CAM.

2 years agoFix "set but not used" warnings in mfi. The one in mfi.c:mfi_data_cb()
Scott Long [Thu, 25 Nov 2021 02:41:18 +0000 (02:41 +0000)]
Fix "set but not used" warnings in mfi.  The one in mfi.c:mfi_data_cb()
was a hidden but likely harmless mistake.  The rest were just old code
that was OBE.

2 years agosh: Avoid some headers when NO_HISTORY is set.
Bryan Drewery [Thu, 25 Nov 2021 01:52:11 +0000 (17:52 -0800)]
sh: Avoid some headers when NO_HISTORY is set.

This is more simpler compatibility with using this source on older
systems before libedit was made to install filecomplete.h in
commit b315a7296d2.

2 years agoig4: Add PCI IDs for Intel Alder Lake I2C controller.
Alexander Motin [Thu, 25 Nov 2021 01:13:38 +0000 (20:13 -0500)]
ig4: Add PCI IDs for Intel Alder Lake I2C controller.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

2 years agoldconfig(8): check for no-args command line after options are parsed
Konstantin Belousov [Fri, 19 Nov 2021 04:07:58 +0000 (06:07 +0200)]
ldconfig(8): check for no-args command line after options are parsed

Default action for ldconfig is specified as -R AKA 'append', and for
no-args (without options changing default actions), ldconfig should
append empty list of directories to current list.  But because the check
was done before options were parsed out, presence of any option turned
off default rescan.

As result, innocently-looked commands like `ldconfig -v' were interpreted
as setting directory hints list to one specified on the command line,
i.e. empty.

Reported by: https://github.com/mesonbuild/meson/issues/9592
Reviewed by: emaste
Tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33058

2 years agoldconfig: use libexec/rtld-elf/rtld_paths.h
Konstantin Belousov [Fri, 19 Nov 2021 03:45:31 +0000 (05:45 +0200)]
ldconfig: use libexec/rtld-elf/rtld_paths.h

instead of duplicating definitions using slighly different macro names.

Reviewed by: emaste
Tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33058

2 years agortld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally
Konstantin Belousov [Fri, 19 Nov 2021 03:44:33 +0000 (05:44 +0200)]
rtld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally

Reviewed by: emaste
Tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33058

2 years agoldconfig(8): nostd/-s does nothing
Konstantin Belousov [Fri, 19 Nov 2021 05:21:21 +0000 (07:21 +0200)]
ldconfig(8): nostd/-s does nothing

Remove the option from man page and summary.  Silently ignore it when
parsing command line for backward compatibility.

Reviewed by: emaste
Tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33058

2 years agoldconfig: start of cleanup
Konstantin Belousov [Fri, 19 Nov 2021 03:35:50 +0000 (05:35 +0200)]
ldconfig: start of cleanup

Use bool.
Use local variables instead of static.
Remove non-functional debugging override of hints file path.
Use explicit exit() instead of return from main.
Minor style tweaks.

Reviewed by: emaste
Tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33058

2 years agoldconfig: remove a comment which is another remnant of a.out support
Konstantin Belousov [Wed, 24 Nov 2021 20:44:20 +0000 (22:44 +0200)]
ldconfig: remove a comment which is another remnant of a.out support

Noted and reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33058

2 years agoext2: plug set-but-not-used vars
Mateusz Guzik [Wed, 24 Nov 2021 22:59:51 +0000 (22:59 +0000)]
ext2: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoLinuxKPI: USB return possible error from suspend/resume
Bjoern A. Zeeb [Wed, 24 Nov 2021 21:28:46 +0000 (21:28 +0000)]
LinuxKPI: USB return possible error from suspend/resume

USB suspend/resume cannot fail so we never returned the error which
resulted in a -Wunused-but-set-variable warning.
Initialize the return variable and return a possible error possibly
triggering a printf upstream to at least have a trace of the problem.
This also fixes the warning.

Suggested by: hselasky
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107

2 years agoLinuxKPI: fix -Wunused-but-set-variable warnings
Bjoern A. Zeeb [Wed, 24 Nov 2021 21:20:52 +0000 (21:20 +0000)]
LinuxKPI: fix -Wunused-but-set-variable warnings

Handle write-only variables by removing the unused return value from void
functions or removing the unused variables entirely.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107

2 years agounionfs: plug a set-but-not-unused var
Mateusz Guzik [Wed, 24 Nov 2021 21:31:35 +0000 (21:31 +0000)]
unionfs: plug a set-but-not-unused var

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoif_epair: ifdef vars only used with ALTQ
Mateusz Guzik [Wed, 24 Nov 2021 21:28:54 +0000 (21:28 +0000)]
if_epair: ifdef vars only used with ALTQ

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agofdescfs: plug a set-but-not-unused var
Mateusz Guzik [Wed, 24 Nov 2021 21:25:24 +0000 (21:25 +0000)]
fdescfs: plug a set-but-not-unused var

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agogeom_journal: plug set-but-not-unused vars
Mateusz Guzik [Wed, 24 Nov 2021 21:21:59 +0000 (21:21 +0000)]
geom_journal: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agolinprocfs: plug set-but-not-unused vars
Mateusz Guzik [Wed, 24 Nov 2021 21:18:36 +0000 (21:18 +0000)]
linprocfs: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agolinux: plug set-but-not-unused vars
Mateusz Guzik [Wed, 24 Nov 2021 21:16:03 +0000 (21:16 +0000)]
linux: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoixl(4): Remove iavf(4) source files
Eric Joyner [Sat, 13 Feb 2021 00:04:54 +0000 (16:04 -0800)]
ixl(4): Remove iavf(4) source files

Since iavf(4) no longer shares code with ixl(4) as of commit
f2fbd56a8d07665bc0a5e8b7e40026b50a591e2a and now has its own directory,
remove these now-unused iavf(4)-only files.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28638

2 years agoiavf(4): Split source and update to 3.0.26-k
Eric Joyner [Fri, 12 Feb 2021 21:28:18 +0000 (13:28 -0800)]
iavf(4): Split source and update to 3.0.26-k

The iavf(4) driver now uses a different source base from ixl(4), since
it will be the standard VF driver for new Intel Ethernet products going
forward, including ice(4). It continues to use the iflib framework
for network drivers.

Since it now uses a different source code base, this commit adds a new
sys/dev/iavf entry, but it re-uses the existing module name so no
configuration changes are necessary.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@
Tested by: lukasz.szczepaniak@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28636

2 years agoAdd ncurses/form to _prebuild_libs to fix build
Ed Maste [Wed, 24 Nov 2021 18:56:38 +0000 (13:56 -0500)]
Add ncurses/form to _prebuild_libs to fix build

Reported by: bz

2 years agovm_fault: Factor out per-object operations into vm_fault_object()
Mark Johnston [Wed, 24 Nov 2021 18:43:38 +0000 (13:43 -0500)]
vm_fault: Factor out per-object operations into vm_fault_object()

No functional change intended.

Obtained from: jeff (object_concurrency patches)
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33018

2 years agovm_fault: Introduce a fault_status enum for internal return types
Mark Johnston [Wed, 24 Nov 2021 18:43:26 +0000 (13:43 -0500)]
vm_fault: Introduce a fault_status enum for internal return types

Rather than overloading the meanings of the Mach statuses, introduce a
new set for use internally in the fault code.  This makes the control
flow easier to follow and provides some extra error checking when a
fault status variable is used in a switch statement.

vm_fault_lookup() and vm_fault_relookup() continue to use Mach statuses
for now, as there isn't much benefit to converting them and they
effectively pass through a status from vm_map_lookup().

Obtained from: jeff (object_concurrency patches)
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33017

2 years agovm_fault: Move nera into faultstate
Mark Johnston [Wed, 24 Nov 2021 18:42:32 +0000 (13:42 -0500)]
vm_fault: Move nera into faultstate

This makes it easier to factor out pieces of vm_fault().  No functional
change intended.

Obtained from: jeff (object_concurrency patches)
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33016

2 years agoacpi: Fix error code returned in acpi_bus_get_prop
Bartlomiej Grzesik [Mon, 22 Nov 2021 14:05:57 +0000 (15:05 +0100)]
acpi: Fix error code returned in acpi_bus_get_prop

ACPI implementation of device_get_property would return "-1" when
property was found, but it's type wasn't supported.
This causes device_has_property to return false in that scenario, which
arguably could be considered as incorrect.

Fix that by returning "0" in that case.

Reviewed by: bz, mw
Tested by: mw
MFC after: 2 weeks
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D33103

2 years agosafexcel: Fix -Wunused-but-set-variable warnings
Mark Johnston [Wed, 24 Nov 2021 18:30:39 +0000 (13:30 -0500)]
safexcel: Fix -Wunused-but-set-variable warnings

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agonatd: Remove uneeded in_cksum.h includes
Mark Johnston [Wed, 24 Nov 2021 18:30:28 +0000 (13:30 -0500)]
natd: Remove uneeded in_cksum.h includes

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agonetinet: Remove unneeded mb_unmapped_to_ext() calls
Mark Johnston [Wed, 24 Nov 2021 18:20:09 +0000 (13:20 -0500)]
netinet: Remove unneeded mb_unmapped_to_ext() calls

in_cksum_skip() now handles unmapped mbufs on platforms where they're
permitted.

Reviewed by: glebius, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33097

2 years agonetinet: Implement in_cksum_skip() using m_apply()
Mark Johnston [Wed, 24 Nov 2021 18:19:54 +0000 (13:19 -0500)]
netinet: Implement in_cksum_skip() using m_apply()

This allows it to work with unmapped mbufs.  In particular,
in_cksum_skip() calls no longer need to be preceded by calls to
mb_unmapped_to_ext() to avoid a page fault.

PR: 259645
Reviewed by: gallatin, glebius, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33096

2 years agonetinet: Deduplicate most in_cksum() implementations
Mark Johnston [Wed, 24 Nov 2021 18:19:44 +0000 (13:19 -0500)]
netinet: Deduplicate most in_cksum() implementations

in_cksum() and related routines are implemented separately for each
platform, but only i386 and arm have optimized versions.  Other
platforms' copies of in_cksum.c are identical except for style
differences and support for big-endian CPUs.

Deduplicate the implementations for the rest of the platforms.  This
will make it easier to implement in_cksum() for unmapped mbufs.  On arm
and i386, define HAVE_MD_IN_CKSUM to mean that the MI implementation is
not to be compiled.

No functional change intended.

Reviewed by: kp, glebius
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33095

2 years agonetinet: Remove in_cksum.c
Mark Johnston [Wed, 24 Nov 2021 18:19:34 +0000 (13:19 -0500)]
netinet: Remove in_cksum.c

It does not get compiled into the kernel.  No functional change
inteneded.

Reviewed by: kp, glebius, cy
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33094

2 years agonetinet: Remove in_cksum_update()
Mark Johnston [Wed, 24 Nov 2021 18:15:40 +0000 (13:15 -0500)]
netinet: Remove in_cksum_update()

It was never implemented on powerpc or riscv and appears to have been
unused since it was added in 1998.  No functional change intended.

Reviewed by: kp, glebius, cy
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33093

2 years agosys/uuid.h: Include sys/types.h
Warner Losh [Wed, 24 Nov 2021 17:49:53 +0000 (10:49 -0700)]
sys/uuid.h: Include sys/types.h

Change the include of sys/cdefs.h to sys/types.h to pick up all the
types. sys/types.h includes cdefs.h.

Sponsored by: Netflix

2 years agosys/backlight.h: include sys/types.h
Warner Losh [Wed, 24 Nov 2021 17:49:34 +0000 (10:49 -0700)]
sys/backlight.h: include sys/types.h

Sponsored by: Netflix

2 years agosys/ata.h: Include sys/types.h
Warner Losh [Wed, 24 Nov 2021 17:48:10 +0000 (10:48 -0700)]
sys/ata.h: Include sys/types.h

This file needs types defined by sys/types.h, and there's no reason not
to include sys/types.h here.

Sponsored by: Netflix

2 years agosys/disk/*.h: Include sys/types.h
Warner Losh [Wed, 24 Nov 2021 17:41:57 +0000 (10:41 -0700)]
sys/disk/*.h: Include sys/types.h

All these files use types defined by sys/types.h. Add an include of it
at the top to make them standalone.

Sponsored by: Netflix

2 years agosys/alq.h: Kernel only file, mark as such
Warner Losh [Wed, 24 Nov 2021 17:39:10 +0000 (10:39 -0700)]
sys/alq.h: Kernel only file, mark as such

The alq interfaces are 100% in-kernel, so make this whole file #ifdef
_KERNEL. There's no users of this in the tree outside of the kernel, nor
does it define anything that could be useful at peeking into the state
of alq.

Sponsored by: Netflix

2 years agosys/acct.h: Add sys/types.h include
Warner Losh [Wed, 24 Nov 2021 17:37:48 +0000 (10:37 -0700)]
sys/acct.h: Add sys/types.h include

There's no harm in including sys/types.h here and acct.h needs it. This
file isn't defined by any standard, so what we do here wrt namespaces
likely doesn't matter. If it does, it will be easy enough to add the
necessary __BSD_VISIBLE guards in the future.

Sponsored by: Netflix

2 years agostd.nodebug: turn off net80211 debugging as well
Bjoern A. Zeeb [Wed, 24 Nov 2021 18:03:48 +0000 (18:03 +0000)]
std.nodebug: turn off net80211 debugging as well

Add IEEE80211_DEBUG to turn off some net80211 debbugging for
no-debug builds.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

2 years agoichsmb: Add PCI IDs for Intel Alder Lake SMBus controller
Alexander Motin [Wed, 24 Nov 2021 18:06:52 +0000 (13:06 -0500)]
ichsmb: Add PCI IDs for Intel Alder Lake SMBus controller

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

2 years agonet80211: fix -Wunused-but-set-variable warnings
Bjoern A. Zeeb [Wed, 24 Nov 2021 17:36:48 +0000 (17:36 +0000)]
net80211: fix -Wunused-but-set-variable warnings

Put the offending variables under the appropriate #ifdefs
(mostly IEEE80211_DEBUG, in one case IEEE80211_SUPPORT_SUPERG, and
in two cases under __notyet__ to revisit why these had been left
there but not used).

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

2 years agoalc: plug a set-but-not-unused var in alc_init_locked
Mateusz Guzik [Wed, 24 Nov 2021 16:26:57 +0000 (16:26 +0000)]
alc: plug a set-but-not-unused var in alc_init_locked

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoamd_ecc_inject: return an error instead of ignoring it in tsc_modevent
Mateusz Guzik [Wed, 24 Nov 2021 16:22:56 +0000 (16:22 +0000)]
amd_ecc_inject: return an error instead of ignoring it in tsc_modevent

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoagp: plug a set-but-not-unused var in agp_intel_gtt_map_memory
Mateusz Guzik [Wed, 24 Nov 2021 16:20:39 +0000 (16:20 +0000)]
agp: plug a set-but-not-unused var in agp_intel_gtt_map_memory

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoaesni: plug a set-but-not-unused var in aesni_newsession
Mateusz Guzik [Wed, 24 Nov 2021 16:17:09 +0000 (16:17 +0000)]
aesni: plug a set-but-not-unused var in aesni_newsession

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years ago32-bit compat: plug a set-but-not-unused var in freebsd32_copy_msg_out
Mateusz Guzik [Wed, 24 Nov 2021 16:15:10 +0000 (16:15 +0000)]
32-bit compat: plug a set-but-not-unused var in freebsd32_copy_msg_out

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agobsddialog, mark the lib as dependent on ncurses
Baptiste Daroussin [Wed, 24 Nov 2021 15:47:39 +0000 (16:47 +0100)]
bsddialog, mark the lib as dependent on ncurses

2 years agoFix bracketing in the arm64 minidump code
Andrew Turner [Tue, 23 Nov 2021 18:28:28 +0000 (18:28 +0000)]
Fix bracketing in the arm64 minidump code

When building with gcc10 it suggests the parentheses are wrong. Set them
to be the calculated physical address or'd with page table attributes.

Reviewed by: mhorne, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33099

2 years agoRemove redundant declarations
Andrew Turner [Tue, 23 Nov 2021 17:26:35 +0000 (17:26 +0000)]
Remove redundant declarations

These are already defined in the same file.

Sponsored by: The FreeBSD Foundation

2 years agoos-release: Quote variables as documented in the manual
Mateusz Piotrowski [Tue, 23 Nov 2021 10:26:47 +0000 (11:26 +0100)]
os-release: Quote variables as documented in the manual

Variables must be quoted if they contain non-alphanumeric characters.

Warner noted in the review that the lack of quoting causing problems
here is rather an edge case. I believe that it's worth adding the quotes
here anyway because this is what the specification says and there is no
good reason not to follow it.

Reviewed by: imp
Approved by: imp (src)
MFC after: 7 days

2 years agoncurses: libform is installed as libformw
Baptiste Daroussin [Wed, 24 Nov 2021 12:58:17 +0000 (13:58 +0100)]
ncurses: libform is installed as libformw

Reported by: many

2 years agobsddialog: actually add directories
Baptiste Daroussin [Wed, 24 Nov 2021 11:13:45 +0000 (12:13 +0100)]
bsddialog: actually add directories

2 years agopartedit: cleanup headers
Baptiste Daroussin [Wed, 24 Nov 2021 11:06:34 +0000 (12:06 +0100)]
partedit: cleanup headers

Removed dialog.h where not needed and include headers actually used

2 years agokbdmap: use libbsddialog instead of calling dialog(1) via system(3)
Baptiste Daroussin [Wed, 24 Nov 2021 10:55:26 +0000 (11:55 +0100)]
kbdmap: use libbsddialog instead of calling dialog(1) via system(3)

2 years agotzsetup: remove dedundant declaration
Baptiste Daroussin [Wed, 24 Nov 2021 10:12:05 +0000 (11:12 +0100)]
tzsetup: remove dedundant declaration

2 years agotzsetup: replace libdialog with libbsddialog
Baptiste Daroussin [Mon, 15 Nov 2021 15:38:34 +0000 (16:38 +0100)]
tzsetup: replace libdialog with libbsddialog

Reviewed by: alfix86_gmail.com (bsddialog author)
Differential Revision: https://reviews.freebsd.org/D33077

2 years agobsddialog: import new TUI widget and utility
Baptiste Daroussin [Wed, 24 Nov 2021 09:26:46 +0000 (10:26 +0100)]
bsddialog: import new TUI widget and utility

bsddialog is an attempt to write in permissive license a replacement for
libdialog.

While it is still in early stage it is good enough to already be used in
many areas, it is imported as private lib until it matures enough to be
considered as having a stable ABI

2 years agoAdd 'contrib/bsddialog/' from commit '857c66bb5f3c5651b012beb1b5ea6ba39354ea94'
Baptiste Daroussin [Wed, 24 Nov 2021 10:03:17 +0000 (11:03 +0100)]
Add 'contrib/bsddialog/' from commit '857c66bb5f3c5651b012beb1b5ea6ba39354ea94'

git-subtree-dir: contrib/bsddialog
git-subtree-mainline: a46722b580567799b484b5a81728eaf380777e04
git-subtree-split: 857c66bb5f3c5651b012beb1b5ea6ba39354ea94

2 years agoncurses: register formw as usable lib for LIBADD
Baptiste Daroussin [Wed, 24 Nov 2021 09:20:10 +0000 (10:20 +0100)]
ncurses: register formw as usable lib for LIBADD

2 years agoncurses: to not create a libncursesw.a in the OBJDIR
Baptiste Daroussin [Wed, 24 Nov 2021 09:10:26 +0000 (10:10 +0100)]
ncurses: to not create a libncursesw.a in the OBJDIR

It breaks intree partial builds for every library depending on ncurses
because ncursesw.a (built without PIC) will be the first the library
path for the linker to resolve -lncursesw

2 years agosys/file.h: Allow inclusion when compiling for a strict namespace
Warner Losh [Wed, 24 Nov 2021 09:25:47 +0000 (02:25 -0700)]
sys/file.h: Allow inclusion when compiling for a strict namespace

Although not part of the standard, this file is sometimes included with
-D_POSIX_C_SOURCE=<value> or -D_XOPEN_SOURCE=<value>. Limit those
sturctures that use types hidden by __BSD_VISIBLE to when they are
visible.

PR: 259975, 234205
Sponsored by: Netflix