]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agonetpfil: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:46:05 +0000 (12:46 +0200)]
netpfil: Correct some typos in source code comments

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

2 years agoiwn(4): Correct a typo in a kernel error message
Gordon Bergling [Sun, 4 Sep 2022 10:23:27 +0000 (12:23 +0200)]
iwn(4): Correct a typo in a kernel error message

- s/settting/setting/

MFC after: 5 days

2 years agosound(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 09:23:34 +0000 (11:23 +0200)]
sound(4): Fix a typo in a source code comment

- s/availavle/available/

MFC after: 3 days

2 years agortld.c: remove extra blank line
Konstantin Belousov [Wed, 31 Aug 2022 01:06:51 +0000 (04:06 +0300)]
rtld.c: remove extra blank line

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36396

2 years agortld: style the rest of rtld_lock.c
Konstantin Belousov [Tue, 30 Aug 2022 12:49:15 +0000 (15:49 +0300)]
rtld: style the rest of rtld_lock.c

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36396

2 years agortld: mask signals for default read locks
Konstantin Belousov [Tue, 30 Aug 2022 12:46:30 +0000 (15:46 +0300)]
rtld: mask signals for default read locks

Rtld locks from libthr defer signals delivery, which means that binding
is not possible while a signal handler is executed.

Binding might upgrade read-locked rtld_bind_lock to write-lock, if
symbol resolution requires loading filters.  If a signal would be delivered
while rtld is in read-locked section, and signal handler needs binding
which upgrades the lock, for non-threaded image that uses default rtld
locks, we get the rtld data structures modified under the top-level
active rtld frame.

To correct the problem, mask signals for read-locking of default locks
in addition to the write-locking.  It is very cheap now with
sigfastblock(2).

Note that the global state is used to track pre-locked state of either
sigfastblock(2) or signal mask (if sigfastblock(2) is administratively
disabled).  It is fine for non-threaded images since there are no other
threads.  But I believe that it is fine for threaded images using libc_r
as well, since masking signals disables preemption (I did not tested
it).

NetBSD PR: https://gnats.netbsd.org/56979
Reported by: tmunro
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36396

2 years agoLinuxKPI: 80211: scanning code updates
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:40:51 +0000 (23:40 +0000)]
LinuxKPI: 80211: scanning code updates

For consistency rename LKPI_SCAN_RUNNING adding a LHW_ prefix.
Add a local flag LKPI_LHW_SCAN_HW mirroring the net80211
IEEE80211_FEXT_SCAN_OFFLOAD flag.
Slightly simplify the code.
Overload (*ic_scan_curchan) and (*ic_scan_mindwell) so that we can
call the net80211 implementation in case of software scan but skip it
in case of full-offload scans.
Also add a bandaid to our (*ic_set_channel) implementation to not siwtch
channels if we have an active hw_scan running.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation (partially)
MFC after: 4 days

2 years agoLinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:11:05 +0000 (23:11 +0000)]
LinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream

Implement the mac80211 (*get_antenna) call and after checking any
antenna information present query the current configuration on startup
(both informations should be identical at this point in theory).
Both the wiphy variables and function call report a bitmask not a count.
Count the bits for net80211 for as long as we get away with just a
number in ic_[rt]xstream.

Sponsored by: The FreeBSD Foundation
MFC after: 4 days

2 years agoLinuxKPI: 80211: make HW_CRYPTO compileable again
Bjoern A. Zeeb [Sat, 3 Sep 2022 22:51:16 +0000 (22:51 +0000)]
LinuxKPI: 80211: make HW_CRYPTO compileable again

Rename TRY_HW_CRYPTO to LKPI_80211_HW_CRYPTO for consitency and make
it compileable again in case someone wants to sit down and make it
work.  It's probably not too much to do.  Otherwise I might eventually
get around to it.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation
MFC after: 4 days

2 years agomgb: quiten -Wunused-function with LINT builds
Bjoern A. Zeeb [Sat, 3 Sep 2022 22:47:19 +0000 (22:47 +0000)]
mgb: quiten -Wunused-function with LINT builds

As the function itself seems to be helpful don't remove the code but
change the #ifdef DEBUG to #if 0 to avoid:
  warning: unused function 'mgb_dump_some_stats' [-Wunused-function]
with LINT builds.

2 years agoFix printf formating.
Kirk McKusick [Sat, 3 Sep 2022 22:39:45 +0000 (15:39 -0700)]
Fix printf formating.

Fix for f4fc389.

Reported by:  Jenkins
Sponsored by: The FreeBSD Foundation

2 years agoProperly handle the replacement of a partially allocated root directory.
Kirk McKusick [Sat, 3 Sep 2022 21:46:50 +0000 (14:46 -0700)]
Properly handle the replacement of a partially allocated root directory.

If the root directory exists but has a bad block number Pass1 will
accept it and setup an inoinfo structure for it. When Pass2 runs
and cannot read the root inode's content because of a bad (or
duplicate) block number, it removes the bad root inode and replaces
it. As part of creating the replacement root inode, it creates an
inoinfo entry for it. But Pass2 did delete the inoinfo entry that
Pass1 had set up for the root inode so ended up with two inoinfo
structures for it. The final step of Pass2 checks that all the ".."
entries are correct adding them if they are missing which resulted
in a second ".." entry being added to the root directory which
definitely did not go over well in the kernel name cache!

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

2 years agonet80211: update (parts of) frame types and subtypes and annotate
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:26:28 +0000 (22:26 +0000)]
net80211: update (parts of) frame types and subtypes and annotate

Update to the full list of frame type and subtype values based on
802.11-2020 with 11ax and 11ay extensions. This includes the 4th type
"Extension" (IEEE80211_FC0_TYPE_EXT).
While here annotate them with descriptions which should help matching
names (as at times things get confusing with LinuxKPI).
Also remove some 802.11-1997 values Reserved nowadays.

No functional changes.

Sponsored by: The FreeBSD Foundation
MFC after: 5 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36410

2 years agoFlush and close getnextino cache when done using it in Pass 1b.
Kirk McKusick [Sat, 3 Sep 2022 21:15:50 +0000 (14:15 -0700)]
Flush and close getnextino cache when done using it in Pass 1b.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

2 years agoUpdates to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Sat, 3 Sep 2022 21:08:25 +0000 (14:08 -0700)]
Updates to UFS/FFS superblock integrity checks when reading a superblock.

Yet more updates based on ways Peter Holm found to corrupt UFS
superblocks in ways that could cause kernel hangs or crashes.

No legitimate superblocks should fail as a result of these changes.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation

2 years agonet80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:19:32 +0000 (22:19 +0000)]
net80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA

Going through the Frame (Sub)types the "QOS Data" being called "QOS"
scheme leads to a naming conflict for QOS_CFPOLL and QOS_CFACKPOLL
(if added).   Rename QOS* to QOS_DATA* to avoid the conflict and
to also better match the standards name.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 5 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36409

2 years agonet80211: simplify an #ifdef INET/INET6 block
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:35:42 +0000 (22:35 +0000)]
net80211: simplify an #ifdef INET/INET6 block

I got lost in the #ifdef #endif here so I changed the code to a
switch block with two non-overlapping #ifdef parts and a default
which makes it a lot easier to read.

No functional changes.

Sponsored by: The FreeBSD Foundation
Reviewed by: (zlei.huang gmail.com)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D36411

2 years agobsdinstall(8) hostname: Update for bsddialog 0.3
Alfonso S. Siciliano [Sat, 3 Sep 2022 20:12:46 +0000 (22:12 +0200)]
bsdinstall(8) hostname: Update for bsddialog 0.3

 * Delete --hline info. bsddialog(1) 0.3 closes an --inputbox pressing
   only Enter (restoring the previous LGPL-dialog behavior).
 * Add dynamic width auto-sizing.

2 years agomlx5en(4): Correct a typo in a kernel error message
Gordon Bergling [Sat, 3 Sep 2022 17:29:33 +0000 (19:29 +0200)]
mlx5en(4): Correct a typo in a kernel error message

- s/ouput/output

MFC after: 5 days

2 years agonetpfil: Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 17:18:54 +0000 (19:18 +0200)]
netpfil: Fix a typo in a source code comment

- s/intergers/integers/

While here, fix some whitespace issues.

MFC after: 3 days

2 years agortld(1): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 17:16:32 +0000 (19:16 +0200)]
rtld(1): Fix a typo in a source code comment

- s/interger/integer/

MFC after: 3 days

2 years agolibm: Correct some typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 17:14:02 +0000 (19:14 +0200)]
libm: Correct some typos in source code comments

- s/modfied/modified/
- s/minimun/minimum/

While here, fix some mandoc warnings:

- whitespace at end of input line
- unusual Xr punctuation
- missing comma before name

Obtained from: NetBSD
MFC after: 5 days

2 years agobsddialog(1): Fix Makefile typo
Alfonso S. Siciliano [Sat, 3 Sep 2022 15:46:26 +0000 (17:46 +0200)]
bsddialog(1): Fix Makefile typo

Fix build fault caused by a typo in the Makefile.

2 years agocontrib/bsddialog: Import version 0.3
Alfonso S. Siciliano [Sat, 3 Sep 2022 14:40:21 +0000 (16:40 +0200)]
contrib/bsddialog: Import version 0.3

New features overview:
 * Unicode. User interface handles multi-column characters. API can
   handle char* like a multibyte character string. Internally wide
   characters are used for keyboard input, to adapt word wrapping and
   dynamic text auto-sizing for multi-column characters.
 * Forms refactoring. Complete rewrite deleting libformw dependency.
 * Theme. New utility options to save and load custom theme at run-time.
 * TUI navigation. Added keys to navigate input components. Changed
   default focus behavior of input dialogs to be LGPL-dialog-like; a new
   option can set the previous whiptail-like behavior.

See /usr/src/contrib/bsddialog/CHANGELOG '2022-08-29 Version 0.3'
for more detailed information.

Merge commit '2c9fd7655ba54e7239f528e1af9fe09662de9b03'

2 years agocontrib/bsddialog: Import version 0.3
Alfonso S. Siciliano [Sat, 3 Sep 2022 14:36:16 +0000 (16:36 +0200)]
contrib/bsddialog: Import version 0.3

New features overview:
 * Unicode. User interface handles multi-column characters. API can
   handle char* like a multibyte character string. Internally wide
   characters are used for keyboard input, to adapt word wrapping and
   dynamic text auto-sizing for multi-column characters.
 * Forms refactoring. Complete rewrite deleting libformw dependency.
 * Theme. New utility options to save and load custom theme at run-time.
 * TUI navigation. Added keys to navigate input components. Changed
   default focus behavior of input dialogs to be LGPL-dialog-like; a new
   option can set the previous whiptail-like behavior.

See /usr/src/contrib/bsddialog/CHANGELOG '2022-08-29 Version 0.3'
for more detailed information.

2 years agoltc430x(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 13:43:05 +0000 (15:43 +0200)]
ltc430x(4): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agobce(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 13:39:51 +0000 (15:39 +0200)]
bce(4): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agobge(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 13:38:26 +0000 (15:38 +0200)]
bge(4): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agobxe(4): Fix two typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 13:36:00 +0000 (15:36 +0200)]
bxe(4): Fix two typos in source code comments

- s/overriden/overridden/

MFC after: 3 days

2 years agomalo(4): Fix a typo in asource code comment
Gordon Bergling [Sat, 3 Sep 2022 13:34:27 +0000 (15:34 +0200)]
malo(4): Fix a typo in asource code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agosdhci(4): Fix a typo in asource code comment
Gordon Bergling [Sat, 3 Sep 2022 13:31:59 +0000 (15:31 +0200)]
sdhci(4): Fix a typo in asource code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agosound(4): Fix a typo in asource code comment
Gordon Bergling [Sat, 3 Sep 2022 13:30:39 +0000 (15:30 +0200)]
sound(4): Fix a typo in asource code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agopci(4): Fix a typo in asource code comment
Gordon Bergling [Sat, 3 Sep 2022 13:28:05 +0000 (15:28 +0200)]
pci(4): Fix a typo in asource code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agokern: Fix a typo in asource code comment
Gordon Bergling [Sat, 3 Sep 2022 13:26:55 +0000 (15:26 +0200)]
kern: Fix a typo in asource code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agoath(4): Fix two typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 13:24:48 +0000 (15:24 +0200)]
ath(4): Fix two typos in source code comments

- s/overriden/overridden/

MFC after: 3 days

2 years agousb: Fix two typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 13:22:42 +0000 (15:22 +0200)]
usb: Fix two typos in source code comments

- s/overriden/overridden/

MFC after: 3 days

2 years agotcp_rack: Fix two typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 13:05:42 +0000 (15:05 +0200)]
tcp_rack: Fix two typos in source code comments

- s/overriden/overridden/

MFC after: 3 days

2 years agonetisr(9): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 13:04:15 +0000 (15:04 +0200)]
netisr(9): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agocron(8): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 13:00:29 +0000 (15:00 +0200)]
cron(8): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agotip(1): Fix a typo in a source code comment
Gordon Bergling [Sat, 3 Sep 2022 12:59:03 +0000 (14:59 +0200)]
tip(1): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agorc.conf: Fix a typo in a comment
Gordon Bergling [Sat, 3 Sep 2022 12:57:39 +0000 (14:57 +0200)]
rc.conf: Fix a typo in a comment

- s/overriden/overridden/

MFC after: 3 days

2 years agoifconfig(8): Fix a typo in source code comment
Gordon Bergling [Sat, 3 Sep 2022 12:55:54 +0000 (14:55 +0200)]
ifconfig(8): Fix a typo in source code comment

- s/overriden/overridden/

MFC after: 3 days

2 years agoisp(4): Fix two typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 12:54:14 +0000 (14:54 +0200)]
isp(4): Fix two typos in source code comments

- s/overriden/overridden/

MFC after: 3 days

2 years agoimpi(4): Fix two typos in source code comments
Gordon Bergling [Sat, 3 Sep 2022 12:52:44 +0000 (14:52 +0200)]
impi(4): Fix two typos in source code comments

- s/overriden/overridden/

MFC after: 3 days

2 years agolibc/stdio: only roll FILE state back on EINTR
Konstantin Belousov [Fri, 2 Sep 2022 13:39:38 +0000 (16:39 +0300)]
libc/stdio: only roll FILE state back on EINTR

Reported by: JunT <takimoto-j@kba.biglobe.ne.jp>
PR: 266171
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36427

2 years ago__swbuf(): style
Konstantin Belousov [Fri, 2 Sep 2022 14:00:56 +0000 (17:00 +0300)]
__swbuf(): style

Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36427

2 years agoqat: Move CWARNFLAGS down so it works.
John Baldwin [Fri, 2 Sep 2022 21:52:19 +0000 (14:52 -0700)]
qat: Move CWARNFLAGS down so it works.

CWARNFLAGS must be added to after including kern.mk, otherwise all the
warnings set in kern.mk are ignored.  This is why the
-Wmissing-prototypes warnings were not seen previously.

While here, drop -Wno-pointer-sign as it is doesn't seem to be needed,
but add -Wno-cast-qual to silence warnings for various casts of const
pointers to non-const pointers.

Reviewed by: MichalX.Gulbicki_intel.com, markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36332

2 years agoqat: Add #includes for missing prototypes.
John Baldwin [Fri, 2 Sep 2022 21:51:54 +0000 (14:51 -0700)]
qat: Add #includes for missing prototypes.

This fixes numerous -Wmissing-prototypes warnings when that warning
is enabled.

Reviewed by: MichalX.Gulbicki_intel.com, markj
Sponsored by: DARPA
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D36331

2 years agoqat: Add a prototype for icp_adf_is_dev_in_error.
John Baldwin [Fri, 2 Sep 2022 21:50:09 +0000 (14:50 -0700)]
qat: Add a prototype for icp_adf_is_dev_in_error.

Reviewed by: MichalX.Gulbicki_intel.com, markj
Sponsored by: DARPA
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D36330

2 years agoqat: Drop extraneous parentheses from some macro values.
John Baldwin [Fri, 2 Sep 2022 21:49:40 +0000 (14:49 -0700)]
qat: Drop extraneous parentheses from some macro values.

This header duplicates a few #defines in "adf_cfg_strings.h".  The
latter header does not use the unneeded parentheses, but if a C file
includes both of these headers, clang raises an error because the macro
is redefined with a different value.

Reviewed by: markj
Sponsored by: DARPA
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D36329

2 years agorelease: Set loader_menu_multi_user_prompt to "Installer" for installer
Jessica Clarke [Fri, 2 Sep 2022 19:30:50 +0000 (20:30 +0100)]
release: Set loader_menu_multi_user_prompt to "Installer" for installer

This makes it more obvious that the media being booted is an installer
rather than an installed system, which is otherwise hard to distinguish.
It also provides a more user-friendly, and more accurate, prompt.

Reviewed by: gjb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36419

2 years agolualoader: Add loader_menu_multi_user_prompt config variable
Jessica Clarke [Fri, 2 Sep 2022 19:30:40 +0000 (20:30 +0100)]
lualoader: Add loader_menu_multi_user_prompt config variable

This allows the "Multi user" in "[B]oot Multi user" to be substituted
with another string, for example with "Installer" in installer media.
Note that this is lua-only at the moment, since loader.4th's menu.rc
defines the alternate name as Boot [M]ulti User, unlike lualoader which
leaves it as [B]oot Multi user. Ideally loader.4th would adopt the newer
and simpler lualoader behaviour and then it could gain support for this
option, but loader.4th is on the way out and isn't used by any official
installer media so this is not a significant concern.

Reviewed by: kevans, rpokala
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36418

2 years agoraw ip: fix regression with multicast and RSVP
Gleb Smirnoff [Fri, 2 Sep 2022 19:17:09 +0000 (12:17 -0700)]
raw ip: fix regression with multicast and RSVP

With 61f7427f02a raw sockets protosw has wildcard pr_protocol.  Protocol
of a specific pcb is stored in inp_ip_p.

Reviewed by: karels
Reported by: karels
Differential revision: https://reviews.freebsd.org/D36429
Fixes: 61f7427f02a307d28af674a12c45dd546e3898e4

2 years agoi386 doreti: Fix calculation of stack frame size
Tijl Coosemans [Fri, 2 Sep 2022 14:16:35 +0000 (16:16 +0200)]
i386 doreti: Fix calculation of stack frame size

Reviewed by: kib
Fixes: e8b2980e4a12 - i386 doreti: stop saving/restoring %ecx

2 years agostand: Parse BIOS revision from SMBIOS
Kornel Dulęba [Fri, 2 Sep 2022 11:08:32 +0000 (13:08 +0200)]
stand: Parse BIOS revision from SMBIOS

Add a smbios.bios.revision kenv, which contains the system BIOS revision
as defined in SMBIOS specification, section 3.3.1.
Since the revision is stored in two separate byte fields,
the smbios_setenv helper can't be used.
Read and construct the kenv manually instead.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D36413

2 years agotpm: Fix entropy harvesting logic
Kornel Dulęba [Fri, 2 Sep 2022 11:07:03 +0000 (13:07 +0200)]
tpm: Fix entropy harvesting logic

Use a taskqueue instead of a callout.
Callout functions mustn't sleep, where as the TPM driver
uses a sx lock in order to serialize accesses to the device.
Since the entropy harvesting feature is not enabled by default,
this commit should not bring any functional changes to the GENERIC
kernel.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36412

2 years agods1307: add support for the EPSON RX-8035SA I2C RTC
Mathew McBride [Sat, 23 Jul 2022 00:29:16 +0000 (00:29 +0000)]
ds1307: add support for the EPSON RX-8035SA I2C RTC

The EPSON RX-8035SA I2C RTC has a similar time register layout to the
ds1307 family, with some minor differences in bit positions, polarity
and control registers.  Further generalize ds1307 to make it easier
to add more compatible chips and add support for the EPSON RX-8035SA.

MFC after: 6 days
Sponsored by: Traverse Technologies
Differential Revision: https://reviews.freebsd.org/D35837

2 years agolocal_unbound: rc: allow to overwrite pid file path
Bjoern A. Zeeb [Thu, 11 Aug 2022 14:32:06 +0000 (14:32 +0000)]
local_unbound: rc: allow to overwrite pid file path

Certain configurations need to use a different path for pidfile.
Allow rc.conf to overwrite it.

Reviewed by: cy, 0mp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D36141

2 years agoacpi: Fix error message
Warner Losh [Thu, 1 Sep 2022 17:34:36 +0000 (11:34 -0600)]
acpi: Fix error message

Fix a formatting error from 195f794318a33

Fixes: 195f794318a33
Sponsored by: Netflix

2 years agohwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs.
Alexander Motin [Thu, 1 Sep 2022 17:18:04 +0000 (13:18 -0400)]
hwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs.

At least KVM in Proxmox seems not happy about it.  Just to be safe
block it for all VMs, since it should just improve profile accuracy.

MFC after: 1 week

2 years agokboot: List sources one per line to make merges easier
Warner Losh [Thu, 1 Sep 2022 17:07:34 +0000 (11:07 -0600)]
kboot: List sources one per line to make merges easier

Make SRC an alphabetical list of files, one per line.

Sponsored by: Netflix

2 years agokboot: add minmalist init functionality
Warner Losh [Thu, 1 Sep 2022 17:06:43 +0000 (11:06 -0600)]
kboot: add minmalist init functionality

It is desirable to run kboot as the first program in some LinuxBoot
environments. This is the traditional "pid 1" or "init" program. When
running as pid 1. rovide a minimal environment based on what sysvinit,
u-root, initramfs-tools and other like projects do. We mount /dev, /sys,
/proc, make symlinks from /dev/fd to /dev/proc, and create /tmp, /run,
and /var. We also setup stdin/out/err to the console, set the tty
characteristics of same and block the appropriate signals.

This is indended as an environment that never does a fork/exec. If
that's required, the process groups, session leaders and all things
POSIX terminal handlers will need to be added.

Unlike the general purpose linux projects in this area, no attempt is
made to support very old kernels.

When not pid 1, we skip all of the above.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36368

2 years agostand: Add lua binding loader.has_command
Warner Losh [Thu, 1 Sep 2022 17:06:19 +0000 (11:06 -0600)]
stand: Add lua binding loader.has_command

Give scripts the ability to determine if the currently running loader
has provided a command.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36365

2 years agostand: Add interp_has_builtin_cmd to see if we have a command
Warner Losh [Thu, 1 Sep 2022 17:06:01 +0000 (11:06 -0600)]
stand: Add interp_has_builtin_cmd to see if we have a command

interp_has_builtin_cmd() will try to lookup the passed in command and
returns true if it was found, false otherwise.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36364

2 years agostand: separate the command lookup from the command execution
Warner Losh [Thu, 1 Sep 2022 17:05:42 +0000 (11:05 -0600)]
stand: separate the command lookup from the command execution

Factor out interp_lookup_cmd to search for a command from
interp_builtin_cmd. This simplifies the latter and can be used to expand
lua to ask if a command exists.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36363

2 years agoacpi: Move some errors with RSDP and XSLT out from under bootverbose
Warner Losh [Thu, 1 Sep 2022 16:39:34 +0000 (10:39 -0600)]
acpi: Move some errors with RSDP and XSLT out from under bootverbose

Failure to map RSDP, XSLT and checksum failures are events that can't
happen unless something has gone wrong. As such, they should be reported
always, and not in bootverbose. This has been this way since it was
originally brought in to parse APIC tables.

Sponsored by: Netflix
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D36406

2 years agoacpi: Unmap RSDP in more error cases
Warner Losh [Thu, 1 Sep 2022 16:39:20 +0000 (10:39 -0600)]
acpi: Unmap RSDP in more error cases

Add missing pmap_unmapbios() calls for when we return 0. Otherwise we
can leave the table mapped when it is of no use.

Sponsored by: Netflix
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D36405

2 years agoacpi: arm64 doesn't support ACPI 1.0 RSDP, report when we see one
Warner Losh [Thu, 1 Sep 2022 16:38:53 +0000 (10:38 -0600)]
acpi: arm64 doesn't support ACPI 1.0 RSDP, report when we see one

arm64 requires ACPI RSDP Revision 2.0 since it requires 64-bit physical
addresses. It is an error worth reporting if we have a RSDP pointer, but
it points to the wrong version.

Sponsored by: Netflix
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D36404

2 years agostand: Document EFI consoles
Warner Losh [Thu, 1 Sep 2022 16:34:30 +0000 (10:34 -0600)]
stand: Document EFI consoles

Document how EFI consoles work, at least on x86. There's a number of
weird quirks and limitations that are generally known, but not
documented until now. Include information on how EFI decides what the
defualt console is, how to set it and how to cope with common
situations. Note limitations and mismatch between ACPI (which uses UID
to identify a device) and our console code (which uses a raw address)
and explain why we can't translate between them in the loader.

Sponsored by: Netflix
Reviewed by: manu, kevans, rpokala, pauamma
Differential Revision: https://reviews.freebsd.org/D36286

2 years agostand: Stop setting hints for bios loader too
Warner Losh [Thu, 1 Sep 2022 16:33:09 +0000 (10:33 -0600)]
stand: Stop setting hints for bios loader too

Catch up to 2753bbe71b5a and remove the old hints.

Sponsored by: Netflix

2 years agolinuxkpi: on i386 only use first_msi_irq if apic is in kernel config
Tijl Coosemans [Sat, 1 May 2021 16:01:22 +0000 (18:01 +0200)]
linuxkpi: on i386 only use first_msi_irq if apic is in kernel config

2 years agoi386 machine/cpu.h: include sys/systm.h for cpu_ticks()
Tijl Coosemans [Wed, 31 Aug 2022 18:56:49 +0000 (20:56 +0200)]
i386 machine/cpu.h: include sys/systm.h for cpu_ticks()

Fixes build of graphics/drm-510-kmod on i386.

2 years agoFix reading the correct ID and REV.
Søren Schmidt [Thu, 1 Sep 2022 07:36:37 +0000 (07:36 +0000)]
Fix reading the correct ID and REV.

Reviewed by: manu

2 years agoAdd support for TCS4525 pmic.
Ganbold Tsagaankhuu [Thu, 1 Sep 2022 07:31:08 +0000 (07:31 +0000)]
Add support for TCS4525 pmic.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D36209

2 years agoFix problem getting gpio version during attach.
Ganbold Tsagaankhuu [Thu, 1 Sep 2022 07:21:56 +0000 (07:21 +0000)]
Fix problem getting gpio version during attach.
Both RK3328 and RK3399 don't have GPIO_VER_ID register.
Set gpio version depending on compat string of the parent.

2 years agomount_nfs.8: Reword sentence so .Pa macro works
Rick Macklem [Wed, 31 Aug 2022 23:19:22 +0000 (16:19 -0700)]
mount_nfs.8: Reword sentence so .Pa macro works

Commit 603677334a64 added a sentence with a file path
in it. However, it did not use .Pa since it would leave
a space after it, where ('s) was supposed to go.

This patch rewords the sentence so that .Pa can
be used.

This is a content change.

Suggested by: mkarels

2 years agoiwlwifi: move an ieee80211_get_tid() call
Bjoern A. Zeeb [Wed, 31 Aug 2022 23:01:36 +0000 (23:01 +0000)]
iwlwifi: move an ieee80211_get_tid() call

Introduce a local change.  It seems ieee80211_get_tid() does not deal
with non-dataqos packets unlike net80211's ieee80211_gettid().
Gernally all calls in Linux drivers to ieee80211_get_tid() seem to
be proceeded by an ieee80211_is_data_qos() check.

Moving the ieee80211_get_tid() has no difference in the result, but
(a) saves us the call if we do not need it due to an earlier return,
and (b) allows us to put an assert into the LinuxKPI ieee80211_get_tid()
implementation to avoid accidentally returning random frame header data
in case of a missing earlier ieee80211_is_data_qos() check in (future/
other) drivers.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agotcp: Functional implementation of Accurate ECN
Richard Scheffenegger [Wed, 31 Aug 2022 13:01:25 +0000 (15:01 +0200)]
tcp: Functional implementation of Accurate ECN

The AccECN handshake and TCP header flags are supported,
no support yet for the AccECN option. This minimalistic
implementation is sufficient to support DCTCP while
dramatically cutting the number of ACKs, and provide ECN
response from the receiver to the CC modules.

Reviewed By: #transport, #manpages, rrs, pauamma
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D21011

2 years agotcp: finish SACK loss recovery on sudden lack of SACK blocks
Richard Scheffenegger [Wed, 31 Aug 2022 12:49:25 +0000 (14:49 +0200)]
tcp: finish SACK loss recovery on sudden lack of SACK blocks

While a receiver should continue sending SACK blocks for the
duration of a SACK loss recovery, if for some reason the
TCP options no longer contain these SACK blocks, but we
already started maintaining the Scoreboard, keep on handling
incoming ACKs (without SACK) as belonging to the SACK recovery.

Reported by: thj
Reviewed by: tuexen, #transport
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36046

2 years agoStore mpidr as a 64-bit value on arm64
Andrew Turner [Thu, 25 Aug 2022 08:28:28 +0000 (08:28 +0000)]
Store mpidr as a 64-bit value on arm64

The mpidr register is 64 bit on arm64 and 32 bit on arm. Fix this by
extending the arm64 definition to include the top 32 bits.

To preserve KBI when MFCing split the value into two 32 bit values.
This will be cleaned up later only on main.

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36346

2 years agoOptionalObsoleteFiles.inc: Add missing sendmail feature macro files.
Peter Wemm [Wed, 31 Aug 2022 08:54:04 +0000 (01:54 -0700)]
OptionalObsoleteFiles.inc: Add missing sendmail feature macro files.

MFC after: 3 days

2 years agoarm64: Fix hwpmc module for OPT_ACPI isn't selected
Emmanuel Vadot [Mon, 29 Aug 2022 09:50:52 +0000 (11:50 +0200)]
arm64: Fix hwpmc module for OPT_ACPI isn't selected

Fixes: 59191f3573f6 ("Add support of ARM CMN-600 controller ...")
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoprotosw: repair protocol selection logic in socket(2)
Gleb Smirnoff [Wed, 31 Aug 2022 04:19:46 +0000 (21:19 -0700)]
protosw: repair protocol selection logic in socket(2)

Pointy hat to: glebius
Fixes: 61f7427f02a307d28af674a12c45dd546e3898e4

2 years agoprocstat: fix printing divert(4) sockets
Gleb Smirnoff [Tue, 30 Aug 2022 23:26:21 +0000 (16:26 -0700)]
procstat: fix printing divert(4) sockets

2 years agotests: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT
Gleb Smirnoff [Tue, 30 Aug 2022 23:23:36 +0000 (16:23 -0700)]
tests: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT

2 years agoipfwpcap: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT
Gleb Smirnoff [Tue, 30 Aug 2022 23:22:50 +0000 (16:22 -0700)]
ipfwpcap: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT

2 years agonatd: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT
Gleb Smirnoff [Tue, 30 Aug 2022 23:21:19 +0000 (16:21 -0700)]
natd: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT

2 years agosqlite3: Vendor import of sqlite3 3.39.2
Cy Schubert [Tue, 30 Aug 2022 22:54:32 +0000 (15:54 -0700)]
sqlite3: Vendor import of sqlite3 3.39.2

Changes at https://www.sqlite.org/releaselog/3_39_2.html.

Security:       CVE-2022-35737
Obtained from:  https://www.sqlite.org/2022/sqlite-autoconf-3390200.tar.gz
MFC after:      immediately

Merge commit '1545dd7d6cc54bdfca9bc9f74c42745b514b60c9' into sqlite3/main3

2 years agosqlite3: Vendor import of sqlite3 3.39.2
Cy Schubert [Tue, 30 Aug 2022 22:29:34 +0000 (15:29 -0700)]
sqlite3: Vendor import of sqlite3 3.39.2

Changes at https://www.sqlite.org/releaselog/3_39_2.html.

Obtained from: https://www.sqlite.org/2022/sqlite-autoconf-3390200.tar.gz

2 years agodivert(4): make it compilable and working without INET
Gleb Smirnoff [Tue, 30 Aug 2022 22:09:21 +0000 (15:09 -0700)]
divert(4): make it compilable and working without INET

Differential revision: https://reviews.freebsd.org/D36383

2 years agodivert(4): maintain own cb database and stop using inpcb KPI
Gleb Smirnoff [Tue, 30 Aug 2022 22:09:21 +0000 (15:09 -0700)]
divert(4): maintain own cb database and stop using inpcb KPI

Here go cons of using inpcb for divert:
- divert(4) uses only 16 bits (local port) out of struct inpcb,
  which is 424 bytes today.
- The inpcb KPI isn't able to provide hashing for divert(4),
  thus it uses global inpcb list for lookups.
- divert(4) uses INET-specific part of the KPI, making INET
  a requirement for IPDIVERT.

Maintain our own very simple hash lookup database instead.  It
has mutex protection for write and epoch protection for lookups.
Since now so->so_pcb no longer points to struct inpcb, don't
initialize protosw methods to methods that belong to PF_INET.
Also, drop support for setting options on a divert socket.  My
review of software in base and ports confirms that this has no
use and unlikely worked before.

Differential revision: https://reviews.freebsd.org/D36382

2 years agodivert(4): provide statistics
Gleb Smirnoff [Tue, 30 Aug 2022 22:09:21 +0000 (15:09 -0700)]
divert(4): provide statistics

Instead of incrementing pretty random counters in the IP statistics,
create divert socket statistics structure.  Export via netstat(1).

Differential revision: https://reviews.freebsd.org/D36381

2 years agoprotosw: cleanup protocols that existed merely to provide pr_input
Gleb Smirnoff [Tue, 30 Aug 2022 22:09:21 +0000 (15:09 -0700)]
protosw: cleanup protocols that existed merely to provide pr_input

Since 4.4BSD the protosw was used to implement socket types created
by socket(2) syscall and at the same to demultiplex incoming IPv4
datagrams (later copied to IPv6).  This story ended with 78b1fc05b20.

These entries (e.g. IPPROTO_ICMP) in inetsw that were added to catch
packets in ip_input(), they would also be returned by pffindproto()
if user says socket(AF_INET, SOCK_RAW, IPPROTO_ICMP).  Thus, for raw
sockets to work correctly, all the entries were pointing at raw_usrreq
differentiating only in the value of pr_protocol.

With 78b1fc05b20 all these entries are no longer needed, as ip_protox
is independent of protosw.  Any socket syscall requesting SOCK_RAW type
would end up with rip_protosw.  And this protosw has its pr_protocol
set to 0, allowing to mark socket with any protocol.

For IPv6 raw socket the change required two small fixes:
o Validate user provided protocol value
o Always use protocol number stored in inp in rip6_attach, instead
  of protosw value, which is now always 0.

Differential revision: https://reviews.freebsd.org/D36380

2 years agodivert: declare PF_DIVERT domain and stop abusing PF_INET
Gleb Smirnoff [Tue, 30 Aug 2022 22:09:21 +0000 (15:09 -0700)]
divert: declare PF_DIVERT domain and stop abusing PF_INET

The divert(4) is not a protocol of IPv4.  It is a socket to
intercept packets from ipfw(4) to userland and re-inject them
back.  It can divert and re-inject IPv4 and IPv6 packets today,
but potentially it is not limited to these two protocols.  The
IPPROTO_DIVERT does not belong to known IP protocols, it
doesn't even fit into u_char.  I guess, the implementation of
divert(4) was done the way it is done basically because it was
easier to do it this way, back when protocols for sockets were
intertwined with IP protocols and domains were statically
compiled in.

Moving divert(4) out of inetsw accomplished two important things:

1) IPDIVERT is getting much closer to be not dependent on INET.
   This will be finalized in following changes.
2) Now divert socket no longer aliases with raw IPv4 socket.
   Domain/proto selection code won't need a hack for SOCK_RAW and
   multiple entries in inetsw implementing different flavors of
   raw socket can merge into one without requirement of raw IPv4
   being the last member of dom_protosw.

Differential revision: https://reviews.freebsd.org/D36379

2 years agomount_nfs.8: Note that NFSv4 requires unique /etc/hostid's
Rick Macklem [Tue, 30 Aug 2022 14:55:32 +0000 (07:55 -0700)]
mount_nfs.8: Note that NFSv4 requires unique /etc/hostid's

Recent problems related to NFSv4 mounts has been traced
to multiple NFSv4 clients using the same /etc/hostid
(or kern.hostuuid, if you prefer).

This patch adds a sentence to the man page noting that
clients must have unique /etc/hostid's.

This is a content change.

Reviewed by: gbe (manpages)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36392

2 years agocp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED.
Alexander Motin [Tue, 30 Aug 2022 14:51:21 +0000 (10:51 -0400)]
cp: Fix build without VM_AND_BUFFER_CACHE_SYNCHRONIZED.

It allows to not use mmap() for small files, which is not helpful
in case of ZFS.  Should be no functional change.

MFC after: 1 week

2 years agoucom(4): Make sure the open routine is executed synchronously.
Dave Baukus [Tue, 30 Aug 2022 14:19:40 +0000 (16:19 +0200)]
ucom(4): Make sure the open routine is executed synchronously.

To avoid issues starting any USB transfers before the open
function is complete.

Differential Revision: https://reviews.freebsd.org/D36391
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoumodem(4): Clear stall at every open.
Hans Petter Selasky [Tue, 30 Aug 2022 14:01:43 +0000 (16:01 +0200)]
umodem(4): Clear stall at every open.

Some controllers like the XHCI(4) loose track of the data toggle value when
USB receive transfers are cancelled at close. This in turn can lead to to
data loss after the next open.

To avoid data loss, make sure both the receive and transmit data toggles
get reset, before trying to read or write any data.

Differential Revision: https://reviews.freebsd.org/D36391
Submitted by: Dave Baukus <daveb@spectralogic.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agotcp: remove a dead code leftover from T/TCP,
Gleb Smirnoff [Tue, 30 Aug 2022 02:30:12 +0000 (19:30 -0700)]
tcp: remove a dead code leftover from T/TCP,

that doesn't have any value today.

2 years agodivert: merge div_output() into div_send()
Gleb Smirnoff [Tue, 30 Aug 2022 02:15:01 +0000 (19:15 -0700)]
divert: merge div_output() into div_send()

No functional change intended.