freebsd.git
14 hours agoNote upgrade to sendmail 8.17.1 main github/main
Gregory Neil Shapiro [Wed, 1 Feb 2023 02:23:02 +0000 (02:23 +0000)]
Note upgrade to sendmail 8.17.1

14 hours agoNote upgrade to sendmail 8.17.1
Gregory Neil Shapiro [Wed, 1 Feb 2023 02:22:39 +0000 (02:22 +0000)]
Note upgrade to sendmail 8.17.1

17 hours agoLinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues()
Bjoern A. Zeeb [Tue, 31 Jan 2023 23:12:30 +0000 (23:12 +0000)]
LinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues()

Fix indentation in lkpi_wake_tx_queues().
No functional changes.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

17 hours agoLinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
Bjoern A. Zeeb [Tue, 31 Jan 2023 23:00:28 +0000 (23:00 +0000)]
LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT

Add code (currently disabled by #ifdef) for HT and VHT to
lkpi_scan_ies_add().  Switch to a local variable for ic given
the new code also needs the value.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

17 hours agolinuxkpi: list_sort()'s callback now takes list arguments
Jean-Sébastien Pédron [Wed, 11 Jan 2023 22:22:07 +0000 (23:22 +0100)]
linuxkpi: list_sort()'s callback now takes list arguments

This change breaks the API of `list_sort()`. `LINUXKPI_VERSION >= 51300`
is used to keep the header compatible with both versions of the
prototype.

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

18 hours agovtd: Increase DRHD_MAX_UNITS
Eric Joyner [Mon, 30 Jan 2023 21:34:03 +0000 (13:34 -0800)]
vtd: Increase DRHD_MAX_UNITS

Observed on a couple Ice Lake-SP platforms (Intel Coyote Pass, Dell
R750), there are more than 8 DRHD sections enumerated in the DMAR ACPI
section.  Since the previous limit was 8, this resulted in some of these
not being parsed by vtd when the iommu is initialized; in this case when
PCI devices are being passthru'd to a bhyve VM.

This omission later causes a kernel panic later in initialization when
devices could not be found in a valid DRHD scope because the DHRD
containing the device's scope was not added to vtd.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
PR: 268486
Sponsored by: Intel Corporation
Reviewed by: rew@, corvink@
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D38285

19 hours agoMechanically convert ffec(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 16:07:08 +0000 (12:07 -0400)]
Mechanically convert ffec(4) to IfAPI

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

19 hours agoMechanically convert mwl(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 19:15:03 +0000 (15:15 -0400)]
Mechanically convert mwl(4) to IfAPI

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

19 hours agoMechanically convert gem(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 19:55:31 +0000 (13:55 -0600)]
Mechanically convert gem(4) to IfAPI

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

19 hours agoMechanically convert ps3 if_glc(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 15:52:25 +0000 (09:52 -0600)]
Mechanically convert ps3 if_glc(4) to IfAPI

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

19 hours agoMechanically convert if_cas(4) to IfAPI
Justin Hibbits [Tue, 1 Mar 2022 15:54:11 +0000 (09:54 -0600)]
Mechanically convert if_cas(4) to IfAPI

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

19 hours agoMechanically convert mge(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 16:04:55 +0000 (12:04 -0400)]
Mechanically convert mge(4) to IfAPI

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

19 hours agoMechanically convert genet(4) to IfAPI
Justin Hibbits [Fri, 19 Aug 2022 16:03:42 +0000 (12:03 -0400)]
Mechanically convert genet(4) to IfAPI

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

19 hours agore(4): Fix whitespace from IfAPI conversion
Justin Hibbits [Tue, 31 Jan 2023 21:09:03 +0000 (16:09 -0500)]
re(4): Fix whitespace from IfAPI conversion

Fixes: 4519a073c326b
Sponsored by: Juniper Networks, Inc.

19 hours agoetherswitch: Clean up whitespace after IfAPI conversion
Justin Hibbits [Tue, 31 Jan 2023 20:54:56 +0000 (15:54 -0500)]
etherswitch: Clean up whitespace after IfAPI conversion

Sponsored by: Juniper Networks, Inc.
Fixes: 2e6a8c1ae

19 hours agoLast change for mgb(4) needed for IfAPI conversion
Justin Hibbits [Tue, 24 Jan 2023 20:58:00 +0000 (15:58 -0500)]
Last change for mgb(4) needed for IfAPI conversion

Sponsored by: Juniper Networks, Inc.

20 hours agoMechanically convert bge(4) to DrvAPI
Justin Hibbits [Fri, 19 Aug 2022 19:16:26 +0000 (15:16 -0400)]
Mechanically convert bge(4) to DrvAPI

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

20 hours agoIfAPI: Finish conversion of bnxt(4) to IfAPI.
Justin Hibbits [Mon, 23 Jan 2023 15:07:58 +0000 (10:07 -0500)]
IfAPI: Finish conversion of bnxt(4) to IfAPI.

Sponsored by: Juniper Networks, Inc.

20 hours agoMechanically convert if_re(4) to DrvAPI
Justin Hibbits [Fri, 25 Feb 2022 19:11:53 +0000 (13:11 -0600)]
Mechanically convert if_re(4) to DrvAPI

Reviewed By: kevlo
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37790

20 hours agoIfAPI: Add if_altq_is_enabled() interface.
Justin Hibbits [Wed, 25 Jan 2023 20:08:12 +0000 (15:08 -0500)]
IfAPI: Add if_altq_is_enabled() interface.

Summary:
The only user of the ALTQ_IS_ENABLED() in a driver checks against the
ifnet queue.  Abstract that all out and present the interface to check
if ALTQ is enabled on the interface.

Sponsored by: Juniper Networks, Inc.
Reviewed By: glebius
Differential Revision: https://reviews.freebsd.org/D38204

20 hours agoIfAPI: Add l2com accessor for firewire.
Justin Hibbits [Wed, 25 Jan 2023 19:45:53 +0000 (14:45 -0500)]
IfAPI: Add l2com accessor for firewire.

Summary:
Firewire is the only device driver that accesses the l2com member, all
other accesses are handled within the netstack itself.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38203

20 hours agoIfAPI: Add some more accessors
Justin Hibbits [Tue, 24 Jan 2023 21:12:08 +0000 (16:12 -0500)]
IfAPI: Add some more accessors

Summary:
* if_setreassignfn for wireguard.
* if_getinputfn() and if_getstartfn() for various drivers.  Use the
  function descriptor typedefs for these and the setters.
* vlantrunk accessor.  This is used by VLAN_CAPABILITIES() used by
  several drivers, as well as directly by mxge(4).
* if_pcp member accessor, used by cxgbe.
* accessors for netmap adapter.

Sponsored by: Juniper Networks, Inc.
Reviewed By: glebius
Differential Revision: https://reviews.freebsd.org/D38202

20 hours agoIfAPI: Use the ifnet APIs in kern_poll()
Justin Hibbits [Tue, 24 Jan 2023 21:27:24 +0000 (16:27 -0500)]
IfAPI: Use the ifnet APIs in kern_poll()

The only API used is if_name().

Sponsored by: Juniper Networks, Inc.

20 hours agoIfAPI: Add if_llsoftc member accessors for TOEDEV
Justin Hibbits [Mon, 23 Jan 2023 15:11:02 +0000 (10:11 -0500)]
IfAPI: Add if_llsoftc member accessors for TOEDEV

Summary:
Keep TOEDEV() macro for backwards compatibility, and add a SETTOEDEV()
macro to complement with the new accessors.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D38199

20 hours agoIfAPI: Explicitly include <net/if_private.h> in netstack
Justin Hibbits [Mon, 23 Jan 2023 15:05:29 +0000 (10:05 -0500)]
IfAPI: Explicitly include <net/if_private.h> in netstack

Summary:
In preparation of making if_t completely opaque outside of the netstack,
explicitly include the header.  <net/if_var.h> will stop including the
header in the future.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38200

20 hours agoIfAPI: Add if_get/setmaclabel() and use it.
Justin Hibbits [Mon, 23 Jan 2023 14:34:43 +0000 (09:34 -0500)]
IfAPI: Add if_get/setmaclabel() and use it.

Summary:
Port the MAC modules to use the IfAPI APIs as part of this.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D38197

20 hours agoIfAPI: Add if_gettype() API and use it for vlan
Justin Hibbits [Tue, 24 Jan 2023 21:17:55 +0000 (16:17 -0500)]
IfAPI: Add if_gettype() API and use it for vlan

Sponsored by: Juniper Networks, Inc.
Reviewed by: #network, glebius
Differential Revision: https://reviews.freebsd.org/D38198

20 hours agobpf: Add "_if" tap APIs
Justin Hibbits [Thu, 12 Jan 2023 20:17:33 +0000 (15:17 -0500)]
bpf: Add "_if" tap APIs

Summary:
Hide more netstack by making the BPF_TAP macros real functions in the
netstack.  "struct ifnet" is used in the header instead of "if_t" to
keep header pollution down.

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

20 hours agoifnet/API: Privatize the implementation of the drbr_* APIs
Justin Hibbits [Fri, 13 Jan 2023 16:40:31 +0000 (11:40 -0500)]
ifnet/API: Privatize the implementation of the drbr_* APIs

When ALTQ is enabled ifnet accessors already need to be called, largely
defeating the purpose of the inline.  To that extent, make the ALTQ form
functions in the netstack proper, and make them always available.

Reviewed By: glebius
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38104

20 hours agoIfAPI: Hide the in6m_lookup_locked() implementation.
Justin Hibbits [Wed, 25 Jan 2023 19:09:09 +0000 (14:09 -0500)]
IfAPI: Hide the in6m_lookup_locked() implementation.

Summary:
in6m_lookup_locked() iterates over the ifnet's multiaddrs list.  Keep
this implementation detail private, by moving the implementation to the
netstack source from the header.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38201

21 hours agoelftoolchain: update the list of riscv relocations
Mitchell Horne [Sat, 28 Jan 2023 18:19:26 +0000 (14:19 -0400)]
elftoolchain: update the list of riscv relocations

A few have been added, a couple removed.

Reviewed by: jrtc27, imp, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38175

22 hours agoelf_common.h: remove obsolete riscv relocations
Mitchell Horne [Sat, 28 Jan 2023 18:19:44 +0000 (14:19 -0400)]
elf_common.h: remove obsolete riscv relocations

These were specified at one time, but later removed.

Reviewed by: jrtc27, imp, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38174

23 hours agoRemove dme(4) from files
Justin Hibbits [Tue, 31 Jan 2023 16:43:48 +0000 (11:43 -0500)]
Remove dme(4) from files

Fixes: 69759b0c695da15a3379ca01335ab314897d8594

23 hours agoLinuxKPI: 802.11: fix ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028 (pspoll)
Bjoern A. Zeeb [Tue, 31 Jan 2023 16:40:13 +0000 (16:40 +0000)]
LinuxKPI: 802.11: fix ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028 (pspoll)

Add the lost "inline".

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC with: ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028

23 hours agoRemove dme(4).
Justin Hibbits [Tue, 31 Jan 2023 16:32:52 +0000 (11:32 -0500)]
Remove dme(4).

This was used only on an Ingenic MIPS SoC.

23 hours agoLinuxKPI: 802.11: implement ieee80211_is_pspoll()
Bjoern A. Zeeb [Tue, 31 Jan 2023 16:36:24 +0000 (16:36 +0000)]
LinuxKPI: 802.11: implement ieee80211_is_pspoll()

Implement ieee80211_is_pspoll() and move it up to the set of implemented
ieee80211_is_*() functions.

There are no further changes (git diff just looks weird).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

24 hours agoLinuxKPI: 802.11: basic implementation of *queue(s)/*txq*
Bjoern A. Zeeb [Tue, 31 Jan 2023 16:17:14 +0000 (16:17 +0000)]
LinuxKPI: 802.11: basic implementation of *queue(s)/*txq*

Very basic implementations of ieee80211_{wake,stop}_queue[s],
as well as ieee80211_txq_schedule_start(), ieee80211_next_txq(),
and ieee80211_schedule_txq().
Various combinations of these are used by different wireless
drivers, incl. iwlwifi.

Sponsored by: The FreeBSD Foundation (parts of this work)
MFC after: 3 days

24 hours agoLinuxKPI: 802.11: implement ieee80211_tx_status_ext()
Bjoern A. Zeeb [Tue, 31 Jan 2023 15:35:59 +0000 (15:35 +0000)]
LinuxKPI: 802.11: implement ieee80211_tx_status_ext()

Add an implementation of ieee80211_tx_status_ext() extending the
internal linuxkpi_ieee80211_tx_status() implementation.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

25 hours agoLinuxKPI: 802.11: extend linuxkpi_ieee80211_rx()
Bjoern A. Zeeb [Tue, 31 Jan 2023 15:05:30 +0000 (15:05 +0000)]
LinuxKPI: 802.11: extend linuxkpi_ieee80211_rx()

Extend linuxkpi_ieee80211_rx() by another argument for
the ieee80211_rx_list() implementation (even though the argument
is currently ignored).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

26 hours agonetlink: add NETLINK to GENERIC.
Alexander V. Chernikov [Tue, 31 Jan 2023 14:22:11 +0000 (14:22 +0000)]
netlink: add NETLINK to GENERIC.

This is a followup of 692e19cf5195 (add netlink to GENERIC@amd64).

Netlink is a communication protocol defined in RFC 3549. It is async,
TLV-based protocol, providing 1-1 and 1-many communications between kernel
and userland. Netlink is currently used in Linux kernel to modify, read and
subscribe for nearly all networking states. Interface state, addresses, routes,
firewall, rules, fibs, etc, are controlled via Netlink.

Netlink support was added in D36002. It has got a number of improvements and
first customers since then:
* net/bird2 got netlink support, enabling route multipath in FreeBSD
* netlink-based devd notifications are being worked on ( D37574 ).
* linux(4) fully supports and depends on Netlink

Enabling Netlink in GENERIC targets two goals.
The first one is to provide stability for the third-party userland applications,
so they can rely on the fact that netlink always exists since 14.0 and potentially 13.2.
Loadable module makes life of the app delepers harder. For example, `net/bird2` can be
either build with netlink or rtsock support, but not both.

The second goal is to enable gradual conversion of the base userland tools
to use netlink(4) interfaces. Converting tools like netstat (D36529), route,
ifconfig one-by-one simplifies testing and addressing the feedback.
Othewise, switching all base to use netlink at once may be too big of a leap.

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

26 hours agoLinuxKPI: 802.11: fix types and whitespace
Bjoern A. Zeeb [Tue, 31 Jan 2023 13:39:04 +0000 (13:39 +0000)]
LinuxKPI: 802.11: fix types and whitespace

Correct struct member types, fix whitespace, and remove superfluous
return statements in void functions.

No functional changes.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

40 hours agocmp: Increase buffer size for non-mmap case.
Dag-Erling Smørgrav [Tue, 31 Jan 2023 00:28:53 +0000 (01:28 +0100)]
cmp: Increase buffer size for non-mmap case.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D38281

40 hours agocmp: Print a summary on SIGINFO.
Dag-Erling Smørgrav [Tue, 31 Jan 2023 00:28:47 +0000 (01:28 +0100)]
cmp: Print a summary on SIGINFO.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38280

42 hours agolinuxkpi: Define `dev_is_platform()` and `to_platform_device()`
Jean-Sébastien Pédron [Sun, 22 Jan 2023 13:46:54 +0000 (14:46 +0100)]
linuxkpi: Define `dev_is_platform()` and `to_platform_device()`

The former returns false and the latter returns NULL.

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

42 hours agolinuxkpi: Try to solve headers dependencies
Jean-Sébastien Pédron [Fri, 20 Jan 2023 18:08:39 +0000 (19:08 +0100)]
linuxkpi: Try to solve headers dependencies

I'm sure I got it wrong but at least the DRM drivers compile.

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

42 hours agolinuxkpi: Add `io_mapping_map_local_wc()` and `io_mapping_unmap_local()`
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:53:49 +0000 (18:53 +0100)]
linuxkpi: Add `io_mapping_map_local_wc()` and `io_mapping_unmap_local()`

`io_mapping_map_local_wc()` is synonymous to `io_mapping_map_atomic_wc()`.

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

42 hours agolinuxkpi: Add `kmap_local_page_prot()` and `kunmap_local()`
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:52:39 +0000 (18:52 +0100)]
linuxkpi: Add `kmap_local_page_prot()` and `kunmap_local()`

They are synonymous to `kmap_atomic_prot()` and `kunmap_atomic()`
respectively.

While here, fix several style(9) issues.

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

42 hours agolinuxkpi: Add <linux/pgtable.h>
Jean-Sébastien Pédron [Fri, 20 Jan 2023 17:50:39 +0000 (18:50 +0100)]
linuxkpi: Add <linux/pgtable.h>

For now, it's empty. It is included by the DRM drivers but nothing is
missing otherwise. Perhaps something we already defined should be in
`pgtable.h` instead of another header.

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

42 hours agolinuxkpi: Add <linux/limits.h>
Jean-Sébastien Pédron [Thu, 19 Jan 2023 17:45:28 +0000 (18:45 +0100)]
linuxkpi: Add <linux/limits.h>

For now, it's empty. It is included by the DRM drivers but nothing is
missing otherwise. Perhaps something we already defined should be in
`limits.h` instead of another header.

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

42 hours agolinuxkpi: Define `might_alloc()`
Jean-Sébastien Pédron [Thu, 19 Jan 2023 00:15:35 +0000 (01:15 +0100)]
linuxkpi: Define `might_alloc()`

... as a no-op.

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

42 hours agolinuxkpi: Add `freeram` and `freehigh` to `struct sysinfo`
Jean-Sébastien Pédron [Mon, 2 Jan 2023 20:57:35 +0000 (21:57 +0100)]
linuxkpi: Add `freeram` and `freehigh` to `struct sysinfo`

The struct layout is modified with this commit because new fields are
added in the middle, keeping original Linux order.

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

43 hours agogh-bc: fix build with WITHOUT_NLS_CATALOGS=YES
Gleb Smirnoff [Mon, 30 Jan 2023 21:26:49 +0000 (13:26 -0800)]
gh-bc: fix build with WITHOUT_NLS_CATALOGS=YES

43 hours agoAdd missing check for xo_parse_args return code.
Phil Shafer [Mon, 30 Jan 2023 20:43:01 +0000 (15:43 -0500)]
Add missing check for xo_parse_args return code.

45 hours agoImport Juniper libxo-1.6.0
Phil Shafer [Mon, 30 Jan 2023 18:35:27 +0000 (13:35 -0500)]
Import Juniper libxo-1.6.0

PR: 262332

46 hours agoman(1): Support zstd compressed manpages using zstdcat
Cameron Katri [Mon, 30 Jan 2023 18:11:14 +0000 (13:11 -0500)]
man(1): Support zstd compressed manpages using zstdcat

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

46 hours agobridge: Fix whitespace
Mark Johnston [Tue, 24 Jan 2023 16:00:56 +0000 (11:00 -0500)]
bridge: Fix whitespace

No functional change intended.

MFC after: 1 week

46 hours agoClarify hardpps() parameter name and comment
Sebastian Huber [Wed, 25 Jan 2023 12:43:11 +0000 (13:43 +0100)]
Clarify hardpps() parameter name and comment

Since 32c203577a5e by phk in 1999 (Make even more of the PPSAPI
implementations generic), the "nsec" parameter of hardpps() is a time
difference and no longer a time point.  Change the name to "delta_nsec"
and adjust the comment.

Remove comment about a clock tick adjustment which is no longer in the code.

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

46 hours agokern_environment: Partially apply style(9)
Jose Luis Duran [Fri, 11 Mar 2022 00:53:02 +0000 (21:53 -0300)]
kern_environment: Partially apply style(9)

Sort include files, remove duplicates and remove trailing whitespce.

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

47 hours agozfs: Disable -Wunused-variable for environ in main in zfs_main.c.
John Baldwin [Mon, 30 Jan 2023 17:31:19 +0000 (09:31 -0800)]
zfs: Disable -Wunused-variable for environ in main in zfs_main.c.

There is an extern declaration of the global variable environ (which
has no portable header that defines it) that is unused on FreeBSD due
to zfs_setproctitle_init() being a stub.

Reviewed by: emaste
Reported by: GCC
Differential Revision: https://reviews.freebsd.org/D38231

2 days agocpuset: Handle CPU_WHICH_TIDPID wherever cpuset_which() is called.
Dmitry Chagin [Mon, 30 Jan 2023 16:28:54 +0000 (19:28 +0300)]
cpuset: Handle CPU_WHICH_TIDPID wherever cpuset_which() is called.

cpuset_which() resolves the argument pair which and id and returns references
to an appropriate resources. To avoid leaking resources or accessing unresolved
references to a resources handle new which CPU_WHICH_TIDPID wherever
cpuset_which() is called.
To avoid code duplication cpuset_which2() has been added.

Reported by: syzbot+331e8402e0f7347f0f2a@syzkaller.appspotmail.com
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D38272
MFC after: 2 weeks

2 days agoUPDATING: Add missing blank line between entries
Warner Losh [Mon, 30 Jan 2023 15:28:28 +0000 (08:28 -0700)]
UPDATING: Add missing blank line between entries

2 days agonetlink: add UPDATING entry on linux_common(4) reliance on netlink.
Alexander V. Chernikov [Mon, 30 Jan 2023 15:12:19 +0000 (15:12 +0000)]
netlink: add UPDATING entry on linux_common(4) reliance on netlink.

Reviewed by: dchagin

2 days agonetlink: add "netlink" to the list of kernel features
Alexander V. Chernikov [Mon, 30 Jan 2023 11:13:51 +0000 (11:13 +0000)]
netlink: add "netlink" to the list of kernel features

Reduce the amount of debug messages on module init/detach.

MFC after: 1 week

2 days agocarp: turn net.inet.carp.allow into a RW tunable
Boris Lytochkin [Sun, 29 Jan 2023 16:42:40 +0000 (16:42 +0000)]
carp: turn net.inet.carp.allow into a RW tunable

Currently CARP starts announcing its state when initialised, regardless
of the state of the other services provided by the server.
As a result, the device can become master while still loading the
firewall ruleset or initialising long-starting service.

This change adds the way to request delayed CARP start by setting the
  net.inet.carp.allow=0 in the loader.conf.

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

2 days agostress2: Added a syzkaller reproducer
Peter Holm [Mon, 30 Jan 2023 08:50:19 +0000 (09:50 +0100)]
stress2: Added a syzkaller reproducer

2 days agostress2: Avoid unrelated disk full messages from tests
Peter Holm [Mon, 30 Jan 2023 08:32:43 +0000 (09:32 +0100)]
stress2: Avoid unrelated disk full messages from tests

2 days agostress2: Added a test scenario for "out of inodes" issue with UFS+SU
Peter Holm [Mon, 30 Jan 2023 08:28:37 +0000 (09:28 +0100)]
stress2: Added a test scenario for "out of inodes" issue with UFS+SU

2 days agoMerge commit '7087c8de43b0d5d27c52da6ba2ba4957b7e336ff' into new_merge
Phil Shafer [Mon, 30 Jan 2023 05:04:21 +0000 (00:04 -0500)]
Merge commit '7087c8de43b0d5d27c52da6ba2ba4957b7e336ff' into new_merge

2 days agoetcupdate: Chase test case after pwd_mkdb(8) no longer copies comments.
Xin LI [Mon, 30 Jan 2023 04:40:58 +0000 (20:40 -0800)]
etcupdate: Chase test case after pwd_mkdb(8) no longer copies comments.

MFC after: 3 days

2 days agoVendor import of Juniper libxo at 1.6.0
Phil Shafer [Mon, 30 Jan 2023 04:10:53 +0000 (23:10 -0500)]
Vendor import of Juniper libxo at 1.6.0

2 days agoMakefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools
Jessica Clarke [Sun, 29 Jan 2023 23:51:30 +0000 (23:51 +0000)]
Makefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools

ITOOLS is only the list of programs to make a copy of during install, it
doesn't cause anything to be bootstrapped. Thus, by removing tzsetup
from _basic_bootstrap_tools, we end up without it on non-FreeBSD, and so
we error out trying to copy it to INSTALLTMP.

Note that _basic_bootstrap_tools is only used for BOOTSTRAP_ALL_TOOLS
(which is why zic was moved away from it). Should tzsetup evolve such
that the host version is insufficient on older FreeBSD it can be moved
to be more like zic, but that seems unnecessary for what is likely to
remain a simple tool.

This partially reverts commit 7a4a520064cb7fbff79560113682d6fe1a1ae9ee.

Fixes: 7a4a520064cb ("Fix cross-build from STABLE or older CURRENT.")

2 days agoMakefile.inc1: Print the right PATH for missing install tool error
Jessica Clarke [Sun, 29 Jan 2023 23:45:49 +0000 (23:45 +0000)]
Makefile.inc1: Print the right PATH for missing install tool error

We override PATH for which but then go and print the non-overridden
PATH, which leads to rather confusing messages.

Fixes: 5bb9250e0af4 ("Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD")

2 days agoRevert "tools/build: Unbreak bmake bootstrap on Linux"
Jessica Clarke [Sun, 29 Jan 2023 23:17:39 +0000 (23:17 +0000)]
Revert "tools/build: Unbreak bmake bootstrap on Linux"

Now that make.py no longer has the described hack on Linux we can drop
this ugly workaround.

This reverts commit fba998a3d897e6297baca74068e4ec1db7adaeec.

2 days agotools/build/make.py: Drop problematic Linux hack for bmake bootstrap
Jessica Clarke [Sun, 29 Jan 2023 23:07:25 +0000 (23:07 +0000)]
tools/build/make.py: Drop problematic Linux hack for bmake bootstrap

Since e2eeea75eb8b ("Merge bmake-20201117") missing/sys/cdefs.h has
been present in bmake, and _GNU_SOURCE seems to have been defined by
config.h for much longer than that, possibly for the entire time OS
cross-build support has been in-tree, so these are obsolete. Moreover,
since 79e02149fcb4 ("Fix dtrace tools bootstrap on non-FreeBSD after
OpenZFS import"), HAVE_STRLCAT and HAVE_STRLCPY have been defined by our
cross-build headers in order to placate DTrace tools (which is not the
right way to solve that problem, but motivates fixing this one). Commit
4fde40d9b540 ("Merge/update to bmake-20230126") changed the strlcpy.c in
bmake from including config.h directly to including make.h, which means
it includes string.h and thus sees these bogus definitions, causing it
to not define the strlcpy compat function on Linux even though it needs
to and thus failing to link. Thus, fix this whole mess by removing the
hack we no longer need.

2 days agosbin/ping6: Remove remains of ping6.
Xin LI [Sun, 29 Jan 2023 23:21:25 +0000 (15:21 -0800)]
sbin/ping6: Remove remains of ping6.

MFC after: 2 weeks

2 days agoFix for getmntpoint(3) when checking for NFS mount points.
Kirk McKusick [Sun, 29 Jan 2023 23:12:48 +0000 (15:12 -0800)]
Fix for getmntpoint(3) when checking for NFS mount points.

Only attempt to add /dev/ to f_mntfromname names that result in a
valid character device.

MFC after:    1 week
Reported by:  Bjoern A. Zeeb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907

2 days agorescue: Add fetch(1) to the rescue tool.
John Grafton [Sun, 29 Jan 2023 23:05:15 +0000 (15:05 -0800)]
rescue: Add fetch(1) to the rescue tool.

After a failed upgrade, having fetch(1) on a system that is
physically unnreachable would be very useful to download files
required to get the OS back up and functional.

On my system this adds 589,824 bytes (3.8%) to the binary size.

PR: 266224
Reported by: Dan Mahoney
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38193

2 days agousr.bin/stat: Fix error message formatting.
Jamie Landeg-Jones [Sun, 29 Jan 2023 22:37:25 +0000 (14:37 -0800)]
usr.bin/stat: Fix error message formatting.

PR: bin/261657
MFC after: 3 days

2 days agoOnly call SMCCC init on arm64
Andrew Turner [Sun, 29 Jan 2023 19:32:11 +0000 (19:32 +0000)]
Only call SMCCC init on arm64

We don't build the smccc code on arm so don't call into it there.

3 days agonetstat: export weight for single-path routes.
Alexander V. Chernikov [Sun, 29 Jan 2023 16:27:31 +0000 (16:27 +0000)]
netstat: export weight for single-path routes.

* Parse and export newly-added NL_RTA_WEIGHT attribute, providing path
 weight for a non-multipath route. This fixes a number of tests in
 sys/net/routing which rely on this data.
* Remove handling of NL_RTA_KNH_ID in multipath routes, as it is
 not provided.
* Improve kernel/user nexthop index export. As a result,
 for multipath routes:
  * nhg-kidx attribute represents kernel nhg index (always provided)
  * nhg-uidx attribute represents user-provided nhg index (if set)
 for non-multipath routes:
  * nhop-kidx attribute represents kernel nhop index (always provided)
  * nhop-udx attribute represents user-provided nexthop index (if set)

3 days agonetlink: allow path weight manipulations for single-path routes.
Alexander V. Chernikov [Sun, 29 Jan 2023 15:53:34 +0000 (15:53 +0000)]
netlink: allow path weight manipulations for single-path routes.

Add support for the scenario when user adds/deletes paths for a single
 prefix one-by-one, all with different weights.
This change adds a new FreeBSD-specific RTA attribute, NL_RTA_WEIGHT.
When dumping non-multipath routes, this attribute is added if the
 route weight is not RT_DEFAULT_WEIGHT.
When adding a new route, this attribute is parsed as a relative path
 weight.

MFC after: 2 weeks

3 days agoMake SMCCC usable by device drivers
Andrew Turner [Sat, 4 Jun 2022 11:13:51 +0000 (12:13 +0100)]
Make SMCCC usable by device drivers

To allow device drivers to call into SMCCC we need to initialise it
earlier. As it depends on PSCI, and that is detected via ACPI or FDT
move the call to smccc_init to the PSCI driver.

Add a function for drivers to read the smccc version, or 0 if smccc
is not present.

3 days agoDisable the arm physical timer when an irq exists
Andrew Turner [Sat, 28 Jan 2023 17:36:24 +0000 (17:36 +0000)]
Disable the arm physical timer when an irq exists

Some firmware leaves the timers enabled. Ensure they are disabled if
there are any physical timer interrupt resources to ensure we don't
receive any unexpected interrupts from them.

3 days agomp_x86: Trim trailing whitespaces.
Dmitry Chagin [Sun, 29 Jan 2023 13:18:39 +0000 (16:18 +0300)]
mp_x86: Trim trailing whitespaces.

MFC after: 1 week

3 days agosubr_smp: Trim trailing whitespaces.
Dmitry Chagin [Sun, 29 Jan 2023 13:18:17 +0000 (16:18 +0300)]
subr_smp: Trim trailing whitespaces.

MFC after: 1 week

3 days agocpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux.
Dmitry Chagin [Sun, 29 Jan 2023 13:17:33 +0000 (16:17 +0300)]
cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux.

Under Linux to sched_[g|s]etaffinity() functions the value returned from a call
to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0
will set the attribute for the calling thread, and passing the value returned
from a call to getpid(2) (process id) will set the attribute for the main thread
of the thread group.

Native cpuset(2) family of system calls has "which" argument to determine how
the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass
a thread id and CPU_WHICH_PID - to pass a process id.

For now native sched_[g|s]etaffinity() implementation is wrong as uses "which"
CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this
adding a new "which" CPU_WHICH_TIDPID intended to handle both id's.

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

3 days agolibthr: Trim trailing whitespaces in pthread_attr_affinity.
Dmitry Chagin [Sun, 29 Jan 2023 12:38:04 +0000 (15:38 +0300)]
libthr: Trim trailing whitespaces in pthread_attr_affinity.

MFC after: 1 week

3 days agolibthr: Fix pthread_attr_[g|s]etaffinity_np manual.
Dmitry Chagin [Sun, 29 Jan 2023 12:37:18 +0000 (15:37 +0300)]
libthr: Fix pthread_attr_[g|s]etaffinity_np manual.

Fix my fault in f35093f8.

MFC after: 1 week

3 days agolibthr: Fix pthread_[g|s]etaffinity_np manual.
Dmitry Chagin [Sun, 29 Jan 2023 12:36:25 +0000 (15:36 +0300)]
libthr: Fix pthread_[g|s]etaffinity_np manual.

Since f35093f8 semantics of a thread affinity functions is changed to be a
compatible with Linux:
In case of getaffinity(), the minimum cpuset_t size that the kernel permits is
the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not
limited.
In case of setaffinity(), the kernel does not limit the size of the user-provided
cpuset_t, internally using only the meaningful part of the set, where the upper
bound is the maximum CPU id, present in the system, no larger than the size of
the kernel cpuset_t.

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

3 days agolibthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel.
Dmitry Chagin [Sun, 29 Jan 2023 12:35:18 +0000 (15:35 +0300)]
libthr: Fix pthread_attr_[g|s]etaffinity_np to match it's manual and the kernel.

Since f35093f8 semantics of a thread affinity functions is changed to be a
compatible with Linux:

In case of getaffinity(), the minimum cpuset_t size that the kernel permits is
the maximum CPU id, present in the system, / NBBY bytes, the maximum size is not
limited.
In case of setaffinity(), the kernel does not limit the size of the user-provided
cpuset_t, internally using only the meaningful part of the set, where the upper
bound is the maximum CPU id, present in the system, no larger than the size of
the kernel cpuset_t.

To match pthread_attr_[g|s]etaffinity_np checks of the user-provided cpusets to
the kernel behavior export the minimum cpuset_t size allowed by running kernel
via new sysctl kern.sched.cpusetsizemin and use it in checks.

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

3 days agosched.h: Fix _S macros for better compatibility with glibc.
Dmitry Chagin [Sun, 29 Jan 2023 12:34:10 +0000 (15:34 +0300)]
sched.h: Fix _S macros for better compatibility with glibc.

In e2650af157 was added "_S" macros for compatibility with glibc, but it's still
incompatible as under glibc the macros whose names end with "_S" operate on the
dynamically allocated CPU set(s) whose size is in bytes, not in bits.

While here remove limiting ifdef to non-kernel case.

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

3 days agosmp: Drop confusing braces and return statement as panic() is never returns.
Dmitry Chagin [Sun, 29 Jan 2023 12:33:16 +0000 (15:33 +0300)]
smp: Drop confusing braces and return statement as panic() is never returns.

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

3 days agoAdd extended attributes
Fedor Uporov [Mon, 5 Dec 2022 17:04:42 +0000 (20:04 +0300)]
Add extended attributes

The extattrs follows semantic of ufs, mean it cannot
be set to char/block devices and fifos. The attributes
are allocated using regular malloc with M_WAITOK
allocation with the own malloc tag M_TMPFSEA. The memory
consumed by extended attributes is limited to avoid OOM
triggereing by tmpfs_mount variable tm_ea_memory_max,
which is set initialy to 16 MB. The extended attributes
entries are stored as linked list in the tmpfs node.
The mount point lock is required only under setextattr
and deleteextattr to update extended attributes
memory-inuse counter, all other operations are doing
under vnode lock.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38052

3 days agoFix pjfstest issue tests/rename/23.t
Fedor Uporov [Thu, 26 Jan 2023 10:23:22 +0000 (13:23 +0300)]
Fix pjfstest issue tests/rename/23.t

This test creates two files like file0 and file1,
then creates link to file1 and checks ctime on it.
Then renames file0 to file1. Then checks ctime on
link again. It is expected, that second ctime will
be higher then first ctime, because rename happen.
Add ctime updating for directory entry,
which will be deleted on rename.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38051

3 days agoFix pjfstest issue tests/rename/19.t
Fedor Uporov [Thu, 26 Jan 2023 10:17:48 +0000 (13:17 +0300)]
Fix pjfstest issue tests/rename/19.t

The rename call with args like:
"./dir0/dir1/.." "./dir2" will cause MPASS failure.
The tmpfs_dir_lookup() does not accept names like
'.' and '..' for lookup. Move the '.' and '..' entry
check before tmpfs_dir_lookup() call.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38051

3 days agoFix block bitmap end position computation
Fedor Uporov [Thu, 26 Jan 2023 10:06:25 +0000 (13:06 +0300)]
Fix block bitmap end position computation

PR:                     261850
Reported by:            chenguang.wang
MFC after:              2 weeks

3 days agoFix developer second name.
Fedor Uporov [Thu, 26 Jan 2023 09:57:00 +0000 (12:57 +0300)]
Fix developer second name.

3 days agousr.bin/gh-bc: update Makefiles for version 6.2.2
Stefan Eßer [Sat, 28 Jan 2023 22:48:34 +0000 (23:48 +0100)]
usr.bin/gh-bc: update Makefiles for version 6.2.2

The sources of this program are in contrib/bc, but built using the
Makefiles touched in this commit, which had to be adapted to comply
with changed made to the build system of this software, which is
not used when building in the base system.

3 days agocontrib/bc: merge from vendor release 6.2.2
Stefan Eßer [Sat, 28 Jan 2023 21:26:22 +0000 (22:26 +0100)]
contrib/bc: merge from vendor release 6.2.2

This update fixes a few issues in history editing and the processing
of the "quit" function. The "quit" function will no longer cause bc
to exit when encountered in a script file (before any command from
the script has been executed).

New functions is_number(), is_string return 1 if the passed argument
is a number resp. a string. The asciify() function has been extended
to support the conversion of an array of numbers into a string.

Merge commit '1a63323d17fedb05b6962853e821c9d7c6b9853e'

3 days agovendor/bc: import version 6.2.2
Stefan Eßer [Sat, 28 Jan 2023 20:08:43 +0000 (21:08 +0100)]
vendor/bc: import version 6.2.2

This is a production release that fixes a bug.

The bug was that if an array element was used as a parameter, and then
a later parameter had the same name as the array whose element was
used, bc would grab the element from the new array parameter, not the
actual element from before the function call.