]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agorc.d/rctl: unbreak for distinct /usr filesystem
Eugene Grosbein [Sat, 20 Nov 2021 08:54:39 +0000 (15:54 +0700)]
rc.d/rctl: unbreak for distinct /usr filesystem

Both rctl and used xargs utility live in /usr/bin
so add REQUIRE: FILESYSTEMS

Reported by: Peter <pmc@citylink.dinoex.sub.org>
MFC after: 3 days

2 years agomixer: make .Dt tags uppercase
Christos Margiolis [Sat, 20 Nov 2021 07:58:36 +0000 (08:58 +0100)]
mixer: make .Dt tags uppercase

The document title should be uppercase in man pages.

Reviewed by: imp, gbe
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D33027

2 years agohyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR
Mark Johnston [Fri, 19 Nov 2021 22:30:05 +0000 (17:30 -0500)]
hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR

This reverts commit 9ef7df022a46 ("hyperv: Register hyperv_timecounter
later during boot") and adds a comment explaining why the timecounter
needs to be registered as early as it is.

PR: 259878
Fixes: 9ef7df022a46 ("hyperv: Register hyperv_timecounter later during boot")
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33014

2 years agotimecounter: Initialize tc_lock earlier
Mark Johnston [Fri, 19 Nov 2021 22:29:28 +0000 (17:29 -0500)]
timecounter: Initialize tc_lock earlier

Hyper-V wants to register its MSR-based timecounter during
SI_SUB_HYPERVISOR, before SI_SUB_LOCK, since an emulated 8254 may not be
available for DELAY().  So we cannot use MTX_SYSINIT to initialize the
timecounter lock.

PR: 259878
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33014

2 years agolagg: fix unused-but-set-variable
Kristof Provost [Fri, 19 Nov 2021 16:22:48 +0000 (17:22 +0100)]
lagg: fix unused-but-set-variable

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoAllow minidumps to be performed on the live system
Mitchell Horne [Wed, 17 Nov 2021 15:35:59 +0000 (11:35 -0400)]
Allow minidumps to be performed on the live system

Add a boolean parameter to minidumpsys(), to indicate a live dump. When
requested, take a snapshot of important global state, and pass this to
the machine-dependent minidump function. For now this includes the
kernel message buffer, and the bitset of pages to be dumped. Beyond
this, we don't take much action to protect the integrity of the dump
from changes in the running system.

A new function msgbuf_duplicate() is added for snapshotting the message
buffer. msgbuf_copy() is insufficient for this purpose since it marks
any new characters it finds as read.

For now, nothing can actually trigger a live minidump. A future patch
will add the mechanism for this. For simplicity and safety, live dumps
are disallowed for mips.

Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31993

2 years agominidump: Use the provided dump bitset
Mitchell Horne [Wed, 17 Nov 2021 15:35:18 +0000 (11:35 -0400)]
minidump: Use the provided dump bitset

When constructing the set of dumpable pages, use the bitset provided by
the state argument, rather than assuming vm_page_dump invariably. For
normal kernel minidumps this will be a pointer to vm_page_dump, but when
dumping the live system it will not.

To do this, the functions in vm_dumpset.h are extended to accept the
desired bitset as an argument. Note that this provided bitset is assumed
to be derived from vm_page_dump, and therefore has the same size.

Reviewed by: kib, markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31992

2 years agominidump: Use provided msgbuf pointer
Mitchell Horne [Wed, 17 Nov 2021 15:34:13 +0000 (11:34 -0400)]
minidump: Use provided msgbuf pointer

Don't assume we are dumping the global message buffer, but use the one
provided by the state argument. While here, drop superfluous
cast to char *.

Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31991

2 years agominidump: reduce the amount direct accesses to page tables
Mitchell Horne [Wed, 17 Nov 2021 15:30:43 +0000 (11:30 -0400)]
minidump: reduce the amount direct accesses to page tables

During a live dump, we may race with updates to the kernel page tables.
This is generally okay; we accept that the state of the system while
dumping may be somewhat inconsistent with its state when the dump was
invoked. However, when walking the kernel page tables, it is important
that we load each PDE/PTE only once while operating on it. Otherwise, it
is possible to have the relevant PTE change underneath us. For example,
after checking the valid bit, but before reading the physical address.

Convert the loads to atomics, and add some validation around the
physical addresses, to ensure that we do not try to dump a non-existent
or non-canonical physical address.

Similarly, don't read kernel_vm_end more than once, on the off chance
that pmap_growkernel() is called between the two page table walks.

Reviewed by: kib, markj
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31990

2 years agoamd64: provide PHYS_IN_DMAP() and VIRT_IN_DMAP()
Mitchell Horne [Wed, 17 Nov 2021 15:29:02 +0000 (11:29 -0400)]
amd64: provide PHYS_IN_DMAP() and VIRT_IN_DMAP()

It is useful for quickly checking an address against the DMAP region.
These definitions exist already on arm64 and riscv.

Reviewed by: kib, markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D32962

2 years agominidump: Parameterize minidumpsys()
Mitchell Horne [Wed, 17 Nov 2021 15:26:59 +0000 (11:26 -0400)]
minidump: Parameterize minidumpsys()

The minidump code is written assuming that certain global state will not
change, and rightly so, since it executes from a kernel debugger
context. In order to support taking minidumps of a live system, we
should allow copies of relevant global state that is likely to change to
be passed as parameters to the minidumpsys() function.

This patch does the work of parameterizing this function, by adding a
struct minidumpstate argument. For now, this struct allows for copies of
the kernel message buffer, and the bitset that tracks which pages should
be dumped (vm_page_dump). Follow-up changes will actually make use of
these arguments.

Notably, dump_avail[] does not need a snapshot, since it is not expected
to change after system initialization.

The existing minidumpsys() definitions are renamed, and a thin MI
wrapper is added to kern_dump.c, which handles the construction of
the state struct. Thus, calling minidumpsys() remains as simple as
before.

Reviewed by: kib, markj, jhb
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31989

2 years agolpr(1): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 19:04:09 +0000 (20:04 +0100)]
lpr(1): Fix a typo in a source code comment

-s /debuging/debugging/

MFC after: 3 days

2 years agoixl(4): Fix a typo in a sysctl description
Gordon Bergling [Fri, 19 Nov 2021 18:59:28 +0000 (19:59 +0100)]
ixl(4): Fix a typo in a sysctl description

MFC after: 3 days

2 years agoiwm(4): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:51:55 +0000 (19:51 +0100)]
iwm(4): Fix a typo in a source code comment

- s/availabe/available/

MFC after: 3 days

2 years agofirewire(4): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:50:56 +0000 (19:50 +0100)]
firewire(4): Fix a typo in a source code comment

- s/unavailabe/unavailable/

MFC after: 3 days

2 years agoiscsi(4): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:29:21 +0000 (19:29 +0100)]
iscsi(4): Fix a typo in a source code comment

- s/conditon/condition/

MFC after: 3 days

2 years agoTWL: Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:26:34 +0000 (19:26 +0100)]
TWL: Fix a typo in a source code comment

- s/maxium/maximum/

MFC after: 3 days

2 years agoppbus(4): Fix a typo in source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:19:36 +0000 (19:19 +0100)]
ppbus(4): Fix a typo in source code comment

- s/quering/querying/

Obtained from: NetBSD
MFC after: 3 days

2 years agoffs_softdep: Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:17:41 +0000 (19:17 +0100)]
ffs_softdep: Fix a typo in a source code comment

- s/conditonally/conditionally/

MFC after: 3 days

2 years agocc_newreno(4): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:16:02 +0000 (19:16 +0100)]
cc_newreno(4): Fix a typo in a source code comment

- s/conditons/conditions/

MFC after: 3 days

2 years agosched_ule(4): Fix two typo in source code comments
Gordon Bergling [Fri, 19 Nov 2021 18:13:28 +0000 (19:13 +0100)]
sched_ule(4): Fix two typo in source code comments

- s/conditons/conditions/
- s/unconditonally/unconditionally/

MFC after: 3 days

2 years agoUse a builtin where possible in msun
Andrew Turner [Tue, 2 Nov 2021 11:31:17 +0000 (11:31 +0000)]
Use a builtin where possible in msun

Some of the functions in msun can be implemented using a compiler
builtin function to generate a small number of instructions. Implement
this support in fma, fmax, fmin, and sqrt on arm64.

Care must be taken as the builtin can be implemented as a function
call on some architectures that lack direct support. In these cases
we need to use the original code path.

As we don't set errno on failure build with -fno-math-errno so the
toolchain doesn't convert a builtin into a function call when it
detects a failure, e.g. gcc will add a call to sqrt when the input
is negative leading to an infinite loop.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32801

2 years agoSwitch to Arm Optimized Routines for mem* & str*
Andrew Turner [Mon, 1 Nov 2021 13:06:56 +0000 (13:06 +0000)]
Switch to Arm Optimized Routines for mem* & str*

These are the updated version of the older Cortex Strings Library we
previously used. The Arm Optimized Routines also support CPU features
that are currently in development on FreeBSD, e.g. Branch Target
Identification (BTI). Rather than add BTI support to the old code it's
easier to just use the maintained version.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32774

2 years agouuid(3): Document return values
Felix Johnson [Fri, 19 Nov 2021 08:42:49 +0000 (03:42 -0500)]
uuid(3): Document return values

PR: 204449
MFC after: 3 days
Reported by: Michael Cress <michael.cress@cress.us>

2 years agoiflib_stop: drain rx tasks to prevent any data races
Andriy Gapon [Fri, 19 Nov 2021 07:56:30 +0000 (09:56 +0200)]
iflib_stop: drain rx tasks to prevent any data races

iflib_stop modifies iflib data structures that are used by _task_fn_rx,
most prominently the free lists.  So, iflib_stop has to ensure that the
rx task threads are not active.

This should help to fix a crash seen when iflib_if_ioctl (e.g.,
SIOCSIFCAP) is called while there is already traffic flowing.

The crash has been seen on VMWare guests with vmxnet3 driver.

My guess is that on physical hardware the couple of 1ms delays that
iflib_stop has after disabling interrupts are enough for the queued work
to be completed before any iflib state is touched.

But on busy hypervisors the guests might not get enough CPU time to
complete the work, thus there can be a race between the taskqueue
threads and the work done to handle an ioctl, specifically in iflib_stop
and iflib_init_locked.

PR: 259458
Reviewed by: markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D32926

2 years agoRevert "Bootstrap: Prune building from pre-FreeBSD 11 support"
Warner Losh [Fri, 19 Nov 2021 07:10:21 +0000 (00:10 -0700)]
Revert "Bootstrap: Prune building from pre-FreeBSD 11 support"

This reverts commit a420a672bc53bd3928626aa5d0ec5b41c0471356.

kevans pointed out some potential problems here, so reverting until
I can fix them.

2 years agoCorrect the name of the second parameter of biowait to wmesg
Wuyang Chung [Sun, 17 Oct 2021 03:25:27 +0000 (11:25 +0800)]
Correct the name of the second parameter of biowait to wmesg

This parameter is passed directly to msleep, and the name of the msleep
parameter is wmesg. Make them match.

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

2 years agoFix 'take effect' spelling in menus and comments.
betterentley [Fri, 12 Nov 2021 21:55:27 +0000 (16:55 -0500)]
Fix 'take effect' spelling in menus and comments.

Signed-off-by: John Bentley <johnbentley.public@gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/559

2 years agogeom: Remove g_class.config
Wuyang Chung [Sat, 16 Oct 2021 01:43:54 +0000 (09:43 +0800)]
geom: Remove g_class.config

g_class.config is write only, remove it.

2 years agoBootstrap: Prune building from pre-FreeBSD 11 support
Warner Losh [Sun, 10 Oct 2021 17:28:54 +0000 (11:28 -0600)]
Bootstrap: Prune building from pre-FreeBSD 11 support

We don't need to bootstrap lex or md4 anymore.
Cat doesn't need to be bootstrapped (but is needed for buildkernel)
cruncgen doesn't need to be bootstrapped at all.
kbdcontrol isn't needed

Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/554

2 years agorelease/packages/Makefile.package: Fix typo
Elyes HAOUAS [Sat, 6 Nov 2021 11:59:36 +0000 (12:59 +0100)]
release/packages/Makefile.package: Fix typo

"librairies" --> "libraries"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/553

2 years agoFix typo on "Celsius"
Elyes HAOUAS [Wed, 6 Oct 2021 15:32:15 +0000 (17:32 +0200)]
Fix typo on "Celsius"

"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files

2 years agonanobsd/rescue: Catch up to 20210907 OpenSSH import
Warner Losh [Fri, 19 Nov 2021 05:54:54 +0000 (22:54 -0700)]
nanobsd/rescue: Catch up to 20210907 OpenSSH import

Sponsored by: Netflix

2 years agonanobsd: remove psuedo-terminals from ttys
Warner Losh [Fri, 19 Nov 2021 05:49:13 +0000 (22:49 -0700)]
nanobsd: remove psuedo-terminals from ttys

Yowsa! Another review mentioned this in passing... Only 10 years late.

Sponsored by: Netflix

2 years agoNanoBSD/rescue: Update to 20200214 OpenSSH configuration files
Jose Luis Duran [Fri, 16 Jul 2021 17:17:30 +0000 (14:17 -0300)]
NanoBSD/rescue: Update to 20200214 OpenSSH configuration files

No functional change intended.

2 years agoANSIify libsa functions
Alfonso [Wed, 7 Jul 2021 14:52:21 +0000 (10:52 -0400)]
ANSIify libsa functions

Convert libsa files to use ANSI function definitions.

Pull request: https://github.com/freebsd/freebsd-src/pull/508
[ cut and paste error corrected ]

2 years agoAdd tcp_freecb() - single place to free tcpcb.
Gleb Smirnoff [Fri, 19 Nov 2021 04:26:09 +0000 (20:26 -0800)]
Add tcp_freecb() - single place to free tcpcb.

Until this change there were two places where we would free tcpcb -
tcp_discardcb() in case if all timers are drained and tcp_timer_discard()
otherwise.  They were pretty much copy-n-paste, except that in the
default case we would run tcp_hc_update().  Merge this into single
function tcp_freecb() and move new short version of tcp_timer_discard()
to tcp_timer.c and make it static.

Reviewed by: rrs, hselasky
Differential revision: https://reviews.freebsd.org/D32965

2 years agotcp_timewait: use on stack struct tcptw as last resort
Gleb Smirnoff [Fri, 19 Nov 2021 04:24:46 +0000 (20:24 -0800)]
tcp_timewait: use on stack struct tcptw as last resort

In case we failed to uma_zalloc() and also failed to reuse with
tcp_tw_2msl_scan(), then just use on stack tcptw.  This will allow
to run through tcp_twrespond() and standard tcpcb discard routine.

Reviewed by: rrs
Differential revision: https://reviews.freebsd.org/D32965

2 years agoAdd warning that MIPS is being removed in FreeBSD 14.0
Warner Losh [Fri, 19 Nov 2021 04:21:55 +0000 (21:21 -0700)]
Add warning that MIPS is being removed in FreeBSD 14.0

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D32853

2 years agoDocument that 13.x is the end of the line for FreeBSD/mips
Warner Losh [Fri, 19 Nov 2021 04:21:46 +0000 (21:21 -0700)]
Document that 13.x is the end of the line for FreeBSD/mips

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: brooks, jhb, emaste
Differential Revision: https://reviews.freebsd.org/D32852

2 years agoRemove mips from universe
Warner Losh [Fri, 19 Nov 2021 04:21:38 +0000 (21:21 -0700)]
Remove mips from universe

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

2 years agogit-arc: with "create" allow to specify parent of the first commit
Gleb Smirnoff [Fri, 19 Nov 2021 02:49:20 +0000 (18:49 -0800)]
git-arc: with "create" allow to specify parent of the first commit

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D33045

2 years agogit-arc: document "create" command options
Gleb Smirnoff [Fri, 19 Nov 2021 02:47:44 +0000 (18:47 -0800)]
git-arc: document "create" command options

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

2 years agoLinuxKPI: make bcd.h use libkern
Bjoern A. Zeeb [Wed, 27 Oct 2021 17:07:38 +0000 (17:07 +0000)]
LinuxKPI: make bcd.h use libkern

Rather than having code to re-define bcd2bin() for the LinuxKPI
make sure libkern.h is always included before the LinuxKPI version.
Then only re-define our local LinuxKPI implementation.  [1]

From the argument truncating wrapper call the libkern version.
If we change our libkern implementation in the future we can save
us the remainder of the hassle. [2]  Given I need this to MFC,
which I am not sure we can with libkern, commit this intermediate
step.

Suggested by: Johannes Berg (johannes sipsolutions.net) [1]
Suggested by: ian [2]
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC with: 548ada00e54a9e7745d041b1ec7f68f3bd493365
Differential Revision: https://reviews.freebsd.org/D32695

2 years agomountd: Fix handling of usernames that start with a digit
Rick Macklem [Thu, 18 Nov 2021 21:35:25 +0000 (13:35 -0800)]
mountd: Fix handling of usernames that start with a digit

yocalebo_gmail.com submitted a patch for mountd.c that
fixes the case where a username starts with a digit.
Without this patch, the username that starts with a
digit is misinterpreted as a numeric uid.
With this patch, any string that does not entirely
convert to a decimal number via strtoul() is considered
a user/group name.

Submitted by: yocalebo_gmail.com
Reviewed by: rmacklem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32993

2 years agostyle.Makefile.5: Do not require $FreeBSD$ SCM IDs
Mateusz Piotrowski [Thu, 18 Nov 2021 21:00:30 +0000 (22:00 +0100)]
style.Makefile.5: Do not require $FreeBSD$ SCM IDs

It's no longer required to have those SCM IDs at the start of makefiles.

MFC after: 3 days

2 years agoRemove myself from bhyve maintenance; ENOTIME.
Peter Grehan [Thu, 18 Nov 2021 21:09:30 +0000 (07:09 +1000)]
Remove myself from bhyve maintenance; ENOTIME.

2 years agoext2fs: check for eh_depth in ext4_ext_check_header()
Neel Chauhan [Wed, 17 Nov 2021 00:25:04 +0000 (16:25 -0800)]
ext2fs: check for eh_depth in ext4_ext_check_header()

PR: 259112
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: fsu
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33030

2 years agorc.conf.5: Add entries for NFS
Rick Macklem [Thu, 18 Nov 2021 15:59:34 +0000 (07:59 -0800)]
rc.conf.5: Add entries for NFS

Entries for a few recently defined rc variables
were missing from rc.conf.5.  This patch adds
those.

It was not obvious to me what the ordering is,
so I added them to the area where other nfsd
related variables are.  I can easily move them.

I also replaced "are" with "is", since it seems to
read better.

This is a content change.

Reviewed by: debdrup
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33043

2 years agobhyve: do not explicitly map fbuf framebuffer
Corvin Köhne [Thu, 18 Nov 2021 15:26:34 +0000 (16:26 +0100)]
bhyve: do not explicitly map fbuf framebuffer

Allocating a BAR will call baraddr which maps the framebuffer. No need
to allocate it explicitly on init.

Reviewed by:     grehan
Sponsored by:    Beckhoff Autmation GmbH & Co. KG
Differential Revision:    https://reviews.freebsd.org/D32596

2 years agobhyve: use physical lobits for BARs of passthru devices
Corvin Köhne [Thu, 18 Nov 2021 15:25:09 +0000 (16:25 +0100)]
bhyve: use physical lobits for BARs of passthru devices

Tell the guest whether a BAR uses prefetched memory or not for
passthru devices by using the same lobits as the physical device.

Reviewed by:  grehan
Sponsored by:  Beckhoff Autmation GmbH & Co. KG
Differential Revision:   https://reviews.freebsd.org/D32685

2 years agonet80211: radiotap add another define
Bjoern A. Zeeb [Thu, 18 Nov 2021 14:57:09 +0000 (14:57 +0000)]
net80211: radiotap add another define

Add a define needed by latest iwlwifi-next.

Sponsored by: The FreeBSD Foundation

2 years agoCirrus-CI: build with LLVM 13 package
Ed Maste [Wed, 17 Nov 2021 02:42:51 +0000 (21:42 -0500)]
Cirrus-CI: build with LLVM 13 package

As of 28a41182c08e the base system uses Clang/LLVM 13.  Follow along in
Cirrus-CI (which uses a packaged toolchain for speed).

Sponsored by: The FreeBSD Foundation

2 years agotop.1: Use the Dq macros instead of \*lq and \*rq
Mateusz Piotrowski [Thu, 18 Nov 2021 14:55:27 +0000 (15:55 +0100)]
top.1: Use the Dq macros instead of \*lq and \*rq

MFC after: 3 days

2 years agotop.1: Improve description of -m
Mateusz Piotrowski [Thu, 18 Nov 2021 14:31:48 +0000 (15:31 +0100)]
top.1: Improve description of -m

Describe -m argument as "mode" instead of "display".

MFC after: 3 days

2 years agotop: Sort flags in usage message
Mateusz Piotrowski [Thu, 18 Nov 2021 13:21:34 +0000 (14:21 +0100)]
top: Sort flags in usage message

While here, fix the indentation of the second line in the message.

MFC after: 3 days

2 years agotop.1: Sort options alphabetically
Mateusz Piotrowski [Thu, 18 Nov 2021 13:11:23 +0000 (14:11 +0100)]
top.1: Sort options alphabetically

While here, add a short sentence introducing the options.

MFC after: 3 days

2 years agotop.1: Fix a typo in description of H interactive command
Mateusz Piotrowski [Thu, 18 Nov 2021 12:50:56 +0000 (13:50 +0100)]
top.1: Fix a typo in description of H interactive command

B is listed as an interactive command to toggle the display of threads.
This is a typo introduced during the conversion of the manual page to
mdoc.

Fixes: 9d6cce02a78c967e69b603d503545c4b43d7765f
MFC after: 3 days

2 years agokmod_syms.awk: fix removal of the export list from the symbol table
Konstantin Belousov [Sun, 7 Nov 2021 09:00:07 +0000 (11:00 +0200)]
kmod_syms.awk: fix removal of the export list from the symbol table

Print some warning when export is requested for non-existing symbol.

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

2 years agoKernel linkers: some style
Konstantin Belousov [Sun, 7 Nov 2021 09:03:45 +0000 (11:03 +0200)]
Kernel linkers: some style

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D32878

2 years agoFix some modules to export more used symbols
Konstantin Belousov [Sun, 7 Nov 2021 08:42:24 +0000 (10:42 +0200)]
Fix some modules to export more used symbols

and remove non-present symbols that are now reported by kmod_syms.awk.

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

2 years agoin6_rmx: remove unnecessary TCP includes
Gleb Smirnoff [Thu, 18 Nov 2021 08:53:42 +0000 (00:53 -0800)]
in6_rmx: remove unnecessary TCP includes

2 years agoipfw: remove unnecessary TCP related includes
Gleb Smirnoff [Thu, 18 Nov 2021 08:53:15 +0000 (00:53 -0800)]
ipfw: remove unnecessary TCP related includes

2 years agoxen/privcmd: fix MMAP_RESOURCE ioctl to copy out results
Roger Pau Monné [Wed, 17 Nov 2021 10:48:35 +0000 (11:48 +0100)]
xen/privcmd: fix MMAP_RESOURCE ioctl to copy out results

The current definition for the MMAP_RESOURCE ioctl was wrong as it
didn't copy back the result to the caller. Fix the definition and also
remove the bogus attempt to copy the result in the implementation.

Note such copy back is only needed when querying the size of a
resource.

Sponsored by: Citrix Systems R&D

2 years agog_vfs_close(): vp is unused
Konstantin Belousov [Thu, 18 Nov 2021 03:02:59 +0000 (05:02 +0200)]
g_vfs_close(): vp is unused

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agofspacectl: remove unneeded freebsd32 wrapper
Brooks Davis [Thu, 18 Nov 2021 01:02:06 +0000 (01:02 +0000)]
fspacectl: remove unneeded freebsd32 wrapper

fspacectl(2) does not require special handling on freebsd32. The
presence of off_t in a struct does not cause it's size to change
between the native ABI and the 32-bit ABI supported by freebsd32
because off_t is always int64_t on BSD systems.  Further, byte
order only requires handling for paired argument or return registers.

(32-byte alignment of 64-bit objects on i386 can require special
handling, but that situtation does not apply here.)

Reviewed by: kib, khng, emaste, delphij
Differential Revision: https://reviews.freebsd.org/D32994

2 years agoelf*_brand_inuse: Change return type to bool.
Alex Richardson [Wed, 17 Nov 2021 23:51:40 +0000 (15:51 -0800)]
elf*_brand_inuse: Change return type to bool.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33052

2 years agoimgact_elf: Use bool instead of boolean_t.
Alex Richardson [Wed, 17 Nov 2021 23:51:29 +0000 (15:51 -0800)]
imgact_elf: Use bool instead of boolean_t.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33051

2 years agolinux_name_to_handle_at: Support AT_EMPTY_PATH.
John Baldwin [Wed, 17 Nov 2021 23:51:18 +0000 (15:51 -0800)]
linux_name_to_handle_at: Support AT_EMPTY_PATH.

Reviewed by: kib
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33050

2 years agolinux_linkat: Don't invert AT_* flags.
John Baldwin [Wed, 17 Nov 2021 23:51:06 +0000 (15:51 -0800)]
linux_linkat: Don't invert AT_* flags.

Reviewed by: kib
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33048

2 years agortld-elf: Use _get_tp in __tls_get_addr for aarch64 and riscv64.
John Baldwin [Wed, 17 Nov 2021 23:50:55 +0000 (15:50 -0800)]
rtld-elf: Use _get_tp in __tls_get_addr for aarch64 and riscv64.

Reviewed by: kib
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33047

2 years agolibarchive: cherry-pick bugfix from vendor
Martin Matuska [Wed, 17 Nov 2021 21:21:19 +0000 (22:21 +0100)]
libarchive: cherry-pick bugfix from vendor

Vendor commit message (ede459d2e):
  archive_write_disk_posix: fix writing fflags broken in 8a1bd5c

  The fixup list was erroneously assumed to be directories only.
  Only in the case of critical file flags modification (e.g.
  SF_IMMUTABLE on BSD systems), other file types (e.g. regular files
  or symbolic links) may be added to the fixup list. We still need to
  verify that we are writing to the correct file type, so compare the
  archive entry file type with the file type of the file to be
  modified.

Fixes vendor issue #1617:
  Immutable flag no longer preserved during tar extraction on FreeBSD

MFC after: 3 days
Reported by: markjdb
Libarchive commit: ede459d2ebb879f5eedb6f7abea203be0b334230

2 years agofreebsd32: sync some audit types with default ABI
Brooks Davis [Wed, 17 Nov 2021 20:12:27 +0000 (20:12 +0000)]
freebsd32: sync some audit types with default ABI

Reviewed by: kevans

2 years agofreebsd32: sync return types with default ABI
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: sync return types with default ABI

This consists of int -> ssize_t where required and one int -> mode_t.
As a rule, return types are informative rather than functional as the
actual return is in a register.

Reviewed by: kevans

2 years agofreebsd32: semid_t -> int32_t
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: semid_t -> int32_t

semid_t is historically an intptr_t so it should be an int32_t.

Reviewed by: kevans

2 years agofreebsd32: update unimplemented syscall comments
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: update unimplemented syscall comments

These were out of sync with sys/kern/syscalls.master

Reviewed by: kevans

2 years agofreebsd32: use __socklen_t consistently
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: use __socklen_t consistently

Reviewed by: kevans

2 years agofreebsd32: tag RESERVED syscalls
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: tag RESERVED syscalls

This reduces diffs when generating freebsd32 files from the default
ABI's syscalls.master.

Reviewed by: kevans

2 years agofreebsd32: rename 32-bit compat pads to _pad
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: rename 32-bit compat pads to _pad

Some 32-bit architectures pass 64-bit values in aligned
register pairs (a0,a1), (a2,a3) etc.  In freebsd32 we add these pads
explicitly from compat code.  We also sometimes add pads in the default
ABI.  Differentiate the two by making the freebsd32 ones int _pad.
In a future commit the 32-bit ones will be automatically generated.

Reviewed by: kevans

2 years agofreebsd32: have sigqueue take a void *
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: have sigqueue take a void *

This matches the default ABI and we work around issues with
union sigval by extracting the bottom 32-bits in a manual handler.

Reviewed by: kevans

2 years agofreebsd32: fix getfsstat sign extension bugs
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: fix getfsstat sign extension bugs

Add freebsd32 versions of getfsstat and freebsd11_getfsstat so that
bufsize is properly sign-extended if a negative value is passed.
Reject negative values before passing to kern_getfsstat as a size_t.

Reviewed by: kevans

2 years agofreebsd32: signed long corrections
Brooks Davis [Wed, 17 Nov 2021 20:12:26 +0000 (20:12 +0000)]
freebsd32: signed long corrections

Syscalls that take signed longs need to treat the 32-bit versions as
signed int so that sign extension happens correctly.  Improve
decleration quality and add a few minimal syscall implementations.

Reviewed by: kevans

2 years agofreebsd32: add missing pads to preadv and pwritev
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: add missing pads to preadv and pwritev

Reviewed by: kevans

2 years agofreebsd32: add stubs for ofreebsd32_(send|recv)msg
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: add stubs for ofreebsd32_(send|recv)msg

The upcoming change to generate freebsd32 generated files from
sys/kern/syscalls.master doesn't have a way to handle disabling
this one without disabling the non-COMPAT counterpart so just add
a stub for now.

Reviewed by: kevans

2 years agofreebsd32: add real abort2
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: add real abort2

Previously, the code would copy twice as many pointers as specified
and print pairs of them a single 64-bit pointer.

abort2 doesn't return so make the return type void

freebsd32_abort2 is in it's own file with a 2-clause BSD license
based on a discussion with Wojciech many years ago.

Reviewed by: kevans

2 years agofreebsd32: add feed foward clock syscalls
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: add feed foward clock syscalls

These are required when supporting i386 because time_t is 32-bit which
reduces struct bintime to 12-bytes when combined with the fact that 64-bit
integers only requiring 32-bit alignment on i386.  Reusing the default
ABI version resulted in 4-byte overreads or overwrites to userspace.

Reviewed by: kevans

2 years agofreebsd32: enable trivial syscalls
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: enable trivial syscalls

These syscalls require no translation.  They were simply missing
from compat/freebsd32/syscalls.master.

Reviewed by: kevans

2 years agofreebsd32: don't implement kldsym
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: don't implement kldsym

Previously we fell back to sys_kldsym, but because we'd always
mismatch on the version field we'd return EINVAL.  A freebsd32
implementation is impossible with the current ABI as there simply
isn't space to store a kernel virtual address in a uint32_t.

Reviewed by: kevans

2 years agofreebsd32: remove freebsd11_freebsd32_getdents
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: remove freebsd11_freebsd32_getdents

It's exactly the same as freebsd11_getdents.

Reviewed by: kevans

2 years agofreebsd32: remove redundent osig*() implementations
Brooks Davis [Wed, 17 Nov 2021 20:12:25 +0000 (20:12 +0000)]
freebsd32: remove redundent osig*() implementations

ofreebsd32_sigprocmask, ofreebsd32_sigblock, ofreebsd32_sigsetmask,
and ofreebsd32_sigsuspend were all duplicates of the default ABI
versions and there are no type concerns as all arguments are the
same.

Reviewed by: kevans

2 years agofreebsd32: remove freebsd32_recvfrom
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: remove freebsd32_recvfrom

The freebsd32_recvfrom() serves no purpose as no arguments require
translation.  The prototype was mis-declared and the implementation
contained (relatively harmless) errors.

Reviewed by: kevans

2 years agofreebsd32: remove redundant no-arg syscalls
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: remove redundant no-arg syscalls

pipe requires no special handling.

ofreebsd32_sigpending did differ from osigpending in that it acted
on the siglist rather than the sigqueue, but this appears to be an
oversight in 3fbdb3c21524d9d95278ada1d61b4d1e6bee654b.

ogetpagesize could theoretically have ABI-dependent results, but in
practice does not. If it does it would be easy handle in the central
implementation and be the least of the problems in changing the value of
PAGE_SIZE.

Reviewed by: kevans

2 years agofreebsd32: simplify memrange translation
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: simplify memrange translation

Assume we've been passed a valid argument and use _IOC_NEWTYPE to
translate the command as we do elsewhere.

Reviewed by: kevans

2 years agofreebsd32: rename fstat() stat buffer argument
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: rename fstat() stat buffer argument

Reviewed by: kevans

2 years agofreebsd32: rename struct wrusage32 to struct __wrusage32
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: rename struct wrusage32 to struct __wrusage32

This matches struct __wrusage

Reviewed by: kevans

2 years agofreebsd32: include `__` in semctl names
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: include `__` in semctl names

This mirrors sys/kern/syscall.master and will simplify generation
of freebsd32 files.

Reviewed by: kevans

2 years agofreebsd32: sync _umtx_op args with default ABI
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: sync _umtx_op args with default ABI

Reviewed by: kevans

2 years agofreebsd32: rename fstat argument to match default abi
Brooks Davis [Wed, 17 Nov 2021 20:12:24 +0000 (20:12 +0000)]
freebsd32: rename fstat argument to match default abi

Reviewed by: kevans

2 years agofreebsd32: rename old SysV IPC types
Brooks Davis [Wed, 17 Nov 2021 20:12:23 +0000 (20:12 +0000)]
freebsd32: rename old SysV IPC types

Move the 32 from ...32_old to ..._old32 to aid automatic generation.

Reviewed by: kevans

2 years agofreebsd32: struct kld32_file_stat -> struct kld_file_stat32
Brooks Davis [Wed, 17 Nov 2021 20:12:23 +0000 (20:12 +0000)]
freebsd32: struct kld32_file_stat -> struct kld_file_stat32

Follow common convention and put the `32` on the end of the struct
name.  This is a step toward generating freebsd32 syscall files
from sys/kern/syscalls.master.

Reviewed by: kevans