]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

2 years agodevctl.h: Spelling typo
Warner Losh [Wed, 24 Nov 2021 09:12:35 +0000 (02:12 -0700)]
devctl.h: Spelling typo

Spell identifier correctly. While I'm here, further simplify.

Fixes: ee2c52fd3fd9
Sponsored by: Netflix

2 years agocam: Unbreak CAM_IO_STATS build
Warner Losh [Wed, 24 Nov 2021 09:10:53 +0000 (02:10 -0700)]
cam: Unbreak CAM_IO_STATS build

Fixes: 6637b7460066
Sponsored by: Netflix

2 years agobsddialog: import snapshot as of 2021-11-24
Baptiste Daroussin [Wed, 24 Nov 2021 08:42:13 +0000 (09:42 +0100)]
bsddialog: import snapshot as of 2021-11-24

2 years agoPcf85063: Add RTC driver
Hubert Mazur [Fri, 8 Oct 2021 08:42:30 +0000 (10:42 +0200)]
Pcf85063: Add RTC driver

Add driver for pcf85063 real time clock. Register set and get time
methods. Parse data obtained from bus according to specification
and fill kernel structures.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32817

2 years agoTCA6408: Add driver for tca6408 gpio expander
Hubert Mazur [Fri, 22 Oct 2021 11:51:45 +0000 (13:51 +0200)]
TCA6408: Add driver for tca6408 gpio expander

Driver for tca6408 gpio expander over i2c bus. Expose API for
manipulating pin's direction, state and polarity inversion.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32819

2 years agofelix: Add support for PHY interrupts
Kornel Duleba [Tue, 26 Oct 2021 14:28:19 +0000 (16:28 +0200)]
felix: Add support for PHY interrupts

- Replace miibus with newly created miibus_fdt.
- Use generic passthrough resource allocation devmethods.

Obtained from: Semihalf
Sponsored by: Alstom Group

2 years agoenetc: Add support for PHY interrupts
Kornel Duleba [Wed, 13 Oct 2021 09:35:12 +0000 (11:35 +0200)]
enetc: Add support for PHY interrupts

- Replace miibus with newly created miibus_fdt.
- Use generic passthrough resource allocation devmethods.

Obtained from: Semihalf
Sponsored by: Alstom Group

2 years agovscphy: Add support for PHY interrupts
Kornel Duleba [Mon, 15 Nov 2021 09:00:07 +0000 (10:00 +0100)]
vscphy: Add support for PHY interrupts

They're allocated using standard newbus API,
which means that we rely on miibus to handle the allocation.
Add VSC8504 to the list of supported PHYs, as it is similar enough
to the VSC8501 that is already supported by this driver.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32816

2 years agoIntroduce DP83822 PHY driver
Kornel Duleba [Mon, 15 Nov 2021 08:58:59 +0000 (09:58 +0100)]
Introduce DP83822 PHY driver

DP83822 is a 10/100 Texas Instruments PHY.
Link status change interrupts are supported by the driver,
however not all boards have the PHY interrupt wired.
Because of that if failure to allocate an IRQ is not treated as an error.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32815

2 years agoIntroduce DP83867 PHY driver
Kornel Duleba [Mon, 15 Nov 2021 08:57:45 +0000 (09:57 +0100)]
Introduce DP83867 PHY driver

DP83867 is a 10/100/1000 Texas Instruments PHY.
Only SGMII mode is supported.
Link status changes can be checked through an interrupt generated by the PHY,
if available

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32813

2 years agomiibus: Add support for mapping OFW nodes to PHY devices
Kornel Duleba [Mon, 15 Nov 2021 08:55:33 +0000 (09:55 +0100)]
miibus: Add support for mapping OFW nodes to PHY devices

Create a new miibus OFW specific layer leveraging miibus_fdt.c code.
PHY drivers can than read the properties using device_get_property(9) API.
Resource(interrupt) allocation is also supported.
In order to enable this each NIC/switch driver will have to be modified,
because of how miibus is attached to the parent driver.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32812

2 years agovscphy: Fill in new mii_maxspeed field
Kornel Duleba [Mon, 15 Nov 2021 08:53:39 +0000 (09:53 +0100)]
vscphy: Fill in new mii_maxspeed field

It is used to limit the max advertised speed.
The value is read from DT by mii_fdt code.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32816

2 years agomii_physubr: Add support for limiting PHY max speed
Kornel Duleba [Mon, 15 Nov 2021 08:49:27 +0000 (09:49 +0100)]
mii_physubr: Add support for limiting PHY max speed

In some cases we might want to limit the max speed advertised below of what
the PHY is capable of.
This is usually the case when we connect 1G capable PHY to 100M MAC, or when
some exotic physical connection is used.
Add a new mii_maxspeed field to mii_softc and parse it in mii_phy_dev_attach.
Speed limit is normally located in DT.
The property is already parsed in mii_fdt.c, but its value still has to be
passed by the PHY driver.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32727

2 years agocam: Remove all the write-only variables
Warner Losh [Wed, 24 Nov 2021 04:14:05 +0000 (21:14 -0700)]
cam: Remove all the write-only variables

Delete all the write only variables in CAM. At worst, the only behavior
change would be to prevent core dumps from chasing NULL pointers (though
I think in all these cases the pointers can't be NULL).

Sponsored by: Netflix

2 years agoFix copyright to be like all my others in the tree
Warner Losh [Wed, 24 Nov 2021 03:52:59 +0000 (20:52 -0700)]
Fix copyright to be like all my others in the tree

2 years agosys/devctl.h: Only declare kernel functions in kernel.
Warner Losh [Wed, 24 Nov 2021 03:28:45 +0000 (20:28 -0700)]
sys/devctl.h: Only declare kernel functions in kernel.

Also, while I'm here, switch to newer, shorter format and fix my
copyright to match the others in the tree.

Sponsored by: Netflix

2 years agopowerpc: Make machine/reg.h self-contained
Warner Losh [Wed, 24 Nov 2021 01:50:20 +0000 (18:50 -0700)]
powerpc: Make machine/reg.h self-contained

Make powerpc*'s machine/reg.h self-contained so that sys/reg.h can be
self-contained.

Sponsored by: Netflix

2 years agoriscv: Make machine/regs.h self-contained
Warner Losh [Wed, 24 Nov 2021 01:47:26 +0000 (18:47 -0700)]
riscv: Make machine/regs.h self-contained

Make sys/reg.h self-contained by making riscv's machine/reg.h
self-contained.

Sponsored by: Netflix

2 years agoarm64: Make machine/reg.h self contained
Warner Losh [Wed, 24 Nov 2021 01:01:01 +0000 (18:01 -0700)]
arm64: Make machine/reg.h self contained

Make sys/reg.h includable on aarch64 by making machine/reg.h
self-contained: Include sys/_types.h and use __uint* instead of uint*.

Sponsored by: Netflix

2 years agoarm: Make machine/reg.h self-contained
Warner Losh [Wed, 24 Nov 2021 00:49:56 +0000 (17:49 -0700)]
arm: Make machine/reg.h self-contained

Allow inclusion of sys/reg.h w/o pre-requisites by making arm's machine/reg.h
self-contained.

Sponsored by: Netflix

2 years agomgb: remove set but not used variables
Ed Maste [Tue, 23 Nov 2021 01:32:29 +0000 (20:32 -0500)]
mgb: remove set but not used variables

Sponsored by: The FreeBSD Foundation

2 years agoAdd assembly optimized code for OpenSSL on powerpc, powerpc64 and powerpc64le
Piotr Kubaj [Mon, 22 Nov 2021 02:28:46 +0000 (03:28 +0100)]
Add assembly optimized code for OpenSSL on powerpc, powerpc64 and powerpc64le

Summary:
1. https://github.com/openssl/openssl/commit/34ab13b7d8e3e723adb60be8142e38b7c9cd382a
needs to be merged for ELFv2 support on big-endian.
2. crypto/openssl/crypto/ppccap.c needs to be patched.
Same reason as in https://github.com/openssl/openssl/pull/17082.

Approved by: jkim, jhibbits
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33076

2 years agoice(4): Update to version 0.29.4-k
Eric Joyner [Wed, 23 Jun 2021 20:41:54 +0000 (13:41 -0700)]
ice(4): Update to version 0.29.4-k

Includes various feature improvements and bug fixes.

Notable changes include:
- Firmware logging support
- Link management flow changes
- New sysctl to report aggregated error counts
- Health Status Event reporting from firmware (Use the new read-only
  tunables hw.ice.enable_health_events / dev.ice.#.enable_health_events
  to turn this off)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

2 years agoBasic signal tests: Can we deliver a signal?
Warner Losh [Tue, 23 Nov 2021 20:37:14 +0000 (13:37 -0700)]
Basic signal tests: Can we deliver a signal?

Basic signal tests that tests can we deliver a signal via raise() and
can we deliver one via SIGALARM asynchronously.

In addition, tests whether or not on ARM T32 (Thumb) code can interrupt
A32 (normal) and vice versa.

While this test is aimed at ensuring basic qemu signals are working,
it's good to have in the base.

Sponsored by: Netflix
Discussed with: kevans, cognet
Differential Revision: https://reviews.freebsd.org/D33078

2 years agokqueue: Define older kqueue event types better
Warner Losh [Tue, 23 Nov 2021 17:51:46 +0000 (10:51 -0700)]
kqueue: Define older kqueue event types better

struct kqueue is designed to live in a restricted namespace, but the
older compat versions are not. Shift to using unsigned short instead
of u_short, unsigned int instead of u_int and the __*int*_t types
instead of the unprefiexed versions.

Sponsored by: Netflix
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D33056

2 years agong_bridge: count item allocation failures as memory failures
Gleb Smirnoff [Tue, 23 Nov 2021 18:05:36 +0000 (10:05 -0800)]
ng_bridge: count item allocation failures as memory failures

Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>

2 years agoRELNOTES: mention 6rd support in if_stf
Kristof Provost [Mon, 22 Nov 2021 21:36:03 +0000 (22:36 +0100)]
RELNOTES: mention 6rd support in if_stf

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33088

2 years agopf: fix netpfil.common.dummynet:pf_nat test
Kristof Provost [Mon, 22 Nov 2021 20:47:18 +0000 (21:47 +0100)]
pf: fix netpfil.common.dummynet:pf_nat test

This test failed if ipfw was loaded (as well as pf). pf used the same
tag as dummynet to indicate a packet had already gone through dummynet.
However, ipfw removes this tag, so pf didn't realise the packet had
already gone through dummynet.

Introduce a separate flag, in the existing pf mtag rather than re-using
the ipfw tag. There were no free flag bits, but PF_TAG_FRAGCACHE is no
longer used so its bit can be re-purposed.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33087

2 years agopf: align IPv6 dummynet handling with IPv4
Kristof Provost [Mon, 22 Nov 2021 20:28:10 +0000 (21:28 +0100)]
pf: align IPv6 dummynet handling with IPv4

In e5c4987e3f we fixed issues with nat and dummynet, but only changed
the IPv4 code. Make the same change for IPv6 as well.

Reviewed by: glebius
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33086

2 years agopf: remove unused variables
Kristof Provost [Mon, 22 Nov 2021 19:30:22 +0000 (20:30 +0100)]
pf: remove unused variables

No functional change intended.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33085

2 years agoMove the arm64 identify_cpu SYSINIT earlier
Andrew Turner [Mon, 22 Nov 2021 10:25:01 +0000 (10:25 +0000)]
Move the arm64 identify_cpu SYSINIT earlier

It is used by late ifunc resolvers so needs to be at an earlier stage
of the boot. Previously it was at the same stage so may not have run
before the ifunc resolvers.

Sponsored by: The FreeBSD Foundation

2 years agoos-release.5: Fix quoting of dots
Mateusz Piotrowski [Tue, 23 Nov 2021 10:34:44 +0000 (11:34 +0100)]
os-release.5: Fix quoting of dots

Dots needs to escaped with \& to be places inside Ql quotes.

MFC after: 3 days

2 years agoif_free: add a comment explaining why ifindex_free() is performed here
Gleb Smirnoff [Tue, 23 Nov 2021 03:53:12 +0000 (19:53 -0800)]
if_free: add a comment explaining why ifindex_free() is performed here

2 years agoifnet: merge if_destroy() and if_free_internal() into one
Gleb Smirnoff [Tue, 23 Nov 2021 03:53:12 +0000 (19:53 -0800)]
ifnet: merge if_destroy() and if_free_internal() into one

New function has more meaningful name if_free_deferred() and has
its header comment fixed to reflect reality.  NFC

2 years agoifnet: make if_alloc_domain() never fail
Gleb Smirnoff [Tue, 23 Nov 2021 03:49:57 +0000 (19:49 -0800)]
ifnet: make if_alloc_domain() never fail

The last consumer of if_com_alloc() is firewire.  It never fails
to allocate.  Most likely the if_com_alloc() KPI will go away
together with if_fwip(), less likely new consumers of if_com_alloc()
will be added, but they would need to follow the no fail KPI.

2 years agoifnet: make if_alloc_domain() static
Gleb Smirnoff [Tue, 23 Nov 2021 03:49:57 +0000 (19:49 -0800)]
ifnet: make if_alloc_domain() static

2 years agoifnet: append if_debug.c to if.c
Gleb Smirnoff [Tue, 23 Nov 2021 03:49:57 +0000 (19:49 -0800)]
ifnet: append if_debug.c to if.c

With this change if_index can become static.  There is nothing
that if_debug.c would want to isolate from if.c.  Potentially
if.c wants to share everything with if_debug.c.

Move Bjoern's copyright to if.c.

Reviewed by: bz

2 years agoifnet: garbage collect drbr_*_drv().
Gleb Smirnoff [Tue, 23 Nov 2021 03:49:57 +0000 (19:49 -0800)]
ifnet: garbage collect drbr_*_drv().

They were left in 62d76917b8678 but after years proved not to be useful.

2 years agofreebsd32: regen
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
freebsd32: regen

There there are two changes here. First, ofreebsd32_sigreturn
is declared to take a struct osigcontext rather than a struct
ia32_sigcontext3. This type is incorrect, but harmlessly so.
Second, the name of the unimplemented ogetkerninfo changes in
freebsd32_syscallnames.

2 years agofreebsd32: generate from sys/kern/syscalls.master
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
freebsd32: generate from sys/kern/syscalls.master

This avoids the need to keep a freebsd32-specific syscalls.master
in sync with the default ABI.  As evidenced by the number of commits
required to sync the two, it is extremely easy for them to get out
of sync due to misunderstandings and user errors.

Reviewed by: kevans, kib

2 years agosyscalls: annotate args pointing to long, pointer, or time_t
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
syscalls: annotate args pointing to long, pointer, or time_t

Add _Contains_ annotations indicating that the data pointed to by a
pointer argument contains types that vary between FreeBSD ABIs. The
supported set is long (including size_t), pointer (including
intptr_t), and time_t.  The first two vary between 32- and 64-bit
ABIs.  The laste betwen i386 and everything else.

These will be used to detect which syscalls require handling on
particular ABIs.

Reviewed by: kevans, kib

2 years agomakesyscalls: strip _Contains_ argument annotations
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
makesyscalls: strip _Contains_ argument annotations

Reviewed by: kevans

2 years agomakesyscalls: add override of ABI change detection
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
makesyscalls: add override of ABI change detection

While we can detect most ABI changes through analysis of
syscalls.master with suitable annotations, to cases are handled
in the core implementation and others have changes that can not be
infered.  Add two new config variables syscall_abi_change and
syscall_no_abi_change which override the detected value.  Both are
space-seperated lists of syscall names.

Reviewed by: kevans

2 years agomakesyscalls: automate detection of ABI changes
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
makesyscalls: automate detection of ABI changes

Use pattern matching including matches of _Contains_*_ argument
annotations to (mostly) determine which system calls require
ABI-specific handling.  Automatically treat syscalls as NOPROTO
if no ABI changes are present.

Reviewed by: kevans

2 years agomakesyscalls.lua: Add the ABI function prefix reliably.
Brooks Davis [Mon, 22 Nov 2021 22:36:58 +0000 (22:36 +0000)]
makesyscalls.lua: Add the ABI function prefix reliably.

The previous code mostly worked, but ended up adding bogus sys_<foo>()
declerations.

Reviewed by: kevans

2 years agomakesyscalls: allow config to force OBSOL and UNIMPL
Brooks Davis [Mon, 22 Nov 2021 22:36:57 +0000 (22:36 +0000)]
makesyscalls: allow config to force OBSOL and UNIMPL

The obsol and unimpl config variables are space-seperated lists of
syscalls that should treated as being declared OBSOL and UNIMPL.

The allows an ABI to exclude select system calls listed in
syscalls.master.

Reviewed by: kevans

2 years agofreebsd32: regen
Brooks Davis [Mon, 22 Nov 2021 22:36:57 +0000 (22:36 +0000)]
freebsd32: regen

2 years agofreebsd32: generate splits of 64-bit arguments
Brooks Davis [Mon, 22 Nov 2021 22:36:57 +0000 (22:36 +0000)]
freebsd32: generate splits of 64-bit arguments

This eliminates the need for ifdefs in syscalls.master and contains the
largest set of diff to generated files on the way to switching to using
the default ABI's syscalls.master.

Reviewed by: kevans

2 years agosyscalls: regen
Brooks Davis [Mon, 22 Nov 2021 22:36:57 +0000 (22:36 +0000)]
syscalls: regen

2 years agomakesyscalls: handle 64-bit args on 32-bit
Brooks Davis [Mon, 22 Nov 2021 22:36:57 +0000 (22:36 +0000)]
makesyscalls: handle 64-bit args on 32-bit

On 32-bit architectures, 64-bit arguments are passed in pairs of
registers. On non-x86 architectures these arguments must be in evenly
aligned registers which necessiciates inserting a pad register into the
argument list. This has historically been supported by adding ifdefs
around padded and unpadded syscall defintions in syscalls.master.

In order to enable generation of 32-bit support files from the base
syscalls.master, pull this support in to makesyscalls.lua enabled by
adding pair_64bit to abi_flags.

The changes to sys_proto.h simply add #ifdef PAD64_REQUIRED
around pad arguments in struct <syscall>_args. In systrace_args(),
replace static syscall index values with post-incremented indexs
allowing a simple ifdef around the argument. Under -O1 or higher
code generation is identical. systrace_entry_setargdesc() is a bit
more complicated as we switch on argument indices.  Solve this
with some use of define/undef pairs to compute the correct indices.

Reviewed by: kevans

2 years agomakesyscalls: handle arrays of pointers
Brooks Davis [Mon, 22 Nov 2021 22:36:57 +0000 (22:36 +0000)]
makesyscalls: handle arrays of pointers

When the config variable abi_intptr_t is not "", transform arrays of
pointers to arrays of abi_intptr_t.

Reviewed by: kevans