]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
23 months agorelease.7: Remove Subversion references
Mateusz Piotrowski [Thu, 21 Jul 2022 18:25:58 +0000 (20:25 +0200)]
release.7: Remove Subversion references

MFC after: 1 week

23 months agorelease.7: Update EMDEDDEDPORTS documentation
Mateusz Piotrowski [Thu, 21 Jul 2022 18:21:44 +0000 (20:21 +0200)]
release.7: Update EMDEDDEDPORTS documentation

EMDEDDEDPORTS does not contain devel/subversion anymore.

Fixes: a03128832c6c In extra_chroot_setup(), use 'uname -U' to determine OSVERSION.
MFC after: 1 week

23 months agotmpfs.5: Add fstab line example
Mateusz Piotrowski [Thu, 21 Jul 2022 18:06:32 +0000 (20:06 +0200)]
tmpfs.5: Add fstab line example

MFC after: 3 days

23 months agotmpfs.5: Fix typos and linter warnings
Mateusz Piotrowski [Thu, 21 Jul 2022 18:01:49 +0000 (20:01 +0200)]
tmpfs.5: Fix typos and linter warnings

MFC after: 3 days

23 months agopw.8: Refernece to openssl-passwd(1) and crypt(3)
Mateusz Piotrowski [Thu, 21 Jul 2022 17:59:19 +0000 (19:59 +0200)]
pw.8: Refernece to openssl-passwd(1) and crypt(3)

It may be unclear how to generate an encrypted password hash for -H,
so point users to openssl-passwd(1) and crypt(3).

MFC after: 2 weeks

23 months agoAdjust fbt_unload() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 17:40:38 +0000 (19:40 +0200)]
Adjust fbt_unload() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/cddl/dev/fbt/fbt.c:1273:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    fbt_unload()
              ^
               void

This is because fbt_unload() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoFix unused variable warning in ocs_cam.c
Dimitry Andric [Wed, 20 Jul 2022 19:36:20 +0000 (21:36 +0200)]
Fix unused variable warning in ocs_cam.c

With clang 15, the following -Werror warning is produced:

    sys/dev/ocs_fc/ocs_cam.c:2556:11: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
            uint32_t        count;
                            ^

The 'count' variable seems to be a left-over from some debugging code
that no longer exists, and can be removed without any functional change.

MFC after: 3 days

23 months agolibnvpair: install libnvpair.h
Kristof Provost [Wed, 20 Jul 2022 22:30:53 +0000 (00:30 +0200)]
libnvpair: install libnvpair.h

This is included by libbe/be.h.

Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agoif_vlan tests: Test changing vlan ID
Kristof Provost [Mon, 18 Jul 2022 22:49:30 +0000 (00:49 +0200)]
if_vlan tests: Test changing vlan ID

We can now change the vlan ID of an if_vlan interface without
disassociating it from the parent interface.

Test that this works.

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

23 months agoifconfig: fix vlan/vlanproto reconfiguration
Kristof Provost [Mon, 18 Jul 2022 22:25:56 +0000 (00:25 +0200)]
ifconfig: fix vlan/vlanproto reconfiguration

The setvlantag() and setvlanproto() functions are used in two scenarios:
when we create a new vlan interface and when we update an existing
interface.
These are distinguished by the getvlan() at the end of the functions. If
this fails we assume that is because the interface doesn't exist (so
we're creating a new one). We only update the 'params' struct, and
expect the settings to be applied when we vlan_create().

However, if we're updating an existing interface we do not retrieve the
current settings, and can end up invalidating settings.

Fix this by using the settings we retrieved while checking which
scenario we're in.

Note that we do not address this for setvlandev(), because if_vlan does
not allow the vlan parent device to be changed without disassociating it
first (with ifconfig vlanX -vlandev).

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

23 months agoif_vlan: allow vlan and vlanproto to be changed
Kristof Provost [Mon, 18 Jul 2022 22:23:50 +0000 (00:23 +0200)]
if_vlan: allow vlan and vlanproto to be changed

It's currently not possible to change the vlan ID or vlan protocol (i.e.
802.1q vs. 802.1ad) without de-configuring the interface (i.e. ifconfig
vlanX -vlandev).
Add a specific flow for this, allowing both the protocol and id (but not
parent interface) to be changed without going through the '-vlandev'
step.

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

23 months agonamespace nv names, version libnv and libnvpair library symbols
Reid Linnemann [Tue, 17 May 2022 19:49:41 +0000 (13:49 -0600)]
namespace nv names, version libnv and libnvpair library symbols

libnv and libnvpair have aliased symbols, and as a result a single process which
dlopens a shared object that is dynamically linked to libnv and another to
libnvpair will wind up with a single set of resolved symbols for those in
conflict. A source file also cannot include both libnv and libnvpair headers
because of aliased identifiers. To resolve the situation, libnv types and
functions are namespaced via nv_namespace.h, and libnv symbols are
versioned. The msgio functions are not namespaced or exported as they are not
part of the external API.

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

23 months agoIPv4: correct limit on loopback_prefix
Mike Karels [Thu, 21 Jul 2022 13:10:15 +0000 (08:10 -0500)]
IPv4: correct limit on loopback_prefix

Commit efe58855f3ea allowed the net.inet.ip.loopback_prefix value
to be 32.  However, with a 32-bit mask, 127.0.0.1 is not included
in the reserved loopback range, which should not be allowed.
Change the max prefix length to 31.

23 months agoRevert "mac_ddb: Make db_show_vnet_valid() handle !VIMAGE"
Allan Jude [Thu, 21 Jul 2022 14:26:54 +0000 (14:26 +0000)]
Revert "mac_ddb: Make db_show_vnet_valid() handle !VIMAGE"

jhb@ already fixed this in a different way

Reported by: andrew

This reverts commit 3810b37903220af1a369d3c4032ae25fb2d7949d.

23 months agomac_ddb: Make db_show_vnet_valid() handle !VIMAGE
Allan Jude [Thu, 21 Jul 2022 13:58:05 +0000 (13:58 +0000)]
mac_ddb: Make db_show_vnet_valid() handle !VIMAGE

Reported by: kib
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.

23 months agovt.4: Provide a hint about Fn + K Scroll Lock combination
Ed Maste [Thu, 3 Mar 2022 14:59:14 +0000 (09:59 -0500)]
vt.4: Provide a hint about Fn + K Scroll Lock combination

Many laptops do not have Scroll Lock and use a function key sequence
to access it.

MFC after: 1 week

Sponsored by: The FreeBSD Foundation

23 months agoRemove "All Rights Reserved" from FreeBSD Foundation libc copyrights
Ed Maste [Thu, 21 Jul 2022 13:51:53 +0000 (09:51 -0400)]
Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights

As per the updated FreeBSD copyright template.  These were unambiguous
cases where the Foundation was the only listed copyright holder.

Sponsored by: The FreeBSD Foundation

23 months agoiommu_gas: Avoid double unmapping on error
Alan Cox [Thu, 21 Jul 2022 06:53:54 +0000 (01:53 -0500)]
iommu_gas: Avoid double unmapping on error

In the extremely unlikely case that the iommu_gas_map_region() call in
bus_dma_iommu_load_ident() failed, we would attempt to unmap the failed
entry twice, first in iommu_gas_map_region(), and a second time in the
caller.  Once is enough, and twice is problematic because it leads to a
second RB_REMOVE call on the same tree node.  Like it or not, RB_TREE
does not handle that possibility.

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

23 months agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Thu, 21 Jul 2022 05:51:15 +0000 (22:51 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

A better fix to commit 9e1f44d044a. Rather than coping with the case
where a backup superblock is used, catch the case when the superblock
is being read in and ensure that the standard one is used rather than
the backup one.

23 months agoDelete UFS2 backup superblock recovery info when building a UFS1 filesystem.
Kirk McKusick [Thu, 21 Jul 2022 05:45:18 +0000 (22:45 -0700)]
Delete UFS2 backup superblock recovery info when building a UFS1 filesystem.

Only the UFS2 filesystem has support for storing information needed
to find alternate superblocks. If that information is inadvertently
left in place when building a UFS1 filesystem, fsck_ffs may stumble
across it and attempt to use it to recover the UFS1 filesystem
which can only end poorly.

23 months agoAsk to look for alternate UFS2 superblocks when the standard one is unusable.
Kirk McKusick [Thu, 21 Jul 2022 05:37:14 +0000 (22:37 -0700)]
Ask to look for alternate UFS2 superblocks when the standard one is unusable.

This feature was inadvertently lost in commit c0bfa109b942.

23 months agomac_ddb: Only include the vnet validator in VIMAGE kernels.
John Baldwin [Wed, 20 Jul 2022 23:02:56 +0000 (16:02 -0700)]
mac_ddb: Only include the vnet validator in VIMAGE kernels.

This fixes the build of at least i386 MINIMAL which was failing with
the error:

sys/security/mac_ddb/mac_ddb.c:200:15: error: use of undeclared identifier 'vnet'; did you mean 'int'?
                if ((void *)vnet == (void *)addr)
                            ^~~~
                            int

Sponsored by: DARPA

23 months agoUpdate share/misc/committers-*.dot comments for git.
Pau Amma [Wed, 13 Jul 2022 08:52:17 +0000 (08:52 +0000)]
Update share/misc/committers-*.dot comments for git.

Approved by: gjb (mentor), lwhsu, imp, eadler

Reviewed by: approvers above, carlavilla and jhb (earlier version)

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

23 months agoFix unused variable warning in acpica's nsaccess.c
Dimitry Andric [Wed, 20 Jul 2022 19:10:43 +0000 (21:10 +0200)]
Fix unused variable warning in acpica's nsaccess.c

With clang 15, the following -Werror warning is produced:

    sys/contrib/dev/acpica/components/namespace/nsaccess.c:452:29: error: variable 'NumCarats' set but not used [-Werror,-Wunused-but-set-variable]
        UINT32                  NumCarats;
                                ^

Here, 'NumCarats' is a variable that is only used when debugging. Since
acpica is contributed code, suppress the warning with a compile flag.

MFC after: 3 days

23 months agoFix unused variable warning in if_alc.c
Dimitry Andric [Sat, 16 Jul 2022 15:06:31 +0000 (17:06 +0200)]
Fix unused variable warning in if_alc.c

With clang 15, the following -Werror warning is produced:

    sys/dev/alc/if_alc.c:3441:6: error: variable 'prog' set but not used [-Werror,-Wunused-but-set-variable]
            int prog;
                ^

The 'prog' variable seems to be a left-over from some debugging code
that no longer exists, and can be removed without any functional change.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D35831

23 months agoAdjust prototype_unload() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 20:10:03 +0000 (22:10 +0200)]
Adjust prototype_unload() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/cddl/dev/prototype.c:99:17: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    prototype_unload()
                    ^
                     void

This is because prototype_unload() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust nvd_{load,unload}() definitions to avoid clang 15 warnings
Dimitry Andric [Tue, 19 Jul 2022 20:05:42 +0000 (22:05 +0200)]
Adjust nvd_{load,unload}() definitions to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/dev/nvd/nvd.c:150:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    nvd_load()
            ^
             void
    sys/dev/nvd/nvd.c:166:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    nvd_unload()
              ^
               void

This is because nvd_load() and nvd_unload() are declared with a (void)
argument list, but defined with an empty argument list. Make the
definitions match the declarations.

MFC after: 3 days

23 months agoSuppress unused variable warning in if_mwl.c
Dimitry Andric [Tue, 19 Jul 2022 19:45:54 +0000 (21:45 +0200)]
Suppress unused variable warning in if_mwl.c

With clang 15, the following -Werror warning is produced:

    sys/dev/mwl/if_mwl.c:3445:8: error: variable 'ix' set but not used [-Werror,-Wunused-but-set-variable]
            u_int ix;
                  ^

Here, 'ix' is a variable that is only used when debugging. Mark the
variable as potentially unused, to suppress the warning.

MFC after: 3 days

23 months agoSuppress unused variable warning in ip_dummynet.c
Dimitry Andric [Tue, 19 Jul 2022 19:43:46 +0000 (21:43 +0200)]
Suppress unused variable warning in ip_dummynet.c

With clang 15, the following -Werror warning is produced:

    sys/netpfil/ipfw/ip_dummynet.c:802:6: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
            int n = 0; /* only for stats */
                ^

Here, 'n' is a variable that is only used when debugging. Mark the
variable as potentially unused, to suppress the warning.

MFC after: 3 days

23 months agoSuppress unused variable warning in mfi.c
Dimitry Andric [Tue, 19 Jul 2022 19:38:41 +0000 (21:38 +0200)]
Suppress unused variable warning in mfi.c

With clang 15, the following -Werror warnings are produced:

    sys/dev/mfi/mfi.c:3698:6: error: variable 'timedout' set but not used [-Werror,-Wunused-but-set-variable]
            int timedout;
                ^
    sys/dev/mfi/mfi.c:3742:6: error: variable 'timedout' set but not used [-Werror,-Wunused-but-set-variable]
            int timedout = 0;
                ^

Here, 'timedout' are variables that are only used when debugging,
requiring #if 0 statements to be modified. Mark the variables as
potentially unused, to suppress the warnings.

MFC after: 3 days

23 months agoSuppress unused variable warning in if_malo.c
Dimitry Andric [Tue, 19 Jul 2022 19:17:03 +0000 (21:17 +0200)]
Suppress unused variable warning in if_malo.c

With clang 15, the following -Werror warning is produced:

    sys/dev/malo/if_malo.c:1573:8: error: variable 'ix' set but not used [-Werror,-Wunused-but-set-variable]
            u_int ix;
                  ^

Here, 'ix' is a variable that is only used when MALO_DEBUG is defined.
Mark the variable as potentially unused, to suppress the warning.

MFC after: 3 days

23 months agotcp.4: Sort sysctl variables
Mike Karels [Mon, 18 Jul 2022 16:39:03 +0000 (11:39 -0500)]
tcp.4: Sort sysctl variables

In preparation for updates including missing variables, sort the
sysctl variables in the MIB variables section alphabetically.
Add a new "hostcache" entry for the hostcache node, containing the
intro text that was previously in hostcache.enable.  Also cleanups
per review comments.

Reviewed by: transport(tuexen), manpages(bcr)
Differential Revision: https://reviews.freebsd.org/D35844
MFC after: 1 week

(cherry picked from commit 5cf709ce72c0b6eb4b4d57db015a65f8a84166d5)

23 months agoicmp.4 inet.4 udp.4: sort sysctl variables
Mike Karels [Mon, 18 Jul 2022 16:33:31 +0000 (11:33 -0500)]
icmp.4 inet.4 udp.4: sort sysctl variables

Sort the sysctl(3)/sysctl(8) variables in the MIB Variables section
alphabetically.  This is in preparation for adding missing variables
(at least in inet.4 and icmp.4).  A few other touchups suggested in
review.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D35843
MFC after: 1 week

(cherry picked from commit 3b656d465127de066511b6ffd02fb9fef85c7a53)

23 months agoipmi(4): spelling fix cyle_wait -> cycle_wait
Eugene Grosbein [Wed, 20 Jul 2022 11:32:24 +0000 (18:32 +0700)]
ipmi(4): spelling fix cyle_wait -> cycle_wait

There are no consumers of hw.ipmi.cyle_wait in our tree.
Also the knob is undocumented, so it should be safe to fix its name.
No MFC planned, though.

23 months agocuse(3): Make some clarifications in the manual page.
Hans Petter Selasky [Wed, 13 Jul 2022 14:30:36 +0000 (16:30 +0200)]
cuse(3): Make some clarifications in the manual page.

MFC after: 1 week
Sponsored by: NVIDIA Networking

23 months agocuse(3): Allow allocating a memory buffer of exactly 2 GBytes.
Hans Petter Selasky [Mon, 18 Jul 2022 15:13:27 +0000 (17:13 +0200)]
cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.

The manual page date will be bumped separately.

MFC after: 1 week
Sponsored by: NVIDIA Networking

23 months agocuse(3): Allow shared memory allocations up to, but excluding 2 GBytes.
Hans Petter Selasky [Wed, 13 Jul 2022 16:17:40 +0000 (18:17 +0200)]
cuse(3): Allow shared memory allocations up to, but excluding 2 GBytes.

Currently the cuse(3) mmap(2) offset is split into 128 banks of 16 Mbytes.
Allow cuse(3) to make allocations that span multiple banks at the expense
of any fragmentation issues that may arise. Typically mmap(2) buffers are
well below 16 Mbytes. This allows 8K video resolution to work using webcamd.

Reviewed by: markj @
Differential Revision: https://reviews.freebsd.org/D35830
MFC after: 1 week
Sponsored by: NVIDIA Networking

23 months agocuse(3): Make cuse_vmfree() NULL safe.
Hans Petter Selasky [Wed, 13 Jul 2022 15:54:24 +0000 (17:54 +0200)]
cuse(3): Make cuse_vmfree() NULL safe.

MFC after: 1 week
Sponsored by: NVIDIA Networking

23 months agocuse(3): Fix an off-by-one.
Hans Petter Selasky [Wed, 13 Jul 2022 13:53:49 +0000 (15:53 +0200)]
cuse(3): Fix an off-by-one.

The page allocation limit is inclusive and not exclusive.

MFC after: 1 week
Sponsored by: NVIDIA Networking

23 months agorandom: Ingest extra fast entropy when !seeded
Colin Percival [Wed, 13 Jul 2022 00:48:06 +0000 (17:48 -0700)]
random: Ingest extra fast entropy when !seeded

We periodically ingest entropy from pollable entropy sources, but only
8 bytes at a time and only occasionally enough to feed all of Fortuna's
pools once per second.  This can result in Fortuna remaining unseeded
for a nontrivial amount of time when there is no entropy passed in from
the boot loader, even if RDRAND is available to quickly provide a large
amount of entropy.

Detect in random_sources_feed if we are not yet seeded, and increase the
amount of immediate entropy harvesting we perform, in order to "fill"
Fortuna's entropy pools and avoid having
  random: randomdev_wait_until_seeded unblock wait
stall the boot process when entropy is available.

This speeds up the FreeBSD boot in the Firecracker VM by 2.3 seconds.

Approved by: csprng (delphij)
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D35802

23 months agoNew committer (doc): Pau Amma
Pau Amma [Tue, 28 Jun 2022 04:56:00 +0000 (04:56 +0000)]
New committer (doc): Pau Amma

Approved by: gjb

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

23 months agoatkbd(4): Fix "hancha" and "han/yong" korean keys handling.
Vladimir Kondratyev [Tue, 19 Jul 2022 21:06:22 +0000 (00:06 +0300)]
atkbd(4): Fix "hancha" and "han/yong" korean keys handling.

The Korean keyboard has two keys, the Korean/Chinese and the
Korean/English toggles, that generate scancodes 0xF1 and 0xF2
(respectively) when pressed, and nothing when released. They do not
repeat.
As Hanyong/Hancha keys are generally greater than 0x80, which is
generally considered a release key, add extra preceding press key event
to generate press/release pair.
Swap Hanyong/Hancha key codes to match reality.

Reported by: Warioburn <warioburn@yahoo.co.jp>
PR: 265260
MFC after: 1 week

23 months agotcp rack: fix switching to RACK when FIN has been sent
Michael Tuexen [Tue, 19 Jul 2022 18:28:25 +0000 (20:28 +0200)]
tcp rack: fix switching to RACK when FIN has been sent

Fix the rack sendmap entry in case a FIN has been sent when the
stack is switched over to RACK.

Reported by: syzbot+dd55e316428419e9354b@syzkaller.appspotmail.com
Reviewed by: rrs
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D35731

23 months agoAdjust dtrace_unload() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:48:47 +0000 (20:48 +0200)]
Adjust dtrace_unload() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    In file included from sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c:18440:
    sys/cddl/dev/dtrace/dtrace_unload.c:26:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    dtrace_unload()
                 ^
                  void

This is because dtrace_unload() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust dtrace_getf_barrier() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:46:18 +0000 (20:46 +0200)]
Adjust dtrace_getf_barrier() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c:17019:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    dtrace_getf_barrier()
       ^
void

This is because dtrace_getf_barrier() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust profile_unload() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:42:52 +0000 (20:42 +0200)]
Adjust profile_unload() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/cddl/dev/profile/profile.c:640:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    profile_unload()
                  ^
                   void

This is because profile_unload() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust dtnfsclient_unload() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:41:24 +0000 (20:41 +0200)]
Adjust dtnfsclient_unload() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/fs/nfsclient/nfs_clkdtrace.c:544:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    dtnfsclient_unload()
                      ^
                       void

This is because dtnfsclient_unload() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust fbd_list() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:35:37 +0000 (20:35 +0200)]
Adjust fbd_list() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/dev/fb/fbd.c:205:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    fbd_list()
            ^
             void

This is because fbd_list() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust db_flush_line() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:31:08 +0000 (20:31 +0200)]
Adjust db_flush_line() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/ddb/db_lex.c:94:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    db_flush_line()
                 ^
                  void

This is because db_flush_line() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust dtmalloc_unload() definition to avoid clang 15 warning
Dimitry Andric [Tue, 19 Jul 2022 18:24:41 +0000 (20:24 +0200)]
Adjust dtmalloc_unload() definition to avoid clang 15 warning

With clang 15, the following -Werror warnings is produced:

    sys/cddl/dev/dtmalloc/dtmalloc.c:177:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    dtmalloc_unload()
                   ^
                    void

This is because dtmalloc_unload() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust t4_tracer_mod{load,unload}() definitions to avoid clang 15 warnings
Dimitry Andric [Tue, 19 Jul 2022 18:20:21 +0000 (20:20 +0200)]
Adjust t4_tracer_mod{load,unload}() definitions to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/dev/cxgbe/t4_tracer.c:234:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    t4_tracer_modload()
                     ^
                      void
    sys/dev/cxgbe/t4_tracer.c:243:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    t4_tracer_modunload()
                       ^
                        void

This is because t4_tracer_modload() and t4_tracer_modunload() are
declared with a (void) argument list, but defined with an empty argument
list. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdd -S option to veriexec
Simon J. Gerraty [Tue, 19 Jul 2022 15:59:53 +0000 (08:59 -0700)]
Add -S option to veriexec

During software installation, use veriexec -S to strictly
enforce certificate validity checks (notBefore, notAfter).

Otherwise ignore certificate validity period.
It is generally unacceptible for the Internet to stop working
just because someone did not upgrade their infrastructure for a decade.

Sponsored by: Juniper Networks, Inc.

Reviewed by: sebastien.bini_stormshield.eu
Differential Revision: https://reviews.freebsd.org/D35758

23 months agoconsole: add U+276E and U+276F glyphs
Ed Maste [Tue, 19 Jul 2022 15:48:29 +0000 (11:48 -0400)]
console: add U+276E and U+276F glyphs

U+276E Heavy Left-Pointing Angle Quotation Mark Ornament
U+276F Heavy Right-Pointing Angle Quotation Mark Ornament

U+276F is used by zprezto (zsh config package).

For the normal font I used the bold font glyphs for U+003C < and
U+003E >.  The bold font glyphs are new.

PR: 232494
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agovtfontcvt: improve hex font format validation
Ed Maste [Tue, 19 Jul 2022 15:20:10 +0000 (11:20 -0400)]
vtfontcvt: improve hex font format validation

Previously an EOF would result in sscanf returning -1 leading to a
crash.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agobacklight(8): Update usage() to match the manual page
Mateusz Piotrowski [Tue, 19 Jul 2022 14:56:27 +0000 (16:56 +0200)]
backlight(8): Update usage() to match the manual page

MFC after: 1 week

23 months agobacklight.8: Show all possible modes in synopsis
Mateusz Piotrowski [Tue, 19 Jul 2022 14:55:25 +0000 (16:55 +0200)]
backlight.8: Show all possible modes in synopsis

MFC after: 1 week

23 months agobacklight.8: Standardize synopsis and improve examples
Mateusz Piotrowski [Tue, 19 Jul 2022 14:49:50 +0000 (16:49 +0200)]
backlight.8: Standardize synopsis and improve examples

MFC after: 1 week

23 months agovtfontcvt(8): Update usage() to match vtfontcvt.8
Mateusz Piotrowski [Tue, 19 Jul 2022 14:34:29 +0000 (16:34 +0200)]
vtfontcvt(8): Update usage() to match vtfontcvt.8

MFC after: 2 weeks

23 months agovtfontcvt.8: Use D1 instead of Ql for readability
Mateusz Piotrowski [Tue, 19 Jul 2022 14:32:41 +0000 (16:32 +0200)]
vtfontcvt.8: Use D1 instead of Ql for readability

MFC after: 2 weeks

23 months agovtfontcvt.8: Sort synopsis
Mateusz Piotrowski [Tue, 19 Jul 2022 14:32:26 +0000 (16:32 +0200)]
vtfontcvt.8: Sort synopsis

MFC after: 2 weeks

23 months agovtfontcvt.8: Improve synopsis and -f documentation
Mateusz Piotrowski [Tue, 19 Jul 2022 14:28:22 +0000 (16:28 +0200)]
vtfontcvt.8: Improve synopsis and -f documentation

MFC after: 2 weeks

23 months agoUpdate Terminus console font to 4.49
Ed Maste [Mon, 18 Jul 2022 17:44:42 +0000 (13:44 -0400)]
Update Terminus console font to 4.49

As in the past Dimitar Zhekov provided a copy of Terminus under a BSD
license for use by our console.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoAdd experimental 16k page support on arm64
Andrew Turner [Wed, 23 Mar 2022 17:39:58 +0000 (17:39 +0000)]
Add experimental 16k page support on arm64

Add initial 16k page support on arm64. It is considered experimental,
with no guarantee of compatibility with a userspace or kernel modules
built with the current a 4k page size as code will likely try to pass
in a too small size when working with APIs that take a multiple of a
page, e.g. mmap.

As this is experimental, and because userspace and the kernel need to
have the PAGE_SIZE macro kept in sync there is no kernel option to
enable this. To test a new image should be built with the
PAGE_{SIZE,SHIFT,MASK} macros changed to the 16k versions.

There are currently known issues with loading modules from an old
loader as it can misalign them to load on a non-16k boundary.

Testing has shown good results in kernel workloads that allocate and
free large amounts of memory as only a quarter of the number of calls
into the VM subsystem are needed in the best case.

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

23 months agoswap_pager: Reduce the scope of the object lock in putpages
Alan Cox [Tue, 19 Jul 2022 03:28:07 +0000 (22:28 -0500)]
swap_pager: Reduce the scope of the object lock in putpages

We don't need to hold the object lock while allocating swap space, so
don't.

Reviewed by: dougm, kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35839

23 months agoipsec: replace SECASVAR mtx by rmlock
Kristof Provost [Thu, 23 Jun 2022 20:35:29 +0000 (22:35 +0200)]
ipsec: replace SECASVAR  mtx by rmlock

This mutex is a significant point of contention in the ipsec code, and
can be relatively trivially replaced by a read-mostly lock.
It does require a separate lock for the replay protection, which we do
here by adding a separate mutex.

This improves throughput (without replay protection) by 10-15%.

MFC after: 3 weeks
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D35763

23 months agox86/iommu: Shrink the critical section in dmar_qi_task()
Alan Cox [Mon, 18 Jul 2022 00:56:39 +0000 (19:56 -0500)]
x86/iommu: Shrink the critical section in dmar_qi_task()

It is safe to test and clear the Invalidation Wait Descriptor
Complete flag before acquiring the DMAR lock in dmar_qi_task(),
rather than waiting until the lock is held.

Reviewed by: kib
MFC after: 2 weeks

23 months agox86: Remove 1 second DELAY from cpu_reset
Colin Percival [Wed, 13 Jul 2022 00:43:07 +0000 (17:43 -0700)]
x86: Remove 1 second DELAY from cpu_reset

On SMP systems, cpu_reset broadcasts a message telling the APs to stop
themselves, and then the BSP waits 1 second before actually resetting
itself; this behaviour dates back to 1998-05-17.

I assume that this delay was added in order to allow the APs to stop
themselves before the BSP resets; but we wait until the APs have all
acknowledged entering the "stopped" state, so it no longer seems to
serve any purpose.

Reviewed by: jhb, kib
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D35797

23 months agoAdd kern.reboot_wait_time sysctl
Colin Percival [Wed, 13 Jul 2022 00:42:26 +0000 (17:42 -0700)]
Add kern.reboot_wait_time sysctl

Historic FreeBSD behaviour (dating back to 1994-04-02) when rebooting
is to print "Rebooting..." and then
/* wait 1 sec for printf's to complete and be read */

Prior to April 1994, there was a 100 ms delay (added 1993-11-12).

Since (a) most users will already be aware that the system is rebooting
and do not need to take time to read an additional message to that
effect, and (b) most FreeBSD systems don't have anyone actively looking
at the console anyway, this delay no longer serves much purpose.

This commit adds a kern.reboot_wait_time sysctl which defaults to 0;
historic behaviour can be regained by setting it to 1.

Reviewed by: imp
Relnotes: FreeBSD now reboots faster; to restore the traditional
wait after printing "Rebooting..." to the console, set
kern.reboot_wait_time=1 (or more).
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D35796

23 months agomac_ddb: add some validation functions
Mitchell Horne [Mon, 18 Jul 2022 21:25:00 +0000 (17:25 -0400)]
mac_ddb: add some validation functions

These global objects are easy to validate, so provide the helper
functions to do so and include these commands in the allow lists.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35372

23 months agomac: add new mac_ddb(4) policy
Mitchell Horne [Mon, 18 Jul 2022 21:24:06 +0000 (17:24 -0400)]
mac: add new mac_ddb(4) policy

Generally, access to the kernel debugger is considered to be unsafe from
a security perspective since it presents an unrestricted interface to
inspect or modify the system state, including sensitive data such as
signing keys.

However, having some access to debugger functionality on production
systems may be useful in determining the cause of a panic or hang.
Therefore, it is desirable to have an optional policy which allows
limited use of ddb(4) while disabling the functionality which could
reveal system secrets.

This loadable MAC module allows for the use of some ddb(4) commands
while preventing the execution of others. The commands have been broadly
grouped into three categories:
 - Those which are 'safe' and will not emit sensitive data (e.g. trace).
   Generally, these commands are deterministic and don't accept
   arguments.
 - Those which are definitively unsafe (e.g. examine <addr>, search
   <addr> <value>)
 - Commands which may be safe to execute depending on the arguments
   provided (e.g. show thread <addr>).

Safe commands have been flagged as such with the DB_CMD_MEMSAFE flag.

Commands requiring extra validation can provide a function to do so.
For example, 'show thread <addr>' can be used as long as addr can be
checked against the system's list of process structures.

The policy also prevents debugger backends other than ddb(4) from
executing, for example gdb(4).

Reviewed by: markj, pauamma_gundo.com (manpages)
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35371

23 months agomac: kdb/ddb framework hooks
Mitchell Horne [Mon, 18 Jul 2022 21:23:16 +0000 (17:23 -0400)]
mac: kdb/ddb framework hooks

Add three simple hooks to the debugger allowing for a loaded MAC policy
to intervene if desired:
 1. Before invoking the kdb backend
 2. Before ddb command registration
 3. Before ddb command execution

We extend struct db_command with a private pointer and two flag bits
reserved for policy use.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35370

23 months agoddb: tag core commands with DB_CMD_MEMSAFE
Mitchell Horne [Mon, 18 Jul 2022 21:22:36 +0000 (17:22 -0400)]
ddb: tag core commands with DB_CMD_MEMSAFE

Those which are statically defined in db_command.c.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35584

23 months agoddb: annotate some commands with DB_CMD_MEMSAFE
Mitchell Horne [Mon, 18 Jul 2022 21:21:38 +0000 (17:21 -0400)]
ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35583

23 months agoddb: add the DB_CMD_MEMSAFE flag for commands
Mitchell Horne [Mon, 18 Jul 2022 20:04:24 +0000 (16:04 -0400)]
ddb: add the DB_CMD_MEMSAFE flag for commands

This flag value can be used to indicate if a command has the property of
being "memory safe". In this instance, memory safe means that the
command does not allow/enable reads or writes of arbitrary memory,
regardless of the arguments passed to it. For example, 'backtrace' is
considered a memory-safe command since its output is deterministic,
while 'show vnode' is not, since it requires a memory address as an
argument and will print the contents beginning at that location.

Apply the flag to the "show all" command macros. It is expected that
commands added to this table will always exhibit this property.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35581

23 months agobge: tell debugnet there are 2 rx rings, not 1,024
Eric van Gyzen [Mon, 18 Jul 2022 18:07:20 +0000 (13:07 -0500)]
bge: tell debugnet there are 2 rx rings, not 1,024

debugnet provides the network stack for netgdb and netdump.  Since it
must operate under panic/debugger conditions and can't rely on dynamic
memory allocation, it preallocates mbufs during boot or network
configuration.  At that time, it does not yet know which interface
will be used for debugging, so it does not know the required size and
quantity of mbufs to allocate.  It takes the worst-case approach by
calculating its requirements from the largest MTU and largest number
of receive queues across all interfaces that support debugnet.

Unfortunately, the bge NIC driver told debugnet that it supports 1,024
receive queues.  It actually supports only 2 queues (with 1,024 slots,
thus the error).  This greatly exaggerated debugnet's preallocation,
so with an MTU of 9000 on any interface, it allocated 600 MB of memory.
A tiny fraction of this memory would be used if netgdb or netdump were
invoked; the rest is completely wasted.

Reviewed by: markj, rlibby
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D35845

23 months agosched_ule: Ensure we hold the thread lock when modifying td_flags
Mark Johnston [Mon, 18 Jul 2022 19:50:45 +0000 (15:50 -0400)]
sched_ule: Ensure we hold the thread lock when modifying td_flags

The load balancer may force a running thread to reschedule and pick a
new CPU.  To do this it sets some flags in the thread running on a
loaded CPU.  But the code assumed that a running thread's lock is the
same as that of the corresponding runqueue, and there are small windows
where this is not true.  In this case, we can end up with non-atomic
modifications to td_flags.

Since this load balancing is best-effort, simply give up if the thread's
lock doesn't match; in this case the thread is about to enter the
scheduler anyway.

Reviewed by: kib
Reported by: glebius
Fixes: e745d729be60 ("sched_ule(4): Improve long-term load balancer.")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35821

23 months agoi386: fix pmap_trm_arena_last atomic load type
Mateusz Guzik [Mon, 18 Jul 2022 18:42:40 +0000 (18:42 +0000)]
i386: fix pmap_trm_arena_last atomic load type

Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agovtfontcvt: correct usage
Ed Maste [Mon, 18 Jul 2022 17:21:22 +0000 (13:21 -0400)]
vtfontcvt: correct usage

Commit e7fd9688ea97 changed vtfontcvt's command line parsing, but did
not correctly update the usage (it omitted the new -o flag).

Fixes: e7fd9688ea97 ("Move font related data structured to...")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agoImplement shared page address randomization
Kornel Dulęba [Tue, 10 May 2022 13:22:55 +0000 (15:22 +0200)]
Implement shared page address randomization

It used to be mapped at the top of the UVA.
If the randomization is enabled any address above .data section will be
randomly chosen and a guard page will be inserted in the shared page
default location.
The shared page is now mapped in exec_map_stack, instead of
exec_new_vmspace. The latter function is called before image activator
has a chance to parse ASLR related flags.
The KERN_PROC_VM_LAYOUT sysctl was extended to provide shared page
address.
The feature is enabled by default for 64 bit applications on all
architectures.
It can be toggled kern.elf64.aslr.shared_page sysctl.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35349

23 months agoRework how shared page related data is stored
Kornel Dulęba [Thu, 2 Jun 2022 07:58:12 +0000 (09:58 +0200)]
Rework how shared page related data is stored

Store the shared page address in struct vmspace.
Also instead of storing absolute addresses of various shared page
segments save their offsets with respect to the shared page address.
This will be more useful when the shared page address is randomized.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35393

23 months agoIntroduce the PROC_SIGCODE() macro
Kornel Dulęba [Thu, 2 Jun 2022 08:45:54 +0000 (10:45 +0200)]
Introduce the PROC_SIGCODE() macro

Use a getter macro instead of fetching the sigcode address directly
from a sysent of a given process. It assumes that the sigcode is stored
in the shared page, which is true in all cases, except for a.out
binaries. This will be later useful when the shared page address
randomization is introduced.
No functional change intended.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D35392

23 months agoBump __FreeBSD_version after the removal of OBJT_DEFAULT
Mark Johnston [Mon, 18 Jul 2022 13:44:59 +0000 (09:44 -0400)]
Bump __FreeBSD_version after the removal of OBJT_DEFAULT

Out-of-tree modules which allocate an object of type OBJT_DEFAULT need
to be recompiled.  No other changes are required, however.

23 months agoofed/infiniband: fix ifdefs for new INET changes, fixing LINT-NOIP
Mike Karels [Sat, 16 Jul 2022 21:05:58 +0000 (16:05 -0500)]
ofed/infiniband: fix ifdefs for new INET changes, fixing LINT-NOIP

Some of the ofed/infiniband code has INET and INET6 address handling
code without using ifdefs.  This failed with a recent change to INET,
in which IN_LOOPBACK() started using a VNET variable, and which is not
present if INET is not configured.  Add #ifdef INET, and INET6 for good
measure, in cma_loopback_addr(), along with inclusion of the options
headers in ib_cma.c.

Reviewed by: hselasky rgrimes bz
Differential Revision: https://reviews.freebsd.org/D35835

(cherry picked from commit 752b7632776237f9c071783acdd1136ebf5f287d)

23 months agoblacklistd: Handle 0 sized messages
Ed Maste [Mon, 18 Jul 2022 00:43:52 +0000 (20:43 -0400)]
blacklistd: Handle 0 sized messages

Patch obtained from https://github.com/zoulasc/blocklist commit
ada75856bc6fcabbdd25ffbe08fbad5cf2a2c08a

PR: 264599
MFC after: 1 week

23 months agoarm64, qoriq_therm: fix handling sites on version 1 and 2
Bjoern A. Zeeb [Sun, 10 Jul 2022 13:38:56 +0000 (13:38 +0000)]
arm64, qoriq_therm: fix handling sites on version 1 and 2

For version 2 extend the TMUV2_TMSAR() write loop over all site_ids
registered for a particular SoC and actually use the site_id rather
than always just the first [0] (which for the LX2080 would be a
problem given there is no site0).

Later, while version 2 adds the SITEs to enable to TMSR in bits 0..<n>,
version 1 (e.g., LS1028, LS1046, LS1088) add MSITEs to TMR
bits 16..31 or rather 15..0(16-<n>).  Adjust the loops to only enable
the site_ids listed for the particular SoC for monitoring.  This now
also deals with sparse site_ids (not starting at 0, or not being
contiguous).

MFC after: 1 week
Sponsored by: Traverse Technologies (providing Ten64 HW for testing)
Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D35764

23 months agoarm64, qoriq_therm: configure the number of sites base don SoC
Bjoern A. Zeeb [Sat, 9 Jul 2022 00:30:17 +0000 (00:30 +0000)]
arm64, qoriq_therm: configure the number of sites base don SoC

Configure the number of sites (sensors) based on SoC.
This avoids timeouts reading non-existent sensors.

The changes are based on mmel's initial work at:
https://github.com/strejda/freebsd/commit/914e3f0098b090cb5c1492b0d24992012c5c553b

MFC after: 1 week
Sponsored by: Traverse Technologies (providing Ten64 HW for testing)
Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D35759

23 months agojail.8: Fix formatting of synopsis and some code examples
Mateusz Piotrowski [Mon, 18 Jul 2022 11:38:00 +0000 (13:38 +0200)]
jail.8: Fix formatting of synopsis and some code examples

MFC after: 3 days

23 months agobeinstall.8: Update example distsites for BSDINSTALL_DISTSITE
Mateusz Piotrowski [Mon, 18 Jul 2022 10:22:42 +0000 (12:22 +0200)]
beinstall.8: Update example distsites for BSDINSTALL_DISTSITE

MFC after: 1 week

23 months agousr.bin/cksum: localize _total variables.
Xin LI [Mon, 18 Jul 2022 00:24:31 +0000 (17:24 -0700)]
usr.bin/cksum: localize _total variables.

23 months agocallout: Simplify the inner loop in callout_process() a bit
Mark Johnston [Fri, 1 Jul 2022 00:16:33 +0000 (20:16 -0400)]
callout: Simplify the inner loop in callout_process() a bit

- Use LIST_FOREACH_SAFE.
- Simplify control flow.

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agocallout: Remove a redundant parameter to callout_cc_add()
Mark Johnston [Thu, 30 Jun 2022 17:31:57 +0000 (13:31 -0400)]
callout: Remove a redundant parameter to callout_cc_add()

The passed cpuid is always equal to the one stored in the callout
structure.  No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agoFix clang 15 warning in cxgbe
Dimitry Andric [Sat, 16 Jul 2022 19:19:51 +0000 (21:19 +0200)]
Fix clang 15 warning in cxgbe

Clang 15 warns:

    sys/dev/cxgbe/cudbg/cudbg_lib.c:2949:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
            int i = 0;
                ^

Apparently 'i' was meant as the current retry counter, but '1' was used
in the while loop comparison instead, making the loop potentially
infinite, if 'busy' never gets reset.

MFC after: 3 days
Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D35834

23 months agounbound: Update version strings to 1.16.1
Cy Schubert [Sun, 17 Jul 2022 13:54:32 +0000 (06:54 -0700)]
unbound: Update version strings to 1.16.1

The last number of unbound upgrades failed to manually update the
version strings in usr.sbin/unbound/config.h. This commit fixes that.

Reported by: "Herbert J. Skuhra" <herbert@gojira.at>
Fixes: 0a92a9fca737edafbad03ee5a8efebe302851cff
a39a5a6905612447def27b66ffe73b9d11efd80c
9cf5bc93f6ba1711ae7bf96a982a2b3c8b073a18
273016e836aa378789612e0a0e08d50f28be778e
24e365220007c415f495cf8dcb228ece6002b8b7
5469a9953005a9a4d4aad7be88545d441622e9a0
MFC after: 3 days

23 months agocd9660: Use ANSI (c89) prototypes
Ed Maste [Sun, 17 Jul 2022 12:14:49 +0000 (08:14 -0400)]
cd9660: Use ANSI (c89) prototypes

Sponsored by: The FreeBSD Foundation

23 months agovm_pager: Remove references to KVME_TYPE_DEFAULT in the kernel
Mark Johnston [Sat, 16 Jul 2022 15:31:08 +0000 (11:31 -0400)]
vm_pager: Remove references to KVME_TYPE_DEFAULT in the kernel

Keep the definition around since it's used by userspace.

Reviewed by: alc, imp, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35791

23 months agovm_pager: Remove the default pager
Mark Johnston [Sat, 16 Jul 2022 15:30:19 +0000 (11:30 -0400)]
vm_pager: Remove the default pager

It's unused now.  Keep the OBJ_DEFAULT identifier, but make it an alias
of OBJT_SWAP for the benefit of out-of-tree code.

Reviewed by: alc, imp, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35790

23 months agovm_object: Remove redundant OBJ_SWAP checks
Mark Johnston [Sat, 16 Jul 2022 15:29:53 +0000 (11:29 -0400)]
vm_object: Remove redundant OBJ_SWAP checks

With the removal of OBJT_DEFAULT, OBJ_ANON implies OBJ_SWAP.

Note, this means that vm_object_split() is more expensive than it used
to be, as it holds busy locks until the end of the range is reached,
even if the object has no swap blocks allocated.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35789

23 months agovm: Remove handling for OBJT_DEFAULT objects
Mark Johnston [Sat, 16 Jul 2022 15:29:19 +0000 (11:29 -0400)]
vm: Remove handling for OBJT_DEFAULT objects

Now that OBJT_DEFAULT objects can't be instantiated, we can simplify
checks of the form object->type == OBJT_DEFAULT || (object->flags &
OBJ_SWAP) != 0.  No functional change intended.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35788

23 months agovm_object: Release object swap charge in the swap pager destructor
Mark Johnston [Sat, 16 Jul 2022 15:28:55 +0000 (11:28 -0400)]
vm_object: Release object swap charge in the swap pager destructor

With the removal of OBJT_DEFAULT, we can simply handle this in
swap_pager_dealloc().  No functional change intended.

Suggested by: alc
Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35787

23 months agoswap_pager: Removing handling for objects with OBJ_SWAP clear
Mark Johnston [Sat, 16 Jul 2022 15:28:09 +0000 (11:28 -0400)]
swap_pager: Removing handling for objects with OBJ_SWAP clear

With the removal of OBJT_DEFAULT, we can assume that pager operations
provide an object with OBJ_SWAP set.  Also, we do not need to convert
objects from type OBJT_DEFAULT.  Thus, remove checks for OBJ_SWAP and
remove code which modifies the object type.  In some places, replace the
check for OBJ_SWAP with a check for whether any swap blocks are
assigned.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35786