]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 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

21 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

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

21 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

21 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")

21 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.

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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.

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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).

21 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

21 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

21 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

21 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>

21 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

21 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

21 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.

21 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.

21 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.

21 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.

21 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

21 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

21 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

21 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.

21 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.

21 months agonetlink: add AF_NETLINK / PF_NETLINK definitions
Alexander V. Chernikov [Fri, 12 Aug 2022 13:45:49 +0000 (13:45 +0000)]
netlink: add AF_NETLINK / PF_NETLINK definitions

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D36174
MFC after: 1 weeks

21 months agodomains: allow domains to be unloaded
Alexander V. Chernikov [Fri, 12 Aug 2022 13:36:53 +0000 (13:36 +0000)]
domains: allow domains to be unloaded

Add domain_remove() SYSUNINT callback that removes the domain
 from the domain list if it has DOMF_UNLOADABLE flag set.
This change is required to support netlink ( D36002 ).

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D36173

21 months agoRemove minigzip from the base system.
Xin LI [Sun, 14 Aug 2022 04:11:50 +0000 (21:11 -0700)]
Remove minigzip from the base system.

The minigzip(1) was initially introduced as a minimal replacement
of GNU gzip(1). We have replaced the GNU gzip(1) with the zlib
based, GPL-free implementation, and minigzip(1) is not being used
anywhere in the base system, so just remove it.

Relnotes: yes
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D35979

21 months agozfs: merge openzfs/zfs@b3d0568cf
Martin Matuska [Sat, 13 Aug 2022 23:13:55 +0000 (01:13 +0200)]
zfs: merge openzfs/zfs@b3d0568cf

Notable upstream pull request merges:
  #9372 Implement a new type of zfs receive: corrective receive (-c)
  #13635 Add snapshots_changed as property
  #13636 Add support for per dataset zil stats and use wmsum counters
  #13643 Fix scrub resume from newly created hole
  #13670 Fix memory allocation for the checksum benchmark
  #13695 Skip checksum benchmarks on systems with slow cpu
  #13711 zpool: fix redundancy check after vdev removal

Obtained from: OpenZFS
OpenZFS commit: b3d0568cfd65458c92f7ab3d7bb709087992628e

21 months agorc.d/hostid: Skip warning on systems w/o smbios
Colin Percival [Fri, 12 Aug 2022 23:48:26 +0000 (16:48 -0700)]
rc.d/hostid: Skip warning on systems w/o smbios

The first time a FreeBSD system boots, it obtains a hostuuid and hostid
from the smbios.system.uuid kernel environment variable.  If this value
is found to be invalid, a warning is printed and the boot pauses for
two seconds to give the user a chance to read it.

If the FreeBSD kernel is launched directly in a virtual machine rather
than via the FreeBSD boot loader, the smbios.system.uuid environment
variable might not be set; in this case, there's no need to alert the
user and delay the boot process since the lack of a "hardware" uuid is
entirely expected.

Distinguish between the cases of "invalid UUID" and "no UUID", warning
and delaying the boot only in the former case.  In both cases we still
generate a random UUID in software.

Reviewed by: delphij
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D36185

21 months agolapic_init: Reduce LOOPS
Colin Percival [Fri, 12 Aug 2022 23:51:34 +0000 (16:51 -0700)]
lapic_init: Reduce LOOPS

While I'm here, instrument lapic_init with TSLOG so it shows up (or
typically not, after this change) on flamecharts.

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

21 months agoLRO: fix BPF filters for lagg in the hpts path
Andrew Gallatin [Sat, 13 Aug 2022 00:15:46 +0000 (20:15 -0400)]
LRO: fix BPF filters for lagg in the hpts path

When in the hpts path, we need to handle BPF filters since aggregated
packets do not pass up the stack in the normal way. This is already
done for most interfaces, but lagg needs special handling. This is
because packets received via a lagg are passed up the stack with
the leaf interface's ifp stored in m_pkthdr.rcvif.

To handle lagg packets, we must identify that the passed rcvif is
currently a lagg port by checking for IFT_IEEE8023ADLAG or
IFT_INFINIBANDLAG (since lagg changes the lagg port's type to that
when an interface becomes a lagg member). Then we need to find the
lagg's ifp, and handle any BPF listeners on the lagg.

Note: It is possible to have multiple BPF filters, one on a member
port and one on the lagg itself. That is why we have to have 2
checks and 2 ETHER_BPF_MTAPs.

Reviewed by: jhb, rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36136

21 months agoReplace a dead cross reference with the proper (I think) macro.
Jens Schweikhardt [Sat, 13 Aug 2022 20:54:00 +0000 (22:54 +0200)]
Replace a dead cross reference with the proper (I think) macro.

21 months agoExplicitly initialize rather than reading newly allocated UFS inodes.
Kirk McKusick [Sat, 13 Aug 2022 20:50:08 +0000 (13:50 -0700)]
Explicitly initialize rather than reading newly allocated UFS inodes.

The function ffs_vgetf() is used to find or load UFS inodes into a
vnode. It first looks up the inode and if found in the cache its
vnode is returned. If it is not already in the cache, a new vnode
is allocated and its associated inode read in from the disk. The
read is done even for inodes that are being initially created.
The contents for the inode on the disk are assumed to be empty. If
the on-disk contents had been corrupted either due to a hardware
glitch or an agent deliberately trying to exploit the system, the
UFS code could panic from the unexpected partially-allocated inode.

Rather then having fsck_ffs(8) verify that all unallocated inodes
are properly empty, it is easier and quicker to add a flag to
ffs_vgetf() to indicate that the request is for a newly allocated
inode. When set, the disk read is skipped and the inode is set to
its expected empty (zero'ed out) initial state. As a side benefit,
an unneeded disk I/O is avoided.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

21 months agoFix wrong section number in man page cross references.
Jens Schweikhardt [Sat, 13 Aug 2022 20:42:23 +0000 (22:42 +0200)]
Fix wrong section number in man page cross references.

21 months agoFix wrong section number in man page cross references.
Jens Schweikhardt [Sat, 13 Aug 2022 20:30:19 +0000 (22:30 +0200)]
Fix wrong section number in man page cross references.

21 months agoCorrectness cleanups in fsck_ffs(8).
Kirk McKusick [Sat, 13 Aug 2022 20:27:37 +0000 (13:27 -0700)]
Correctness cleanups in fsck_ffs(8).

Allocation or I/O failures in fsck_ffs(8) could cause segment
faults because of missing checks or not-yet-initialized data
structures. Correct these issues.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

21 months agostand: Fix a couple of comment typos in f8a199f28f9d
Jessica Clarke [Sat, 13 Aug 2022 19:48:30 +0000 (20:48 +0100)]
stand: Fix a couple of comment typos in f8a199f28f9d

The commit message documented it as /etc/src.conf but the comment in the
source mentioned the non-existent /etc/loader.conf.

Fixes: f8a199f28f9d ("stand: Raise limit to 550,000 bytes for loader")

21 months agoMove the ability to search for alternate UFS superblocks from fsck_ffs(8)
Kirk McKusick [Sat, 13 Aug 2022 19:41:53 +0000 (12:41 -0700)]
Move the ability to search for alternate UFS superblocks from fsck_ffs(8)
into ffs_sbsearch() to allow use by other parts of the system.

Historically only fsck_ffs(8), the UFS filesystem checker, had code
to track down and use alternate UFS superblocks. Since fsdb(8) used
much of the fsck_ffs(8) implementation it had some ability to track
down alternate superblocks.

This change extracts the code to track down alternate superblocks
from fsck_ffs(8) and puts it into a new function ffs_sbsearch() in
sys/ufs/ffs/ffs_subr.c. Like ffs_sbget() and ffs_sbput() also found
in ffs_subr.c, these functions can be used directly by the kernel
subsystems. Additionally they are exported to the UFS library,
libufs(8) so that they can be used by user-level programs. The new
functions added to libufs(8) are sbfind(3) that is an alternative
to sbread(3) and sbsearch(3) that is an alternative to sbget(3).
See their manual pages for further details.

The utilities that have been changed to search for superblocks are
dumpfs(8), fsdb(8), ffsinfo(8), and fsck_ffs(8). Also, the prtblknos(8)
tool found in tools/diag/prtblknos searches for superblocks.

The UFS specific mount code uses the superblock search interface
when mounting the root filesystem and when the administrator doing
a mount(8) command specifies the force flag (-f). The standalone UFS
boot code (found in stand/libsa/ufs.c) uses the superblock search
code in the hope of being able to get the system up and running so
that fsck_ffs(8) can be used to get the filesystem cleaned up.

The following utilities have not been changed to search for
superblocks: clri(8), tunefs(8), snapinfo(8), fstyp(8), quot(8),
dump(8), fsirand(8), growfs(8), quotacheck(8), gjournal(8), and
glabel(8). When these utilities fail, they do report the cause of
the failure. The one exception is the tasting code used to try and
figure what a given disk contains. The tasting code will remain
silent so as not to put out a slew of messages as it trying to taste
every new mass storage device that shows up.

Reviewed by: kib
Reviewed by: Warner Losh
Tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D36053
Sponsored by: The FreeBSD Foundation

21 months agobhyve nvme: Fix out-of-bound IOV array access
Chuck Tuffli [Thu, 9 Jun 2022 18:19:32 +0000 (11:19 -0700)]
bhyve nvme: Fix out-of-bound IOV array access

Summary:
NVMe operations indicate the memory region(s) associated with a command
via physical region pages (PRPs). Since each PRP has a fixed size,
contiguous memory regions larger than the PRP size require multiple PRP
entries.

Instead of issuing a blockif call for each PRP, the NVMe emulation
concatenates multiple contiguous PRP entries into a single blockif
request. The test for contiguous regions has a bug such that it
mistakenly treats an initial PRP address of zero as a contiguous range
and concatenates it with the previous. But because there is no previous
IOV, the concatenation code corrupts the IO request structure and leads
to a segmentation fault when the blockif request completes.

Fix is to test for the existence of a previous range before trying to
concatenate the current range with the previous one.

While in the area, rename pci_nvme_append_iov_req()'s lba parameter to
offset to match its usage.

PR:             264177
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by: jhb
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D35328

21 months agoFix wrong capitalization in man page references.
Jens Schweikhardt [Sat, 13 Aug 2022 18:46:59 +0000 (20:46 +0200)]
Fix wrong capitalization in man page references.

21 months agomrsas module: Use MACHINE_ARCH exlcusively
Warner Losh [Sat, 13 Aug 2022 17:53:22 +0000 (11:53 -0600)]
mrsas module: Use MACHINE_ARCH exlcusively

TARGET_ARCH is always wrong when not used at the toplevel Makefile*, or
in something that has to be included from there. Switch to using
MACHINE_ARCH exclusively here since there's no benefit from assigning
TARGET_ARCH the value of MACHINE_ARCH and then using TARGET_ARCH (and
make TARGET_ARCH=xxx won't work).

Sponsored by: Netflix

21 months agoFix a broken man page reference.
Jens Schweikhardt [Sat, 13 Aug 2022 15:40:29 +0000 (17:40 +0200)]
Fix a broken man page reference.

21 months agostand: Only compile decompression routines
Warner Losh [Sat, 13 Aug 2022 03:30:24 +0000 (21:30 -0600)]
stand: Only compile decompression routines

We don't need the compress rotuines, nor zstd_opt.c. Remove them.
Expand the number of places we omit code for IN_LIBSA (which are FreeBSD
specific). Due to the agressive optimization, though, this doesn't
reduce the size of the loader. It does reduce the number of 'false
positives' for places to omit to reduce the size as well as reducing the
build time slightly.

Sponsored by: Netflix
Reviewed by: tsoome, delphij
Differential Revision: https://reviews.freebsd.org/D36145

21 months agostand: Compile out the extensive superblock diagnostic messages for BIOS loader
Warner Losh [Fri, 12 Aug 2022 17:08:36 +0000 (11:08 -0600)]
stand: Compile out the extensive superblock diagnostic messages for BIOS loader

The BIOS loader operates in a very constrained environment. The messages
for the super block integrity tests take up about 12k of space. Compile
them out for the BIOS loader, while leaving it intact for all other
loaders that aren't space constrained. These aren't used in the 'super
tiny' *boot* programs, so no adjustment is needed there.

We reply on the fact that (a) i386 doesn't support 32-bit UEFI booting
and (b) LIBSA_CPUARCH is "i386" when building on both i386 and when
we're building the 32-bit libsa32 library.

This saves about 12k of space for this constrained envrionment and will
take a bit of the pressure off some machines where the loader has grown
too big for their BIOS (see comments in i386/loader/Makefile for
details).

Sponsored by: Netflix
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D36175

21 months agostand: Raise limit to 550,000 bytes for loader
Warner Losh [Fri, 12 Aug 2022 04:59:51 +0000 (22:59 -0600)]
stand: Raise limit to 550,000 bytes for loader

Raise the limit for /boot/loader to be 550k. The IBM PC imposes a limit
of 640k of RAM below 1MB, which is needed for real mode calls. BTX takes
40k of that. The BIOS takes some amount (25k seems a good "99% take less
than or equal to this" estimate for that, though some systems consume
more). Most typical setups need 25k of stack.  This leaves 550k for
code. We set the limit to 550,000 which gives about an extra 13,000
bytes of buffer for machines that whose setups use a little more stack
or whose BIOS reserves a bit more...

Add this derivation in the Makefile. Also recommend setting LOADERSIZE
lower in /etc/src.conf when the loader has to run on a system whose BIOS
takes up more space, or for a complex setup. Add a recipe for how to
find how much RAM your BIOS uses as well (thanks to jhb@ for the
trick). Network cards that boot via PXE and HBAs with their BIOS enabled
are known to be large consumers of lomem space.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D36152

21 months agosys/vm: Add TSLOG to some functions
Colin Percival [Fri, 12 Aug 2022 23:52:47 +0000 (16:52 -0700)]
sys/vm: Add TSLOG to some functions

The functions pbuf_init, kva_alloc, and keg_alloc_slab are significant
contributors to the kernel boot time when FreeBSD boots inside the
Firecracker VMM.  Instrument them so they show up on flamecharts.

21 months agokeysock: explicitly initialized LIST_HEAD
Gleb Smirnoff [Fri, 12 Aug 2022 19:29:26 +0000 (12:29 -0700)]
keysock: explicitly initialized LIST_HEAD

This is supposed to fix syzcaller report.

Reported by: syzbot+1e08b5f9f7f00383ddea@syzkaller.appspotmail.com
Fixes: ea7be1293b48385f27b97c5f112e4cad93cbd33b

21 months agoprotosw: change prototype for pr_control
Gleb Smirnoff [Fri, 12 Aug 2022 19:08:18 +0000 (12:08 -0700)]
protosw: change prototype for pr_control

For some reason protosw.h is used during world complation and userland
is not aware of caddr_t, a relic from the first version of C.  Broken
buildworld is good reason to get rid of yet another caddr_t in kernel.

Fixes: 886fc1e80490fb03e72e306774766cbb2c733ac6

21 months agomac_ddb: Fix the show rman validator.
John Baldwin [Fri, 12 Aug 2022 17:20:05 +0000 (10:20 -0700)]
mac_ddb: Fix the show rman validator.

The validator always returned true due to an incorrect check.

Reviewed by: mhorne, imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36125

21 months agoWhen -u option is used also set USER, HOME and SHELL variables.
Maxim Sobolev [Thu, 11 Aug 2022 01:44:20 +0000 (18:44 -0700)]
When -u option is used also set USER, HOME and SHELL variables.
This is consistent with what other uid-morphing utilities
do, i.e. jexec(1), su(1) etc.

MFC after:      2 weeks
Reviewed by:    gbe
Differential Revision:  https://reviews.freebsd.org/D36148

21 months agonetinet: do not broadcast PRC_REDIRECT_HOST on ICMP redirect
Gleb Smirnoff [Fri, 12 Aug 2022 15:31:28 +0000 (08:31 -0700)]
netinet: do not broadcast PRC_REDIRECT_HOST on ICMP redirect

This is expensive and useless call.  It has been useless since Alexander
melifaro@ moved the forwarding table to nexthops with passive invalidation.
What happens now is that cached route in a inpcb would get invalidated
on next ip_output().

These were the last users of pfctlinput(), so garbage collect it.

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

21 months agoprotosw: provide prototypes for all protocol switch methods
Gleb Smirnoff [Fri, 12 Aug 2022 15:30:34 +0000 (08:30 -0700)]
protosw: provide prototypes for all protocol switch methods

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

21 months agonetinet6: simplify defrouter_select_fib()
Alexander V. Chernikov [Fri, 12 Aug 2022 11:43:14 +0000 (11:43 +0000)]
netinet6: simplify defrouter_select_fib()

* factor out underlying llentry check into a separate function and use it consistently
* enter epoch once instead of per-router enter/exit
* don't execute body with fibnum = `RT_ALL_FIBS`

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

21 months agorouting: add rib_match_gw() helper
Alexander V. Chernikov [Fri, 12 Aug 2022 09:31:21 +0000 (09:31 +0000)]
routing: add rib_match_gw() helper

Finish 02e05b8faec1:
* add gateway matcher function that can be used in rib_del_route_px()
 or any rib_walk-family functions. It will be used in the upcoming
 migration to the new KPI
* rename gw_fulter_func to match_gw_one() to better signal the
 function purpose / semantic.

MFC after: 1 month

21 months agoDocument implicit dependencies of the mlx5(4) & friends.
Maxim Sobolev [Thu, 11 Aug 2022 23:28:27 +0000 (16:28 -0700)]
Document implicit dependencies of the mlx5(4) & friends.

MFC after:      2 weeks

21 months agostand: Go back to a.out format for /boot/loader
Warner Losh [Thu, 11 Aug 2022 23:29:10 +0000 (17:29 -0600)]
stand: Go back to a.out format for /boot/loader

Turns out there's two hidden a.out dependencies. pxeldr.S assumes it has
access to the a.out header from /boot/loader and cdboot.S assumes that
/boot/loader is also a.out and doesn't use boot2.

So, go back to making a.out files for these and adjust the size checks
to use ls, but we only need to check loader.bin. Trim the size we check
against by 2,000. The difference in size between loader and loader.bin
is about 3000 bytes, but clang15 produces binaries that are a smidge
bigger so we need to relax the check just a little and accept some
additional risk for the moment.

Add some comments to loader's Makefile about this.

Sponsored by: Netflix
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D36142

21 months agoInstall working pkgconfig .pc files for compat libraries
Alex Richardson [Thu, 11 Aug 2022 22:17:52 +0000 (23:17 +0100)]
Install working pkgconfig .pc files for compat libraries

The default ones are install them to /usr/libdata/pkgconfig, and we can't
use this path for compat libraries, so we use /usr/lib<suffix>/pkgconfigi here.

Test Plan: grep -rn libdir= ./usr/lib32/pkgconfig/*.pc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34939

21 months agomac: s/0/false/ in macros denoting probe enablement
Mateusz Guzik [Thu, 11 Aug 2022 22:11:24 +0000 (22:11 +0000)]
mac: s/0/false/ in macros denoting probe enablement

No functional changes.

21 months agorouting: unbreak the build of a bunch of kernels
Mateusz Guzik [Thu, 11 Aug 2022 21:50:37 +0000 (21:50 +0000)]
routing: unbreak the build of a bunch of kernels

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

21 months agox86: remove MP_WATCHDOG
Mateusz Guzik [Tue, 9 Aug 2022 20:34:46 +0000 (22:34 +0200)]
x86: remove MP_WATCHDOG

It does not work with ULE, which is the default scheduler for over a
decade.

Reviewed by: emaste, kib
Differential Revision: https://reviews.freebsd.org/D36094

21 months agoctladm: Fix typo in command line help.
Alexander Motin [Thu, 11 Aug 2022 20:53:50 +0000 (16:53 -0400)]
ctladm: Fix typo in command line help.

MFC after: 1 week

21 months agortsock: subscribe to ifnet eventhandlers instead of direct calls.
Alexander V. Chernikov [Thu, 11 Aug 2022 20:09:45 +0000 (20:09 +0000)]
rtsock: subscribe to ifnet eventhandlers instead of direct calls.

Stop treating rtsock as a "special" consumer and use already-provided
 ifaddr arrival/departure notifications.

MFC after: 2 weeks

Test Plan:
```
21:05 [0] m@devel0 route -n monitor

-> ifconfig vtnet0.2 create

got message of size 24 on Tue Aug  9 21:05:44 2022
RTM_IFANNOUNCE: interface arrival/departure: len 24, if# 3, what: arrival

got message of size 168 on Tue Aug  9 21:05:54 2022
RTM_IFINFO: iface status change: len 168, if# 3, link: up, flags:<BROADCAST,RUNNING,SIMPLEX,MULTICAST>

-> ifconfig vtnet0.2 destroy

got message of size 24 on Tue Aug  9 21:05:54 2022
RTM_IFANNOUNCE: interface arrival/departure: len 24, if# 3, what: departure

```

Reviewed By: glebius
Differential Revision: https://reviews.freebsd.org/D36095
MFC after: 2 weeks

21 months agoiconv_std: complete the //IGNORE support
Kyle Evans [Tue, 22 Feb 2022 07:15:04 +0000 (01:15 -0600)]
iconv_std: complete the //IGNORE support

Previously, it would only ignore failures due to csmapper conversion
failure.  It may be the case that the input string contains invalid
sequences that also need to be ignored.

A good example of //IGNORE application is sanitizing user- or remotely-
specified strings that are expected to be UTF-8; perhaps as part of a
pipeline that will feed the result into a system less tested against or
tolerant of illegal UTF-8 sequences.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34345

21 months agolibc: iconv: add mb_cur_min for encoder traits
Kyle Evans [Tue, 22 Feb 2022 07:12:27 +0000 (01:12 -0600)]
libc: iconv: add mb_cur_min for encoder traits

A future commit will actually implement //IGNORE so that applications
using base iconv can, e.g., sanitize UTF-8 strings.  To do this, the
iconv_std module needs to be able to determine the minimum width for any
given encoding so that it can skip that many bytes in the input buffer.
This is mainly an issue for UTF-16 and UTF-32.

This commit bumps shlib versions to 5 for libiconv modules to reflect
the ABI change.  It also fixes OptionalObsoleteFiles to remove the
libiconv modules if WITHOUT_ICONV is in use.

re: _ENCODING_MB_CUR_MIN, note that this file (citrus_stdenc_template.h)
is included at the bottom of an encoding *implementation*, so the
implementation is free to #define it prior.  UTF1632 is a good example,
as it redefines the minimum to be a property on the encodinginfo, and
the minimum is set to 2 or 4 bytes for UTF-16 and UTF-32 respectively.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34344