]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 months agonamei: Add a comment explaining ISRESTARTED flag
Dmitry Chagin [Tue, 13 Jun 2023 12:22:09 +0000 (15:22 +0300)]
namei: Add a comment explaining ISRESTARTED flag

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40494

12 months agoipfw: simplify action case parser
Alexander V. Chernikov [Wed, 7 Jun 2023 08:31:52 +0000 (08:31 +0000)]
ipfw: simplify action case parser

Remove "goto charg" from the action parser.
This is a prerequisite for the further split of the gigantic
compile_rule().

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

12 months agoipfw(8): add ioctl/instruction generation tests
Alexander V. Chernikov [Sun, 11 Jun 2023 08:12:04 +0000 (08:12 +0000)]
ipfw(8): add ioctl/instruction generation tests

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

12 months agostress2: Added a regression test for mksnap_ffs(8)
Peter Holm [Tue, 13 Jun 2023 09:01:43 +0000 (11:01 +0200)]
stress2: Added a regression test for mksnap_ffs(8)

12 months agolinuxkpi: advance platform_device
Corvin Köhne [Tue, 31 Jan 2023 08:18:38 +0000 (09:18 +0100)]
linuxkpi: advance platform_device

These are required by some linux driver like:
https://github.com/beckhoff/bbapi

Reviewed by: manu
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39554

12 months agoWrite out corrected superblock when creating a UFS/FFS snapshot.
Kirk McKusick [Tue, 13 Jun 2023 07:21:43 +0000 (00:21 -0700)]
Write out corrected superblock when creating a UFS/FFS snapshot.

When taking a snapshot on a UFS version 1 filesystem we need to
call ffs_oldfscompat_write() to unwind any in-memory changes that
were made to the superblock before writing it. The cause of this bug
was that the trimmed down maximum file size was not being reverted.

PR:           271352
Tested-by: Peter Holm
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
12 months agoifconfig(8): add the dotted format for MAC addresses.
Trond Endrestol [Tue, 13 Jun 2023 06:36:16 +0000 (06:36 +0000)]
ifconfig(8): add the dotted format for MAC addresses.

MFC after: 2 weeks
PR: 261572

12 months agoifconfig: remove global_args variable.
Alexander V. Chernikov [Tue, 13 Jun 2023 06:25:10 +0000 (06:25 +0000)]
ifconfig: remove global_args variable.

This variable was temporarily introduced in the beginning of the
code cleanup. Use on-stack instance in main() instead.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40439
MFC after: 2 weeks

12 months agoifconfig: remove global 'name' variable.
Alexander V. Chernikov [Tue, 13 Jun 2023 06:22:29 +0000 (06:22 +0000)]
ifconfig: remove global 'name' variable.

Consistenly use newly-added 'ctx->ifname' as the name of the current
target interface.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40438
MFC after: 2 weeks

12 months agoifconfig: pass if_ctx instead of socket to the tunnel handlers.
Alexander V. Chernikov [Tue, 13 Jun 2023 06:19:50 +0000 (06:19 +0000)]
ifconfig: pass if_ctx instead of socket to the tunnel handlers.

This is a pre-requisite for the global 'name' variable removal.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40432
MFC after: 2 weeks

12 months agoifconfig: remove global 'printifname' variable.
Alexander V. Chernikov [Tue, 13 Jun 2023 06:18:05 +0000 (06:18 +0000)]
ifconfig: remove global 'printifname' variable.

This variable was used to print the created interface name in the
atexit(3) handler. The interface name was calculated in the
ifclonecreate() by matching old & new names.

This change alter the implementation the following way:
1) the function responsible for the interface creation (ifcreate_ioctl)
 updates all necessary state internally. This removes the need for the
 name manipulation hack in wlan_create().
2) As atexit(3) handler does not accept any parameters, explicitly store
 the name to print in the ifname_to_print variable read by the atexit(3)
 handler.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40431
MFC after: 2 weeks

12 months agoifconfig: eliminate global 'verbose' and 'printkey' variables
Alexander V. Chernikov [Tue, 13 Jun 2023 06:15:13 +0000 (06:15 +0000)]
ifconfig: eliminate global 'verbose' and 'printkey' variables

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40427
MFC after: 2 weeks

12 months agoifconfig: add if_ctx argument to the generic and ifclone callbacks.
Alexander V. Chernikov [Tue, 13 Jun 2023 06:10:41 +0000 (06:10 +0000)]
ifconfig: add if_ctx argument to the generic and ifclone callbacks.

This is the continuation of the ifconfig cleanup work. This change is
a pre-requsite for the next changes removing some of the global variables.
It will also help in implementing functionality via Netlink instead of ioctl.
No functional changes intended.
* vxlan_cb() was removed as it contained no code
* ioctl_ifcreate() was renamed to ifcreate_ioctl() to follow the other
netlink/ioctl function naming. Netlink and ioctl provide _different_
interfaces and it's not possible to have a unified interface object
that can be filled by either netlink or ioctl implementations. With that
in mind, I'm leaning more to the function_<nl|ioctl> postfix pattern,
than doing ioctl_ or netlink_ prefix.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40426
MFC after: 2 weeks

12 months agoroute(8): teach route to attach to jails
Yan Ka, Chiu [Tue, 13 Jun 2023 06:05:17 +0000 (06:05 +0000)]
route(8): teach route to attach to jails

Add -j <jail> flag to route(8) to allow route to perform actions in
a Jail.

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

12 months agoktest: make ktest work with Netlink loaded as a module.
Alexander V. Chernikov [Thu, 1 Jun 2023 07:25:41 +0000 (07:25 +0000)]
ktest: make ktest work with Netlink loaded as a module.

MFC after: 2 weeks

12 months agoexpand_number: Tighten check of unit.
Xin LI [Tue, 13 Jun 2023 04:08:32 +0000 (21:08 -0700)]
expand_number: Tighten check of unit.

The current code silently ignores characters after the unit as long
the unit themselves were recognized. This commit makes expand_number(3)
to fail with EINVAL if buf did not terminate after the unit character.

Historically, the function accepts and ignores "B" as a SI unit, this
behavior is preserved and e.g. KB, MB are still accepted as aliases of
K and M, document this behavior in the manual page.

While I am there, also write a few test cases to validate the behavior.

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

12 months agonvme: Switch to nda by default
Warner Losh [Tue, 13 Jun 2023 03:37:10 +0000 (21:37 -0600)]
nvme: Switch to nda by default

We already run nda by default on all the !x86 architectures. Switch the
default to nda. nda created nvd compatibility links by default, so this
should be a nop. If this causes problems for your application, set
hw.nvme.use_nvd=1 in your loader.conf.

Sponsored by: Netflix

12 months agomac(9): update SEE ALSO
Mitchell Horne [Mon, 12 Jun 2023 18:59:00 +0000 (15:59 -0300)]
mac(9): update SEE ALSO

Rather than maintaining an incomplete list of MAC modules references,
just reference mac(4), where such a list can be found.

Reviewed by: Mina Galić <freebsd@igalic.co>
Reviewed by: Pau Amma <pauamma@gundo.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40485

12 months agomac(4): update the references to MAC modules
Mitchell Horne [Mon, 12 Jun 2023 18:56:34 +0000 (15:56 -0300)]
mac(4): update the references to MAC modules

Add entries for mac_ntpd(4) and mac_priority(4) to the table of MAC
modules.

Drop the entry for mac_none(4) from the list, but retain the
cross-reference in SEE ALSO. This module has no functional impact and is
of minimal interest to users. Add a new cross-reference to the similar
mac_stub(4), limited to SEE ALSO for the same reasoning.

Reviewed by: Pau Amma <pauamma@gundo.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40483

12 months agoamd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion
Alan Cox [Wed, 31 May 2023 23:10:41 +0000 (18:10 -0500)]
amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion

Stop requiring all of the PTEs to have the accessed bit set for superpage
promotion to occur.  Given that change, add support for promotion to
pmap_enter_quick(), which does not set the accessed bit in the PTE that
it creates.

Since the final mapping within a superpage-aligned and sized region of a
memory-mapped file is typically created by a call to pmap_enter_quick(),
we now achieve promotions in circumstances where they did not occur
before, for example, the X server's read-only mapping of libLLVM-15.so.

See also https://www.usenix.org/system/files/atc20-zhu-weixi_0.pdf

Reviewed by: kib, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40478

12 months agowg(4): add Matt Macy back to AUTHORS section
Ed Maste [Mon, 12 Jun 2023 17:54:56 +0000 (13:54 -0400)]
wg(4): add Matt Macy back to AUTHORS section

Matt did the initial in-kernel FreeBSD driver port.  The driver would
not exist without that work and some of it remains, even if the driver
was largely rewritten and reworked before being added back to the tree.

Authors remain in alphabetical order by surname.

Sponsored by: The FreeBSD Foundation

12 months agoqatfw: Don't build if WITH_SOURCELESS_UCODE is defined
Mark Johnston [Mon, 12 Jun 2023 17:47:51 +0000 (13:47 -0400)]
qatfw: Don't build if WITH_SOURCELESS_UCODE is defined

12 months agoqat: Add Intel® 4xxx Series VF driver support
Krzysztof Zdziarski [Mon, 12 Jun 2023 17:10:03 +0000 (13:10 -0400)]
qat: Add Intel® 4xxx Series VF driver support

Overview:
Intel(R) QuickAssist Technology (Intel(R) QAT) provides hardware
acceleration for offloading security, authentication and compression
services from the CPU, thus significantly increasing the performance and
efficiency of standard platform solutions.

This commit introduces:
- Intel® 4xxx Series VF driver support.
- Device configurability via sysctls.
- UIO support for Intel® 4xxx Series devices.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Karol Grzadziel <karolx.grzadziel@intel.com>

Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39850

12 months agoqat: Stop building on i386
Mark Johnston [Mon, 12 Jun 2023 17:41:59 +0000 (13:41 -0400)]
qat: Stop building on i386

The driver isn't tested on i386, so don't spend effort compiling it.

12 months agogeli tests: Add a regression test for PR 271766
Mark Johnston [Mon, 12 Jun 2023 16:11:20 +0000 (12:11 -0400)]
geli tests: Add a regression test for PR 271766

This test case catches both of the bugs reported there.

PR: 271766
Reviewed by: imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40469

12 months agocrypto: Advance the correct pointer in crypto_cursor_copydata()
Mark Johnston [Mon, 12 Jun 2023 16:09:54 +0000 (12:09 -0400)]
crypto: Advance the correct pointer in crypto_cursor_copydata()

PR: 271766
Reported by: Michael Laß <bevan@bi-co.net>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40468

12 months agoopencrypto: Handle end-of-cursor conditions in crypto_cursor_segment()
Mark Johnston [Mon, 12 Jun 2023 16:09:34 +0000 (12:09 -0400)]
opencrypto: Handle end-of-cursor conditions in crypto_cursor_segment()

Some consumers, e.g., swcr_encdec(), may call crypto_cursor_segment()
after having advanced the cursor to the end of the buffer.  In this case
I believe the right behaviour is to return NULL and a length of 0.

When this occurs with a CRYPTO_BUF_VMPAGE buffer, the cc_vmpage pointer
will point past the end of the page pointer array, so
crypto_cursor_segment() ends up dereferencing a random pointer before
the function returns a length of 0.  The uio-backed cursor has
a similar problem.

Address this by keeping track of the residual buffer length and
returning immediately once the length is zero.

PR: 271766
Reported by: Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40428

12 months agohwpstate_amd: calculate power if P-state info comes from MSR
Johannes Totz [Mon, 12 Jun 2023 16:00:15 +0000 (12:00 -0400)]
hwpstate_amd: calculate power if P-state info comes from MSR

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40140

12 months agocheckstyle9.pl: Add check for bad email
Warner Losh [Mon, 12 Jun 2023 16:06:50 +0000 (10:06 -0600)]
checkstyle9.pl: Add check for bad email

Add check for bad email. And remove check for qemu that doesn't matter.

Sponsored by: Netflix

12 months agoAdd comments for memory size
VexedUXR [Mon, 12 Jun 2023 14:57:02 +0000 (08:57 -0600)]
Add comments for memory size

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/753

12 months agouipc_syscalls: removed unnecessary check in accept1() function
Dmitriy Alexandrov [Mon, 12 Jun 2023 14:44:08 +0000 (08:44 -0600)]
uipc_syscalls: removed unnecessary check in accept1() function

Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/773

12 months agoAdd boot1.efi to CLEANFILES
VexedUXR [Mon, 12 Jun 2023 14:41:19 +0000 (08:41 -0600)]
Add boot1.efi to CLEANFILES

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/775

12 months agomount_nullfs(8): refer to nullfs(5)
Tom Hukins [Mon, 12 Jun 2023 14:35:32 +0000 (08:35 -0600)]
mount_nullfs(8): refer to nullfs(5)

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/772

12 months agofix qcom_cpu_kpssv2 compile on ASUS_AC1300
Mina Galić [Sun, 11 Jun 2023 21:12:59 +0000 (22:12 +0100)]
fix qcom_cpu_kpssv2 compile on ASUS_AC1300

Complete afdb42987ca8 by changing the return type from boolean_t to bool
for the definition for qcom_cpu_kpssv2_regulator_start.

PR: 271932
Fixes: afdb42987ca82869eeaecf6dc25c2b6fb7b8370e
Pull Request: https://github.com/freebsd/freebsd-src/pull/776

12 months agobhyve: register TPM device as ACPI device
Corvin Köhne [Mon, 15 May 2023 11:24:14 +0000 (13:24 +0200)]
bhyve: register TPM device as ACPI device

The TPM device is an ACPI device with some custom ACPI tables.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40453

12 months agobhyve: add basic TPM device
Corvin Köhne [Mon, 15 May 2023 11:00:06 +0000 (13:00 +0200)]
bhyve: add basic TPM device

Add an empty TPM device struct which will be used for TPM emulation in
subsequent commits.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40452

12 months agobhyve: allow adding FwCfg items to ACPI tables
Corvin Köhne [Fri, 22 Jul 2022 08:58:01 +0000 (10:58 +0200)]
bhyve: allow adding FwCfg items to ACPI tables

A TPM has an event log. Therefore, qemu adds a FwCfg item and adds it to
an ACPI table. We like to use the same OVMF driver as qemu, so we should
do the same. This commit adds the ability to basl to do it.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40451

12 months agobhyve: Remove vestigial support for setting max vCPUs.
John Baldwin [Mon, 12 Jun 2023 10:47:35 +0000 (12:47 +0200)]
bhyve: Remove vestigial support for setting max vCPUs.

The kernel part of the hypervisor is not going to support per-VM maxcpu
limits. The topology is only used to control the values returned by
CPUID leaves for which max vCPUs is not relevant.

Reviewed by: corvink, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D37176

12 months agoAdd more arm64 special register values
Andrew Turner [Fri, 9 Jun 2023 17:46:58 +0000 (18:46 +0100)]
Add more arm64 special register values

These will be used to simplify the kernel special register handling.

Sponsored by: Arm Ltd

12 months agowpa: Enable receiving priority tagged (VID 0) frames
R. Christian McDonald [Sun, 11 Jun 2023 23:22:53 +0000 (16:22 -0700)]
wpa: Enable receiving priority tagged (VID 0) frames

Certain internet service providers transmit vlan 0 priority tagged
EAPOL frames from the ONT towards the residential gateway. VID 0
should be ignored, and the frame processed according to the priority
set in the 802.1P bits and the encapsulated EtherType (i.e. EAPOL).

The pcap filter utilized by l2_packet is inadquate for this use case.

Here we modify the pcap filter to accept both unencapsulated and
encapsulated (with VLAN 0) EAPOL EtherTypes. This preserves the
original filter behavior while also matching on encapsulated EAPOL.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Reviewed by: cy
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40442

12 months agoRevert "linux(4): The futex_wait operation should restart."
Dmitry Chagin [Sun, 11 Jun 2023 09:47:27 +0000 (12:47 +0300)]
Revert "linux(4): The futex_wait operation should restart."

This reverts commit 5eec19c8eb0e1afafd7290325c61611c9a13b621 due to its
wrong. Linux interrupts futex syscall on signal and return EINTR.

12 months agoLinuxKPI: 802.11: correct HE_MAC_CAP3 values
Bjoern A. Zeeb [Sat, 10 Jun 2023 22:56:03 +0000 (22:56 +0000)]
LinuxKPI: 802.11: correct HE_MAC_CAP3 values

While we had assigned dummy values so far to HE, correct the HW_MAC_CAP3
values to avoid compile time errors of drivers when shifting values out
of range.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

12 months agoLinuxKPI: qcom: update QMI and MHI
Bjoern A. Zeeb [Sat, 10 Jun 2023 22:54:35 +0000 (22:54 +0000)]
LinuxKPI: qcom: update QMI and MHI

Minor updates to QMI and MHI (mostly making arguments const)
in order to facilitate porting the next generation athk driver.

MFC after: 10 days

12 months agoLinuxKPI: add dummy of.h
Bjoern A. Zeeb [Sat, 10 Jun 2023 22:52:04 +0000 (22:52 +0000)]
LinuxKPI: add dummy of.h

Given https://reviews.freebsd.org/D34318 was abandoned add an empty
of.h dummy header file to at least avoid #include errors and avoid
covering those #include with CONFIG_OF.

MFC after: 10 days

12 months agoLinuxKPI: 802.11: initialize txq
Bjoern A. Zeeb [Sat, 10 Jun 2023 22:18:38 +0000 (22:18 +0000)]
LinuxKPI: 802.11: initialize txq

In 5a9a0d7803382321b5f9fff1deae5fb08463cf1a we omitted the initialization
of the per-hw txq settings.  Fix this.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Fixes: 5a9a0d7803382321b5f9fff1deae5fb08463cf1a

12 months agoLinuxKPI: 802.11: improve scan handling
Bjoern A. Zeeb [Sat, 10 Jun 2023 21:53:56 +0000 (21:53 +0000)]
LinuxKPI: 802.11: improve scan handling

Under certain circumstances a hw_scan may be downgraded to a software
scan.  Handle these situations better and make sure we free resources
in all cases once. [1]

Also leave a note about scanning all bands (or we would have to switch
bands manually).

In both cases hardware doing and driver saying seem not entirely
consistent for all and all firmware.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reported by: imp [1]

12 months agozfs: merge openzfs/zfs@feff9dfed
Martin Matuska [Sat, 10 Jun 2023 17:31:17 +0000 (19:31 +0200)]
zfs: merge openzfs/zfs@feff9dfed

Notable upstream pull request merges:
  #14833 Update compatibility.d files
  #14841 ZIL: Reduce scope of per-dataset zl_issuer_lock
  #14863 zil: Add some more statistics
  #14866 btree: Implement faster binary search algorithm
  #14894 Fix inconsistent definition of zfs_scrub_error_blocks_per_txg
  #14892 Fix concurrent resilvers initiated at same time
  #14903 Fix NULL pointer dereference when doing concurrent 'send' operations
  #14910 ZIL: Allow to replay blocks of any size
  #14939 Fix the L2ARC write size calculating logic
  #14934 Introduce zfs_refcount_(add|remove)_few()
  #14946 Improve l2arc reporting in arc_summary
  #14953 Finally drop long disabled vdev cache
  #14954 Fix the L2ARC write size calculating logic (2)
  #14955 Use list_remove_head() where possible
  #14959 ZIL: Fix race introduced by f63811f0721

Obtained from: OpenZFS
OpenZFS commit: feff9dfed3df1bbae5dd74959a6ad87d11f27ffb

12 months agohier(7): typo (critial)
Graham Perrin [Sat, 10 Jun 2023 13:08:35 +0000 (14:08 +0100)]
hier(7): typo (critial)

https://bugs.freebsd.org/261349

PR:                      261349
Reported by:             Mike Karels <mike@karels.net>
Fixes: 6469f9c595c6 hier(7): improvement, modernisation
12 months agohier(7): improvement, modernisation
Graham Perrin [Sat, 10 Jun 2023 08:41:35 +0000 (09:41 +0100)]
hier(7): improvement, modernisation

Consistent use of lowercase, spacing between sections, etc.

Cease mentioning floppy disks.

De-list /usr/share/misc/fonts/, which has been ??? (without a
description) for twenty-seven years.

Change zpool to pool. (zpool is a command.)

Uppercase PPP for Point-to-Point Protocol.

A few other changes to wording, including avoidance of the phrase
pre-fab.

Update the descriptions of:

* /tmp/
* /usr/share/misc/
* /var/preserve/
* /var/tmp/
* /var/tmp/vi.recover/.

Refer to vi(1) instead of ex(1).

https://bugs.freebsd.org/261349

PR:                      261349
Reviewed by:             mhorne
Approved by:             mhorne
Pull request:            https://github.com/freebsd/freebsd-src/pull/763

12 months agoCorrect man page URI formatting.
David E. O'Brien [Sat, 10 Jun 2023 03:47:03 +0000 (20:47 -0700)]
Correct man page URI formatting.

Don't format URL's embedding a ',' where one doesn't exist; so that
one may copy-n-paste the displayed URL into a browser.

12 months agortld: fix typo in comment
Konstantin Belousov [Sat, 10 Jun 2023 01:35:14 +0000 (04:35 +0300)]
rtld: fix typo in comment

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

12 months agoCirrus-CI: add a manually triggered aarch64-gcc12 task
Ed Maste [Fri, 9 Jun 2023 15:19:42 +0000 (11:19 -0400)]
Cirrus-CI: add a manually triggered aarch64-gcc12 task

Sponsored by: The FreeBSD Foundation

12 months agoFix the L2ARC write size calculating logic (2)
George Amanakis [Sat, 10 Jun 2023 00:05:47 +0000 (02:05 +0200)]
Fix the L2ARC write size calculating logic (2)

While commit bcd5321 adjusts the write size based on the size of the log
block, this happens after comparing the unadjusted write size to the
evicted (target) size.

In this case l2ad_hand will exceed l2ad_evict and violate an assertion
at the end of l2arc_write_buffers().

Fix this by adding the max log block size to the allocated size of the
buffer to be committed before comparing the result to the target
size.

Also reset the l2arc_trim_ahead ZFS module variable when the adjusted
write size exceeds the size of the L2ARC device.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14936
Closes #14954

12 months agomvs: Eliminate unused variable.
Warner Losh [Fri, 9 Jun 2023 23:18:54 +0000 (17:18 -0600)]
mvs: Eliminate unused variable.

ccim is unused. Just remove it.

PR: 271920
Sponsored by: Netflix

12 months agoipf: Remove no-longer-needed NO_WARRAY_BOUNDS.
John Baldwin [Fri, 9 Jun 2023 22:35:32 +0000 (15:35 -0700)]
ipf: Remove no-longer-needed NO_WARRAY_BOUNDS.

12 months agoLinuxKPI: implement timer_{delete,shutdown}_sync()
Bjoern A. Zeeb [Tue, 16 May 2023 21:02:03 +0000 (21:02 +0000)]
LinuxKPI: implement timer_{delete,shutdown}_sync()

Implement timer_{delete,shutdown}_sync(), which do not seem to require
anything additional to the already existing del_timer_sync().

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D40124

12 months agonetstat: display c and C flags properly
Richard Scheffenegger [Fri, 9 Jun 2023 21:57:00 +0000 (23:57 +0200)]
netstat: display c and C flags properly

Restructure c and C flag checks for string length to
work properly. Quickly bypass for non TCP protos too.

Reviewed By: tuexen
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D40480

12 months agokern_ntptime: Fix undefined behavior of the shift operator
Dmitriy Alexandrov [Thu, 8 Jun 2023 09:08:46 +0000 (12:08 +0300)]
kern_ntptime: Fix undefined behavior of the shift operator

L_LINT macro is used with negative numbers [i.e.
L_LINT(time_freq, -MAXFREQ)], it could cause undefined
behavior. It should be similar to the L_RSHIFT(v, n) macro.

MFC after: 2 weeks
Reviewed by: cy
Pull Request: https://github.com/freebsd/freebsd-src/pull/769
Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com>
12 months agomsun: Correct FreeBSD version in sincos() man page
Brad Smith [Fri, 9 Jun 2023 20:01:35 +0000 (22:01 +0200)]
msun: Correct FreeBSD version in sincos() man page

The sincos() man page notes the function was added to msun in FreeBSD
9.0 which must have been an oversight in the review as it was commited
to 12.0 and then backported to the 11 branch.

So I have provided a diff to correct this to the first FreeBSD version
it did ship with which was 11.2.

Reviewed by: dim, imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D40308

12 months agoFinally drop long disabled vdev cache.
Alexander Motin [Fri, 9 Jun 2023 19:40:55 +0000 (15:40 -0400)]
Finally drop long disabled vdev cache.

It was a vdev level read cache, designed to aggregate many small
reads by speculatively issuing bigger reads instead and caching
the result.  But since it has almost no idea about what is going
on with exception of ZIO_FLAG_DONT_CACHE flag set by higher layers,
it was found to make more harm than good, for which reason it was
disabled for the past 12 years.  These days we have much better
instruments to enlarge the I/Os, such as speculative and prescient
prefetches, I/O scheduler, I/O aggregation etc.

Besides just the dead code removal this removes one extra mutex
lock/unlock per write inside vdev_cache_write(), not otherwise
disabled and trying to do some work.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14953

12 months agoZTS: Skip checkpoint_discard_busy
Brian Behlendorf [Fri, 9 Jun 2023 18:10:01 +0000 (11:10 -0700)]
ZTS: Skip checkpoint_discard_busy

Until the ASSERT which is occasionally hit while running
checkpoint_discard_busy is resolved skip this test case.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #12053
Closes #14952

12 months agoImprove l2arc reporting in arc_summary.
Alexander Motin [Fri, 9 Jun 2023 17:14:05 +0000 (13:14 -0400)]
Improve l2arc reporting in arc_summary.

- Do not report L2ARC as FAULTED in presence of in-flight writes.
- Report read and write I/Os, bytes and errors.
- Remove few numbers not important to average user.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #12304
Closes #14946

12 months agoUse list_remove_head() where possible.
Alexander Motin [Fri, 9 Jun 2023 17:12:52 +0000 (13:12 -0400)]
Use list_remove_head() where possible.

... instead of list_head() + list_remove().  On FreeBSD the list
functions are not inlined, so in addition to more compact code
this also saves another function call.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14955

12 months agoZIL: Fix race introduced by f63811f0721.
Alexander Motin [Fri, 9 Jun 2023 17:08:05 +0000 (13:08 -0400)]
ZIL: Fix race introduced by f63811f0721.

We are not allowed to access lwb after setting LWB_STATE_FLUSH_DONE
state and dropping zl_lock, since it may be freed by zil_sync().
To free itxs and waiters after dropping the lock we need to move
lwb_itxs and lwb_waiters lists elements to local storage.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14957
Closes #14959

12 months agoUpdate the Arm Optimized Routine library to v23.01
Andrew Turner [Fri, 9 Jun 2023 16:56:02 +0000 (17:56 +0100)]
Update the Arm Optimized Routine library to v23.01

Sponsored by:   Arm Ltd

12 months agoAdd more arm64 ID registers to the user_regs array
Andrew Turner [Fri, 9 Jun 2023 08:36:12 +0000 (09:36 +0100)]
Add more arm64 ID registers to the user_regs array

This is a mapping from ID register value to offset in struct cpu_desc.
These registers may be needed with future architecture revisions either
by userspace or by bhyve.

Sponsored by: Arm Ltd

12 months agoCirrus-CI: split main script into separate world + kernel
Ed Maste [Fri, 9 Jun 2023 13:53:08 +0000 (09:53 -0400)]
Cirrus-CI: split main script into separate world + kernel

It appears that Cirrus-CI has a 100MB limit for log output, and we
exceed that (!) with the amd64-gcc12 build.  Separate world and kernel
build tasks in an attempt to stay below the limit.

This also has the benefit of showing world and kernel build status
separately in the Cirrus-CI UI.

PR: 271903
Sponsored by: The FreeBSD Foundation

12 months agonlsysevent: remove useless CFLAGS
Baptiste Daroussin [Fri, 9 Jun 2023 15:04:10 +0000 (17:04 +0200)]
nlsysevent: remove useless CFLAGS

12 months agoveriexec: Do not save error from file info in fingerprint status
Stephen J. Kiernan [Fri, 9 Jun 2023 14:38:07 +0000 (10:38 -0400)]
veriexec: Do not save error from file info in fingerprint status

We do not want or need to propagate the error from fetching file info
when determining the file status. It could cause open(2) and similar
calls to fail when trying to access devices.

Obtained from: Juniper Networks, Inc.

12 months agotcp: Rack fixes and misc updates
Randall Stewart [Fri, 9 Jun 2023 14:27:08 +0000 (10:27 -0400)]
tcp: Rack fixes and misc updates

So over the past few weeks we have found several bugs and updated hybrid pacing to have
more data in the low-level logging. We have also moved more of the BBlogs to "verbose" mode
so that we don't generate a lot of the debug data unless you put verbose/debug on.
There were a couple of notable bugs, one being the incorrect passing of percentage
for reduction to timely and the other the incorrect use of 20% timely Beta instead of
80%. This also expands a simply idea to be able to pace a cwnd (fillcw) as an alternate
pacing mechanism combining that with timely reduction/increase.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D40391

12 months agoRegenerate sysent stuff after $FreeBSD$ removal
Warner Losh [Fri, 9 Jun 2023 13:28:27 +0000 (07:28 -0600)]
Regenerate sysent stuff after $FreeBSD$ removal

Sponsored by: Netflix

12 months agomakesyscall: Stop generating $FreeBSD$
Warner Losh [Fri, 9 Jun 2023 13:26:07 +0000 (07:26 -0600)]
makesyscall: Stop generating $FreeBSD$

With 14 coming, we no longer need to generate the $FreeBSD$. We can
likely MFC that to 13 as well.

MFC After: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39879

12 months agotcpdump: Do not hard code HAVE_LIBCRYPTO in config.h
Joseph Mingrone [Thu, 8 Jun 2023 22:51:32 +0000 (19:51 -0300)]
tcpdump: Do not hard code HAVE_LIBCRYPTO in config.h

Reviewed by: emaste
Fixes: ee67461e5682 (tpcdump: Update to 4.99.4)
Sponsored by: The FreeBSD Foundation

12 months agortld: fix allocate_module_tls() variant I fallback to static allocation
Konstantin Belousov [Fri, 9 Jun 2023 00:51:32 +0000 (03:51 +0300)]
rtld: fix allocate_module_tls() variant I fallback to static allocation

Submitted by: Joerg Sonnenberger
Fixes: 91880e07f605edb90339685bc934699a4344de3bESC
MFC after: 1 week

12 months agoe1000: Format em_txrx
Kevin Bowling [Fri, 9 Jun 2023 02:06:04 +0000 (19:06 -0700)]
e1000: Format em_txrx

No functional changes intended.

Reviewed by: markj (prior version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30072

12 months agoe1000: Add SPDX tag to em_txrx
Kevin Bowling [Fri, 9 Jun 2023 01:42:20 +0000 (18:42 -0700)]
e1000: Add SPDX tag to em_txrx

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30072

12 months agohexdump: Partial lines cannot be repetitions of earlier lines.
Xin LI [Fri, 9 Jun 2023 01:38:47 +0000 (18:38 -0700)]
hexdump: Partial lines cannot be repetitions of earlier lines.

When checking for repetitions of earlier lines, we compare the
first nread bytes of the line against the saved line. However,
when we read a partial line, it should never be treated as a
repetition of an earlier line, even if the first bytes match.

This change fixes a bug where a partial line could be
incorrectly identified as a repetition of an earlier line.

Reported-by: Mark Adler <madler@alumni.caltech.edu>
PR: 118723
Reviewed-by: emaste
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40471

12 months agolinux(4): Preserve fpu xsave state across signal delivery on amd64
Dmitry Chagin [Thu, 8 Jun 2023 22:33:26 +0000 (01:33 +0300)]
linux(4): Preserve fpu xsave state across signal delivery on amd64

PR: 270247
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40444
MFC after: 2 weeks

12 months agolinux(4): In preparation for xsave refactor fxsave code on amd64
Dmitry Chagin [Thu, 8 Jun 2023 22:32:46 +0000 (01:32 +0300)]
linux(4): In preparation for xsave refactor fxsave code on amd64

Due to fxsave area is os independent reimplement fxsave handmade code
using copying of a whole area.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40443
MFC after: 2 weeks

12 months agosh: make smark a static variable instead of a local in main()
Daniel Kolesa [Wed, 7 Jun 2023 15:06:00 +0000 (17:06 +0200)]
sh: make smark a static variable instead of a local in main()

We are modifying it after setjmp and then accessing it after the jump,
so it cannot be a local.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40415

12 months agolibvmmapi: Remove some unneeded includes
Mark Johnston [Thu, 8 Jun 2023 19:03:46 +0000 (15:03 -0400)]
libvmmapi: Remove some unneeded includes

These are amd64-specific and so can't be used when targetting arm64, but
they don't appear to be needed.

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

12 months agostand/boot1.efi: use the bootonce dataset as root dataset
Gleb Smirnoff [Thu, 8 Jun 2023 18:14:45 +0000 (11:14 -0700)]
stand/boot1.efi: use the bootonce dataset as root dataset

Before this change we would only pass the bootonce dataset name
to the environment for the next loader, while actually reading
the next stage loader from the 'bootfs' dataset, not the bootonce
dataset.

Another problem fixed by this change is a boot from a configuration
when bootonce attribute is present, but 'bootfs' property is not set.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40389

12 months agostand/loader.efi: read zfs bootonce attribute before checking currdev
Gleb Smirnoff [Thu, 8 Jun 2023 18:14:45 +0000 (11:14 -0700)]
stand/loader.efi: read zfs bootonce attribute before checking currdev

First check if bootonce is configured and if it is, then change currdev
accordingly and after that do the sanity check.  This fixes boot in a
situation when ZFS pool doesn't have the "bootfs" property, but has
bootonce attribute set.  A strange, but legitimate case.

Reviewed by: tsoome, imp
Differential Revision: https://reviews.freebsd.org/D40388

12 months agoetc: Don't create stray directories in NO_ROOT distrib-dirs
Jessica Clarke [Thu, 8 Jun 2023 16:00:50 +0000 (17:00 +0100)]
etc: Don't create stray directories in NO_ROOT distrib-dirs

The loop above is responsible for creating the actual directories,
whilst this one is just responsible for creating the corresponding
METALOG. Since DESTDIR already includes DISTBASE, this results in
creating a second set of roots (one per MTREES entry) within DISTBASE
whenever DISTBASE is non-empty, such as base/base, base/base/var,
base/base/usr, etc. in the distributeworld case. This is purely cosmetic
though as they won't appear in the METALOG.

12 months agoMakefile.inc1: Fix distributeworld mtree mangling for dist root dir
Jessica Clarke [Thu, 8 Jun 2023 17:35:23 +0000 (18:35 +0100)]
Makefile.inc1: Fix distributeworld mtree mangling for dist root dir

The trailing slash means that ./base itself doesn't get mangled and
remains as-is in the output, leading to a stray /base in base.txz for
NO_ROOT builds and thus in the installed system. Since this action is
running on a line whose file matches one listed by find (and we're
printing all of these as part of that distribution), we don't need to
care about the possibility of a path like ./basefoo/bar where the path
prefix isn't ./base, and can thus just drop the slash rather than
needing something more complicated like "slash or whitespace or EOL" as
one might first think.

12 months agoMakefile.inc1: Use INSTALL_DDIR for distributeworld's distrib-dirs
Jessica Clarke [Thu, 8 Jun 2023 16:47:04 +0000 (17:47 +0100)]
Makefile.inc1: Use INSTALL_DDIR for distributeworld's distrib-dirs

INSTALL_DDIR is the canonicalised version of DESTDIR/DISTDIR. Whilst
most of what distrib-dirs does doesn't need the canonicalised form, it
is responsible for installing the POSIX and en_US.US_ASCII NLS symlinks
to C, and therefore needs the canonicalised version for those two uses
of install for NO_ROOT builds, since our install does a naive text-based
prefix strip when creating the METALOG entry rather than a smarter path
semantics-aware one (which itself is really a bug, and has bitten us
many times). As a result, using plain DESTDIR/DISTDIR instead can result
in the METALOG having ./path/to/destdir/base/usr/share/nls/$LOCALE
rather than ./base/usr/share/nls/$LOCALE and then being filtered out
when creating base.meta (or, if you're unlucky and the absolute path
begins with base or tests, weird things will probably happen).

Given this footgun an audit of DESTDIR uses is probably in order,
especially those using DESTDIR/DISTDIR, but this is sufficient for now.

12 months agoLinuxKPI: add dummy rhashtable implementation
Bjoern A. Zeeb [Sat, 20 May 2023 00:45:47 +0000 (00:45 +0000)]
LinuxKPI: add dummy rhashtable implementation

Add a skeleton implementation of rhashtable in order to keep an
upcoming wireless driver compiling.  We'll implement it as soon as
we get there.

MFC after: 10 days
Reviewed by: emaste (previous version before his suggested changes)
Differential Revision: https://reviews.freebsd.org/D40176

12 months agoLinuxKPI: add devm_ioremap()
Bjoern A. Zeeb [Sat, 20 May 2023 00:53:21 +0000 (00:53 +0000)]
LinuxKPI: add devm_ioremap()

Given we do not seem to support ioremap() do not support the "devm"
version either and simply return NULL, which means we do not have
to keep track of the memory to be freed on device free later.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D40173

12 months agoLinuxKPI: pci: update struct msi_desc
Bjoern A. Zeeb [Sat, 20 May 2023 00:48:28 +0000 (00:48 +0000)]
LinuxKPI: pci: update struct msi_desc

It seems struct msi_desc is setup differently (or was changed) compared
to how we added it a while ago.  Catch up in order to keep drivers
directly accessing fields compiling.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40175

12 months agoLinuxKPI: pci: add PCI_COMMAND_MEMORY
Bjoern A. Zeeb [Tue, 23 May 2023 23:11:06 +0000 (23:11 +0000)]
LinuxKPI: pci: add PCI_COMMAND_MEMORY

Add another PCI alias to our native defines for a wireless driver.

MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40247

12 months agoLinuxKPI: add struct_group(...)
Bjoern A. Zeeb [Wed, 17 May 2023 22:22:13 +0000 (22:22 +0000)]
LinuxKPI: add struct_group(...)

Add a struct_group() macro needed by a wireless driver.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D40138

12 months agoLinuxKPI: add ktime_get_real_ts64()
Bjoern A. Zeeb [Tue, 23 May 2023 23:10:32 +0000 (23:10 +0000)]
LinuxKPI: add ktime_get_real_ts64()

Add a wrapper for ktime_get_real_ts64() used by a wireless driver.

MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40246

12 months agotpcdump: Update to 4.99.4
Joseph Mingrone [Thu, 8 Jun 2023 17:30:54 +0000 (14:30 -0300)]
tpcdump: Update to 4.99.4

Local changes:

- Update some local modifications to fix build
- Synch config.h with upstream as much as possible

Changelog:      https://git.tcpdump.org/tcpdump/blob/55bc126b0216cfe409b8d6bd378f65679d136ddf:/CHANGES
Reviewed by:    emaste
Obtained from:  https://www.tcpdump.org/release/tcpdump-4.99.4.tar.gz
Sponsored by:   The FreeBSD Foundation

12 months agokern: Move devctl_systems[] out of sys/sys/devctl.h
Ed Maste [Thu, 8 Jun 2023 13:58:26 +0000 (09:58 -0400)]
kern: Move devctl_systems[] out of sys/sys/devctl.h

The amd64-gcc12 build was failing with `error: 'devctl_systems' defined
but not used`.  Just move it to the C file where it's used.

PR: 271903
Sponsored by: The FreeBSD Foundation

12 months agoarm64: Malloc the cpu_desc array
Andrew Turner [Fri, 2 Jun 2023 16:12:24 +0000 (17:12 +0100)]
arm64: Malloc the cpu_desc array

We only need this during boot. Allocate the array before starting CPUs
to reduce the memory usage.

Reviewed by: Zach Leaf <zachary.leaf@arm.com>
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40433

12 months agoarm64: Reduce the direct use of cpu_desc
Andrew Turner [Thu, 1 Jun 2023 17:25:37 +0000 (18:25 +0100)]
arm64: Reduce the direct use of cpu_desc

To help moving to a dynamically allocated cpu_desc array reduce the
places we use it directly and create a pointer that is passed in to
functions that read it.

Reviewed by: Zach Leaf <zachary.leaf@arm.com>
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40392

12 months agocontrib/spleen: update to Spleen 2.0.0
Ed Maste [Thu, 8 Jun 2023 14:38:41 +0000 (10:38 -0400)]
contrib/spleen: update to Spleen 2.0.0

Merge commit '533de2d7a9875ff652be477a3f6c817d66a3d3d9'

Submitted by: Frederic Cambus
Differential Revision: https://reviews.freebsd.org/D40378

13 months agostress2: Avoid using "__unused"
Peter Holm [Thu, 8 Jun 2023 07:49:52 +0000 (09:49 +0200)]
stress2: Avoid using "__unused"

13 months agoEC2: Chase awscli package rename
Colin Percival [Thu, 8 Jun 2023 04:22:25 +0000 (21:22 -0700)]
EC2: Chase awscli package rename

MFC after: 1 week

13 months agondp: Prepare for pending tcpdump update
Joseph Mingrone [Wed, 7 Jun 2023 02:21:27 +0000 (23:21 -0300)]
ndp: Prepare for pending tcpdump update

ndp makes use of gmt2local, however that library has been removed from
tcpdump.  Add utc_offset() as a substitute.

Reviewed by: emaste, jhb, melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40445