]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolinux: Improve debugging by recognizing TIOCGPTPEER
Edward Tomasz Napierala [Thu, 29 Apr 2021 20:26:46 +0000 (21:26 +0100)]
linux: Improve debugging by recognizing TIOCGPTPEER

Sponsored By: EPSRC

2 years agoscript(1): work around slow reading child
Konstantin Belousov [Sat, 8 Jan 2022 13:19:14 +0000 (15:19 +0200)]
script(1): work around slow reading child

If child is slow reading from its input, or even completely stops doing
the read, script(1) hangs in write(2) to the pts master waiting until
there is a space in the terminal discipline buffer.  This also stops
handling any outer io, as well as child output.

Work around the problem by making pts master fd non-blocking, and be
prepared for short writes to it.  The data to be written to master is
buffered in the tailq which is processed when select(2) detects that
master is ready for write.

PR: 260938
Reported by: наб <nabijaczleweli@nabijaczleweli.xyz>
See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003095
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33789

2 years agogpart(8): add minimal reference to glabel(8) to manual page
Eugene Grosbein [Mon, 10 Jan 2022 15:00:30 +0000 (22:00 +0700)]
gpart(8): add minimal reference to glabel(8) to manual page

MFC after: 1 week

2 years agoRevert "iflib: Relax timer period from 0.5 to 0.5-0.75s."
Alexander Motin [Mon, 10 Jan 2022 14:35:01 +0000 (09:35 -0500)]
Revert "iflib: Relax timer period from 0.5 to 0.5-0.75s."

I've noticed relations between iflib_timer() vs ixl_admin_timer().
Both scheduled at the same 2Hz rate, but the second is rescheduling
the first each time, so if the first get any slower, it won't be
executed at all.  Revert this until deeper investigation.

This reverts commit 90bc1cf65778aafb1f226c8fe08218cfed5e40b2.

2 years agohwpmc: Fix amd/arm64/armv7/uncore sampling overflow race
Jessica Clarke [Mon, 10 Jan 2022 14:30:05 +0000 (14:30 +0000)]
hwpmc: Fix amd/arm64/armv7/uncore sampling overflow race

If a counter more than overflows just as we read it on switch out then,
if using sampling mode, we will negate this small value to give a huge
reload count, and if we later switch back in that context we will
validate that value against pm_reloadcount and panic an INVARIANTS
kernel with:

  panic: [pmc,1470] pmcval outside of expected range cpu=2 ri=16 pmcval=fffff292 pm_reloadcount=10000

or similar. Presumably in a non-INVARIANTS kernel we will instead just
use the provided value as the reload count, which would lead to the
overflow not happing for a very long time (e.g. 78 minutes for a 48-bit
counter incrementing at an averate rate of 1GHz).

Instead, clamp the reload count to 0 (which corresponds precisely to the
value we would compute if it had just overflowed and no more), which
will result in hwpmc using the full original reload count again. This is
the approach used by core for Intel (for both fixed and programmable
counters).

As part of this, armv7 and arm64 are made conceptually simpler; rather
than skipping modifying the overflow count for sampling mode counters so
it's always kept as ~0, those special cases are removed so it's always
applicable and the concatentation of it and the hardware counter can
always be viewed as a 64-bit counter, which also makes them look more
like other architectures.

Whilst here, fix an instance of UB (shifting a 1 into the sign bit) for
amd in its sign-extension code.

Reviewed by: andrew, mhorne, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33654

2 years agoFix a typo in an arm64 comment
Andrew Turner [Mon, 10 Jan 2022 13:55:22 +0000 (13:55 +0000)]
Fix a typo in an arm64 comment

This was pointed out by markj in the review, but I missed it and forgot
to fix before pushing.

Reported by: markj
Sponsored by: The FreeBSD Foundation

2 years agoMana: report OS info to PF driver
Wei Hu [Fri, 7 Jan 2022 13:12:31 +0000 (05:12 -0800)]
Mana: report OS info to PF driver

The PF driver might use the OS info for statistical purposes.

MFC after: 2 weeks
Sponsored by: Microsoft

2 years agoMove instructions into the arm64 exception vectors
Andrew Turner [Wed, 5 Jan 2022 15:12:01 +0000 (15:12 +0000)]
Move instructions into the arm64 exception vectors

We have 32 instructions in each exception vector on arm64. Previously
only one was used to branch to the handler function. We can split the
start of these functions and move some of the instructions into the
vectors.

Reviewed by: kib, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33751

2 years agovm_addr_ok: add power2 invariant check
Doug Moore [Mon, 10 Jan 2022 07:17:25 +0000 (01:17 -0600)]
vm_addr_ok: add power2 invariant check

With INVARIANTS defined, have vm_addr_align_ok and vm_addr_bound_ok
panic when passed an alignment/boundary parameter that is not a power
of two.

Reviewed by: alc
Suggested by: kib, se
Differential Revision: https://reviews.freebsd.org/D33725

2 years agoiflib: Relax timer period from 0.5 to 0.5-0.75s.
Alexander Motin [Mon, 10 Jan 2022 01:32:50 +0000 (20:32 -0500)]
iflib: Relax timer period from 0.5 to 0.5-0.75s.

While there switch it from hardclock ticks to milliseconds.

MFC after: 2 weeks

2 years agoReduce minimum idle hardclock rate from 2Hz to 1Hz.
Alexander Motin [Mon, 10 Jan 2022 00:17:43 +0000 (19:17 -0500)]
Reduce minimum idle hardclock rate from 2Hz to 1Hz.

On idle 80-thread system it allows to improve package-level idle state
residency and so power consumption by several percent.

MFC after: 2 weeks

2 years agoAvoid unnecessary setting of UFS flag requesting fsck(8) be run.
Kirk McKusick [Mon, 10 Jan 2022 00:17:13 +0000 (16:17 -0800)]
Avoid unnecessary setting of UFS flag requesting fsck(8) be run.

When the kernel is requested to mount a filesystem with a bad superblock
check hash, it would set the flag in the superblock requesting that the
fsck(8) program be run. The flag is only written to disk as part of a
superblock update. Since the superblock always has its check hash updated
when it is written to disk, the problem for which the flag has been set
will no longer exist. Hence, it is counter-productive to set the flag
as it will just cause an unnecessary run of fsck if it ever gets written.

Sponsored by: Netflix

2 years agotws: fix "set but not used" in the tws driver
Robert Wing [Sun, 9 Jan 2022 23:28:08 +0000 (14:28 -0900)]
tws: fix "set but not used" in the tws driver

With __diagused, these warnings were still emitted since INVARIANTS was
defined but TWS_DEBUG was not.

Fixes: a21f086a3316 ("Fix "set but not used" in the tws driver")
Differential Revision: https://reviews.freebsd.org/D33784

2 years agonfsd: Reduce callouts rate.
Alexander Motin [Sun, 9 Jan 2022 18:09:29 +0000 (13:09 -0500)]
nfsd: Reduce callouts rate.

Before this callouts were scheduled twice a seconds even if nfsd was
never used.  This reduces the rate to ~1Hz and only after nfsd first
started.

MFC after: 2 weeks

2 years agoLinuxKPI: 802.11 update compat code for driver updates
Bjoern A. Zeeb [Sun, 9 Jan 2022 18:08:47 +0000 (18:08 +0000)]
LinuxKPI: 802.11 update compat code for driver updates

Add more (dummy in case of HE) defines, structs, functions and another
mac80211 function pointer needed to update and support recent drivers.

MFC after: 3 days

2 years agodevd: correct wifi regexp
Warner Losh [Sun, 9 Jan 2022 17:16:31 +0000 (10:16 -0700)]
devd: correct wifi regexp

Correct the wifi regexp to include iwlwifi and remove wi driver that was
has been retired.

Sponsored by: Netflix

2 years agodevd: remove the scsi regexp
Warner Losh [Sun, 9 Jan 2022 17:13:58 +0000 (10:13 -0700)]
devd: remove the scsi regexp

We don't really use the scsi regexp for anything. The rescan was a
workaround that was fixed a long time ago and has been disabled for
ages. And the regexp was incomplete.

Sponsored by: Netflix

2 years agocam: Include more statuses as errors for CAM_IO_STATS
Warner Losh [Sun, 9 Jan 2022 17:13:05 +0000 (10:13 -0700)]
cam: Include more statuses as errors for CAM_IO_STATS

Tag more status return values as an error for the
I/O. CAM_SCSI_STATUS_ERROR is returned for medium errors, for example,
but the counts weren't increased. The added errors all indicate a
problem with the device request.

Sponsored by: Netflix
PR: 260257
Feedback from: ken
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D33783

2 years agoLinuxKPI: bitfields add more *replace_bits()
Bjoern A. Zeeb [Sun, 9 Jan 2022 01:12:05 +0000 (01:12 +0000)]
LinuxKPI: bitfields add more *replace_bits()

Add or extend the already existing *_replace_bits() implementations
using macros as we do for the other parts in the file for
le<n>p_replace_bits(), u<n>p_replace_bits(), and _u<n>_replace_bits().

MFC after: 3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D33799

2 years agoLinuxKPI: add hex2bin()
Bjoern A. Zeeb [Sun, 9 Jan 2022 01:09:17 +0000 (01:09 +0000)]
LinuxKPI: add hex2bin()

Add a hex2bin() implementation needed by a driver's debugfs code.

MFC after: 3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D33798

2 years agolinux: More man page tweaks
Edward Tomasz Napierala [Sun, 9 Jan 2022 10:03:44 +0000 (10:03 +0000)]
linux: More man page tweaks

Mention debootstrap(8) and improve the wording.

Reviewed By: debdrup, emaste, Pau Amma
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D33772

2 years agolibc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper
Konstantin Belousov [Sun, 9 Jan 2022 05:09:22 +0000 (07:09 +0200)]
libc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper

Otherwise on mapper failure we goto error handler which expect
rpscoc_lock owned, but we do not.

PR: 261051
Reported by: RyanCai <ryancaicse@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agoLinuxKPI / iwlwifi: fix spelling of constants
Bjoern A. Zeeb [Sun, 9 Jan 2022 02:21:05 +0000 (02:21 +0000)]
LinuxKPI / iwlwifi: fix spelling of constants

Fix the spelling of IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_*
(was "NOMIMAL").  The original version came from iwlwifi
in iwlwifi-next.  Other drivers (from wireless-testing) already
use the correct spelling and need this change in LinuxKPI.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agosyncache: accept packet with no SA when TCP_MD5SIG is set
Robert Wing [Sun, 9 Jan 2022 01:07:50 +0000 (16:07 -0900)]
syncache: accept packet with no SA when TCP_MD5SIG is set

When TCP_MD5SIG is set on a socket, all packets are dropped that don't
contain an MD5 signature. Relax this behavior to accept a non-signed
packet when a security association doesn't exist with the peer.

This is useful when a listen socket set with TCP_MD5SIG wants to handle
connections protected with and without MD5 signatures.

Reviewed by: bz (previous version)
Sponsored by:   nepustil.net
Sponsored by:   Klara Inc.
Differential Revision: https://reviews.freebsd.org/D33227

2 years agotcpmd5: return ENOENT when security association not found
Robert Wing [Sun, 9 Jan 2022 01:07:10 +0000 (16:07 -0900)]
tcpmd5: return ENOENT when security association not found

Return ENOENT from tcp_ipsec_input() when a security association is not
found. This allows callers of TCP_MD5_INPUT() to differentiate between a
security association not found and receiving a bad signature.

Also return ENOENT from tcp_ipsec_output() for consistency.

Reviewed by: ae
Sponsored by:   nepustil.net
Sponsored by:   Klara Inc.
Differential Revision: https://reviews.freebsd.org/D33226

2 years agoLinuxKPI: 802.11 handle IEEE80211_CONF_IDLE better
Bjoern A. Zeeb [Sun, 9 Jan 2022 00:59:50 +0000 (00:59 +0000)]
LinuxKPI: 802.11 handle IEEE80211_CONF_IDLE better

We never initialized hw->conf.flags for IEEE80211_CONF_IDLE but
on set_channel we would clear it and announce a change.
This lead to a problem that drivers may do some work every time
which was not needed and may lead to unexpected behaviour (for no
better driver code).

Properly initialize conf.flags with IEEE80211_CONF_IDLE.
Factor out the toggling into a function and clear IDLE while
sw scanning and when associated and set again when scan ends
or we are bouncing out of assoc.

MFC after: 3 days

2 years agoLinuxKPI: ip.h add #include
Bjoern A. Zeeb [Sun, 9 Jan 2022 00:57:13 +0000 (00:57 +0000)]
LinuxKPI: ip.h add #include

Also include netinet/in.h so that in_addr in known for ip.h.
Found by compiling a new piece of code which complained.

MFC after: 3 days

2 years agoldconfig: remove two symbols
Konstantin Belousov [Sat, 8 Jan 2022 10:42:36 +0000 (12:42 +0200)]
ldconfig: remove two symbols

_PATH_LD32_HINTS is unused because it is a.out remnant.
_PATH_ELF32_HINTS is provided by rtld_paths.h already.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agostress2: Aded two msdos FS fuzzer tests
Peter Holm [Sat, 8 Jan 2022 06:11:10 +0000 (07:11 +0100)]
stress2: Aded two msdos FS fuzzer tests

2 years agoipfilter: Restore ipfsync
Cy Schubert [Sat, 8 Jan 2022 04:12:50 +0000 (20:12 -0800)]
ipfilter: Restore ipfsync

ipfsync is a WIP sync daemon designed to be used in a failover scenario.
It was removed by 5ee61c7daa511927aae8652d6a3ea78866a50ef8. This commit
restores its three files. ipfsync is in my work queue.

MFC after: 10 days
X-MFC with: 5ee61c7daa511927aae8652d6a3ea78866a50ef8

2 years agoamd64 pmap: preset A and M bits for pmap_qenter() and pmap_kenter() mappings
Konstantin Belousov [Wed, 5 Jan 2022 01:25:41 +0000 (03:25 +0200)]
amd64 pmap: preset A and M bits for pmap_qenter() and pmap_kenter() mappings

This removes one or two atomic update of the pte on access. Also it
makes the pte constant during its lifecycle.

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

2 years agoamd64 pmap: simplify vtopte() and vtopde()
Konstantin Belousov [Wed, 5 Jan 2022 00:26:12 +0000 (02:26 +0200)]
amd64 pmap: simplify vtopte() and vtopde()

Pre-calculate masks and page table/page directory bases, for LA48 and
LA57 cases, trading a conditional for the memory accesses.

This shaves 672 bytes of .text, by the cost of 32 .data bytes.  Note
that eliminated code contained one conditional, and several costly
movabs instructions, which are traded by two memory fetches per
vtop{t,d}e() inlines.

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33776

2 years agomsdosfs: use mntfs vnode for pm_devvp
Konstantin Belousov [Thu, 6 Jan 2022 01:47:31 +0000 (03:47 +0200)]
msdosfs: use mntfs vnode for pm_devvp

to prevent races with devfs VCHR vnode reclamation, same as it was
done for UFS.

Reported by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: on integrity error, fire a task to remount filesystem to ro
Konstantin Belousov [Sat, 25 Dec 2021 19:45:47 +0000 (21:45 +0200)]
msdosfs: on integrity error, fire a task to remount filesystem to ro

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: add msdosfs_integrity_error()
Konstantin Belousov [Sat, 25 Dec 2021 21:20:56 +0000 (23:20 +0200)]
msdosfs: add msdosfs_integrity_error()

A function to remount the filesystem from rw to ro on integrity error.
The work is performed in taskqueue to allow the call to be done from
almost arbitrary context where erronous state was detected.

Tested by: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agoAdd vfs_remount_ro()
Konstantin Belousov [Sat, 25 Dec 2021 19:44:59 +0000 (21:44 +0200)]
Add vfs_remount_ro()

a helper to remount filesystem from rw to ro.

Tested by: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: sanity check sector count from BPB
Konstantin Belousov [Thu, 30 Dec 2021 19:45:40 +0000 (21:45 +0200)]
msdosfs: sanity check sector count from BPB

We use sector count to size the FAT inuse bitset.  If sector count is
corrupted, kernel might be tricked into doing unbound allocation.
Ensure that the sector count does not exceed the actual volume size.

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: clusterfree() is used only in error handling cases
Konstantin Belousov [Tue, 4 Jan 2022 14:43:02 +0000 (16:43 +0200)]
msdosfs: clusterfree() is used only in error handling cases

Change its return type to void, because its result is ignored in both
call sites.  Remove oldcnp argument as well, it is NULL always.

Suggested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: do no allow lookup to return vdp except for dot lookups
Konstantin Belousov [Sun, 26 Dec 2021 21:51:48 +0000 (23:51 +0200)]
msdosfs: do no allow lookup to return vdp except for dot lookups

In collaboaration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: handle a case when non-dot lookup returned dvp
Konstantin Belousov [Tue, 28 Dec 2021 13:41:30 +0000 (15:41 +0200)]
msdosfs: handle a case when non-dot lookup returned dvp

This means that filesystem is corrupted, there is a loop.

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: take inusemap inconsistency as an error, not invariants violation
Konstantin Belousov [Sat, 25 Dec 2021 18:39:15 +0000 (20:39 +0200)]
msdosfs: take inusemap inconsistency as an error, not invariants violation

In other words, stop silently accepting freeing free cluster in
non-debug kernels, but return the error to the caller.  Modify callers
to handle errors from usemap_free().

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomsdosfs: handle inconsistently hashed denodes
Konstantin Belousov [Thu, 23 Dec 2021 23:21:53 +0000 (01:21 +0200)]
msdosfs: handle inconsistently hashed denodes

It is possible, on the corrupted msdosfs volume, to have file which
denode inode number does not match the one calculated using directory
cluster.  Instead of asserting the condition as impossible, handle it
and return error, after reclaiming the aliased vnode.

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agogeom label msdosfs: sanity check BPB before using it for io request
Konstantin Belousov [Thu, 30 Dec 2021 13:17:59 +0000 (15:17 +0200)]
geom label msdosfs: sanity check BPB before using it for io request

It must be greater than zero, and be multiple of the device block size.

In collaboration with: pho
Reviewed by: markj, mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721

2 years agomps/mpr: Relax doorbell polling precision.
Alexander Motin [Sat, 8 Jan 2022 02:30:12 +0000 (21:30 -0500)]
mps/mpr: Relax doorbell polling precision.

It does not matter how often do we check firmware for crashes.

MFC after: 2 weeks

2 years agoBuild libclang also if LLDB is enabled
Ed Maste [Fri, 7 Jan 2022 15:34:08 +0000 (10:34 -0500)]
Build libclang also if LLDB is enabled

LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

Users who set WITHOUT_CLANG in order to reduce build time or size
might want to set WITHOUT_LLDB in addition to WITHOUT_CLANG, or use
WITHOUT_TOOLCHAIN instead.

PR: 260993
Reported by: eugen
Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoFix build. Sorry.
Alexander Motin [Fri, 7 Jan 2022 19:33:51 +0000 (14:33 -0500)]
Fix build.  Sorry.

MFC after: 2 weeks

2 years agoCTL: Relax callouts precisions.
Alexander Motin [Fri, 7 Jan 2022 19:30:44 +0000 (14:30 -0500)]
CTL: Relax callouts precisions.

MFC after: 2 weeks

2 years agonvme: Do not rearm timeout for commands without one.
Alexander Motin [Fri, 7 Jan 2022 17:54:49 +0000 (12:54 -0500)]
nvme: Do not rearm timeout for commands without one.

Admin queues almost always have several ASYNC_EVENT_REQUEST outstanding.
They have no timeouts, but their presence in qpair->outstanding_tr caused
useless timeout callout rearming twice a second.

While there, relax timeout callout period from 0.5s to 0.5-1s to improve
aggregation.  Command timeouts are measured in seconds, so we don't need
to be precise here.

Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33781

2 years agocam: Relax callouts precisions.
Alexander Motin [Fri, 7 Jan 2022 17:49:21 +0000 (12:49 -0500)]
cam: Relax callouts precisions.

On large systems even relatively rare callouts may fire many times
per second.  This should allow them to aggregate better, since we do
not require any precision when polling for media change, etc.

MFC after: 2 weeks

2 years agonet/if_pfsync.h: Add back to bad files
Warner Losh [Fri, 7 Jan 2022 16:36:25 +0000 (09:36 -0700)]
net/if_pfsync.h: Add back to bad files

This file does not build for WITHOUT_PF sometimes. Looking at various
ways to cope (it exposes other issues too), but in the mean time just
add it back here to unbreak WITHOUT_PF in some scenarios.

Sponsored by: Netflix

2 years agoddb: Remove SOFTWARE_SSTEP support
Warner Losh [Fri, 7 Jan 2022 16:25:33 +0000 (09:25 -0700)]
ddb: Remove SOFTWARE_SSTEP support

It was needed for mips only, and only kinda sorta worked for mips. It
can be brought back if we grow another architecture that need it.

Sponsored by: Netflix

2 years agowbwd: Move set but not used variable test under notyet
Warner Losh [Fri, 7 Jan 2022 16:23:00 +0000 (09:23 -0700)]
wbwd: Move set but not used variable test under notyet

Sponsored by: Netflix

2 years agoRemove mips dtrace.
Warner Losh [Fri, 7 Jan 2022 15:59:15 +0000 (08:59 -0700)]
Remove mips dtrace.

Remove mips dtrace code. It's no longer needed.

Sponsored by: Netflix

2 years agopowerpc/aim: ifdef DDB pmap debugging functions
Warner Losh [Fri, 7 Jan 2022 15:48:08 +0000 (08:48 -0700)]
powerpc/aim: ifdef DDB pmap debugging functions

INVARIANTS and DDB can be enabled independently.

Submitted by: Sterling Jensen
Pull Request: https://github.com/freebsd/freebsd-src/pull/566

2 years agoFix 'make cscope' with ALL_ARCH defined
Mitchell Horne [Fri, 7 Jan 2022 15:53:52 +0000 (11:53 -0400)]
Fix 'make cscope' with ALL_ARCH defined

The sys/mips directory has been removed.

2 years agoFix "Mesurement" typo in usr.sbin/acpi/acpiconf/acpiconf.c
Matt Audesse [Fri, 17 Dec 2021 00:16:40 +0000 (19:16 -0500)]
Fix "Mesurement" typo in usr.sbin/acpi/acpiconf/acpiconf.c

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

2 years agofile: Fix cross-compilation on Darwin/macOS
Jose Luis Duran [Wed, 5 Jan 2022 12:13:22 +0000 (09:13 -0300)]
file: Fix cross-compilation on Darwin/macOS

Darwin/macOS does not have pipe2(2).

Apply a similar guard as in f3d7ace4b235422e5ccff0315f2965ac935241d8
after 43a5ec4eb41567cc92586503212743d89686d78f.

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

2 years agortwn(4): Add new USB ID.
Hans Petter Selasky [Fri, 7 Jan 2022 13:00:36 +0000 (14:00 +0100)]
rtwn(4): Add new USB ID.

Submitted by: arved@
PR: 260952
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agouchcom(4): Add new USB ID.
Hans Petter Selasky [Fri, 7 Jan 2022 12:56:47 +0000 (13:56 +0100)]
uchcom(4): Add new USB ID.

Submitted by: darius@dons.net.au
PR: 260783
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoFix formatting of the usage() output
Scott Long [Fri, 7 Jan 2022 05:59:18 +0000 (22:59 -0700)]
Fix formatting of the usage() output

2 years agolibsoft: Remove
Warner Losh [Fri, 7 Jan 2022 05:34:25 +0000 (22:34 -0700)]
libsoft: Remove

libsoft was a transition from the FreeBSD/armv6 10 (and earlier) with
'softfp' ABI (that is, hardware float, but passed as integer registers)
to the 'hardfp' ABI that was in FreeBSD/armv[67] in FreeBSD 11 and
newer. It's been off by default since it was created.

This was mostly used by people that wanted to do a source upgrade of
their system from FreeBSD 10 to 11 or from 11-current before the cutover
to 11-current after. This should not be confused with the full software
floating point implementation (that doesn't use the hardware floating
point instructions at all) that is used out of tree by at least one
company selling armv7 gear that has no FPU.

There's no longer a need for the transition, so retire it like should
likely have happened sometime before FreeBSD 12 was released 3 years
ago.

Sponsored by: Netflix
Suggestions by: jrtc27, jhb
Reviewed by: manu, mmel
Differential Revision: https://reviews.freebsd.org/D33761

2 years agortld-elf: Remove libsoft support
Warner Losh [Fri, 7 Jan 2022 05:34:21 +0000 (22:34 -0700)]
rtld-elf: Remove libsoft support

Remove support for loading libsoft libraries.

Sponsored by: Netflix

2 years agoldconfig: remove libsoft support
Warner Losh [Fri, 7 Jan 2022 05:41:38 +0000 (22:41 -0700)]
ldconfig: remove libsoft support

Remove support for -soft and its implementation. This arg was never
documented, so no need to remove it from the man page.

Sponsored by: Netflix

2 years agolibsoft: Remove runtime ldconfig support for libsoft
Warner Losh [Fri, 7 Jan 2022 05:34:18 +0000 (22:34 -0700)]
libsoft: Remove runtime ldconfig support for libsoft

Remove the runtime support for running ldconfig at boot to cache lists
of libsoft libbraries.

Sponsored by: Netflix

2 years agolibsoft: Remove targets to generate libsoft
Warner Losh [Fri, 7 Jan 2022 05:34:15 +0000 (22:34 -0700)]
libsoft: Remove targets to generate libsoft

Remove the targets needed to make and install libsoft.

Sponsored by: Netflix

2 years agolibsoft: Remove support for installing libsoft
Warner Losh [Fri, 7 Jan 2022 05:34:10 +0000 (22:34 -0700)]
libsoft: Remove support for installing libsoft

Remove the infrasturcture needed to create the libsoft directories.

Sponsored by: Netflix

2 years agocryptocheck: Add aliases for algs with multiple key sizes.
John Baldwin [Thu, 6 Jan 2022 22:46:50 +0000 (14:46 -0800)]
cryptocheck: Add aliases for algs with multiple key sizes.

Previously algorithms such as AES-CBC would provide an algorithm
without a key size for the smallest key size and additional algorithms
with an explicit key size, e.g. "aes-cbc" (128 bits), "aes-cbc192",
and "aes-cbc256".

Instead, always make the key size name explicit and reuse the
"generic" name to request running tests against all of the key sizes.
For example, for AES-CBC this means "aes-cbc128" is now the name of
the variant with a 128-bit key and "aes-cbc" runs tests of AES-CBC
with all three key sizes.

This makes it easier to run tests on all combinations of ciphers like
AES-GCM or AES-CCM with -z in a single invocation.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33759

2 years agonfscl: Always invalidate buffers for append writes
Rick Macklem [Thu, 6 Jan 2022 22:18:36 +0000 (14:18 -0800)]
nfscl: Always invalidate buffers for append writes

kib@ reported a problem which was resolved by
reverting commit 867c27c23a5c, which changed the NFS
client to use direct RPCs to the server for
IO_APPEND writes.  He also spotted that the
code only invalidated buffer cache buffers
when they were marked NMODIFIED (had been
written into).

This patch modifies the NFS VOP_WRITE() to
always invalidate the buffer cache buffers
and pages for the file when IO_APPEND is
specified.  It also includes some cleanup
suggested by kib@.

Reported by: kib
Tested by: kib
Reviewed by: kib
MFC after: 10 weeks

2 years agoFix ifa refcount leak in ifa_ifwithnet()
Ryan Stone [Thu, 11 Feb 2021 16:17:58 +0000 (11:17 -0500)]
Fix ifa refcount leak in ifa_ifwithnet()

In 4f6c66cc9c75c8, ifa_ifwithnet() was changed to no longer
ifa_ref() the returned ifaddr, and instead the caller was required
to stay in the net_epoch for as long as they wanted the ifaddr
to remain valid.  However, this missed the case where an AF_LINK
lookup would call ifaddr_byindex(), which still does ifa_ref()
the ifaddr.  This would cause a refcount leak.

Fix this by inlining the relevant parts of ifaddr_byindex() here,
with the ifa_ref() call removed.  This also avoids an unnecessary
entry and exit from the net_epoch for this case.

I've audited all in-tree consumers of ifa_ifwithnet() that could
possibly perform an AF_LINK lookup and confirmed that none of them
will expect the ifaddr to have a reference that they need to
release.

MFC after: 2 months
Sponsored by: Dell Inc
Differential Revision: https://reviews.freebsd.org/D28705
Reviewed by: melifaro

2 years agowpa: Import wpa_supplicant/hostapd commit b26f5c0fe
Cy Schubert [Thu, 6 Jan 2022 18:28:57 +0000 (10:28 -0800)]
wpa: Import wpa_supplicant/hostapd commit b26f5c0fe

This is the December/January update to vendor/wpa committed upstream
2021-12-13.

MFC after: 1 month

2 years agoroute: remove write-only struct hostent from getaddr()
Ed Maste [Sun, 2 Jan 2022 00:16:43 +0000 (19:16 -0500)]
route: remove write-only struct hostent from getaddr()

Under some INET/INET6 src.conf configurations sbin/route previously
failed to build due to an unused variable warning.  It was functionally
write-only anyway, so just remove it.

Reported by: melifaro
Reviewed by: melifaro
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33717

2 years agosqlite3: Vendor import of sqlite3 3.37.1
Cy Schubert [Thu, 6 Jan 2022 00:03:14 +0000 (16:03 -0800)]
sqlite3: Vendor import of sqlite3 3.37.1

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

Merge commit '7e13a4eb402641ddf307497cc9ac7ce1ab21c2a8' into sqlite3-work2

2 years agobitset.9: add description of BIT_ISSET
Doug Moore [Thu, 6 Jan 2022 12:14:18 +0000 (13:14 +0100)]
bitset.9: add description of BIT_ISSET

Extracted from abandoned review https://reviews.freebsd.org/D33701.

MFC after: 3 days

2 years agoocs_fc: Remove giant lock usage in sysctl.
Ram Kishore Vegesna [Wed, 5 Jan 2022 14:45:54 +0000 (20:15 +0530)]
ocs_fc: Remove giant lock usage in sysctl.

Summary: Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE.

Reviewers: ken, mav

Subscribers: imp

Approved by: mav

Differential Revision: https://reviews.freebsd.org/D33752

2 years agoRestore DT_DEBUG processing
Konstantin Belousov [Thu, 6 Jan 2022 07:14:09 +0000 (09:14 +0200)]
Restore DT_DEBUG processing

Pointed out by: kevans
Fixes: 292cba9b4919ee188ca08cc8bf5057e346514383
Sponsored by: The FreeBSD Foundation

2 years agoSilent some warnings for i386 kernel build
Konstantin Belousov [Thu, 6 Jan 2022 04:45:49 +0000 (06:45 +0200)]
Silent some warnings for i386 kernel build

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agolink_elf.h: cleanup struct link_map definition, remove mips-specific field
Konstantin Belousov [Thu, 6 Jan 2022 04:14:17 +0000 (06:14 +0200)]
link_elf.h: cleanup struct link_map definition, remove mips-specific field

Sponsored by: The FreeBSD Foundation

2 years agortld: remove mips arch directory
Konstantin Belousov [Thu, 6 Jan 2022 00:44:51 +0000 (02:44 +0200)]
rtld: remove mips arch directory

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D33763

2 years agortld: remove mips-specific cases from generic code
Konstantin Belousov [Thu, 6 Jan 2022 00:43:51 +0000 (02:43 +0200)]
rtld: remove mips-specific cases from generic code

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D33763

2 years agoDump page tracking no longer needed on mips
Konstantin Belousov [Thu, 6 Jan 2022 00:42:40 +0000 (02:42 +0200)]
Dump page tracking no longer needed on mips

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D33763

2 years agoRemove special kstack allocation code for mips.
Konstantin Belousov [Thu, 6 Jan 2022 00:40:28 +0000 (02:40 +0200)]
Remove special kstack allocation code for mips.

The arch required two-pages alignment due to single TLB entry caching
two consequtive mappings.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D33763

2 years agoWhitespace and capitalization cleanups.
Kirk McKusick [Thu, 6 Jan 2022 00:32:12 +0000 (16:32 -0800)]
Whitespace and capitalization cleanups.

No changes intended.

Sponsored by: Netflix

2 years agosqlite3: Vendor import of sqlite3 3.37.1
Cy Schubert [Wed, 5 Jan 2022 23:26:24 +0000 (15:26 -0800)]
sqlite3: Vendor import of sqlite3 3.37.1

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

2 years agovfslist.c: initialize skipvfs variable
Stefan Eßer [Wed, 5 Jan 2022 22:00:36 +0000 (23:00 +0100)]
vfslist.c: initialize skipvfs variable

The function makevfslist is only called once in mount.c, but should
be save to be called more than once with different parameters.

The bin/df command links against this file, and will need this
possibility to allow -l and -t to be used together.

MFC after: 3 days

2 years agobus_dma: Deduplicate locking helper functions.
John Baldwin [Wed, 5 Jan 2022 21:50:40 +0000 (13:50 -0800)]
bus_dma: Deduplicate locking helper functions.

- Move busdma_lock_mutex to subr_bus_dma.c.

- Move _busdma_lock_dflt to subr_bus_dma.c.  This function was named a
  couple of different things previously.  It is not a public API but
  an internal helper used in place of a NULL pointer.  The prototype
  is in <sys/bus_dma.h> as not all backends include
  <sys/bus_dma_internal.h>.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33694

2 years agoDeduplicate bus_dma bounce code.
John Baldwin [Wed, 5 Jan 2022 21:50:40 +0000 (13:50 -0800)]
Deduplicate bus_dma bounce code.

Move mostly duplicated code in various MD bus_dma backends to support
bounce pages into sys/kern/subr_busdma_bounce.c.  This file is
currently #include'd into the backends rather than compiled standalone
since it requires access to internal members of opaque bus_dma
structures such as bus_dmamap_t and bus_dma_tag_t.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33684

2 years agohier: Remove mips and sparc64
Warner Losh [Wed, 5 Jan 2022 21:38:05 +0000 (14:38 -0700)]
hier: Remove mips and sparc64

These have been removed from the kernel, so should be removed here.

Sponsored by: Netflix

2 years agolio: remove from NOIP
Warner Losh [Wed, 5 Jan 2022 21:19:34 +0000 (14:19 -0700)]
lio: remove from NOIP

It doesn't build here. This was masked earlier by other build breakage.

Sponsored by: Netflix

2 years agoatkbd: Disable periodic polling by default.
Alexander Motin [Wed, 5 Jan 2022 20:00:36 +0000 (15:00 -0500)]
atkbd: Disable periodic polling by default.

It is one of the few remaining Giant-locked callouts.  It would be
good to remove it, not mentioning that polling itself is not good.

If this cause keyboard/mouse freezes on some hardware, please set
loader tunable hw.atkbd.hz=1 as workaround and report the issue.

Submitted by: imp, jhb

2 years agosqlite3: Vendor import of sqlite3 3.37.1
Cy Schubert [Wed, 5 Jan 2022 19:24:29 +0000 (11:24 -0800)]
sqlite3: Vendor import of sqlite3 3.37.1

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

2 years agocxgbe(4): Do not request an FEC that is invalid for the requested speed.
Navdeep Parhar [Wed, 5 Jan 2022 18:45:06 +0000 (10:45 -0800)]
cxgbe(4): Do not request an FEC that is invalid for the requested speed.

This eliminates error messages like this from the driver when running at
50Gbps with 100G cables:
[3726] cc0: l1cfg failed: 71
[4407] cc0: l1cfg failed: 71

Note that link comes up anyway with or without this change.

Reported by: Suhas Lokesha @ Chelsio
MFC after: 1 week
Sponsored by: Chelsio Communications

2 years agoatkbd: Reduce polling rate from 10Hz to ~1Hz.
Alexander Motin [Wed, 5 Jan 2022 16:32:44 +0000 (11:32 -0500)]
atkbd: Reduce polling rate from 10Hz to ~1Hz.

In my understanding this is only needed to workaround lost interrupts.
I was thinking to remove it completely, but the comment about edge-
triggered interrupt may be true and needs deeper investigation.  ~1Hz
should be often enough to handle the supposedly rare loss cases, but
rare enough to not appear in top.  Add sysctl hw.atkbd.hz to tune it.

MFC after: 1 month

2 years agobhyve: Correct unmapping of the MSI-X table BAR
Mark Johnston [Wed, 5 Jan 2022 15:08:13 +0000 (10:08 -0500)]
bhyve: Correct unmapping of the MSI-X table BAR

The starting address passed to mprotect was wrong, so in the case where
the last page containing the table is not the last page of the BAR, the
wrong region would be unmapped.

Reported by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: jhb
Fixes: 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33739

2 years agobhyve: Map the right BAR in init_msix_table()
Mark Johnston [Tue, 4 Jan 2022 19:02:55 +0000 (14:02 -0500)]
bhyve: Map the right BAR in init_msix_table()

The PBA and MSI-X table can reside in different BARs.

Reported by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: jhb
Fixes: 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33739

2 years agoUse the arm64 ttbr macro to define the ASID shift
Andrew Turner [Wed, 5 Jan 2022 14:30:40 +0000 (14:30 +0000)]
Use the arm64 ttbr macro to define the ASID shift

Now we have a macro to descrive the arm64 TTBR registers use it in the
ASID_TO_OPERAND pmap macro.

Sponsored by: The FreeBSD Foundation

2 years agoAdd the arm64 TTBR fields to armreg.h
Andrew Turner [Wed, 5 Jan 2022 13:06:47 +0000 (13:06 +0000)]
Add the arm64 TTBR fields to armreg.h

Sponsored by: The FreeBSD Foundation

2 years agoFix kernel build without INET and INET6
Ed Maste [Sun, 2 Jan 2022 00:53:42 +0000 (19:53 -0500)]
Fix kernel build without INET and INET6

Reviewed by: brooks, melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33718

2 years agoAdd a missing space in the arm64 sendsig
Andrew Turner [Wed, 5 Jan 2022 12:38:54 +0000 (12:38 +0000)]
Add a missing space in the arm64 sendsig

Sponsored by: The FreeBSD Foundation

2 years agoRemove the sigcode base check on arm64
Andrew Turner [Wed, 5 Jan 2022 11:01:31 +0000 (11:01 +0000)]
Remove the sigcode base check on arm64

This was added with the shared page support. It is unused as we always
enable the shared page on FreeBSD executables on arm64.

2 years agostress2: Added new test cases
Peter Holm [Wed, 5 Jan 2022 09:27:29 +0000 (10:27 +0100)]
stress2: Added new test cases