]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoAdjust irdma_prep_for_unregister() definition to avoid clang 15 warning
Dimitry Andric [Sun, 24 Jul 2022 21:27:24 +0000 (23:27 +0200)]
Adjust irdma_prep_for_unregister() definition to avoid clang 15 warning

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

    sys/dev/irdma/icrdma.c:621:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    irdma_prep_for_unregister()
                             ^
                              void

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

MFC after: 3 days

2 years agoFix unused variable warning in icl_soft.c
Dimitry Andric [Sun, 24 Jul 2022 20:54:08 +0000 (22:54 +0200)]
Fix unused variable warning in icl_soft.c

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

    sys/dev/iscsi//icl_soft.c:886:6: error: variable 'coalesced' set but not used [-Werror,-Wunused-but-set-variable]
            int coalesced, error;
                ^

The 'coalesced' variable is eventually used only in an #if 0'd block,
obviously meant for debugging. Ensure that 'coalesced' is only declared
and used when DEBUG_COALESCED is defined, so the debugging can be easily
turned on later, if desired.

MFC after: 3 days

2 years agonl: Correct history
Warner Losh [Sun, 24 Jul 2022 20:58:44 +0000 (14:58 -0600)]
nl: Correct history

nl actually first was available with System III, not System Vr2. Updated
based on discussion on TUHS mailing list (archive recently moved so this
message isn't get available in the archive).

Suggested by: segalogo (Matt G)

2 years agoReap dead code in lio_kqueue_test and aio_kqueue_test
Alan Somers [Mon, 30 May 2022 18:34:49 +0000 (12:34 -0600)]
Reap dead code in lio_kqueue_test and aio_kqueue_test

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35358

2 years agoAdd more aio tests
Alan Somers [Tue, 31 May 2022 02:20:55 +0000 (20:20 -0600)]
Add more aio tests

* Add tests for kqueue completion with all file types.
* Add a test for kqueue completion with EV_ONESHOT.
* Cleanup an unused variable.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35359

2 years agoprometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI
Alan Somers [Tue, 21 Jun 2022 18:51:14 +0000 (12:51 -0600)]
prometheus_sysctl_exporter: ignore ENOENT for mibs specified on the CLI

They might belong to kernel modules not currently loaded, or to other
kernel versions.  Ignoring them allows the configuration to be shared
between multiple hosts.

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D35540

2 years agoRevert "Fill in cn_name in struct consdev."
Jessica Clarke [Sat, 23 Jul 2022 21:44:19 +0000 (22:44 +0100)]
Revert "Fill in cn_name in struct consdev."

This reverts commit 82a21151cf1d7a3e9e95b9edbbf74ac10f386d6a.

This commit was made to aid debugging before consoles are initialised so
that they can more easily be identified from a debugger. However,
various consoles (cfecons, ofwcons, mambocons and rcons) all check
whether cn_name[0] is non-zero to see they are attached or not, and so
this breaks that (perhaps misguided) approach. On RISC-V this results in
rcons (the SBI firmware console driver) racing with the real UART driver
and so input gets probabilistically lost on the real UART (around 2/3 of
the time for me on QEMU).

Moreover, the name given to CONSOLE_DRIVER isn't necessarily the same as
what eventually gets written to cn_name, such as cfecons vs cfe, rcons
vs riscv, ttyj0 vs aju, ttyv0 vs sc, ttyuN vs uart_phyp/opal and all
manner of things vs ucom, so in some cases this is in fact misleading as
the name will change after attaching.

Discussed with: cperciva

2 years agoConvert runtime param checks to KASSERTs for fo_fspacectl
Ka Ho Ng [Sat, 23 Jul 2022 19:14:45 +0000 (15:14 -0400)]
Convert runtime param checks to KASSERTs for fo_fspacectl

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D35880

2 years agoif_vlan: avoid hash table thrashing when adding and removing entries
Kristof Provost [Fri, 22 Jul 2022 17:17:04 +0000 (19:17 +0200)]
if_vlan: avoid hash table thrashing when adding and removing entries

vlan_remhash() uses incorrect value for b.

When using the default value for VLAN_DEF_HWIDTH (4), the VLAN hash-list table
expands from 16 chains to 32 chains as the 129th entry is added. trunk->hwidth
becomes 5. Say a few more entries are added and there are now 135 entries.
trunk-hwidth will still be 5. If an entry is removed, vlan_remhash() will
calculate a value of 32 for b. refcnt will be decremented to 134. The if
comparison at line 473 will return true and vlan_growhash() will be called. The
VLAN hash-list table will be compressed from 32 chains wide to 16 chains wide.
hwidth will become 4. This is an error, and it can be seen when a new VLAN is
added. The table will again be expanded. If an entry is then removed, again
the table is contracted.

If the number of VLANS stays in the range of 128-512, each time an insert
follows a remove, the table will expand. Each time a remove follows an
insert, the table will be contracted.

The fix is simple. The line 473 should test that the number of entries has
decreased such that the table should be contracted using what would be the new
value of hwidth. line 467 should be:

b = 1 << (trunk->hwidth - 1);

PR: 265382
Reviewed by: kp
MFC after: 2 weeks
Sponsored by: NetApp, Inc.

2 years agostand geli: Restore include path to LDRSRC.
John Baldwin [Fri, 22 Jul 2022 15:56:18 +0000 (09:56 -0600)]
stand geli: Restore include path to LDRSRC.

Various GELI sources need bootstrap.h and disk.h. In theory they
shouldn't need anything outside of libsa, but disk.h and bootstrap.h are
currently required.

This fixes the build with MK_LOADER_ZFS=no.

Obtained from: CheriBSD
Fixes: eaf7aabddcde stand: geli CFLAGS tightening
Sponsored by: DARPA
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D35861

2 years agostand libsa: Restore include path to LDRSRC for disk.h for filesystems.
John Baldwin [Fri, 22 Jul 2022 15:53:57 +0000 (09:53 -0600)]
stand libsa: Restore include path to LDRSRC for disk.h for filesystems.

In theory they shouldn't need anything outside of libsa, but disk.h and
bootstrap.h are currently required. Future work wil address this issue.

This fixes the build with MK_LOADER_ZFS=no. ZFS's Makefile.inc adds
these flags globally to CFLAGS when it should not. This masked the
problem because the tools/boot/universe.sh didn't build MK_LOADER_ZFS=no
as part of its regressions. Future work will also fix this.

Obtained from: CheriBSD
Fixes: 84bf2bbbecc3 stand: constrain zlib/gzip CFLAGS better
Sponsored by: DARPA
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D35860

2 years agofind.1: small language fix after previous change
Eugene Grosbein [Fri, 22 Jul 2022 11:46:38 +0000 (18:46 +0700)]
find.1: small language fix after previous change

collate -> collation

2 years agofind.1: explain why "find -s" may differ from "find | sort"
Eugene Grosbein [Fri, 22 Jul 2022 11:39:47 +0000 (18:39 +0700)]
find.1: explain why "find -s" may differ from "find | sort"

In short, that's because a directory name may end
with a character that goes before slash (/).

MFC after: 1 week

2 years agoig4(4): Add device HID to match I2C controller on ASUS X540 laptops
Vladimir Kondratyev [Thu, 21 Jul 2022 23:19:15 +0000 (02:19 +0300)]
ig4(4): Add device HID to match I2C controller on ASUS X540 laptops

Tested by: Andrés Ramírez <rrandresf_AT_hotmail_DOT_com>
MFC after: 1 week

2 years agolibnv: bump library version
Kristof Provost [Thu, 21 Jul 2022 18:07:22 +0000 (20:07 +0200)]
libnv: bump library version

Now that we version symbols we should bump the library major version.
While here use version FBSD_1.7 to match the current HEAD FreeBSD
namespace and remove extraneous 'All rights reserved' and incorrect
copyright statement.

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

2 years agocheck/delete-old: Fix /bin/rmail removal condition
Dmitry Chagin [Thu, 21 Jul 2022 22:20:25 +0000 (01:20 +0300)]
check/delete-old: Fix /bin/rmail removal condition

When WITHOUT_SENDMAIL is enabled and WITHOUT_MAILWRAPPER is disabled
we install /bin/rmail as a link to the /usr/sbin/mailwrapper.
Ensure make delete-old does not unlink /bin/rmail in that case.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D35874
MFC after: 2 weeks

2 years agoAdjust vt_mouse_paste() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 20:10:22 +0000 (22:10 +0200)]
Adjust vt_mouse_paste() definition to avoid clang 15 warning

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

    sys/dev/vt/vt_core.c:2129:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    vt_mouse_paste()
                  ^
                   void

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

MFC after: 3 days

2 years agoFix unused variable warning in ipsec_mbuf.c
Dimitry Andric [Thu, 21 Jul 2022 20:03:50 +0000 (22:03 +0200)]
Fix unused variable warning in ipsec_mbuf.c

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

    sys/netipsec/ipsec_mbuf.c:93:24: error: variable 'alloc' set but not used [-Werror,-Wunused-but-set-variable]
                    int todo, len, done, alloc;
                                         ^

The 'alloc' variable appears to have been a debugging aid that has never
been used for anything, so remove it.

MFC after: 3 days

2 years agogmirror.8: Remove references rc.early
Mateusz Piotrowski [Thu, 21 Jul 2022 19:43:14 +0000 (21:43 +0200)]
gmirror.8: Remove references rc.early

The manual page of gmirror describes how gmirror providers can be used
for kernel dumps. Unfortunately, the instruction references
/etc/rc.early, which is no longer a part of rc(8).

Remove references to rc.early and suggest creating an rc(8) service
script instead.

Future work: In the Problem Report on Bugzilla, Lawrence Chen suggested
adding example rc(8) scripts to the gmirror. However, those examples
need to be tested before they become official reference examples in the
base. Also, those scripts should probably land directly to /etc/rc.d,
/usr/share/examples/rc.d, or /usr/share/examples/gmirror instead of the
gmirror manual page.

PR: 178818
Reported by: Lawrence Chen <beastie@tardisi.com>
Fixes: dd2b024a336f Removal of early.sh
MFC after: 1 week

2 years agoFix unused variable warning in if_re_netmap.h
Dimitry Andric [Thu, 21 Jul 2022 19:52:29 +0000 (21:52 +0200)]
Fix unused variable warning in if_re_netmap.h

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

    sys/dev/netmap/if_re_netmap.h:179:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
            u_int n;
                  ^

The 'n' variable appears to have been a debugging aid that has never
been used for anything, so remove it.

MFC after: 3 days

2 years agoAdjust tdsaContext_t::NvmdResponseSet declaration to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:49:47 +0000 (21:49 +0200)]
Adjust tdsaContext_t::NvmdResponseSet declaration to avoid clang 15 warning

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

    In file included from sys/dev/pms/freebsd/driver/ini/src/agtiapi.c:70:
    sys/dev/pms/RefTisa/tisa/sassata/common/tdsatypes.h:346:13: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
      volatile  NvmdResponseSet;
      ~~~~~~~~  ^
      int

The NvmdResponseSet member is effectively only used as a boolean in the
pms(4) driver, so it could be a single bit. But to avoid changing the
semantics at all in this unmaintained driver, simply declare it as a
volatile int.

MFC after: 3 days

2 years agoAdjust ipfw_iface_{init,destroy}() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:37:09 +0000 (21:37 +0200)]
Adjust ipfw_iface_{init,destroy}() definitions to avoid clang 15 warning

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

    sys/netpfil/ipfw/ip_fw_iface.c:206:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_iface_init()
                   ^
                    void
    sys/netpfil/ipfw/ip_fw_iface.c:219:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_iface_destroy()
                      ^
                       void

This is because ipfw_iface_init() and ipfw_iface_destroy() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

2 years agoAdjust iface_khandler_deregister() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:32:16 +0000 (21:32 +0200)]
Adjust iface_khandler_deregister() definition to avoid clang 15 warning

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

    sys/netpfil/ipfw/ip_fw_iface.c:159:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    iface_khandler_deregister()
                             ^
                              void

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

MFC after: 3 days

2 years agoAdjust ipfw_{init,destroy}_sopt_handler() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:30:05 +0000 (21:30 +0200)]
Adjust ipfw_{init,destroy}_sopt_handler() definitions to avoid clang 15 warning

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

    sys/netpfil/ipfw/ip_fw_sockopt.c:3477:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_init_sopt_handler()
                          ^
                           void
    sys/netpfil/ipfw/ip_fw_sockopt.c:3485:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_destroy_sopt_handler()
                             ^
                              void

This is because ipfw_init_sopt_handler() and ipfw_destroy_sopt_handler()
are declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

2 years agoAdjust iface_khandler_register() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:28:03 +0000 (21:28 +0200)]
Adjust iface_khandler_register() definition to avoid clang 15 warning

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

    sys/netpfil/ipfw/ip_fw_iface.c:128:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    iface_khandler_register()
                           ^
                            void

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

MFC after: 3 days

2 years agoAdjust ipfw_{init,destroy}_*() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 19:23:13 +0000 (21:23 +0200)]
Adjust ipfw_{init,destroy}_*() definitions to avoid clang 15 warning

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

    sys/netpfil/ipfw/ip_fw_sockopt.c:187:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_init_counters()
                      ^
                       void
    sys/netpfil/ipfw/ip_fw_sockopt.c:196:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_destroy_counters()
                         ^
                          void
    sys/netpfil/ipfw/ip_fw_sockopt.c:3241:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_init_obj_rewriter()
                          ^
                           void
    sys/netpfil/ipfw/ip_fw_sockopt.c:3249:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ipfw_destroy_obj_rewriter()
                             ^
                              void

This is because ipfw_init_counters(), ipfw_destroy_counters(),
ipfw_init_obj_rewriter(), and ipfw_destroy_obj_rewriter() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

2 years agoFix unused variable warning in iflib.c
Dimitry Andric [Thu, 21 Jul 2022 19:19:28 +0000 (21:19 +0200)]
Fix unused variable warning in iflib.c

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

    sys/net/iflib.c:993:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
            u_int n;
                  ^

The 'n' variable appears to have been a debugging aid that has never
been used for anything, so remove it.

MFC after: 3 days

2 years agoFix unused variable warning in if_lagg.c
Dimitry Andric [Thu, 21 Jul 2022 18:51:23 +0000 (20:51 +0200)]
Fix unused variable warning in if_lagg.c

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

    sys/net/if_lagg.c:2413:6: error: variable 'active_ports' set but not used [-Werror,-Wunused-but-set-variable]
            int active_ports = 0;
                ^

The 'active_ports' variable appears to have been a debugging aid that
has never been used for anything (ref https://reviews.freebsd.org/D549),
so remove it.

MFC after: 3 days

2 years agoFix unused variable warnings in hwpmc_mod.c
Dimitry Andric [Thu, 21 Jul 2022 18:35:41 +0000 (20:35 +0200)]
Fix unused variable warnings in hwpmc_mod.c

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

    sys/dev/hwpmc/hwpmc_mod.c:4805:6: error: variable 'nfree' set but not used [-Werror,-Wunused-but-set-variable]
            int nfree;
                ^
    sys/dev/hwpmc/hwpmc_mod.c:4804:6: error: variable 'ncallchains' set but not used [-Werror,-Wunused-but-set-variable]
            int ncallchains;
                ^

The 'nfree' and 'ncallchains' variables were used in KASSERTs, but these
were removed due to refactoring in d9f1b8dbf29d. Remove the variables
since they no longer serve any purpose.

MFC after:      3 days

2 years agoAdjust pmc_thread_descriptor_pool_drain() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 18:31:56 +0000 (20:31 +0200)]
Adjust pmc_thread_descriptor_pool_drain() definition to avoid clang 15 warning

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

    sys/dev/hwpmc/hwpmc_mod.c:2462:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmc_thread_descriptor_pool_drain()
                                    ^
                                     void

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

MFC after: 3 days

2 years agoAdjust pcm_md_initialize() definition to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 18:23:19 +0000 (20:23 +0200)]
Adjust pcm_md_initialize() definition to avoid clang 15 warning

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

    sys/dev/hwpmc/hwpmc_x86.c:245:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pcm_md_initialize()
                     ^
                      void

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

MFC after: 3 days

2 years agoAdjust pcmlog_{initialize,shutdown}() definitions to avoid clang 15 warning
Dimitry Andric [Thu, 21 Jul 2022 18:20:56 +0000 (20:20 +0200)]
Adjust pcmlog_{initialize,shutdown}() definitions to avoid clang 15 warning

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

    sys/dev/hwpmc/hwpmc_logging.c:1228:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmclog_initialize()
                     ^
                      void
    sys/dev/hwpmc/hwpmc_logging.c:1277:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmclog_shutdown()
                   ^
                    void

This is because pcmlog_{initialize,shutdown}() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after: 3 days

2 years agoFix unused variable warning in fwohci.c
Dimitry Andric [Thu, 21 Jul 2022 17:59:08 +0000 (19:59 +0200)]
Fix unused variable warning in fwohci.c

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

    sys/dev/firewire/fwohci.c:2762:23: error: variable 'pcnt' set but not used [-Werror,-Wunused-but-set-variable]
            int len, plen, hlen, pcnt, offset;
                                 ^

The 'pcnt' variable is eventually used only in an #if 0'd block,
obviously meant for debugging. Ensure that 'pcnt' is only declared and
used when COUNT_PACKETS is defined, so the debugging can be easily
turned on later, if desired.

MFC after: 3 days

2 years agodevelopment.7: Remove CVS and SVN cross-references
Mateusz Piotrowski [Thu, 21 Jul 2022 18:33:47 +0000 (20:33 +0200)]
development.7: Remove CVS and SVN cross-references

Instead, point to the homepages of the projects.

MFC after: 1 week

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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")

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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)

2 years 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)

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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