Commit Graph

253641 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
fa8bc7ed92 80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT()
As we did in the kernel in r366112 replace the MS() macro with the version(s)
added to the kernel: _IEEE80211_MASKSHIFT().  Also provide its counter part.
This will later allow use to use other macros defined in net80211 headers
here in ifconfig.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-10-07 22:29:26 +00:00
Bjoern A. Zeeb
90707c4e44 LinuxKPI: add a bitfield.h implementation.
This code was iteratively implemented during the work on various WiFi
drivers -- from individual functions to a macro-created implementations
for the various bit sized needed (and then extended to more for
comepleteness). Some of the bit combinations do not seem to make sense
so are left out.

The __bf_shf(x) was obtained from D26681 [1].

Requested by:		manu [1]
Reviewed by:		hselasky, manu
MFC after:		1 week
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26708
2020-10-07 22:07:26 +00:00
Bjoern A. Zeeb
1e375f3aa7 80211: non-functional changes
Sort a few VHT160 and 80+80 lines, update some comments, and remove
a superfluous ','.

No functional changes intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-10-07 21:56:58 +00:00
Conrad Meyer
cc71ff7234 bhyveload(8): Implement loader_callbacks::diskwrite
The method was optional prior to r365938, which made it mandatory but did add
any test that an implementation provides the method nor implement it for
bhyveload.  The code path might not be hit unless the user's loader was
configured to write to a file on disk, such as with nextboot(8).

Reviewed by:	grehan, tsoome
Approved by:	bhyve
X-MFC-With:	r365938
Differential Revision:	https://reviews.freebsd.org/D26710
2020-10-07 20:31:13 +00:00
Mitchell Horne
8481aab1ac Print symbol index for unsupported relocation types
It is unlikely, but possible, that an unrecognized or unsupported
relocation type is encountered while trying to load a kernel module. If
this occurs we should offer the symbol index as a hint to the user.

While here, fix some small style issues.

Reviewed by:	markj, kib (amd64 part, in D26701)
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
2020-10-07 18:48:10 +00:00
Hans Petter Selasky
194ddc011a Properly cleanup driver during remove_one() in mlx5core.
Cleanup all host resources, SYSCTLs, MSIX vectors and memory used
by the host and only leave the device allocated memory behind, if any,
because it may still be in use, when the PCI remove function is called.
Else future probe calls may fail due to SYSCTLs already existing.

MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-07 17:46:49 +00:00
Michael Tuexen
e7a39b856a Minor cleanups.
MFC after:		3 days
2020-10-07 15:22:48 +00:00
Fernando Apesteguía
d643ff21f4 ul(1): Remove references to colcrt(1) and nroff(1)
colcrt(1) and nroff(1) where removed in r319664.
Remove references to these commands in ul(1) man page.

PR:	244127
Reported by:	freebsd@tim.thechases.com
Approved by:	manpages (gbe@)
Differential Revision:	https://reviews.freebsd.org/D2614
2020-10-07 14:43:16 +00:00
Edward Tomasz Napierala
29c4e4b1af Don't use critical section when calling intr_irq_handler() - that function
enters critical section by itself anyway.

Reviewed by:	kp
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26694
2020-10-07 12:11:11 +00:00
Konstantin Belousov
cefdb89514 Fix typo.
Sponsored by:	Mellanox Technologies/NVIDIA Networking
MFC after:	3 days
2020-10-07 10:58:56 +00:00
Li-Wen Hsu
2c39128feb Temporarily skip failing test cases in CI:
sys.capsicum.functional.Capability__NoBypassDAC
sys.capsicum.functional.Pdfork__OtherUserForked

PR:		250178, 250179
Sponsored by:	The FreeBSD Foundation
2020-10-07 09:53:24 +00:00
Warner Losh
edad03308b Use intmax_t to print uint64_t values.
This fixes the 32-bit build where the types are different.
2020-10-07 07:55:55 +00:00
Li-Wen Hsu
85a6f8076f Revert r358001 in favor of r366509
Sponsored by:	The FreeBSD Foundation
2020-10-07 07:55:55 +00:00
Li-Wen Hsu
3d077160cb Skip test written in Googltest in the wrapper script
This leaves the main test body untouched and only skip running in the CI env,
makes doing local test easier while developing.

PR:		244165
Sponsored by:	The FreeBSD Foundation
2020-10-07 07:23:29 +00:00
Warner Losh
bc683a89a3 Move kernel env global variables, etc to sys/kenv.h
The kernel globals for kenv are confined to 2 files that need them and
a few that likely shouldn't (but as written the code does). Move them
from sys/systm.h to sys/kenv.h. This removed a XXX from systm.h and
cleans it up a little bit...
2020-10-07 06:16:37 +00:00
Warner Losh
863f967f95 cam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer
Sometimes, this drive will be present in the system such that the the
firmware identification string doesn't start with ATA, such as when
it's behind a SATA-to-SAS interposer. Add another quirk for that.

Submitted by: github user mr44er
Github PR: 423
2020-10-07 05:44:35 +00:00
Warner Losh
c03b1920fb nvmecontrol: Update wdc module for newer WDC NVMe products
Update the to log fetch operation for latest WDC NVMe products.

Tested on HGST SN100 (a few years old) and WDC SN720 (more recent).

Submitted by: Akhilesh Rn <Akhilesh.RN@wdc.com> (minor style tweak by me)
Github PR: 435
2020-10-07 05:36:05 +00:00
Warner Losh
f8503fde31 nvme: Note where the CCB was released for passthrough command 2020-10-06 23:35:26 +00:00
Warner Losh
a1975719dd cam: Assert we have a reference when freeing sim
Before we decrement refcount to sleep on the sim, assert that the
refcount >= 1. If it were 0 here, we'd never wake up.
2020-10-06 23:33:56 +00:00
Mitchell Horne
6debfd4b13 Remove unused function cpu_boot()
The prototype was added with the creation of kern_shutdown.c in r17658,
but it appears to have never been implemented. Remove it now.

Reviewed by:	cem, kib
Differential Revision:	https://reviews.freebsd.org/D26702
2020-10-06 23:16:56 +00:00
John-Mark Gurney
c2ebbb5572 add the FILESYSTEMS placeholder and note that it's the default early_late_divider 2020-10-06 22:53:11 +00:00
Pedro F. Giffuni
c2f0581e43 ext2fs: minor typo.
Obtained from:	Dragonfly
MFC after:	3 days
2020-10-06 21:31:04 +00:00
Kristof Provost
4af1bd8157 bridge: call member interface ioctl() without NET_EPOCH
We're not allowed to hold NET_EPOCH while sleeping, so when we call ioctl()
handlers for member interfaces we cannot be in NET_EPOCH.  We still need some
protection of our CK_LISTs, so hold BRIDGE_LOCK instead.

That requires changing BRIDGE_LOCK into a sleepable lock, and separating the
BRIDGE_RT_LOCK, to protect bridge_rtnode lists. That lock is taken in the data
path (while in NET_EPOCH), so it cannot be a sleepable lock.

While here document the locking strategy.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D26418
2020-10-06 19:19:56 +00:00
John Baldwin
f34702b76e Don't permit DRM buffer mappings to be upgraded to executable.
Reviewed by:	kib
MFC after:	1 month
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26697
2020-10-06 18:13:15 +00:00
John Baldwin
e0b155fe4a Simplify swcr_authcompute() after removal of deprecated algorithms.
- Just use sw->octx != NULL to handle the HMAC case when finalizing
  the MAC.

- Explicitly zero the on-stack auth context.

Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26688
2020-10-06 18:07:52 +00:00
John Baldwin
9aed26b906 Check if_capenable, not if_capabilities when enabling rate limiting.
if_capabilities is a read-only mask of supported capabilities.
if_capenable is a mask under administrative control via ifconfig(8).

Reviewed by:	gallatin
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26690
2020-10-06 18:02:33 +00:00
John Baldwin
56fb710f1b Store the send tag type in the common send tag header.
Both cxgbe(4) and mlx5(4) wrapped the existing send tag header with
their own identical headers that stored the type that the
type-specific tag structures inherited from, so in practice it seems
drivers need this in the tag anyway.  This permits removing these
extra header indirections (struct cxgbe_snd_tag and struct
mlx5e_snd_tag).

In addition, this permits driver-independent code to query the type of
a tag, e.g. to know what type of tag is being queried via
if_snd_query.

Reviewed by:	gallatin, hselasky, np, kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26689
2020-10-06 17:58:56 +00:00
Michael Tuexen
6f155d690b Reset delayed SACK state when restarting an SCTP association.
MFC after:		3 days
2020-10-06 14:26:05 +00:00
Jessica Clarke
2152743f11 riscv: Remove outdated condition in page_fault_handler
Since r366355 and r366284 we panic on access faults rather than treating
them like page faults so this condition is never true.

Reviewed by:	jhb (mentor), markj, mhorne
Approved by:	jhb (mentor), markj, mhorne
Differential Revision:	https://reviews.freebsd.org/D26686
2020-10-06 13:03:31 +00:00
Jessica Clarke
105708ca1c riscv: Handle supervisor instruction page faults
We should never take instruction page faults when in the kernel, but by
using the standard page fault code we should get a more-informative
message about faulting on a NOFAULT page rather than branching to the
default case here and printing an "Unknown kernel exception ..."
message.

Reviewed by:	jhb (mentor), markj
Approved by:	jhb (mentor), markj
Differential Revision:	https://reviews.freebsd.org/D26685
2020-10-06 13:02:20 +00:00
Li-Wen Hsu
c300407979 Temporarily skip failing test cases in CI:
sys.capsicum.functional.ForkedOpenatTest_WithFlagInCapabilityMode___
sys.capsicum.functional.OpenatTest__WithFlag

PR:		249960
Sponsored by:	The FreeBSD Foundation
2020-10-06 12:57:54 +00:00
Jessica Clarke
da8944d96d riscv: De-Arm a few names
These names were inherited from the arm64 port and should be changed to
the RISC-V terminology.

Reviewed by:	jhb (mentor), kp, markj
Approved by:	jhb (mentor), kp, markj
Differential Revision:	https://reviews.freebsd.org/D26671
2020-10-06 12:56:29 +00:00
Michael Tuexen
b954d81662 Ensure variables are initialized before used.
MFC after:		3 days
2020-10-06 11:29:08 +00:00
Michael Tuexen
6176f9d6df Remove dead stores reported by clang static code analysis
MFC after:		3 days
2020-10-06 11:08:52 +00:00
Gordon Bergling
c52a3a8c90 intro(3): Update the list of included libraries
- Extend the list of main libraries of section 3
- Extend the library functions that are included in the libc

MFC after:	2 weeks
Submitted by:	Naga Chaitanya Vellanki <pnagato at protonmail dot com>
Approved by:	gbe
Differential Revision:	https://reviews.freebsd.org/D26476
2020-10-06 10:51:47 +00:00
Michael Tuexen
11daa73adc Cleanup, no functional change intended.
MFC after:		3 days
2020-10-06 10:41:04 +00:00
Emmanuel Vadot
a113b1037f linuxkpi: Add pagemap.h
Add release_pages needed by drm which simply calls put_page for
all the pages provided

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26680
2020-10-06 10:41:00 +00:00
Emmanuel Vadot
b74986e7fa linuxkpi: Add power_supply.h
Add power_supply_is_system_supplied which is needed by drm.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26679
2020-10-06 10:39:40 +00:00
Emmanuel Vadot
49c85a33e5 linuxkpi: Add prefetch.h
Only add prefetchw as it is the only function used by drm.
Simply use the __builtin_prefetch which is available in all
compiler for a long time.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26677
2020-10-06 10:37:21 +00:00
Emmanuel Vadot
3ee75811a6 linuxkpi: Add numa.h
Only contain NUMA_NO_NODE needed by drm

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26676
2020-10-06 10:36:16 +00:00
Emmanuel Vadot
2aa0ea94ea linuxkpi: Add gcd function
This compute the common greater divider
Taken from OpenBSD

Reviewed by:	bz, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26674
2020-10-06 10:35:03 +00:00
Michael Tuexen
c8e55b3c0c Whitespace changes.
MFC after:		3 days
2020-10-06 09:51:40 +00:00
Baptiste Daroussin
cf64bfef77 backlight: check the lenght if the input before trimming '%'
Reported by:	hps
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D26693
2020-10-06 08:18:09 +00:00
Baptiste Daroussin
4d1308f49b backlight: accept '%' in the brightness input value
Improve friendlyness of the command line by accepting the percent brightness
in both format: with or without a trailing '%'

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D26692
2020-10-06 08:05:19 +00:00
Li-Wen Hsu
194d562872 Make capsicum test cases fine-grained
Add a wrapping script to use ATF to run tests written with Googletest
one by one. This helps locating and tracking the failing case in CI easier.

This is a temporarily solution while Googletest support in Kyua is developing.
We will revert this once Kyua+Googletest integration is ready.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25896
2020-10-06 06:45:52 +00:00
Li-Wen Hsu
7862a433e9 Clear the dmesg buffer to prevent rotating causes issues
This is a workaround for the current continuously failing test case

sys.kern.sonewconn_overflow.sonewconn_overflow_01

The side effect is the dmesg buffer got cleared and may effect other tests
depends on dmesg output running in parallel.  The better solution would be
tailing the log file like /var/log/debug.log

Sponsored by:	The FreeBSD Foundation
2020-10-06 04:18:42 +00:00
Mateusz Guzik
f165a1df9a libkvm: catch up with pre-subtracated per-cpu addresses
Only concerns amd64.

Reported by:	imp
2020-10-06 02:57:37 +00:00
Navdeep Parhar
8741306b3b cxgbe(4) sysctls do not need Giant.
Sponsored by:	Chelsio Communications
2020-10-05 22:18:04 +00:00
Kyle Evans
9c7bd4f198 crunchgen: fix MK_AUTO_OBJ logic after r364166
r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a
trailing newline at the end of path.  This caused a later stat() of it to
erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as
unexpected.

Harry Schmalzbauer bissected the resulting build failure he experienced
(stable/12 host, -HEAD build) down to r365887. This change is mostly
unrelated, except it switches the build to bootstrapped crunchgen - clue!

I then bissected recent crunchgen changes going back a bit since we wouldn't
observe the failure immediately with -CURRENT in most configurations, which
landed me on r364166. After many intense head-scratching minutes and printf
debugging, I realized that the newline was the difference. This is where our
tale ends.

Reported by:	Harry Schmalzbauer, O. Hartmann, Mike Tancsa, kevans
MFC after:	3 days
2020-10-05 20:57:44 +00:00
Ryan Moeller
92e17803cd Enable iterating all sysctls, even ones with CTLFLAG_SKIP
Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be
normally skipped for cost reasons.

This makes it so the names/descriptions of those sysctls can be discovered with
sysctl -aN/sysctl -ad/sysctl -at.

It also makes it so children are visited when a node flagged with CTLFLAG_SKIP
is explicitly requested.

The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so that
the extensive and expensive stats are skipped by default but may still be easily
obtained without having to know them all (which may not even be possible) and
request each one-by-one.

Reviewed by:	jhb
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D26560
2020-10-05 20:13:22 +00:00