]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoApply upstream lldb fix for unhandled Error causing abort
Dimitry Andric [Mon, 16 Aug 2021 16:56:41 +0000 (18:56 +0200)]
Apply upstream lldb fix for unhandled Error causing abort

Merge commit 5033f0793fe6 from llvm git (by Dimitry Andric):

  [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage

  When assertions are turned off, the `llvm::Error` value created at the
  start of this function is overwritten using the move-assignment
  operator, but the success value is never checked. Whenever a TypeSystem
  cannot be found or created, this can lead to lldb core dumping with:

      Program aborted due to an unhandled Error:
      Error value was Success. (Note: Success values must still be checked prior to being destroyed).

  Fix this by not creating a `llvm::Error` value in advance, and directly
  returning the result of `llvm::make_error` instead, whenever an error is
  encountered.

  See also: <https://bugs.freebsd.org/253881> and
  <https://bugs.freebsd.org/257829>.

  Reviewed By: teemperor

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

Reported by: dmgk, ota@j.email.ne.jp
PR: 253881, 257829

(cherry picked from commit c1a540709a83f810aa47380b946552ab20020374)

2 years agowpa: Add wpa_cli action file event
Cy Schubert [Thu, 12 Aug 2021 13:38:21 +0000 (06:38 -0700)]
wpa: Add wpa_cli action file event

Yang Zhong at FreeBSD Foundation is working on a wireless network
configuratior for an experimental FreeBSD installer. The new installer
requires an event to detect when connecting to a network fails due to a
bad password. When this happens a WPA-EVENT-TEMP-DISABLED event is
triggered. This patch passes the event to an action file provided by
the new experimental installer.

Submitted by: Yang Zhong <yzhong () freebsdfoundation.org>
Reviewed by: assumed to be reviewed by emaste (and cy)

(cherry picked from commit ce92f5a91b161c85e0a7e37cc754e3c28074281a)

2 years agowpa: The ap library is not needed by wpa_supplicant or wpa_cli
Cy Schubert [Sat, 12 Jun 2021 23:51:51 +0000 (16:51 -0700)]
wpa: The ap library is not needed by wpa_supplicant or wpa_cli

The ap library is not needed by wpa_supplicant or wpa_cli. It is only
used by hostapd.

(cherry picked from commit dc9d54b5c1e058b4f1bb9ab9372b171ac87a0d72)

2 years agowpa: Fix GCC 6 build
Cy Schubert [Fri, 4 Jun 2021 01:40:55 +0000 (18:40 -0700)]
wpa: Fix GCC 6 build

GCC 6 searches serially to resolve external references.

(cherry picked from commit 681500889424423403ace51f118b3467e09acc00)

2 years agowpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload
Cy Schubert [Wed, 2 Jun 2021 19:46:02 +0000 (12:46 -0700)]
wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload

Incorrectly linked built-in wpa functions resulted in overwriting
sm->ctx->set_rekey_offload with garbage. It was initialized correctly
however it changed after wpa_supplicant became a daemon.

No SIGBUS violations reported by dhw@ were experienced during testing
of the original commit by msyelf or philip@.

Reported by: dhw
Tested by: dhw
X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3

(cherry picked from commit 9a0f82285322a338548d13fcda07e1d574301190)

2 years agowpa: Restructure wpa build
Cy Schubert [Thu, 20 May 2021 21:28:17 +0000 (14:28 -0700)]
wpa: Restructure wpa build

The current WPA build assumes a flat namespace. However the latest sources
from w1.fi now have a duplicate config.c, in two separate subdirectories.
The flat namespace will overwrite config.o with the output from the most
recently modified config.c, of which there are two of them.

This commit resolves this problem by building each component in
wpa's src subdirectory tree into its own .a archive, just as the w1.fi
upstream build as used by the port does. The advantages of this approach
are:

1. Duplicate source file names, i.e. config.c in the wpa_supplicant
   direcory and another config.c in src/utils in the next wpa
   will result in both compiles writing to the same .o file.

2. This restructure simplifies maintanence. A develper needs only to add
   new files as identified by git status in the vendor branch to the
   appropriate Makefile within the usr.sbin/wpa tree. This also reduces
   time required to prepare a new import and should reduce error.

3. The new wpa build structure more closely represents the build as
   performed by the upstream tarball.

This is in preparation for the next wpa update from w1.fi.

Reviewed by: philip
Tested by: philip
Differential Revision: https://reviews.freebsd.org/D30372

(cherry picked from commit 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3)

2 years agong_bridge: Use M_NOWAIT when allocating memory in the newhook routine
Mark Johnston [Fri, 13 Aug 2021 13:49:43 +0000 (09:49 -0400)]
ng_bridge: Use M_NOWAIT when allocating memory in the newhook routine

newhook can be invoked by ngthread, which runs in a network epoch
section and is thus not permitted to perform M_WAITOK allocations.

Reported by: Jenkins
Reviewed by: donner, afedorov
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e0e3ded78a5d0859f3520c541726b815897ba7b0)

2 years agortld: Round down relro_size
Konstantin Belousov [Thu, 12 Aug 2021 02:45:15 +0000 (05:45 +0300)]
rtld: Round down relro_size

(cherry picked from commit c9f833abf1d76ea194b82caafa06a0627790ad97)

2 years agortld: fix the man page
Mariusz Zaborski [Wed, 24 Mar 2021 23:49:59 +0000 (00:49 +0100)]
rtld: fix the man page

(cherry picked from commit e086aff91c242a2decdf7dd1ceb5a0b3e723a53f)

2 years agortld: introduce PRELOAD_FDS
Mariusz Zaborski [Wed, 24 Mar 2021 21:10:33 +0000 (22:10 +0100)]
rtld: introduce PRELOAD_FDS

(cherry picked from commit f90218886fc82e7b1fdb9e241adc5d713dadabe3)

2 years agortld: style nits
Mariusz Zaborski [Wed, 24 Mar 2021 21:05:39 +0000 (22:05 +0100)]
rtld: style nits

(cherry picked from commit 852a88a1d92500028f1364a4afc58955190db7a5)

2 years agoloader: cstyle cleanup of userboot/devicename.c
Toomas Soome [Wed, 11 Aug 2021 07:07:28 +0000 (10:07 +0300)]
loader: cstyle cleanup of userboot/devicename.c

No functional changes intended.

(cherry picked from commit 5d5a6216645a6aefa8665c79bb761b754d74c067)

2 years agoFix a typo that was introduced while fixing a typo
Gordon Bergling [Sat, 14 Aug 2021 12:30:59 +0000 (14:30 +0200)]
Fix a typo that was introduced while fixing a typo

- s/enrtry/entry/

(cherry picked from commit 646f3a36c8df0e54e71332038ede594965daac6e)

2 years agoAdd test for fstatat(pipefd, AT_EMPTY_PATH)
Konstantin Belousov [Sat, 14 Aug 2021 10:33:18 +0000 (13:33 +0300)]
Add test for fstatat(pipefd, AT_EMPTY_PATH)

(cherry picked from commit b42df9dafb8038169e23f9225f3f1588ded8d27e)

2 years agofstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH
Konstantin Belousov [Fri, 13 Aug 2021 17:40:10 +0000 (20:40 +0300)]
fstatat(2): handle non-vnode file descriptors for AT_EMPTY_PATH

(cherry picked from commit 9446d9e88fd7b203fa50c015f29b636db5b1d52b)

2 years agoufs rename: ensure that the result of ufs_checkpath() is stable
Konstantin Belousov [Fri, 6 Aug 2021 01:03:19 +0000 (04:03 +0300)]
ufs rename: ensure that the result of ufs_checkpath() is stable

(cherry picked from commit 8df4bc48c89a1302078282f22139a8368dc06971)

2 years agoStyle: wrap the long line, definition of ufs_checkpath()
Konstantin Belousov [Sun, 1 Aug 2021 17:56:33 +0000 (20:56 +0300)]
Style: wrap the long line, definition of ufs_checkpath()

(cherry picked from commit 2e2212b4f55f307ed814cbe1ea633c32faea4a9c)

2 years agopipe_paircreate(): do not leak pipepair memory on error
Konstantin Belousov [Mon, 16 Aug 2021 09:24:49 +0000 (12:24 +0300)]
pipe_paircreate(): do not leak pipepair memory on error

(cherry picked from commit 81b895a95bdab28897bf948f5265fad1f51f8aa2)

2 years agoFix a few typos in source code comments
Gordon Bergling [Sat, 14 Aug 2021 07:06:09 +0000 (09:06 +0200)]
Fix a few typos in source code comments

- s/becase/because/

(cherry picked from commit fa7a635f7ee277960eb37b9102a3aef76b36b825)

2 years agoFix a few typos in source code comments
Gordon Bergling [Sat, 14 Aug 2021 07:39:17 +0000 (09:39 +0200)]
Fix a few typos in source code comments

- s/posbile/possible/

(cherry picked from commit 34f620f1d0cfa67f5987452ac3fdd8c113b6b099)

2 years agomd5(1): Fix a typo in the manual page
Gordon Bergling [Sat, 14 Aug 2021 12:48:39 +0000 (14:48 +0200)]
md5(1): Fix a typo in the manual page

- s/compatibilty/compatibility/

(cherry picked from commit 0d71cea832f4b6e1db9d28d3ca393682d577b43e)

2 years agoFix a common typo in source code comments
Gordon Bergling [Sat, 14 Aug 2021 12:08:46 +0000 (14:08 +0200)]
Fix a common typo in source code comments

- s/definitons/definitions/

(cherry picked from commit 1da11b8ac3474817f38330e272f50553f2ef21a4)

2 years agoFix some common typos in source code comments
Gordon Bergling [Sat, 14 Aug 2021 06:55:58 +0000 (08:55 +0200)]
Fix some common typos in source code comments

- s/struture/structure/
- s/structre/structure/

(cherry picked from commit 17db4b52fb41aeabeb945c68c1b5edd4db4eac31)

2 years agoFix a few typos in source code comments
Gordon Bergling [Sat, 14 Aug 2021 08:08:49 +0000 (10:08 +0200)]
Fix a few typos in source code comments

- s/procesing/processing/

(cherry picked from commit 288e553623d3f8ac33baaabc93a4f030689755d2)

2 years agoFix a common typo in a comment
Gordon Bergling [Sat, 14 Aug 2021 11:29:51 +0000 (13:29 +0200)]
Fix a common typo in a comment

- s/enrty/entry/

(cherry picked from commit 86b74b736818a0b025ef520f8a4f570f48741666)

2 years agoFix a common typo in source code comments
Gordon Bergling [Sat, 14 Aug 2021 12:17:48 +0000 (14:17 +0200)]
Fix a common typo in source code comments

- s/aligment/alignment/

(cherry picked from commit a1581cd73594bbbde638859c31226c2c21be1ab3)

2 years agopkgbase: Fix cherry-pick conflict
Emmanuel Vadot [Thu, 19 Aug 2021 07:09:39 +0000 (09:09 +0200)]
pkgbase: Fix cherry-pick conflict

17fe7de111dd was supposed to remove the option from src.opts.mk

2 years agopkgbase: Fix building out-of-tree manual pages
Jung-uk Kim [Tue, 16 Mar 2021 18:16:10 +0000 (14:16 -0400)]
pkgbase: Fix building out-of-tree manual pages

c7e6cb9e08d6 introduced MK_MANSPLITPKG but it was not available for
building out-of-tree manual pages.  For example, x11/nvidia-driver fails
with the following error:

===> doc (all)
make[3]: "/usr/share/mk/bsd.man.mk" line 53: Malformed conditional (${MK_MANSPLITPKG} == "no")
make[3]: Fatal errors encountered -- cannot continue

Move the definition from src.opts.mk to bsd.opts.mk to make it visible.

(cherry picked from commit 6827435548d257c672f934db5c6ff01012d96995)

2 years agoFix race between first rand(3) calls with _once().
Alexander Motin [Wed, 21 Jul 2021 15:25:46 +0000 (11:25 -0400)]
Fix race between first rand(3) calls with _once().

Before this patch there was a chance for thread that called rand(3)
slightly later to see rand3_state already allocated, but not yet
initialized.  While this API is not expected to be thread-safe, it
is not expected to crash.  ztest on 64-thread system reproduced it
reliably for me.

Submitted by: avg@
MFC after: 1 month

(cherry picked from commit 3a57f08b5042f15bb8ffb2fcce99d082d225d4cf)

2 years agoipfilter: remove doubled semicolons
Ed Maste [Mon, 16 Aug 2021 17:16:23 +0000 (13:16 -0400)]
ipfilter: remove doubled semicolons

Local commit; ipfilter upstream is inactive.

Discussed with: cy
MFC after: 3 days

2 years agofrag6: do less work in frag6_slowtimo if possible
Mateusz Guzik [Fri, 13 Aug 2021 11:32:03 +0000 (13:32 +0200)]
frag6: do less work in frag6_slowtimo if possible

frag6_slowtimo avoidably uses CPU on otherwise idle boxes

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

(cherry picked from commit 8afe9481cfa382337b8a885f358fe888bddf5982)

2 years agofrag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line
Mateusz Guzik [Fri, 13 Aug 2021 11:28:39 +0000 (13:28 +0200)]
frag6: drop the volatile keyword from frag6_nfrags and mark with __exclusive_cache_line

The keyword adds nothing as all operations on the var are performed
through atomic_*

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

(cherry picked from commit c17ae18080b4412435aa2fb91cd6e81dd6cd180b)

2 years agoip_reass: do less work in ipreass_slowtimo if possible
Mateusz Guzik [Fri, 13 Aug 2021 09:32:16 +0000 (11:32 +0200)]
ip_reass: do less work in ipreass_slowtimo if possible

ipreass_slowtimo avoidably uses CPU on otherwise idle boxes

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

(cherry picked from commit 3be3cbe06d6107486d67d8eb80480d34d084c39c)

2 years agoip_reass: drop the volatile keyword from nfrags and mark with __exclusive_cache_line
Mateusz Guzik [Fri, 13 Aug 2021 09:29:57 +0000 (11:29 +0200)]
ip_reass: drop the volatile keyword from nfrags and mark with __exclusive_cache_line

The keyword adds nothing as all operations on the var are performed
through atomic_*

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

(cherry picked from commit d2b95af1c27ed51d72bef5d9f3d89860edc4fd40)

2 years agoMark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now
Alex Richardson [Tue, 17 Aug 2021 16:44:40 +0000 (17:44 +0100)]
Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now

I enabled these options again in 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3,
but unfortunately only my specific build configuration worked whereas the
build with default options is still broken.

(cherry picked from commit d9f25575a29ff7c83f226349a10a37b9aaf75ad5)

2 years agoAdd missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap
Alex Richardson [Mon, 16 Aug 2021 08:56:17 +0000 (09:56 +0100)]
Add missing lex/yacc dependency for mkesdb/mkcsmapper bootstrap

This causes build failures on macOS where the build can end up invoking
an incompatible m4 binary.

Fxies: 2de949cf85d0 ("Remove mkcsmapper_static and mkesdb_static from build-tools")
(cherry picked from commit cc1345056b113d57f0c65b0ecf3e3d5da3f34276)

2 years agoar: remove invalid extra param in bsdar_warnc calls
Ed Maste [Wed, 11 Aug 2021 17:22:23 +0000 (13:22 -0400)]
ar: remove invalid extra param in bsdar_warnc calls

A number of warnings passed an exit status code to bsdar_warnc, but it
does not take exit status (as a warning, it does not exit).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 09319f7d3f8aefe8a6b37b1c2a6d842126a2c181)

2 years ago[multipath][nhops] Fix random crashes with high route churn rate.
Alexander V. Chernikov [Sun, 1 Aug 2021 09:46:05 +0000 (09:46 +0000)]
[multipath][nhops] Fix random crashes with high route churn rate.

When certain multipath route begins flapping really fast, it may
 result in creating multiple identical nexthop groups. The code
 responsible for unlinking unused nexthop groups had an implicit
 assumption that there could be only one nexthop group for the
 same combination of nexthops with weights. This assumption resulted
 in always unlinking the first "identical" group, instead of the
 desired one. Such action, in turn, produced a used-but-unlinked
 nhg along with freed-and-linked nhg, ending up in random crashes.

Similarly, it is possible that multiple identical nexthops gets
 created in the case of high route churn, resulting in the same
 problem when deleting one of such nexthops.

Fix by matching the nexthop/nexhop group pointer when deleting the item.

Reported by: avg
(cherry picked from commit 054948bd81bb9e4e32449cf351b62e501b8831ff)

2 years agobuild.7: Describe the default value for LOCAL_MODULES
Mark Johnston [Tue, 10 Aug 2021 17:34:57 +0000 (13:34 -0400)]
build.7: Describe the default value for LOCAL_MODULES

Suggested by: jhb

(cherry picked from commit 805c3af898a8fed6a92caa069011c0ce7fa542ef)

2 years agobuild.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR
Mark Johnston [Tue, 10 Aug 2021 15:42:35 +0000 (11:42 -0400)]
build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR

Reviewed by: 0mp, imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e7a13643b17c3ec7357b26324986587dab810da5)

2 years agoe1000: rctl/srrctl buffer size init, rfctl fix
Kevin Bowling [Tue, 10 Aug 2021 19:47:22 +0000 (12:47 -0700)]
e1000: rctl/srrctl buffer size init, rfctl fix

Simplify the setup of srrctl.BSIZEPKT on igb class NICs.
Improve the setup of rctl.BSIZE on lem and em class NICs.
Don't try to touch rfctl on lem class NICs.
Manipulate rctl.BSEX correctly on lem and em class NICs.

Approved by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31457

(cherry picked from commit 12e8addd320df995bfb2b00f51c233541f741ae4)

2 years agoe1000: fix build after b761f264926a (orig c1655b0f)
Marius Strobl [Wed, 27 Jan 2021 14:28:25 +0000 (15:28 +0100)]
e1000: fix build after b761f264926a (orig c1655b0f)

(cherry picked from commit c262e8e87e7b59b768c717c1779ef1ba28507f44)

2 years agoe1000: consistently use the hw variables
Marius Strobl [Sat, 23 Jan 2021 18:18:28 +0000 (19:18 +0100)]
e1000: consistently use the hw variables

It's rather confusing when adapter->hw and hw are mixed and matched
within a particular function.
Some of this was missed in cd1cf2fc1d49c509ded05dcd41b7600a5957fb9a
and r353778 respectively.

(cherry picked from commit c1655b0f8998f9e842a004f33e7c9c01c5d9e879)

2 years agopkgbase: Add nfsiod to the FreeBSD-nfs package
Emmanuel Vadot [Thu, 5 Aug 2021 16:17:34 +0000 (18:17 +0200)]
pkgbase: Add nfsiod to the FreeBSD-nfs package

Missed in 081fb644925f

(cherry picked from commit e06b8f11280397d7fdaa27d8d6f8eec9e4c707b3)

2 years agopkgbase: make only vital packages vital, not their sub-packages
Mina Igalic [Sun, 28 Mar 2021 10:16:45 +0000 (12:16 +0200)]
pkgbase: make only vital packages vital, not their sub-packages

make "vital" a replaceable, which defaults to "false" and only set it for
the main clib, utilities and runtime packages, not their sub-packages

PR: 254174
Differential Revision: https://reviews.freebsd.org/D29224

(cherry picked from commit 1c1ff7979571bf07c05a48e857b7b285b037410f)

2 years agopkgbase: Add an src.conf option for splitting man pages
Emmanuel Vadot [Tue, 16 Mar 2021 06:11:56 +0000 (07:11 +0100)]
pkgbase: Add an src.conf option for splitting man pages

Man pages can be big in total, add an options to split man pages
in -man packages so we produce smaller packages.
This is useful for small jails or mfsroot produced of pkgbase.
The option is off by default.

Reviewed by: bapt, Mina Galić <me@igalic.co>
Differential Revision: https://reviews.freebsd.org/D29169
MFC after:      2 weeks

(cherry picked from commit c7e6cb9e08d6b51e677a9f5546b8e36d678687d0)

2 years agoarm64: Only check for freebsd,dts-version if we are booted in FDT mode.
Emmanuel Vadot [Tue, 23 Mar 2021 15:37:25 +0000 (16:37 +0100)]
arm64: Only check for freebsd,dts-version if we are booted in FDT mode.

Reported by:   andrew

(cherry picked from commit 6bcba8dac9a4ddaeabf84ad8d31b1113a9dcf8c2)

2 years agoarm64: Check dtb version against the one we're expecting to find
Emmanuel Vadot [Tue, 23 Mar 2021 14:24:14 +0000 (15:24 +0100)]
arm64: Check dtb version against the one we're expecting to find

Do for arm64 what was done for armv7 in e63faa9ba832b6

(cherry picked from commit 63f344024a0d336b116f3563a1604fbd9b4253c7)

2 years agovfs: Avoid a comparison with an uninitialized field in setutimes()
Mark Johnston [Mon, 9 Aug 2021 17:27:20 +0000 (13:27 -0400)]
vfs: Avoid a comparison with an uninitialized field in setutimes()

Some filesystems, e.g., devfs, do not populate va_birthtime in their
GETATTR implementations.  To handle this, make sure that va_birthtime is
initialized to the quasi-standard value of { VNOVAL, 0 } before calling
VOP_GETATTR.

Reported by: KMSAN
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit eca9ac5a32e432313b1c7f52f43dd11504fceef4)

2 years agoin6: Enter the net epoch in in6_tmpaddrtimer()
Mark Johnston [Mon, 9 Aug 2021 17:14:23 +0000 (13:14 -0400)]
in6: Enter the net epoch in in6_tmpaddrtimer()

We need to do so to safely traverse the ifnet list.

Reviewed by: bz
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8ee0826f75136f6ac6443f32c582882bc31abd73)

2 years agoamd64: Fix output operand specs for the stmxcsr and vmread intrinsics
Mark Johnston [Mon, 9 Aug 2021 17:28:08 +0000 (13:28 -0400)]
amd64: Fix output operand specs for the stmxcsr and vmread intrinsics

This does not appear to affect code generation, at least with the
default toolchain.

Noticed because incorrect output specifications lead to false positives
from KMSAN, as the instrumentation uses them to update shadow state for
output operands.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e54ae8258d6433ad2f2411dbeaa1fde6b817d5ef)

2 years agovmm: Make iommu ops tables const
Mark Johnston [Mon, 9 Aug 2021 17:28:27 +0000 (13:28 -0400)]
vmm: Make iommu ops tables const

While here, use designated initializers and rename some AMD iommu method
implementations to match the corresponding op names.  No functional
change intended.

Reviewed by: grehan
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 41335c6b7f636f9ca59d0afba5728cf90020d6b1)

2 years agond6: Mark several callouts as MPSAFE
Mark Johnston [Mon, 9 Aug 2021 17:21:43 +0000 (13:21 -0400)]
nd6: Mark several callouts as MPSAFE

The use of Giant here is vestigal and does not provide any useful
synchronization.  Furthermore, non-MPSAFE callouts can cause the
softclock threads to block waiting for long-running newbus operations to
complete.

Reported by: mav
Reviewed by: bz
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 663428ea17e3a81f4c514d2571b90a13c065b1e8)

2 years agonfs_write(): do not call ncl_pager_setsize() after clearing TDP2_SBPAGES
Konstantin Belousov [Sat, 23 Jan 2021 21:40:07 +0000 (23:40 +0200)]
nfs_write(): do not call ncl_pager_setsize() after clearing TDP2_SBPAGES

(cherry picked from commit bd01a69f4836994b50b492883fb5367db41fb506)

2 years agonfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write
Konstantin Belousov [Fri, 22 Jan 2021 21:47:06 +0000 (23:47 +0200)]
nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write

(cherry picked from commit aa8c1f8d84d2638a354e71f9593e978d00878243)

2 years agobhyve.8: Fix mandoc -Tlint issues
Mateusz Piotrowski [Sun, 18 Apr 2021 23:53:06 +0000 (01:53 +0200)]
bhyve.8: Fix mandoc -Tlint issues

While here, keep network backends section consistent with other
sections.

MFC after: 2 weeks

(cherry picked from commit 8d9fefe64334818a27812658bf9efd0371fbc77c)

2 years agobhyve: Document the format for HD audio backends
Mateusz Piotrowski [Sun, 18 Apr 2021 23:50:29 +0000 (01:50 +0200)]
bhyve: Document the format for HD audio backends

- This change is done for consistency with other backend definitions.

MFC after: 2 weeks

(cherry picked from commit 061f37d280976e0f79f823c732fa80825ce48ded)

2 years agobhyve.8: Improve AHCI backends documentation
Mateusz Piotrowski [Sun, 18 Apr 2021 23:44:23 +0000 (01:44 +0200)]
bhyve.8: Improve AHCI backends documentation

- Document the backend format.

MFC after: 2 weeks

(cherry picked from commit d5fcc4b6066e878ed70bce7a52d6aca605befde5)

2 years agobhyve.8: Improve documentation of NVME backend
Mateusz Piotrowski [Sun, 18 Apr 2021 23:16:51 +0000 (01:16 +0200)]
bhyve.8: Improve documentation of NVME backend

- Document the configuration format.
- Document two additional configuration options: eui64 and dsm.

MFC after: 2 weeks

(cherry picked from commit 6eff58acc776d8308863f49b89664997d4642a4e)

2 years agobhyve.8: Improve framebuffer backends description
Mateusz Piotrowski [Sun, 18 Apr 2021 22:59:44 +0000 (00:59 +0200)]
bhyve.8: Improve framebuffer backends description

- Use appropriate mdoc macros
- Document that tcp= is a synonym to rfb= (tcp is used in the examples,
  but never mentioned)
- Clarify the IP address specification

MFC after: 2 weeks

(cherry picked from commit 8b97e97548bdc74cf3b4939a0b21cfdd27d8c11c)

2 years agobhyve.8: Clean up virtio console device backends description
Mateusz Piotrowski [Sun, 18 Apr 2021 22:23:26 +0000 (00:23 +0200)]
bhyve.8: Clean up virtio console device backends description

MFC after: 2 weeks

(cherry picked from commit 3f4c771f64e816750de08ab6fd7e7bf29398f5fb)

2 years agobhyve.8: Clean up TTY, boot ROM, and pass-through descriptions
Mateusz Piotrowski [Sun, 18 Apr 2021 22:09:22 +0000 (00:09 +0200)]
bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions

MFC after: 2 weeks

(cherry picked from commit 2fda01a1b7e958e6cfffda512954b8d6c40a064e)

2 years agobhyve.8: Clean up 9P device backends section
Mateusz Piotrowski [Sun, 18 Apr 2021 21:52:48 +0000 (23:52 +0200)]
bhyve.8: Clean up 9P device backends section

MFC after: 2 weeks

(cherry picked from commit 2d00b57022f09561706afef9050e0b527c41314a)

2 years agobhyve.8: Clean up SCSI device backends section
Mateusz Piotrowski [Sun, 18 Apr 2021 21:49:18 +0000 (23:49 +0200)]
bhyve.8: Clean up SCSI device backends section

MFC after: 2 weeks

(cherry picked from commit 7c5829c942822561688c9b8239900773c6d82db4)

2 years agobhyve.8: Clean up block storage device backends description
Mateusz Piotrowski [Sun, 18 Apr 2021 21:39:53 +0000 (23:39 +0200)]
bhyve.8: Clean up block storage device backends description

MFC after: 2 weeks

(cherry picked from commit 5232a35f1ed7b8fa4f378897598438c2056ef60e)

2 years agobhyve.8: Clean up network backends section
Mateusz Piotrowski [Sun, 18 Apr 2021 21:29:30 +0000 (23:29 +0200)]
bhyve.8: Clean up network backends section

- Reformat the format lists, use appropriate mdoc macros for
  readability.
- Add a missing Oxford comma.

MFC after: 2 weeks

(cherry picked from commit 7fb22729816ef6c9e65e5c544047e669edd2f06d)

2 years agobhyve.8: Improve emulation description of the -s flag
Mateusz Piotrowski [Sun, 18 Apr 2021 21:08:39 +0000 (23:08 +0200)]
bhyve.8: Improve emulation description of the -s flag

- Set width of the list to the longest key word for readability.
- Separate descriptions of amd_hostbridge and hostbridge emulations.
  Also, wordsmith their descriptions for consistency with other entries.
- Use Cm instead of Li for command modifiers.
- Do not stylize AMD with Li, there's no need to do it.
- Mention COM3 and COM4 in the definition of lpc.
- Fix a typo in the definition of ahci-hd ("hard drive" instead of
  "hard-drive").

MFC after: 2 weeks

(cherry picked from commit 7014cb2393594ee4a8389c65d507afacf729c041)

2 years agobhyve.8: Clean up the slot description of -s
Mateusz Piotrowski [Sun, 18 Apr 2021 20:56:19 +0000 (22:56 +0200)]
bhyve.8: Clean up the slot description of -s

Also, remove the macros of the nested list which contained slot,
emulation and conf. This decreases the indention of the -s description.
It was necessary to clean up the slot description.

MFC after: 2 weeks

(cherry picked from commit 234d8c470b44160fe0cbce49b972b3b19f246a89)

2 years agobhyve.8: Clean-up synopsis of -s
Mateusz Piotrowski [Sun, 18 Apr 2021 20:28:47 +0000 (22:28 +0200)]
bhyve.8: Clean-up synopsis of -s

- Document "-s help" separately for readability.
- Use appropriate mdoc macros.

MFC after: 2 weeks

(cherry picked from commit 449f0e48e902ed36ec0de31279eefad9e6200cdc)

2 years agobhyve.8: Fix indention in the signals table
Mateusz Piotrowski [Sun, 18 Apr 2021 20:06:12 +0000 (22:06 +0200)]
bhyve.8: Fix indention in the signals table

MFC after: 2 weeks

(cherry picked from commit 3357e9482fe8a0ee153ec62d4bd8cb96966bbf26)

2 years agobhyve.8: Clean up description of -r
Mateusz Piotrowski [Sun, 18 Apr 2021 20:03:40 +0000 (22:03 +0200)]
bhyve.8: Clean up description of -r

There is no need to wrap those flags in Op macros.

MFC after: 2 weeks

(cherry picked from commit b24eea8c7a2ff2bf19b1bdbb2838d185e578581a)

2 years agobhyve.8: Fix the synopsis of -p
Mateusz Piotrowski [Sun, 18 Apr 2021 20:01:30 +0000 (22:01 +0200)]
bhyve.8: Fix the synopsis of -p

Use appropriate mdoc macros.

MFC after: 2 weeks

(cherry picked from commit 90df54374f1ce1b94c10c34c2a5b06be0353ebae)

2 years agobhyve.8: Improve the description of the -m flag
Mateusz Piotrowski [Sun, 18 Apr 2021 19:56:13 +0000 (21:56 +0200)]
bhyve.8: Improve the description of the -m flag

- Stylize the synopsis with proper mdoc macros
- Do some wordsmithing on the description for consistency.

MFC after: 2 weeks

(cherry picked from commit 7e0cb3df687695212ae20cc90d5f2f48bd42eba7)

2 years agobhyve.8: Improve the description and synopsis of -l
Mateusz Piotrowski [Sun, 18 Apr 2021 19:41:15 +0000 (21:41 +0200)]
bhyve.8: Improve the description and synopsis of -l

- Describe "-l help" separately for readability.
- List all the supported comX devices explicitly
- Use Cm instead of Ar for command modifiers (i.e., literal values a
  user can specify as an argument to the command).
- Explain where to get more information about the possible values of the
  conf argument.

MFC after: 2 weeks

(cherry picked from commit 4c08b978b276f8cfc25f72715e97898f629f7f89)

2 years agobhyve.8: Sort the options in the OPTIONS section
Mateusz Piotrowski [Sun, 18 Apr 2021 18:26:04 +0000 (20:26 +0200)]
bhyve.8: Sort the options in the OPTIONS section

No content change intended. Just moving the option descriptions around
to follow the order suggested by style(9).

MFC after: 2 weeks

(cherry picked from commit ccb1c87a6aa563a927a98a6f9175d95929535b21)

2 years agobhyve: Improve the option description in the usage message
Mateusz Piotrowski [Sun, 18 Apr 2021 18:13:54 +0000 (20:13 +0200)]
bhyve: Improve the option description in the usage message

- Sort options as suggested by style(9)
- Capitalize some words like CPU and HLT
- Add a missing description for the -G flag

MFC after: 2 weeks

(cherry picked from commit b6a572d03f654236b929b91d376ad1a6dfaa2e9a)

2 years agobhyve: Fix synopsis in the usage message
Mateusz Piotrowski [Sun, 18 Apr 2021 18:04:12 +0000 (20:04 +0200)]
bhyve: Fix synopsis in the usage message

In particular:
- Sort short options to align with style(9)
- Add two missing flags: -G and -r
- Drop unnecessary angle brackets for consistency
- Rename the "vm" argument to vmname for consistency with the manual
  page

MFC after: 2 weeks

(cherry picked from commit 03c3e5e40d6497afa33df1d0b43857157c086729)

2 years agobhyve.8: Make synopsis more readable
Mateusz Piotrowski [Sun, 18 Apr 2021 17:54:45 +0000 (19:54 +0200)]
bhyve.8: Make synopsis more readable

There is no need to squeeze all the possible options into one synopsis
entry. Let "-l help" and "-s help" be listed separately.

While here, keep -s and its arguments on the same line.

MFC after: 2 weeks

(cherry picked from commit bfe40b692d087cdd5fdeea69e18496ab2a7f67ac)

2 years agoipfw(8): Fix a typo in an error message
Gordon Bergling [Wed, 11 Aug 2021 07:53:01 +0000 (09:53 +0200)]
ipfw(8): Fix a typo in an error message

- s/suport/support/

(cherry picked from commit 809ad8170aa97e570ef5e1e414b4c25e4b58044c)

2 years agoiscontrol(8): Fix a typo in a struct
Gordon Bergling [Wed, 11 Aug 2021 07:55:08 +0000 (09:55 +0200)]
iscontrol(8): Fix a typo in a struct

- s/suport/support/

(cherry picked from commit 1e1fbf3b47d7296896593b1e477141263b0c555f)

2 years agoe1000: Fix lem/em UDP rx csum offload
Kevin Bowling [Mon, 9 Aug 2021 21:29:31 +0000 (14:29 -0700)]
e1000: Fix lem/em UDP rx csum offload

Rebase on igb code and unify lem/em implementations.

PR: 257642
Reported by: Nick Reilly <nreilly@blackberry.com>
Reviewed by: karels, emaste
Tested by: Nick Reilly <nreilly@blackberry.com>
Approved by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31449

(cherry picked from commit 015075f383489fcbedbe8aae7c1c64a3d55ca75e)

2 years agopsm(4): Probe Synaptics touchpad with active multiplexing mode enabled
Vladimir Kondratyev [Wed, 14 Jul 2021 10:30:26 +0000 (13:30 +0300)]
psm(4): Probe Synaptics touchpad with active multiplexing mode enabled

if it is only multiplexed device. Also enable syncbit checks for them.
This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop.

Reported by: Tomasz "CeDeROM" CEDRO <tomek_AT_cedro_DOT_info>
PR: 253279
Differential revision: https://reviews.freebsd.org/D28502

(cherry picked from commit f5998d20ed80fdc1cb3ba0c245cae5f179e22fe2)

2 years agoiichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts
Vladimir Kondratyev [Fri, 9 Jul 2021 19:32:59 +0000 (22:32 +0300)]
iichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts

during suspend/resume cycle. Previously used bus_generic_suspend_intr and
bus_generic_resume_intr may cause interrupt storm because of missed
interrupt acknowledges caused by blocking of intr handler.

Reported by: J.R. Oldroyd <jr_AT_opal_DOT_com>

(cherry picked from commit 82626fef6253a9172163df137097f54e93e3c209)

2 years agoiichid(4): disable interrupt on suspend
J.R. Oldroyd [Mon, 31 May 2021 19:33:07 +0000 (22:33 +0300)]
iichid(4): disable interrupt on suspend

Commit message of the identical change in Linux driver says:
"When an I2C HID device is powered off during system sleep, as a result
of removing its power resources (by the ACPI core) the interrupt line
might go low as well.  This results inadvertent interrupts."

This change fixes suspend/resume on Asus S510UQ laptops.

While here add a couple of typo fixes as well as a slight change to the
iichid_attach() code to have the power_on flag set properly.

Submitted by: J.R. Oldroyd <jr_AT_opal_DOT_com>
Reviewed by: wulf

(cherry picked from commit 5236888db77194c194706b122675af7355fe7ceb)

2 years agonfscl: Set correct lockowner for "oneopenown" mount option
Rick Macklem [Wed, 28 Jul 2021 22:23:05 +0000 (15:23 -0700)]
nfscl: Set correct lockowner for "oneopenown" mount option

For NFSv4.1/4.2, the client may use either an open, lock or
delegation stateid as the stateid argument for an I/O operation.
RFC 5661 defines an order of preference of delegation, then lock
and finally open stateid for the argument, although NFSv4.1/4.2
servers are expected to handle any stateid type.

For the "oneopenown" mount option, the lock owner was not being
correctly generated and, as such, the I/O operation would use an
open stateid, even when a lock stateid existed.  Although this
did not and should not affect an NFSv4.1/4.2 server's behaviour,
this patch makes the behaviour for "oneopenown" the same as when
the mount option is not specified.

Found during inspection of packet captures.  No failure during
testing against NFSv4.1/4.2 servers of the unpatched code occurred.

(cherry picked from commit 54ff3b3986741b9cd06ce20b90c96711cbe146d0)

2 years agonfscl: Cache an open stateid for the "oneopenown" mount option
Rick Macklem [Wed, 28 Jul 2021 22:48:27 +0000 (15:48 -0700)]
nfscl: Cache an open stateid for the "oneopenown" mount option

For NFSv4.1/4.2, if the "oneopenown" mount option is used,
there is, at most, only one open stateid for each NFS vnode.
When an open stateid for a file is acquired, set a pointer to
the open structure in the NFS vnode.  This pointer can be used to
acquire the open stateid without searching the open linked list
when the following is true:
- No delegations have been issued for the file.  Since delegations
  can outlive an NFS vnode for a file, use the global
  NFSMNTP_DELEGISSUED flag on the mount to determine this.
- No lock stateid has been issued for the file.  To determine
  this, a new NFS vnode flag called NMIGHTBELOCKED is set when a lock
  stateid is issued, which can then be tested.

When this open structure pointer can be used, it avoids the need to
acquire the NFSCLSTATELOCK() and searching the open structure list for
an open.  The NFSCLSTATELOCK() can be highly contended when there are
a lot of opens issued for the NFSv4.1/4.2 mount.

This patch only affects NFSv4.1/4.2 mounts when the "oneopenown"
mount option is used.

(cherry picked from commit efea1bc1fd93831c29fa7594d67094e0c125fb88)

2 years agogetprogname.3: Add an example
Mateusz Piotrowski [Sat, 17 Apr 2021 21:26:54 +0000 (23:26 +0200)]
getprogname.3: Add an example

It shows the difference between getprogname() and argv[0].

Reviewed by: yuripv
Approved by: yuripv (src)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27204

(cherry picked from commit 1ffdcdadf61423dd02ddad82fc4f3f6c39090c8c)

2 years agoports.7: Document DEBUG_FLAGS and the process of debugging ports
Mateusz Piotrowski [Sat, 17 Apr 2021 20:51:54 +0000 (22:51 +0200)]
ports.7: Document DEBUG_FLAGS and the process of debugging ports

Loosely based on https://wiki.freebsd.org/BenWoods/DebuggingPorts.

Reviewed by: crees
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27296

(cherry picked from commit d25f7d324a9d0c33655876b920ba590918d16f4c)

2 years agogrep: Fix an incorrect description of the -C flag
Mateusz Piotrowski [Fri, 5 Feb 2021 18:38:09 +0000 (19:38 +0100)]
grep: Fix an incorrect description of the -C flag

It seems that the number of lines is no longer an optional parameter to
the -C flag. Document it accordingly both in the manual page and the
usage message.

Reviewed by: yuripv
Approved by: yuripv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28509

(cherry picked from commit be6b8b7a3a18acb3b044e144d946392fca05e5d0)

2 years agoigc: sync igc_txrx with igb(4)
Kevin Bowling [Sat, 31 Jul 2021 15:00:16 +0000 (08:00 -0700)]
igc: sync igc_txrx with igb(4)

Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31227

(cherry picked from commit d02e436353d292e6fd50f70ea80507095543764e)

2 years agoMFC 517904de5cca: igc(4): Introduce new driver for the Intel I225 Ethernet controller.
Peter Grehan [Mon, 12 Jul 2021 04:50:15 +0000 (14:50 +1000)]
MFC 517904de5cca: igc(4): Introduce new driver for the Intel I225 Ethernet controller.

This controller supports 2.5G/1G/100MB/10MB speeds, and allows
tx/rx checksum offload, TSO, LRO, and multi-queue operation.

The driver was derived from code contributed by Intel, and modified
by Netgate to fit into the iflib framework.

Thanks to Mike Karels for testing and feedback on the driver.

Reviewed by: bcr (manpages), kbowling, scottl, erj
Relnotes: yes
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30668

(cherry picked from commit 517904de5ccac643589c71ac0d2751797f89e4f9)

2 years agohms(4): Fix a typo in sysctl description
Gordon Bergling [Thu, 12 Aug 2021 13:37:47 +0000 (15:37 +0200)]
hms(4): Fix a typo in sysctl description

- s/threshhold/threshold/

(cherry picked from commit 4b4850aefe3ff9d9c29c7ed8bd8907bbd6142e86)

2 years agoAdd ElfW() macro for compatibility with Linux
Dimitry Andric [Thu, 5 Aug 2021 18:57:22 +0000 (20:57 +0200)]
Add ElfW() macro for compatibility with Linux

Some Linux software using ELF headers assumes the existence of an
ElfW(type) macro, which concatenates 'Elf', the default ELF word size,
and the given type. This is identical to our __ElfN(x) macro in
<sys/elf_generic.h>. Add the macro for compatibility, with a comment
that we prefer the __ElfN() macro for FreeBSD.

Reviewed by: emaste, kib
Differential Revision: https://reviews.freebsd.org/D31427
MFC after: 1 week

(cherry picked from commit 34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9)

2 years agoApply upstream lld fix for compressed input sections on BE targets
Dimitry Andric [Sat, 7 Aug 2021 11:14:11 +0000 (13:14 +0200)]
Apply upstream lld fix for compressed input sections on BE targets

Merge commit c6ebc651b6fa from llvm git (by Simon Atanasyan):

  [LLD] Support compressed input sections on big-endian targets

  This patch enables compressed input sections on big-endian targets by
  checking the target endianness and selecting an appropriate `Chdr`
  structure.

  Fixes PR51369

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

Reported by: emaste

(cherry picked from commit d69d07569ee2404705ff4c4abb45dc0b884eeb35)

Follow-up to d69d07569ee2 by bumping lld local version

This makes it easier to detect that lld's support for compressed input
sections on BE targets is fixed.

(cherry picked from commit cd38d9cf26db9264f709c52469f0f4e9684d62bb)

2 years agonull_vput_pair(): release use reference on dvp earlier
Konstantin Belousov [Sun, 7 Mar 2021 21:08:38 +0000 (23:08 +0200)]
null_vput_pair(): release use reference on dvp earlier

(cherry picked from commit 16dea8341024b8ee8be619c27d4e63bd81bd9b6c)

2 years agovlrureclaim: only skip vnode with resident pages if it own the pages
Konstantin Belousov [Sat, 6 Mar 2021 21:09:16 +0000 (23:09 +0200)]
vlrureclaim: only skip vnode with resident pages if it own the pages

(cherry picked from commit 44691b33cc99d0e17262368b6e0f64e531994a23)

2 years agosoftdep_unmount: assert that no dandling dependencies are left
Konstantin Belousov [Sat, 6 Mar 2021 09:52:10 +0000 (11:52 +0200)]
softdep_unmount: assert that no dandling dependencies are left

(cherry picked from commit 0b3948e73b749b0fefc3f9d4fc61f356542bb9b9)

2 years agoFFS: assign fully initialized struct mount_softdeps to um_softdep
Konstantin Belousov [Wed, 3 Mar 2021 22:02:30 +0000 (00:02 +0200)]
FFS: assign fully initialized struct mount_softdeps to um_softdep

(cherry picked from commit 7a8d4b4da69af966bff4892acb2fd101a95a4848)

2 years agoAssert that um_softdep is NULL on free(ump), i.e. softdep_unmount() was called
Konstantin Belousov [Wed, 3 Mar 2021 19:40:34 +0000 (21:40 +0200)]
Assert that um_softdep is NULL on free(ump), i.e. softdep_unmount() was called

(cherry picked from commit 2af934cc15bd8e7daa2daeb806321d0daddf3b7a)

2 years agoffs_mount: when remounting ro->rw and sbupdate failed, cleanup softdeps
Konstantin Belousov [Wed, 3 Mar 2021 18:02:13 +0000 (20:02 +0200)]
ffs_mount: when remounting ro->rw and sbupdate failed, cleanup softdeps

(cherry picked from commit f776c54cee81b4297b59ffe87a0f154e3924ee7f)