]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years ago80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT()
Bjoern A. Zeeb [Wed, 7 Oct 2020 22:29:26 +0000 (22:29 +0000)]
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

3 years agoLinuxKPI: add a bitfield.h implementation.
Bjoern A. Zeeb [Wed, 7 Oct 2020 22:07:26 +0000 (22:07 +0000)]
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

3 years ago80211: non-functional changes
Bjoern A. Zeeb [Wed, 7 Oct 2020 21:56:58 +0000 (21:56 +0000)]
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

3 years agobhyveload(8): Implement loader_callbacks::diskwrite
Conrad Meyer [Wed, 7 Oct 2020 20:31:13 +0000 (20:31 +0000)]
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

3 years agoPrint symbol index for unsupported relocation types
Mitchell Horne [Wed, 7 Oct 2020 18:48:10 +0000 (18:48 +0000)]
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.

3 years agoProperly cleanup driver during remove_one() in mlx5core.
Hans Petter Selasky [Wed, 7 Oct 2020 17:46:49 +0000 (17:46 +0000)]
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

3 years agoMinor cleanups.
Michael Tuexen [Wed, 7 Oct 2020 15:22:48 +0000 (15:22 +0000)]
Minor cleanups.

MFC after: 3 days

3 years agoul(1): Remove references to colcrt(1) and nroff(1)
Fernando Apesteguía [Wed, 7 Oct 2020 14:43:16 +0000 (14:43 +0000)]
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

3 years agoDon't use critical section when calling intr_irq_handler() - that function
Edward Tomasz Napierala [Wed, 7 Oct 2020 12:11:11 +0000 (12:11 +0000)]
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

3 years agoFix typo.
Konstantin Belousov [Wed, 7 Oct 2020 10:58:56 +0000 (10:58 +0000)]
Fix typo.

Sponsored by: Mellanox Technologies/NVIDIA Networking
MFC after: 3 days

3 years agoTemporarily skip failing test cases in CI:
Li-Wen Hsu [Wed, 7 Oct 2020 09:53:24 +0000 (09:53 +0000)]
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

3 years agoUse intmax_t to print uint64_t values.
Warner Losh [Wed, 7 Oct 2020 07:55:55 +0000 (07:55 +0000)]
Use intmax_t to print uint64_t values.

This fixes the 32-bit build where the types are different.

3 years agoRevert r358001 in favor of r366509
Li-Wen Hsu [Wed, 7 Oct 2020 07:55:55 +0000 (07:55 +0000)]
Revert r358001 in favor of r366509

Sponsored by: The FreeBSD Foundation

3 years agoSkip test written in Googltest in the wrapper script
Li-Wen Hsu [Wed, 7 Oct 2020 07:23:29 +0000 (07:23 +0000)]
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

3 years agoMove kernel env global variables, etc to sys/kenv.h
Warner Losh [Wed, 7 Oct 2020 06:16:37 +0000 (06:16 +0000)]
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...

3 years agocam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer
Warner Losh [Wed, 7 Oct 2020 05:44:35 +0000 (05:44 +0000)]
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

3 years agonvmecontrol: Update wdc module for newer WDC NVMe products
Warner Losh [Wed, 7 Oct 2020 05:36:05 +0000 (05:36 +0000)]
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

3 years agonvme: Note where the CCB was released for passthrough command
Warner Losh [Tue, 6 Oct 2020 23:35:26 +0000 (23:35 +0000)]
nvme: Note where the CCB was released for passthrough command

3 years agocam: Assert we have a reference when freeing sim
Warner Losh [Tue, 6 Oct 2020 23:33:56 +0000 (23:33 +0000)]
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.

3 years agoRemove unused function cpu_boot()
Mitchell Horne [Tue, 6 Oct 2020 23:16:56 +0000 (23:16 +0000)]
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

3 years agoadd the FILESYSTEMS placeholder and note that it's the default early_late_divider
John-Mark Gurney [Tue, 6 Oct 2020 22:53:11 +0000 (22:53 +0000)]
add the FILESYSTEMS placeholder and note that it's the default early_late_divider

3 years agoext2fs: minor typo.
Pedro F. Giffuni [Tue, 6 Oct 2020 21:31:04 +0000 (21:31 +0000)]
ext2fs: minor typo.

Obtained from: Dragonfly
MFC after: 3 days

3 years agobridge: call member interface ioctl() without NET_EPOCH
Kristof Provost [Tue, 6 Oct 2020 19:19:56 +0000 (19:19 +0000)]
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

3 years agoDon't permit DRM buffer mappings to be upgraded to executable.
John Baldwin [Tue, 6 Oct 2020 18:13:15 +0000 (18:13 +0000)]
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

3 years agoSimplify swcr_authcompute() after removal of deprecated algorithms.
John Baldwin [Tue, 6 Oct 2020 18:07:52 +0000 (18:07 +0000)]
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

3 years agoCheck if_capenable, not if_capabilities when enabling rate limiting.
John Baldwin [Tue, 6 Oct 2020 18:02:33 +0000 (18:02 +0000)]
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

3 years agoStore the send tag type in the common send tag header.
John Baldwin [Tue, 6 Oct 2020 17:58:56 +0000 (17:58 +0000)]
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

3 years agoReset delayed SACK state when restarting an SCTP association.
Michael Tuexen [Tue, 6 Oct 2020 14:26:05 +0000 (14:26 +0000)]
Reset delayed SACK state when restarting an SCTP association.

MFC after: 3 days

3 years agoriscv: Remove outdated condition in page_fault_handler
Jessica Clarke [Tue, 6 Oct 2020 13:03:31 +0000 (13:03 +0000)]
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

3 years agoriscv: Handle supervisor instruction page faults
Jessica Clarke [Tue, 6 Oct 2020 13:02:20 +0000 (13:02 +0000)]
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

3 years agoTemporarily skip failing test cases in CI:
Li-Wen Hsu [Tue, 6 Oct 2020 12:57:54 +0000 (12:57 +0000)]
Temporarily skip failing test cases in CI:

sys.capsicum.functional.ForkedOpenatTest_WithFlagInCapabilityMode___
sys.capsicum.functional.OpenatTest__WithFlag

PR: 249960
Sponsored by: The FreeBSD Foundation

3 years agoriscv: De-Arm a few names
Jessica Clarke [Tue, 6 Oct 2020 12:56:29 +0000 (12:56 +0000)]
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

3 years agoEnsure variables are initialized before used.
Michael Tuexen [Tue, 6 Oct 2020 11:29:08 +0000 (11:29 +0000)]
Ensure variables are initialized before used.

MFC after: 3 days

3 years agoRemove dead stores reported by clang static code analysis
Michael Tuexen [Tue, 6 Oct 2020 11:08:52 +0000 (11:08 +0000)]
Remove dead stores reported by clang static code analysis

MFC after: 3 days

3 years agointro(3): Update the list of included libraries
Gordon Bergling [Tue, 6 Oct 2020 10:51:47 +0000 (10:51 +0000)]
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

3 years agoCleanup, no functional change intended.
Michael Tuexen [Tue, 6 Oct 2020 10:41:04 +0000 (10:41 +0000)]
Cleanup, no functional change intended.

MFC after: 3 days

3 years agolinuxkpi: Add pagemap.h
Emmanuel Vadot [Tue, 6 Oct 2020 10:41:00 +0000 (10:41 +0000)]
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

3 years agolinuxkpi: Add power_supply.h
Emmanuel Vadot [Tue, 6 Oct 2020 10:39:40 +0000 (10:39 +0000)]
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

3 years agolinuxkpi: Add prefetch.h
Emmanuel Vadot [Tue, 6 Oct 2020 10:37:21 +0000 (10:37 +0000)]
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

3 years agolinuxkpi: Add numa.h
Emmanuel Vadot [Tue, 6 Oct 2020 10:36:16 +0000 (10:36 +0000)]
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

3 years agolinuxkpi: Add gcd function
Emmanuel Vadot [Tue, 6 Oct 2020 10:35:03 +0000 (10:35 +0000)]
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

3 years agoWhitespace changes.
Michael Tuexen [Tue, 6 Oct 2020 09:51:40 +0000 (09:51 +0000)]
Whitespace changes.

MFC after: 3 days

3 years agobacklight: check the lenght if the input before trimming '%'
Baptiste Daroussin [Tue, 6 Oct 2020 08:18:09 +0000 (08:18 +0000)]
backlight: check the lenght if the input before trimming '%'

Reported by: hps
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D26693

3 years agobacklight: accept '%' in the brightness input value
Baptiste Daroussin [Tue, 6 Oct 2020 08:05:19 +0000 (08:05 +0000)]
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

3 years agoMake capsicum test cases fine-grained
Li-Wen Hsu [Tue, 6 Oct 2020 06:45:52 +0000 (06:45 +0000)]
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

3 years agoClear the dmesg buffer to prevent rotating causes issues
Li-Wen Hsu [Tue, 6 Oct 2020 04:18:42 +0000 (04:18 +0000)]
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

3 years agolibkvm: catch up with pre-subtracated per-cpu addresses
Mateusz Guzik [Tue, 6 Oct 2020 02:57:37 +0000 (02:57 +0000)]
libkvm: catch up with pre-subtracated per-cpu addresses

Only concerns amd64.

Reported by: imp

3 years agocxgbe(4) sysctls do not need Giant.
Navdeep Parhar [Mon, 5 Oct 2020 22:18:04 +0000 (22:18 +0000)]
cxgbe(4) sysctls do not need Giant.

Sponsored by: Chelsio Communications

3 years agocrunchgen: fix MK_AUTO_OBJ logic after r364166
Kyle Evans [Mon, 5 Oct 2020 20:57:44 +0000 (20:57 +0000)]
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

3 years agoEnable iterating all sysctls, even ones with CTLFLAG_SKIP
Ryan Moeller [Mon, 5 Oct 2020 20:13:22 +0000 (20:13 +0000)]
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

3 years agore(4): Add a 8168-compatible device ID
Mark Johnston [Mon, 5 Oct 2020 19:58:55 +0000 (19:58 +0000)]
re(4): Add a 8168-compatible device ID

This is described in RealTek's driver as a "RTL8168 Series add-on card."

PR: 250037
Submitted by: Hiroshi HASEGAWA <hhase1973@gmail.com>
MFC after: 1 week

3 years agocache: fix pwd use-after-free in setting up fallback
Mateusz Guzik [Mon, 5 Oct 2020 19:38:51 +0000 (19:38 +0000)]
cache: fix pwd use-after-free in setting up fallback

Since the code exits smr section prior to calling pwd_hold, the used
pwd can be freed and a new one allocated with the same address, making
the comparison erroneously true.

Note it is very unlikely anyone ran into it.

3 years agodevfs.rules: unhide pf in vnet jails
Kristof Provost [Mon, 5 Oct 2020 19:26:54 +0000 (19:26 +0000)]
devfs.rules: unhide pf in vnet jails

/dev/pf is usable in vnet jails, so don't hide the node there.

We shouldn't expose /dev/pf in regular jails, as that gives them control over
the host (or parent vnet jail) firewall.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D26537

3 years agoTweak arm64's cpu_fetch_syscall_args(). This should make it possible
Edward Tomasz Napierala [Mon, 5 Oct 2020 18:46:14 +0000 (18:46 +0000)]
Tweak arm64's cpu_fetch_syscall_args().  This should make it possible
for the compiler to inline the memcpy().

Reviewed by: andrew
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26629

3 years agoDrop useless assignment, and add a KASSERT to make sure it really was useless.
Edward Tomasz Napierala [Mon, 5 Oct 2020 18:41:35 +0000 (18:41 +0000)]
Drop useless assignment, and add a KASSERT to make sure it really was useless.

Reviewed by: nick, jhb
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26649

3 years agoufs: restore uniqueness of st_dev as returned by ufs_stat()
Chuck Silvers [Mon, 5 Oct 2020 18:17:50 +0000 (18:17 +0000)]
ufs: restore uniqueness of st_dev as returned by ufs_stat()

switch ufs_stat() to use the same value for st_dev as was used by
the previous ufs_getattr() stat path.

Submitted by: gallatin
Reviewed by: mjg, imp, kib, mckusick
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26596

3 years agoRemove sysctl_kern_consmute()
Mark Johnston [Mon, 5 Oct 2020 15:54:19 +0000 (15:54 +0000)]
Remove sysctl_kern_consmute()

It is a trivial wrapper for sysctl_handle_int() since r184521.  Also
remove the NEEDGIANT flag, cn_mute is accessed locklessly.

MFC after: 1 week

3 years agoprocstat(1): Add EXAMPLES section
Fernando Apesteguía [Mon, 5 Oct 2020 14:07:32 +0000 (14:07 +0000)]
procstat(1): Add EXAMPLES section

* Add some examples showing binary, arguments and file info from living
  processes.
* Show information from core dumps including an attempt using an old core file.
* While here, fix warning 'no blank before trailing delimiter' reported by igor.

Approved by: manpages (0mp@)
Differential Revision: https://reviews.freebsd.org/D25467

3 years agopkill(1): Add EXAMPLES section to man page
Fernando Apesteguía [Mon, 5 Oct 2020 13:52:31 +0000 (13:52 +0000)]
pkill(1): Add EXAMPLES section to man page

Add a dozen of examples to the EXAMPLES section for pgrep(1) and pkill(1).

Flags covered: -f, -F, -n, -j, -l, -S, -x

Approved by: mandoc (bcr@)
Differential Revision: pkill(1): Add EXAMPLES section to man page

3 years agokenv(1): Add EXAMPLES to man page
Fernando Apesteguía [Mon, 5 Oct 2020 13:49:45 +0000 (13:49 +0000)]
kenv(1): Add EXAMPLES to man page

Add EXAMPLES section covering all the options

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26664

3 years agohostname(1): Add EXAMPLES to man page
Fernando Apesteguía [Mon, 5 Oct 2020 13:46:19 +0000 (13:46 +0000)]
hostname(1): Add EXAMPLES to man page

Add a very simple set of examples

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26663

3 years agodf(1): Add EXAMPLES section to man page
Fernando Apesteguía [Mon, 5 Oct 2020 13:39:37 +0000 (13:39 +0000)]
df(1): Add EXAMPLES section to man page

* Add EXAMPLES section with four simple examples.
* Simplify -H flag description. This makes easy to see the difference between
  this flag and -h
* While here, fix .Tn deprecated macro.

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26662

3 years agopwait(1): Add EXAMPLES section to man page
Fernando Apesteguía [Mon, 5 Oct 2020 13:35:34 +0000 (13:35 +0000)]
pwait(1): Add EXAMPLES section to man page

* Add small EXAMPLES section to the man page showing the different
  flags and exit codes.

* Complete description for -v flag.

Approved by: manpages (bcr@)

3 years agoGet tools/tools/cxgbtool to build with the latest clang.
Navdeep Parhar [Mon, 5 Oct 2020 06:53:29 +0000 (06:53 +0000)]
Get tools/tools/cxgbtool to build with the latest clang.

Reported by: olivier@

3 years agolualoader: improve the design of the brand-/logo- mechanism
Kyle Evans [Sun, 4 Oct 2020 22:41:43 +0000 (22:41 +0000)]
lualoader: improve the design of the brand-/logo- mechanism

In the previous world order, any brand/logo was forced to pull in the
drawer and call drawer.add{Brand,Logo} with the name their brand/logo is
taking and a table describing it.

In the new world order, these files just need to return a table that maps
out graphics types to a table of the exact same format as what was
previously being passed back into the drawer. The appeal here is not needing
to grab a reference back to the drawer module and having a cleaner
data-driven looking format for these. The format has been renamed to 'gfx-*'
prefixes and each one can provide a logo and a brand.

drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as
there's no overhead to them and it's not yet worth the break in
compatibility with any pre-existing brands and logos.

Reviewed by: freqlabs
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24966

3 years agoExplicit CTLFLAG_DYN not needed
Ryan Moeller [Sun, 4 Oct 2020 19:37:15 +0000 (19:37 +0000)]
Explicit CTLFLAG_DYN not needed

Dynamically created OIDs automatically get this flag set.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D26561

3 years agoPopulate the acquire context field of a ww_mutex in the LinuxKPI.
Hans Petter Selasky [Sun, 4 Oct 2020 17:23:39 +0000 (17:23 +0000)]
Populate the acquire context field of a ww_mutex in the LinuxKPI.
Bump the FreeBSD version to force recompilation of external kernel modules.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26657
Submitted by: greg_unrelenting.technology (Greg V)
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoAdd support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to
Hans Petter Selasky [Sun, 4 Oct 2020 17:17:16 +0000 (17:17 +0000)]
Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to
the USB generic serial port driver, ugensa.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21863
Submitted by: greg_unrelenting.technology (Greg V)
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agongctl: add -c (compact output) for the dot command
Kyle Evans [Sun, 4 Oct 2020 17:07:13 +0000 (17:07 +0000)]
ngctl: add -c (compact output) for the dot command

The output of "ngctl dot" is suitable for small netgraph networks. Even
moderate complex netgraph setups (about a dozen nodes) are hard to
understand from the .dot output, because each node and each hook are shown
as a full blown structure.

This patch allows to generate much more compact output and graphs by
omitting the extra structures for the individual hooks. Instead the names of
the hooks are labels to the edges.

Submitted by: Lutz Donnerhacke <lutz_donnerhacke.de>
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21965

3 years agoAdd sig_intr(9).
Konstantin Belousov [Sun, 4 Oct 2020 16:33:42 +0000 (16:33 +0000)]
Add sig_intr(9).

It gives the answer would the thread sleep according to current state
of signals and suspensions.  Of course the answer is racy and allows
for false-negatives (no sleep when signal is delivered after process
lock is dropped).  Also the answer might change due to signal
rescheduling among threads in multi-threaded process.

Still it is the best approximation I can provide, to answering the
question was the thread interrupted.

Reviewed by: markj
Tested by: pho, rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D26628

3 years agoRefactor sleepq_catch_signals().
Konstantin Belousov [Sun, 4 Oct 2020 16:30:05 +0000 (16:30 +0000)]
Refactor sleepq_catch_signals().

- Extract suspension check into sig_ast_checksusp() helper.
- Extract signal check and calculation of the interruption errno into
  sig_ast_needsigchk() helper.
The helpers are moved to kern_sig.c which is the proper place for
signal-related code.

Improve control flow in sleepq_catch_signals(), to handle ret == 0
(can sleep) and ret != 0 (interrupted) only once, by separating
checking code into sleepq_check_ast_sq_locked(), which return value is
interpreted at single location.

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

3 years agoUse __func__ instead of __FUNCTION__ for consistency.
Michael Tuexen [Sun, 4 Oct 2020 15:37:34 +0000 (15:37 +0000)]
Use __func__ instead of __FUNCTION__ for consistency.

MFC after: 3 days

3 years agoCleanup, no functional change intended.
Michael Tuexen [Sun, 4 Oct 2020 15:22:14 +0000 (15:22 +0000)]
Cleanup, no functional change intended.

MFC after: 3 days

3 years agoFix route flags update during RTM_CHANGE.
Alexander V. Chernikov [Sun, 4 Oct 2020 13:24:58 +0000 (13:24 +0000)]
Fix route flags update during RTM_CHANGE.
Nexthop lookup was not consireding rt_flags when doing
 structure comparison, which lead to an original nexthop
 selection when changing flags. Fix the case by adding
 rt_flags field into comparison and rearranging nhop_priv
 fields to allow for efficient matching.
Fix `route change X/Y flags` case - recent changes
 disallowed specifying RTF_GATEWAY flag without actual gateway.
 It turns out, route(8) fills in RTF_GATEWAY by default, unless
 -interface flag is specified. Fix regression by clearing
 RTF_GATEWAY flag instead of failing.
Fix route flag reporting in RTM_CHANGE messages by explicitly
 updating rtm_flags after operation competion.
Add IPv4/IPv6 tests for flag-only route changes.

3 years agoamd64: Store full 64bit of FIP/FDP for 64bit processes when using XSAVE.
Konstantin Belousov [Sat, 3 Oct 2020 23:17:29 +0000 (23:17 +0000)]
amd64: Store full 64bit of FIP/FDP for 64bit processes when using XSAVE.

If current process is 64bit, use rex-prefixed version of XSAVE
(XSAVE64).  If current process is 32bit and CPU supports saving
segment registers cs/ds in the FPU save area, use non-prefixed variant
of XSAVE.

Reported and tested by: Michał Górny <mgorny@mgorny@moritz.systems>
PR: 250043
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D26643

3 years agoFix pmap_pti_add_kva() call for doublefault stack page.
Konstantin Belousov [Sat, 3 Oct 2020 23:11:20 +0000 (23:11 +0000)]
Fix pmap_pti_add_kva() call for doublefault stack page.

After r354889 stack got struct nmi_pcpu at top, which makes IST top
not page-aligned.  Since pmap_pti_add_kva() truncates/rounds up
addresses, it erronously entered a page mapped before double fault
stack into the pti page table.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 years agoMove ctx_switch_xsave declaration to amd64 md_var.h.
Konstantin Belousov [Sat, 3 Oct 2020 23:07:09 +0000 (23:07 +0000)]
Move ctx_switch_xsave declaration to amd64 md_var.h.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 years agocpuset(1): Fix some issues reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 19:10:54 +0000 (19:10 +0000)]
cpuset(1): Fix some issues reported by mandoc

- whitespace at end of input line
- new sentence, new line

MFC after: 1 week

3 years agoAdd virtio-9p (aka VirtFS) filesystem sharing to bhyve.
Jakub Wojciech Klama [Sat, 3 Oct 2020 19:05:13 +0000 (19:05 +0000)]
Add virtio-9p (aka VirtFS) filesystem sharing to bhyve.

VirtFS allows sharing an arbitrary directory tree between bhyve virtual
machine and the host. Current implementation has a fairly complete support
for 9P2000.L protocol, except for the extended attribute support. It has
been verified to work with the qemu-kvm hypervisor.

Reviewed by: rgrimes, emaste, jhb, trasz
Approved by: trasz (mentor)
MFC after: 1 month
Relnotes: yes
Sponsored by: Conclusive Engineering (development), vStack.com (funding)
Differential Revision: https://reviews.freebsd.org/D10335

3 years agoImport lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c.
Jakub Wojciech Klama [Sat, 3 Oct 2020 18:52:54 +0000 (18:52 +0000)]
Import lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c.

Approved by: trasz (mentor)
Sponsored by: Conclusive Engineering Sp. z o. o.

3 years agogvinum(8): Fix an issue reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:49:00 +0000 (18:49 +0000)]
gvinum(8): Fix an issue reported by mandoc

- new sentence, new line

MFC after: 1 week

3 years agomdmfs(8): Fix an issue reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:47:50 +0000 (18:47 +0000)]
mdmfs(8): Fix an issue reported by mandoc

- whitespace at end of input line

MFC after: 1 week

3 years agoveriexec(8): Bugfix for an issue reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:46:42 +0000 (18:46 +0000)]
veriexec(8): Bugfix for an issue reported by mandoc

- consider using OS macro: Nx

MFC after: 1 week

3 years agofsdb(8): Fix an issue reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:44:13 +0000 (18:44 +0000)]
fsdb(8): Fix an issue reported by mandoc

- whitespace at end of input line

MFC after: 1 week

3 years agodhclient(8): Bugfixes for some issues reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:42:15 +0000 (18:42 +0000)]
dhclient(8): Bugfixes for some issues reported by mandoc

- no blank before trailing delimiter
- new sentence, new line

MFC after: 1 week

3 years agocamcontrol(8): Bugfixes for some issues reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:40:02 +0000 (18:40 +0000)]
camcontrol(8): Bugfixes for some issues reported by mandoc

- new sentence, new line

MFC after: 1 week

3 years agodevd.conf(5): Bugfix for an issue reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:37:59 +0000 (18:37 +0000)]
devd.conf(5): Bugfix for an issue reported by mandoc

- whitespace at end of input line

MFC after: 1 week

3 years agocp(1): Bugfixes for some issues reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:36:22 +0000 (18:36 +0000)]
cp(1): Bugfixes for some issues reported by mandoc

- no blank before trailing delimiter

MFC after: 1 week

3 years agols(1): Bugfix for an issue reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:34:24 +0000 (18:34 +0000)]
ls(1): Bugfix for an issue reported by mandoc

- no blank before trailing delimiter

MFC after: 1 week

3 years agoipfw(8): Bugfixes for some issues reported by mandoc
Gordon Bergling [Sat, 3 Oct 2020 18:30:01 +0000 (18:30 +0000)]
ipfw(8): Bugfixes for some issues reported by mandoc

- whitespace at end of input line
- new sentence, new line
- skipping paragraph macro: Pp before Pp

MFC after: 1 week

3 years agoRemove ROUTE_MPATH-related warnings introduced in r366390.
Alexander V. Chernikov [Sat, 3 Oct 2020 14:37:54 +0000 (14:37 +0000)]
Remove ROUTE_MPATH-related warnings introduced in r366390.

Reported by: mjg

3 years agopwm_backlight: Add regnode_if.h to SRCS
Emmanuel Vadot [Sat, 3 Oct 2020 14:01:20 +0000 (14:01 +0000)]
pwm_backlight: Add regnode_if.h to SRCS

If the kernel config doesn't have this pseudo device it will not be generated
and then the module will fail to compile.

Reported by: mjg

3 years agopwm_backlight: Depend on ext_resources
Emmanuel Vadot [Sat, 3 Oct 2020 14:00:33 +0000 (14:00 +0000)]
pwm_backlight: Depend on ext_resources

This driver cannot work without it.

3 years agonetmap: tools: extend CFLAGS after including bsd.prog.mk
Vincenzo Maffione [Sat, 3 Oct 2020 13:27:12 +0000 (13:27 +0000)]
netmap: tools: extend CFLAGS after including bsd.prog.mk

MFC after: 1 week

3 years agonetmap: tools: fix several compiler warnings
Vincenzo Maffione [Sat, 3 Oct 2020 13:19:48 +0000 (13:19 +0000)]
netmap: tools: fix several compiler warnings

MFC after: 1 week

3 years agoOptimize riscv's cpu_fetch_syscall_args(), making it possible
Edward Tomasz Napierala [Sat, 3 Oct 2020 13:01:07 +0000 (13:01 +0000)]
Optimize riscv's cpu_fetch_syscall_args(), making it possible
for the compiler to inline the memcpy.

Reviewed by: arichardson, mhorne
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26528

3 years agoMove KTRUSERRET() from userret() to ast(). It's a really long
Edward Tomasz Napierala [Sat, 3 Oct 2020 12:03:08 +0000 (12:03 +0000)]
Move KTRUSERRET() from userret() to ast().  It's a really long
detour - it writes ktrace entries to the filesystem - so the overhead
of ast() won't make any difference.

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26404

3 years agoIntroduce scalable route multipath.
Alexander V. Chernikov [Sat, 3 Oct 2020 10:47:17 +0000 (10:47 +0000)]
Introduce scalable route multipath.

This change is based on the nexthop objects landed in D24232.

The change introduces the concept of nexthop groups.
Each group contains the collection of nexthops with their
 relative weights and a dataplane-optimized structure to enable
 efficient nexthop selection.

Simular to the nexthops, nexthop groups are immutable. Dataplane part
 gets compiled during group creation and is basically an array of
 nexthop pointers, compiled w.r.t their weights.

With this change, `rt_nhop` field of `struct rtentry` contains either
 nexthop or nexthop group. They are distinguished by the presense of
 NHF_MULTIPATH flag.
All dataplane lookup functions returns pointer to the nexthop object,
leaving nexhop groups details inside routing subsystem.

User-visible changes:

The change is intended to be backward-compatible: all non-mpath operations
 should work as before with ROUTE_MPATH and net.route.multipath=1.

All routes now comes with weight, default weight is 1, maximum is 2^24-1.

Current maximum multipath group width is statically set to 64.
 This will become sysctl-tunable in the followup changes.

Using functionality:
* Recompile kernel with ROUTE_MPATH
* set net.route.multipath to 1

route add -6 2001:db8::/32 2001:db8::2 -weight 10
route add -6 2001:db8::/32 2001:db8::3 -weight 20

netstat -6On

Nexthop groups data

Internet6:
GrpIdx  NhIdx     Weight   Slots                                 Gateway     Netif  Refcnt
1         ------- ------- ------- --------------------------------------- ---------       1
              13      10       1                             2001:db8::2     vlan2
              14      20       2                             2001:db8::3     vlan2

Next steps:
* Land outbound hashing for locally-originated routes ( D26523 ).
* Fix net/bird multipath (net/frr seems to work fine)
* Add ROUTE_MPATH to GENERIC
* Set net.route.multipath=1 by default

Tested by: olivier
Reviewed by: glebius
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D26449

3 years agonetmap: minor documentation fix
Vincenzo Maffione [Sat, 3 Oct 2020 09:36:33 +0000 (09:36 +0000)]
netmap: minor documentation fix

Also update date of pkt-gen.8 (not done in r366387).

Submitted by: milosz.kaniewski@gmail.com
MFC after: 3 days

3 years agonetmap: fix constness warnings generated by "-Wcast-qual"
Vincenzo Maffione [Sat, 3 Oct 2020 09:33:29 +0000 (09:33 +0000)]
netmap: fix constness warnings generated by "-Wcast-qual"

Submitted by: milosz.kaniewski@gmail.com
MFC after: 3 days