]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
22 months agobhyve nvme: Switch to POSIX standard functions
Chuck Tuffli [Wed, 17 Aug 2022 00:16:06 +0000 (17:16 -0700)]
bhyve nvme: Switch to POSIX standard functions

Switch bzero to memset and bcopy to memcpy

Reviewed by: imp, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36215

22 months agobasic_signal test: really skip trap_signal_test on i386
Li-Wen Hsu [Wed, 17 Aug 2022 00:15:10 +0000 (08:15 +0800)]
basic_signal test: really skip trap_signal_test on i386

PR: 265889
Fixes: c04721e35ff0e8220c88d5b10f068dba18629f7e
Sponsored by: The FreeBSD Foundation

22 months agoUpdate date in tunefs(8) manual page.
Kirk McKusick [Tue, 16 Aug 2022 23:46:12 +0000 (16:46 -0700)]
Update date in tunefs(8) manual page.

Requested by: Li-Wen Hsu
PR:           261944
Sponsored by: The FreeBSD Foundation

22 months agobasic_signal test: temporarily skip trap_signal_test on i386
Li-Wen Hsu [Tue, 16 Aug 2022 22:03:37 +0000 (06:03 +0800)]
basic_signal test: temporarily skip trap_signal_test on i386

This case crashes a bhyve VM.

PR: 265889
Sponsored by: The FreeBSD Foundation

22 months agostand: Make makeroot.sh use makefs for ZFS
Warner Losh [Tue, 16 Aug 2022 17:29:25 +0000 (11:29 -0600)]
stand: Make makeroot.sh use makefs for ZFS

Start to use makefs for ZFS. This covers the gpt nogeli variants.  ZFS
MBR booting is tricky and complicated, so will need some additional
tweaks that makefs/mkimg isn't able to do at the moment. This means that
all gpt nogeli amd64 combinations can be built w/o root.

In addition, tweak the generated qemu.sh files to use stdio for the
console. We grep the output for SUCCESS and report each of the booting
types. Create a all.sh that will run these automatically. These all can
also run w/o root.

In the future, I'll add support for a make univers followed by this
script to create other architectures' tests and/or generate stand tests
for /usr/tests...

Sponsored by: Netflix

22 months agobsdinstall: add variables to allow skipping over some phases of the install
Brad Davis [Tue, 16 Aug 2022 21:11:44 +0000 (15:11 -0600)]
bsdinstall: add variables to allow skipping over some phases of the install

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

22 months agoDisallow invalid PT_GNU_STACK
Ed Maste [Fri, 18 Mar 2022 17:56:32 +0000 (13:56 -0400)]
Disallow invalid PT_GNU_STACK

Stack must be at least readable and writable.

PR: 242570
Reviewed by: kib, markj
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35867

22 months agoudp: call UDP methods from UDP over IPv6 directly
Gleb Smirnoff [Tue, 16 Aug 2022 19:40:36 +0000 (12:40 -0700)]
udp: call UDP methods from UDP over IPv6 directly

Both UDP and UDP Lite use same methods on sockets.  Both UDP over IPv4
and over IPv6 use same methods.  Don't pretend that methods can switch
and remove this unneeded complexity.

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36154

22 months agobuf.h: Fix declaration of unmapped_buf
Sebastian Huber [Tue, 19 Jul 2022 18:09:43 +0000 (20:09 +0200)]
buf.h: Fix declaration of unmapped_buf

For architectures with a small-data area, the __read_mostly section must
present at the object declaration.

(emaste note: This does not appear to have an affect within FreeBSD, but
may be needed by downstream projects that handle __read_mostly /
__section(".data.read_mostly") differently.)

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

22 months agosdp: garbage collect sdp_ctlinput
Gleb Smirnoff [Tue, 16 Aug 2022 19:38:15 +0000 (12:38 -0700)]
sdp: garbage collect sdp_ctlinput

The pr_ctlinput method was a feature of IPv4/IPv6 with exception of
pfctlinput(), which broadcasted a call to pr_ctlinput on all protocols
ever registered statically or with pf_proto_register().  Now that
this broadcast call is gone, the only protocols that get their
pr_ctlinput ever called are those that have registered itselves with
ipproto_register() or ip6proto_register().

It is entirely possible that code deleted now was dead code from very
beginning. Just a copy-paste from TCP.

Reviewed by: rstone
Differential revision: https://reviews.freebsd.org/D36208

22 months agopkgbase: Put accounting utilities in the acct package
Emmanuel Vadot [Thu, 21 Jul 2022 15:09:34 +0000 (17:09 +0200)]
pkgbase: Put accounting utilities in the acct package

22 months agolib: Gate libfigpar under MK_DIALOG
Emmanuel Vadot [Thu, 21 Jul 2022 14:52:24 +0000 (16:52 +0200)]
lib: Gate libfigpar under MK_DIALOG

libfigpar is only used by dpv and dpv isn't built if WITHOUT_DIALOG
is set.

22 months agopkgbase: Put mount_nfs in the FreeBSD-nfs package
Emmanuel Vadot [Fri, 22 Jul 2022 11:23:14 +0000 (13:23 +0200)]
pkgbase: Put mount_nfs in the FreeBSD-nfs package

22 months agopkgbase: mtree: Correctly tag /var/db entries
Emmanuel Vadot [Fri, 22 Jul 2022 09:21:44 +0000 (11:21 +0200)]
pkgbase: mtree: Correctly tag /var/db entries

22 months agopkgbase: mtree: Correctly tag /var/run entries
Emmanuel Vadot [Fri, 22 Jul 2022 09:14:40 +0000 (11:14 +0200)]
pkgbase: mtree: Correctly tag /var/run entries

22 months agoOops, wlan(4) is not the removed an(4). Restore that paragraph.
Jens Schweikhardt [Tue, 16 Aug 2022 19:08:17 +0000 (21:08 +0200)]
Oops, wlan(4) is not the removed an(4). Restore that paragraph.

22 months agoThe wi(4) and an(4) drivers have been removed. Delete dead xrefs.
Jens Schweikhardt [Tue, 16 Aug 2022 19:05:01 +0000 (21:05 +0200)]
The wi(4) and an(4) drivers have been removed. Delete dead xrefs.

22 months agoIndicate the port where the referenced man pages come from.
Jens Schweikhardt [Tue, 16 Aug 2022 18:57:30 +0000 (20:57 +0200)]
Indicate the port where the referenced man pages come from.

22 months agobhyve: Sprinkle const qualifiers where appropriate
Mark Johnston [Tue, 16 Aug 2022 17:13:12 +0000 (13:13 -0400)]
bhyve: Sprinkle const qualifiers where appropriate

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agobhyve: Mark variables and functions as static where appropriate
Mark Johnston [Tue, 16 Aug 2022 17:12:32 +0000 (13:12 -0400)]
bhyve: Mark variables and functions as static where appropriate

Mark them const as well when it makes sense to do so.  No functional
change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agobhyve: Use "void" instead of empty parameter lists
Mark Johnston [Tue, 16 Aug 2022 17:10:58 +0000 (13:10 -0400)]
bhyve: Use "void" instead of empty parameter lists

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agomakefs: Style
Mark Johnston [Tue, 16 Aug 2022 17:07:46 +0000 (13:07 -0400)]
makefs: Style

Reported by: rpokala
Fixes: 187084dddd3e ("makefs: Align the block buffer used in ZFS mode")
Sponsored by: The FreeBSD Foundation

22 months agoImport bionic's x86_64 optimized string routines
Ed Maste [Tue, 16 Aug 2022 17:26:59 +0000 (13:26 -0400)]
Import bionic's x86_64 optimized string routines

Add 'contrib/bionic-x86_64-string/' from commit 'd77520609f5240f5fad18fa1fd2275ac1de7cbb5'

git-subtree-dir: contrib/bionic-x86_64-string
git-subtree-mainline: 715f82e4f5c51c04314904dee8090c8abbbe2156
git-subtree-split: d77520609f5240f5fad18fa1fd2275ac1de7cbb5

Requested by: mjg
Sponsored by: The FreeBSD Foundation

22 months agoImport bionic's x86_64 string routines to vendor
Ed Maste [Mon, 15 Aug 2022 21:24:08 +0000 (17:24 -0400)]
Import bionic's x86_64 string routines to vendor

Obtained from https://android.googlesource.com/platform/bionic
libc/arch-x86_64/string/ at commit
919fb7f2e0e0c877dd5e9bbaa71d4c4a73e50ad3

Requested by: mjg
Sponsored by: The FreeBSD Foundation

22 months agobhyve nvme: Support minimal Controller list
Chuck Tuffli [Tue, 16 Aug 2022 16:15:53 +0000 (09:15 -0700)]
bhyve nvme: Support minimal Controller list

Controllers must support the Identify Controller list if they support
Namespace Management. But the UNH NVMe tests use this command regardless
of whether the device under test supports Namespace Management.

This implementation returns an empty Controller list (i.e., Number of
Identifiers is zero).

Fixes UNH Test 1.1.2

Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36193

22 months agobhyve nvme: Fix reported SANICAP value
Chuck Tuffli [Tue, 16 Aug 2022 16:14:43 +0000 (09:14 -0700)]
bhyve nvme: Fix reported SANICAP value

The NVMe specification only allows Controllers compliant with the
revision 1.3 and earlier specification to report a value of 0x0 in the
No-Deallocate Modifies Media After Sanitize (NODMMAS) field.

For our revision 1.4 Controller, report that media is not modified after
Sanitize as the implementation does not implement Sanitize.

Fixes UNH Test 1.1.2

Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36192

22 months agomakefs tests: Re-enable the ZFS snapshot test
Mark Johnston [Tue, 16 Aug 2022 14:35:51 +0000 (10:35 -0400)]
makefs tests: Re-enable the ZFS snapshot test

This reverts commit 35b587464afce15ff62600c3499d38cbb5b9f3d5.

PR: 265849
Sponsored by: The FreeBSD Foundation

22 months agomakefs: Fix space accounting for the root DSL directory
Mark Johnston [Tue, 16 Aug 2022 14:15:53 +0000 (10:15 -0400)]
makefs: Fix space accounting for the root DSL directory

Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
counting bytes used for each directory.  The DSL layer failed to update
the MOS DSL directory's parent, the root directory, accordingly, so the
root directory reported less space used than was used in reality.  Be
careful to update the root directory after the MOS is finalized.

PR: 265849
Sponsored by: The FreeBSD Foundation

22 months agomakefs: Align the block buffer used in ZFS mode
Mark Johnston [Tue, 16 Aug 2022 14:02:09 +0000 (10:02 -0400)]
makefs: Align the block buffer used in ZFS mode

For some dnode types, particularly ZAPs, we want the buffer to have
uint64_t alignment.

Sponsored by: The FreeBSD Foundation

22 months agoDisable promotion on pcpu memory on arm64
Andrew Turner [Fri, 29 Apr 2022 09:30:38 +0000 (10:30 +0100)]
Disable promotion on pcpu memory on arm64

We need to be careful to not promote or demote the memory containing
the per-CPU structures as the exception handlers will dereference it
so any time it's invalid may cause recursive exceptions.

Add a new pmap function to set a flag in the pte marking memory that
cannot be promoted or demoted and use it to mark pcpu memory.

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

22 months agoexports.5: Clean up EXAMPLES and STANDARDS
Mateusz Piotrowski [Tue, 16 Aug 2022 13:03:20 +0000 (15:03 +0200)]
exports.5: Clean up EXAMPLES and STANDARDS

There was a missing sentence in the description of the second mount
entry in the example. Fix that and some other bits in the EXAMPLES
section.

Also, make the STANDARDS section a bit more readable.

MFC after: 1 week
Sponsored by: Klara Inc.

22 months agoAdd support for RockChip RK356X to DWC3 driver.
Søren Schmidt [Tue, 16 Aug 2022 12:24:44 +0000 (12:24 +0000)]
Add support for RockChip RK356X to DWC3 driver.
For RK356x platform, we can set bit 26 of DWC3_GUCTL1 register
for usb 2.0 device.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D36211

22 months agovfs: plug a dead store in kern_linkat_vp
Mateusz Guzik [Tue, 16 Aug 2022 10:45:48 +0000 (10:45 +0000)]
vfs: plug a dead store in kern_linkat_vp

Reported by: clang --analyze

22 months agovfs: plug dead store in vn_io_fault1
Mateusz Guzik [Tue, 16 Aug 2022 10:44:31 +0000 (10:44 +0000)]
vfs: plug dead store in vn_io_fault1

Reported by: clang --analyze

22 months agoTPM: do not set device description if probe fails
Konrad Sewiłło-Jopek [Tue, 16 Aug 2022 07:27:36 +0000 (09:27 +0200)]
TPM: do not set device description if probe fails

device_set_desc should be called only if driver probes successfully.

Approved by: mw(mentor)
Reviewed by: mw, kd
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35998

22 months agocxgbe(4): Add a knob to request that clocks be gated on suspend.
Navdeep Parhar [Tue, 16 Aug 2022 07:48:21 +0000 (00:48 -0700)]
cxgbe(4): Add a knob to request that clocks be gated on suspend.

MFC after: 3 months
Sponsored by: Chelsio Communications

22 months agocxgbe(4): Decode and display some more bits in the PL interrupt handler.
Navdeep Parhar [Sat, 13 Aug 2022 04:11:13 +0000 (21:11 -0700)]
cxgbe(4): Decode and display some more bits in the PL interrupt handler.

MFC after: 1 week
Sponsored by: Chelsio Communications

22 months agocxgbe(4): Update firmwares to 1.27.0.0.
Navdeep Parhar [Sun, 14 Aug 2022 23:57:39 +0000 (16:57 -0700)]
cxgbe(4): Update firmwares to 1.27.0.0.

Changes since 1.26.6.0 are listed here.  This list comes from the
Release Notes for "Chelsio Unified Wire 3.17.0.0 for Linux" dated
2022-07-29.

Fixes
-----

BASE:
- Enabled all MA parity interrupt bits.
- Use config file value to override number of rx channel. nrxch=1 was not
  handled in the firmware.
- Replaced read only registers with new registers EDC_H_BIST_USER_WDATA0,
  EDC_H_BIST_USER_WDATA1 and EDC_H_BIST_CMD_LEN to dump the uP memory parity
  error status registers.
- 10G simplex module support enabled.

Obtained from: Chelsio Communications
MFC after: 1 month
Sponsored by: Chelsio Communications

22 months agoAdd RockChip rk809/rk817 pmic support to existing
Søren Schmidt [Tue, 16 Aug 2022 07:55:18 +0000 (07:55 +0000)]
Add RockChip rk809/rk817 pmic support to existing
RockChip pmic drivers.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D36149

22 months agolibc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_utf_8_test
Li-Wen Hsu [Tue, 16 Aug 2022 05:18:15 +0000 (13:18 +0800)]
libc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_utf_8_test

This test case starts failing after iconv changes on 2022-08-11.

PR: 265871
Sponsored by: The FreeBSD Foundation

22 months agocontrib/tzdata: import tzdata 2022c
Philip Paeps [Tue, 16 Aug 2022 02:54:37 +0000 (10:54 +0800)]
contrib/tzdata: import tzdata 2022c

Changes: https://github.com/eggert/tz/blob/2022c/NEWS

MFC after: 1 day

22 months agoObsoleteFiles: don't delete zoneinfo/GMT
Herbert J. Skuhra [Tue, 16 Aug 2022 02:53:08 +0000 (10:53 +0800)]
ObsoleteFiles: don't delete zoneinfo/GMT

The tzdata2022b import restored the zoneinfo/GMT link.
Don't delete it again with 'make delete-old'.

MFC after: 1 day

22 months agoImport tzdata 2022c
Philip Paeps [Tue, 16 Aug 2022 02:34:28 +0000 (10:34 +0800)]
Import tzdata 2022c

22 months agoAdd a description of soft updates journaling to tunefs(8).
Kirk McKusick [Mon, 15 Aug 2022 20:44:49 +0000 (13:44 -0700)]
Add a description of soft updates journaling to tunefs(8).

Add a descrition to the tunefs(8) -j (journal enablement) flag
that explains what soft updates journaling does, the tradeoffs
to using it, and the limitations that it imposes.

Requested by: Graham Perrin
PR:           261944
Sponsored by: The FreeBSD Foundation

22 months agorouting: G/C rt_exportinfo declaration
Mateusz Guzik [Mon, 15 Aug 2022 20:38:31 +0000 (20:38 +0000)]
routing: G/C rt_exportinfo declaration

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

22 months agoIndicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff.
Jens Schweikhardt [Mon, 15 Aug 2022 20:14:15 +0000 (22:14 +0200)]
Indicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff.

22 months agoAdjust function definition in riscv's db_trace.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:48:17 +0000 (20:48 +0200)]
Adjust function definition in riscv's db_trace.c to avoid clang 15 warning

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

    sys/riscv/riscv/db_trace.c:56:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    db_md_list_watchpoints()
                          ^
                           void

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

MFC after: 3 days

22 months agoAdjust function definitions in mp_cpudep.c.c to avoid clang 15 warnings
Dimitry Andric [Mon, 15 Aug 2022 18:46:44 +0000 (20:46 +0200)]
Adjust function definitions in mp_cpudep.c.c to avoid clang 15 warnings

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

    sys/powerpc/booke/mp_cpudep.c:54:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cpudep_ap_bootstrap()
                       ^
                        void
    sys/powerpc/booke/mp_cpudep.c:97:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cpudep_ap_setup()
                   ^
                    void

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

MFC after: 3 days

22 months agoAdjust function definition in moea64_native.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:44:30 +0000 (20:44 +0200)]
Adjust function definition in moea64_native.c to avoid clang 15 warning

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

    sys/powerpc/aim/moea64_native.c:306:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    moea64_install_native()
                         ^
                          void

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

MFC after: 3 days

22 months agoFix unused variable warning in mmu_radix.c
Dimitry Andric [Mon, 15 Aug 2022 18:42:51 +0000 (20:42 +0200)]
Fix unused variable warning in mmu_radix.c

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

    sys/powerpc/aim/mmu_radix.c:5409:22: error: variable 'freed' set but not used [-Werror,-Wunused-but-set-variable]
            int allfree, field, freed, idx;
                                ^

The 'freed' variable is only used when PV_STATS is defined. Ensure it is
only declared and set in that case.

MFC after: 3 days

22 months agoAdjust function definitions in mmu_radix.c to avoid clang 15 warnings
Dimitry Andric [Mon, 15 Aug 2022 18:37:14 +0000 (20:37 +0200)]
Adjust function definitions in mmu_radix.c to avoid clang 15 warnings

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

    sys/powerpc/aim/mmu_radix.c:786:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mmu_radix_tlbie_all()
                       ^
                        void
    sys/powerpc/aim/mmu_radix.c:3615:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mmu_radix_init()
                  ^
                   void
    sys/powerpc/aim/mmu_radix.c:6081:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mmu_radix_scan_init()
                       ^
                        void

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

MFC after: 3 days

22 months agoAdjust function definitions in mmu_oea64.c to avoid clang 15 warnings
Dimitry Andric [Mon, 15 Aug 2022 18:33:25 +0000 (20:33 +0200)]
Adjust function definitions in mmu_oea64.c to avoid clang 15 warnings

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

    sys/powerpc/aim/mmu_oea64.c:1947:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    moea64_init()
               ^
                void
    sys/powerpc/aim/mmu_oea64.c:3257:17: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    moea64_scan_init()
                    ^
                     void

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

MFC after: 3 days

22 months agoAdjust function definition in aim_machdep.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:27:56 +0000 (20:27 +0200)]
Adjust function definition in aim_machdep.c to avoid clang 15 warning

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

    sys/powerpc/aim/aim_machdep.c:750:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mpc745x_sleep()
                 ^
                  void

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

MFC after: 3 days

22 months agoFix unused variable warnings in tcp_hpts.c
Dimitry Andric [Mon, 15 Aug 2022 18:14:39 +0000 (20:14 +0200)]
Fix unused variable warnings in tcp_hpts.c

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

    sys/netinet/tcp_hpts.c:1114:10: error: variable 'paced_cnt' set but not used [-Werror,-Wunused-but-set-variable]
            int32_t paced_cnt = 0;
                    ^
    sys/netinet/tcp_hpts.c:1112:11: error: variable 'total_slots_processed' set but not used [-Werror,-Wunused-but-set-variable]
            uint64_t total_slots_processed = 0;
                     ^

The 'paced_cnt' variable was in tcp_hpts.c when it was first added, and
the 'total_slots_processed' variable was added in d7955cc0ffdf9, but
both appear to have been debugging aids that have never been used, so
remove them.

MFC after: 3 days

22 months agoAdjust function definition in tcp_hpts.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:05:34 +0000 (20:05 +0200)]
Adjust function definition in tcp_hpts.c to avoid clang 15 warning

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

    sys/netinet/tcp_hpts.c:1594:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    tcp_choose_hpts_to_run()
                          ^
                           void

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

MFC after: 3 days

22 months agoAdjust function definition in arm64's db_trace.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:03:39 +0000 (20:03 +0200)]
Adjust function definition in arm64's db_trace.c to avoid clang 15 warning

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

    sys/arm64/arm64/db_trace.c:53:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    db_md_list_watchpoints()
                          ^
                           void

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

MFC after: 3 days

22 months agoAdjust function definition in arm's mv_common.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:02:13 +0000 (20:02 +0200)]
Adjust function definition in arm's mv_common.c to avoid clang 15 warning

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

    sys/arm/mv/mv_common.c:414:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mv_check_soc_family()
                       ^
                        void

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

MFC after: 3 days

22 months agostand: Abstract out fstab creation
Warner Losh [Mon, 15 Aug 2022 18:32:12 +0000 (12:32 -0600)]
stand: Abstract out fstab creation

Now that all the fstabs are the same, abstract it out into a function.

Sponsored by: Netflix

22 months agostand: Update GELI UFS cases to use ufs labels
Warner Losh [Mon, 15 Aug 2022 18:20:50 +0000 (12:20 -0600)]
stand: Update GELI UFS cases to use ufs labels

GELI images are created in a different manner than non-GELI
images. Update them to set the label of 'root' on the UFS partition and
use that in fstab. Drop comments about needing to do this, as well as
the 'dev' variable now that it's unused.

Sponsored by: Netflix

22 months agostand: Update testing harness to start to use UFS labels
Warner Losh [Mon, 15 Aug 2022 18:09:55 +0000 (12:09 -0600)]
stand: Update testing harness to start to use UFS labels

Minor changes to the non-geli UFS targets: migrate to using ufs labels
so we don't need to know the name of the device we booted off of. This
doesn't change the GELI test cass just yet since I've not tested them.
ZFS doesn't need these changes since we don't need to encode the device
for it.

Sponsored by: Netflix

22 months agostand: Update testing script for arch retirement
Warner Losh [Sun, 14 Aug 2022 14:41:11 +0000 (08:41 -0600)]
stand: Update testing script for arch retirement

And catch up to changes in booting methods currently supported. Add
riscv.

Sponsored by: Netflix

22 months agoloader: zfs reader should only store devdesc in f_devdata
Toomas Soome [Sun, 14 Aug 2022 21:49:50 +0000 (00:49 +0300)]
loader: zfs reader should only store devdesc in f_devdata

Use d_opendata for device specific data.

PR: 265825
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36202

22 months agowtap: Implement IBSS mode on wtap(4)
En-Wei Wu [Mon, 15 Aug 2022 16:21:15 +0000 (16:21 +0000)]
wtap: Implement IBSS mode on wtap(4)

For TSF and beacon generation, each STA has to start its local TSF timer
and sends beacon frames when it reaches the state IEEE80211_S_RUN.
The TSF timer will be used for IBSS merge and beacon frame transmission.

The TSF timer is kept in the HAL of wtap(4). It is working by
continuously updating its value on timer interrupt simulated
by callout_reset().

When receiving beacons, the STA will be merged into the IBSS if
- the STA has the same SSID as the beacon sender
- the STA's TSF timer is smaller than the beacon sender's TSF timer.

After the merging process, the younger STA will be in the IBSS
created by the older STA and the younger STA stops sending beacon
frames.  So beacon frames will always be sent by the oldest STA
in IBSS.

Sponsored by: Google, Inc. (GSoC 2022)
Reviewed By: lwhsu, adrian
Differential Revision: https://reviews.freebsd.org/D35841

22 months agoiommu_gas: add iommu_gas_remove()
Konstantin Belousov [Sun, 31 Jul 2022 08:43:43 +0000 (11:43 +0300)]
iommu_gas: add iommu_gas_remove()

The function removes the range of addresses from GAS.  Right now it is
unused.

The initial version of the patch was extracted from the stalled work for
integration of DMAR and bhyve, see D25672. Having the function in the
main tree would allow it to co-evolve with other active changes to the
IOMMU driver.

Requested by: alc
Reviewed by: alc, dougm
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36001

22 months agorc: add ${name}_setup script support
Franco Fichtner [Mon, 15 Aug 2022 14:41:31 +0000 (16:41 +0200)]
rc: add ${name}_setup script support

Run a service-based setup script before running the start command.
Useful for automatic configuration file generation.

Reviewed by: https://reviews.freebsd.org/D36006

22 months agoAdd RockChip RK356X support to existing RockChip iodomain driver.
Søren Schmidt [Mon, 15 Aug 2022 12:03:28 +0000 (12:03 +0000)]
Add RockChip RK356X support to existing RockChip iodomain driver.

22 months agomana: add rmb load fence to comply with hw spec
Wei Hu [Mon, 15 Aug 2022 07:36:09 +0000 (07:36 +0000)]
mana: add rmb load fence to comply with hw spec

To ensure software reads fresh data after observing ownership bits.

Sponsored by: Microsoft

22 months agoHyper-V: storvsc: Call bus_dmamap_sync() for dma operations
Wei Hu [Mon, 15 Aug 2022 06:56:01 +0000 (06:56 +0000)]
Hyper-V: storvsc: Call bus_dmamap_sync() for dma operations

Call bus_dmamap_sync() for related dma operations. This is required
on ARM64 architecture.

Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
MFC after: 2 weeks
Sponsored by: Microsoft

22 months agorouting: retire rib_lookup_info()
Alexander V. Chernikov [Sun, 14 Aug 2022 10:39:06 +0000 (10:39 +0000)]
routing: retire rib_lookup_info()

This function was added in pre-epoch era ( 9a1b64d5a0224 ) to
 provide public rtentry access interface & hide rtentry internals.
The implementation is based on the large on-stack copying and
 refcounting of the referenced objects (ifa/ifp).
It has become obsolete after epoch & nexthop introduction. Convert
 the last remaining user and remove the function itself.

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

22 months agomakefs tests: Skip a ZFS regression test in CI
Mark Johnston [Mon, 15 Aug 2022 01:37:41 +0000 (21:37 -0400)]
makefs tests: Skip a ZFS regression test in CI

It triggers panics after the latest OpenZFS import.

PR: 265849

22 months agoSuppress unused variable warning in tcp_stacks's rack.c
Dimitry Andric [Sun, 14 Aug 2022 19:27:16 +0000 (21:27 +0200)]
Suppress unused variable warning in tcp_stacks's rack.c

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

    sys/netinet/tcp_stacks/rack.c:17405:12: error: variable 'outstanding' set but not used [-Werror,-Wunused-but-set-variable]
                    uint32_t outstanding;
                             ^

The 'outstanding' variable was used later in the rack_output() function,
but refactoring in 35c7bb340788f removed the usage. To avoid too much
code churn, mark the variable unused to supress the warning.

MFC after: 3 days

22 months agoFix unused variable warning in tcp_stacks's rack.c
Dimitry Andric [Sun, 14 Aug 2022 19:13:40 +0000 (21:13 +0200)]
Fix unused variable warning in tcp_stacks's rack.c

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

    sys/netinet/tcp_stacks/rack.c:16148:6: error: variable 'cnt_thru' set but not used [-Werror,-Wunused-but-set-variable]
            int cnt_thru = 1;
                ^

The 'cnt_thru' variable is only used when TCP_ACCOUNTING is defined.
Ensure it is only declared and set in that case.

MFC after: 3 days

22 months agoFix unused variable warning in tcp_stacks's bbr.c
Dimitry Andric [Sun, 14 Aug 2022 19:06:07 +0000 (21:06 +0200)]
Fix unused variable warning in tcp_stacks's bbr.c

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

sys/netinet/tcp_stacks/bbr.c:11925:11: error: variable 'rtr_cnt' set but not used [-Werror,-Wunused-but-set-variable]
        uint32_t rtr_cnt = 0;
                 ^

The 'rtr_cnt' variable was in bbr.c when it was first added, but it
appears to have been a debugging aid that has never been used, so remove
it.

MFC after: 3 days

22 months agoAdjust function definition in kern_poll.c to avoid clang 15 warning
Dimitry Andric [Sun, 14 Aug 2022 19:03:39 +0000 (21:03 +0200)]
Adjust function definition in kern_poll.c to avoid clang 15 warning

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

    sys/kern/kern_poll.c:374:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    netisr_pollmore()
                   ^
                    void

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

MFC after: 3 days

22 months agoAdjust function definition in drm_fb_helper.c to avoid clang 15 warning
Dimitry Andric [Sun, 14 Aug 2022 19:01:31 +0000 (21:01 +0200)]
Adjust function definition in drm_fb_helper.c to avoid clang 15 warning

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

    sys/dev/drm2/drm_fb_helper.c:86:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    framebuffer_alloc()
                     ^
                      void

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

MFC after: 3 days

22 months agoAdjust function definition in riscv's dtrace_subr.c to avoid clang 15 warning
Dimitry Andric [Sun, 14 Aug 2022 19:00:34 +0000 (21:00 +0200)]
Adjust function definition in riscv's dtrace_subr.c to avoid clang 15 warning

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

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

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

MFC after: 3 days

22 months agoAdjust function definition in powerpc's dtrace_subr.c to avoid clang 15 warning
Dimitry Andric [Sun, 14 Aug 2022 18:57:59 +0000 (20:57 +0200)]
Adjust function definition in powerpc's dtrace_subr.c to avoid clang 15 warning

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

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

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

MFC after: 3 days

22 months agoAdjust function definition in arm's dtrace_subr.c to avoid clang 15 warning
Dimitry Andric [Sun, 14 Aug 2022 18:49:20 +0000 (20:49 +0200)]
Adjust function definition in arm's dtrace_subr.c to avoid clang 15 warning

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

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

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

MFC after: 3 days

22 months agoFix unused variable warning in rockchip's rk_spi.c
Dimitry Andric [Sun, 14 Aug 2022 18:36:13 +0000 (20:36 +0200)]
Fix unused variable warning in rockchip's rk_spi.c

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

    sys/arm64/rockchip/rk_spi.c:229:6: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]
            int cnt = 0;
                ^

The 'cnt' variable was in rk_spi.c when it was first added, but it
appears to have been a debugging aid that has never been used, so remove
it.

MFC after: 3 days

22 months agogoldfish_rtc: Fix handling a local time RTC
Jessica Clarke [Sun, 14 Aug 2022 18:50:22 +0000 (19:50 +0100)]
goldfish_rtc: Fix handling a local time RTC

The default QEMU config is to have the RTC in UTC. However, if run with
-rtc base=localtime (and wall_cmos_clock is set to match), the driver
fails to account for adjkerntz due to the use of CLOCKF_SETTIME_NO_ADJ.
Copy the same code used by other CLOCKF_SETTIME_NO_ADJ-using drivers
to fix this, namely manually subtracting utc_offset().

Fixes: d63a631e7244 ("Add Goldfish RTC device driver for RISC-V")
MFC after: 1 week

22 months agobhyve nvme: Fix firmware read only initialization
Wanpeng Qian [Sun, 14 Aug 2022 15:30:06 +0000 (08:30 -0700)]
bhyve nvme: Fix firmware read only initialization

Summary:
Code was using the mask value without the shift.

Test Plan: Within FreeBSD/Linux guest, Identify NVMe controller to check the result.

Reviewed by: chuck, imp
MFC after: 2 weeks
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32659

22 months agobhyve nvme: Fix Active Firmware Info
WanpengQian [Sun, 14 Aug 2022 15:28:05 +0000 (08:28 -0700)]
bhyve nvme: Fix Active Firmware Info

Summary:
Currently Active Firmware Info is not initialized.

Fix is to initialize the Active Firmware Info to Slot 1.

Test Plan: Within FreeBSD/Linux guests, show the Firmware Logpage to confirm.

Reviewed By: chuck
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32658

22 months agobhyve: Fix Number of Power States Supported value
WanpengQian [Sun, 14 Aug 2022 15:26:42 +0000 (08:26 -0700)]
bhyve: Fix Number of Power States Supported value

Summary:
Set Number of Power States Supported to indicate 1 power state. Keep the
Power State Descriptor data structures as zero to indicate "Not
reported".

Test Plan:
Within FreeBSD/Linux guests, list the number of power states and check
the Max Power value.

Reviewed By: markj, chuck
MFC after: 2 weeks
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32657

22 months agonet80211: add an IEEE80211_IS_PROTECTED() macro
Adrian Chadd [Fri, 12 Aug 2022 20:56:00 +0000 (13:56 -0700)]
net80211: add an IEEE80211_IS_PROTECTED() macro

Summary: This returns whether the given 802.11 frame has the protected bit set.

Test Plan:
* tested in AP/STA mode
* STA mode - local athp/ath10k driver
* AP mode - in tree ath driver

Subscribers: imp, melifaro, glebius
Reviewed by: bz
Approved by: bz

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

22 months agoThe fdformat man page is in section 8 (not 1).
Jens Schweikhardt [Sun, 14 Aug 2022 16:14:08 +0000 (18:14 +0200)]
The fdformat man page is in section 8 (not 1).

22 months agobhyve: Address uses of uninitialized variables in pci_nvme.c
Mark Johnston [Sun, 14 Aug 2022 15:57:24 +0000 (11:57 -0400)]
bhyve: Address uses of uninitialized variables in pci_nvme.c

The debug print in nvme_opc_get_log_page() would print an uninitialized
local variable.

In nvme_opc_write_read(), a failed LBA bounds check would cause
pci_nvme_stats_write_read_update() to be called with an uninitialized
variable as a parameter.  Although the parameter is unused when the
check fails (and so status != 0), LLVM 14 emits some bogus machine code
in this path, which happens to result in a segfault when it gets
executed.

PR: 265749
Reviewed by: chuck, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36119

22 months agobhyve: Address -Wunused* warnings in pci_nvme.c
Mark Johnston [Sun, 14 Aug 2022 15:56:33 +0000 (11:56 -0400)]
bhyve: Address -Wunused* warnings in pci_nvme.c

Currently these are not reported because bhyve is compiled with WARNS=2.
Let's start taking small steps towards enabling more warnings.

No functional change intended.

Reviewed by: chuck, imp, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36118

22 months agortld: fix display of the mapbase for the traced objects
Konstantin Belousov [Sun, 14 Aug 2022 14:57:40 +0000 (17:57 +0300)]
rtld: fix display of the mapbase for the traced objects

Commit 24d0c9c1f565bab6e introduced the following regression:
% ldd /bin/ls
/bin/ls:
        libutil.so.9 => /lib/libutil.so.9 (0x1021000)
        libncursesw.so.9 => /lib/libncursesw.so.9 (0x1021000)
        libc.so.7 => /lib/libc.so.7 (0x1021000)
Note that the base address is the same for all displayed libraries.

Fix it by passing correct object to trace_print_obj().

Fixes: 24d0c9c1f565bab6e
Reviewed by: jrtc27
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36198

22 months agobhyve nvme: Fix uninitialized pointer
Chuck Tuffli [Thu, 9 Jun 2022 20:05:46 +0000 (13:05 -0700)]
bhyve nvme: Fix uninitialized pointer

The Dataset Management code could free an uninitialized pointer if the
device doesn't support the Dataset Management command.

PR: 264548
Reported by: Robert Morris <rtm@lcs.mit.edu>

22 months agobhyve nvme: Fix Controller init error cases
Chuck Tuffli [Sun, 14 Aug 2022 14:47:34 +0000 (07:47 -0700)]
bhyve nvme: Fix Controller init error cases

Fuzzing of bhyve uncovered an assertion failure in the NVMe emulation.
Investigation uncovered several corner cases the code did not handle.
This change handles several Controller initialization errors, including
 - bad AQ sizes
 - bad AQ vm_map_gpa
 - doorbell writes prior to RDY
 - doorbell writes to uninitialized queue
 - CSTS.RDY if CFS set

PR: 256317,256319,256320,256322
Reported by: Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35453

22 months agobhyve nvme: Check return value of mapped memory
Chuck Tuffli [Sun, 14 Aug 2022 14:45:21 +0000 (07:45 -0700)]
bhyve nvme: Check return value of mapped memory

Fuzzing of bhyve using hyfuzz discovered a way to cause a segmentation
fault in the NVMe emulation. If a guest specifies a physical address in
either the PRP1 or PRP2 field of a command that cannot be mapped from
guest to host, the function paddr_guest2host() returns a NULL pointer.
The NVMe emulation did not check for this error case, which allowed for
the segmentation fault to occur.

Fix is to check for a return value of NULL and indicate an error back to
the guest (Data Transfer error). While in the area, slightly refactor
the write/read blockif function to use a common error exit path.

PR: 256321
Reported by: Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D35452

22 months agoIndicate that racoon.8 is in ports/security/ipsec-tools.
Jens Schweikhardt [Sun, 14 Aug 2022 13:55:34 +0000 (15:55 +0200)]
Indicate that racoon.8 is in ports/security/ipsec-tools.

22 months agoDelete xref to suidperl(1) which has long since been removed in perl5.12.
Jens Schweikhardt [Sun, 14 Aug 2022 13:43:27 +0000 (15:43 +0200)]
Delete xref to suidperl(1) which has long since been removed in perl5.12.

22 months agoIndicate that kgdb.1 is from ports/devel/gdb.
Jens Schweikhardt [Sun, 14 Aug 2022 13:17:29 +0000 (15:17 +0200)]
Indicate that kgdb.1 is from ports/devel/gdb.

22 months agoFor man page references found in ports, indicate the respective port.
Jens Schweikhardt [Sun, 14 Aug 2022 13:02:06 +0000 (15:02 +0200)]
For man page references found in ports, indicate the respective port.

22 months agogpio: mark more INVARIANTS variables as __diagused
Dimitry Andric [Sun, 14 Aug 2022 12:12:42 +0000 (14:12 +0200)]
gpio: mark more INVARIANTS variables as __diagused

Mark another set of variables that are only used in INVARIANTS builds,
which otherwise result in set-but-not-used warnings.

Fixes: 7dc4d5118c02
MFC after: 3 days

22 months agoAvoid using TARGET_ARCH in llvm.build.mk
Dimitry Andric [Sun, 14 Aug 2022 11:10:48 +0000 (13:10 +0200)]
Avoid using TARGET_ARCH in llvm.build.mk

Apparently the TARGET_ARCH macro is not supposed to be used outside of
the top-level Makefiles. Directly use MACHINE_ARCH instead.

Noticed by: imp, jrtc27
MFC after: 1 week

22 months agoAdjust function definition in if_ovpn_c.c to avoid clang 15 warning
Dimitry Andric [Sat, 13 Aug 2022 17:40:07 +0000 (19:40 +0200)]
Adjust function definition in if_ovpn_c.c to avoid clang 15 warning

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

    tests/sys/net/if_ovpn/if_ovpn_c.c:19:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    fake_sockaddr()
 ^
  void

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

MFC after:      3 days

22 months agoIndicate that X(7) cross refs are satisfied by ports/x11/xorg-docs.
Jens Schweikhardt [Sun, 14 Aug 2022 10:01:30 +0000 (12:01 +0200)]
Indicate that X(7) cross refs are satisfied by ports/x11/xorg-docs.

22 months agoIn man page cross refs to sudo, indicate it comes from ports/security/sudo.
Jens Schweikhardt [Sun, 14 Aug 2022 09:42:18 +0000 (11:42 +0200)]
In man page cross refs to sudo, indicate it comes from ports/security/sudo.