]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agopkgbase: Put certctl in the FreeBSD-caroot package
Emmanuel Vadot [Wed, 15 Dec 2021 10:38:18 +0000 (11:38 +0100)]
pkgbase: Put certctl in the FreeBSD-caroot package

There is no reason that this shouldn't be there.
Change the dependency of caroot from utilities to openssl as it's
the only command that it uses not in runtime.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33458

(cherry picked from commit 380073af3aa3048e3e19abe57e64bff4481d829f)

2 years agopkgbase: Create a FreeBSD-newsyslog package
Emmanuel Vadot [Wed, 15 Dec 2021 09:46:00 +0000 (10:46 +0100)]
pkgbase: Create a FreeBSD-newsyslog package

This allow one to install it without having to install FreeBSD-utilities.
While here put some newsyslog.d file in their own package.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33456

(cherry picked from commit 26ea904caae7e6be8394eb8ca94f282d99f63c8c)

2 years agopkgbase: Create a FreeBSD-syslogd package
Emmanuel Vadot [Wed, 15 Dec 2021 09:34:00 +0000 (10:34 +0100)]
pkgbase: Create a FreeBSD-syslogd package

This allow one to not install syslogd and use syslog-ng or any other
syslog daemon.
While here put some syslog.d file in their own package.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33455

(cherry picked from commit 25367c806be5b321b6c7b2fd6bee264b99f240da)

2 years agopkgbase: Create a FreeBSD-periodic package
Emmanuel Vadot [Wed, 15 Dec 2021 09:08:20 +0000 (10:08 +0100)]
pkgbase: Create a FreeBSD-periodic package

While here put the periodic files for some utilities in their own
packages.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33454

(cherry picked from commit b3d14eaccc5f606690d99b1998bfdf32a22404f6)

2 years agopkgbase: Create a FreeBSD-ftpd package
Emmanuel Vadot [Wed, 15 Dec 2021 08:53:54 +0000 (09:53 +0100)]
pkgbase: Create a FreeBSD-ftpd package

And put ftpd into it.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33453

(cherry picked from commit 20cd6e315e05a76ee0b745a029ebfd4a79d98e55)

2 years agopkgbase: Create a FreeBSD-mtree package
Emmanuel Vadot [Tue, 14 Dec 2021 16:19:30 +0000 (17:19 +0100)]
pkgbase: Create a FreeBSD-mtree package

And put the mtree binary and files in it.
Useful to create small mfsroot using /etc/rc.d/var without
having to install FreeBSD-utilities.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33442

(cherry picked from commit dcf9d46a3fb8176651abd64afe17ad323fc318ea)

2 years agopkgbase: Create a FreeBSD-tcpd package
Emmanuel Vadot [Tue, 14 Dec 2021 15:42:46 +0000 (16:42 +0100)]
pkgbase: Create a FreeBSD-tcpd package

And put the tcp-wrapper utilities in it.

Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33439

(cherry picked from commit 078b764da3a12c354b331764c6b86886f2464960)

2 years agopkgbase: Remove vital flags for FreeBSD-utilities
Emmanuel Vadot [Wed, 29 Sep 2021 16:07:06 +0000 (18:07 +0200)]
pkgbase: Remove vital flags for FreeBSD-utilities

Per the pkg-descr: "Non-vital programs and librairies"

Reviewed by: emaste
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33436

(cherry picked from commit 3ea43eff0554aad3f1c973d9078549e625168908)

2 years agopkgbase: Put more binaries/lib in runtime
Emmanuel Vadot [Tue, 14 Dec 2021 14:31:30 +0000 (15:31 +0100)]
pkgbase: Put more binaries/lib in runtime

Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33435

(cherry picked from commit 93c43690960274dd3bb67b1ee0f1dd3ca4d13def)

2 years agopkgbase: Put autofs config files in the FreeBSD-autofs package
Emmanuel Vadot [Wed, 29 Sep 2021 06:42:09 +0000 (08:42 +0200)]
pkgbase: Put autofs config files in the FreeBSD-autofs package

Reviewed by: emaste
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33434

(cherry picked from commit eb14f050a39f7f71110535ad260fb8df5eef068c)

2 years agopkgbase: Put yellow pages programs to its own package
Emmanuel Vadot [Tue, 28 Sep 2021 09:49:50 +0000 (11:49 +0200)]
pkgbase: Put yellow pages programs to its own package

YP is less and less used, split them to users have the choice to not
install them.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33441

(cherry picked from commit 5abb10faa1ff471b45ac4f49ace2b79cc57d7c3c)

2 years agopkgbase: Put sconfig in FreeBSD-utilities
Emmanuel Vadot [Tue, 21 Dec 2021 09:16:08 +0000 (10:16 +0100)]
pkgbase: Put sconfig in FreeBSD-utilities

There is no need to have it in runtime as it's not essential.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 0855e37c72c7904600967ff4268ef69505eb4f4e)

2 years agopkgbase: Move back mlxcontrol in the default package
Emmanuel Vadot [Thu, 9 Sep 2021 06:14:53 +0000 (08:14 +0200)]
pkgbase: Move back mlxcontrol in the default package

mlxcontrol(8) is a tool for mlx(4) raid card and isn't related to
Mellanox card.

Reported by: jhb

(cherry picked from commit 06cce53d5623c1106a54caee28791ed3994df23f)

2 years agopkgbase: Create a FreeBSD-ftp package
Emmanuel Vadot [Thu, 2 Sep 2021 15:14:20 +0000 (17:14 +0200)]
pkgbase: Create a FreeBSD-ftp package

ftp tools aren't that useful nowadays but some might want them.
Create a FreeBSD-ftp package so users have a choice to have
them or not.

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

(cherry picked from commit b5be5c35dbaf38caaa9c70a83025f3535abbfd4f)

2 years agopkgbase: Create a FreeBSD-hyperv package
Emmanuel Vadot [Thu, 2 Sep 2021 15:13:45 +0000 (17:13 +0200)]
pkgbase: Create a FreeBSD-hyperv package

Put all hyperv utilities in it.

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

(cherry picked from commit db953e8b97756df2d6907408388952bcc301c762)

2 years agopkgbase: Remove libefivar package and add a efi-tools one
Emmanuel Vadot [Thu, 2 Sep 2021 15:12:51 +0000 (17:12 +0200)]
pkgbase: Remove libefivar package and add a efi-tools one

Put all the efi related tools into FreeBSD-efi-tools.

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

(cherry picked from commit d8d41d3b842980e7b76c8f3081ed8b571af97e0c)

2 years agopkgbase: Create a FreeBSD-kerberos package
Emmanuel Vadot [Thu, 2 Sep 2021 04:09:15 +0000 (06:09 +0200)]
pkgbase: Create a FreeBSD-kerberos package

This allows users to install or not kerberos related utilities
and libs.

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

(cherry picked from commit a30235a4c360c06bb57be1f10ae6866a71fb5622)

2 years agopkgbase: Put libbsdxml in FreeBSD-runtime
Emmanuel Vadot [Wed, 1 Sep 2021 18:25:50 +0000 (20:25 +0200)]
pkgbase: Put libbsdxml in FreeBSD-runtime

libbsdxml is used by a lot of programs so just put it in FreeBSD-runtime.

Differential Revision: https://reviews.freebsd.org/D31800
Reviewed by: emaste

(cherry picked from commit 30975efbaff0a021545e81bd9fa09d848edfaafa)

2 years agopkgbase: Create a FreeBSD-rdma package
Emmanuel Vadot [Wed, 1 Sep 2021 18:23:56 +0000 (20:23 +0200)]
pkgbase: Create a FreeBSD-rdma package

Put all the rdma related tools into this package.

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

(cherry picked from commit cab6a39d7b343596a5823e65c0f7b426551ec22d)

2 years agopkgbase: Create a syscons-data package
Emmanuel Vadot [Wed, 1 Sep 2021 17:58:27 +0000 (19:58 +0200)]
pkgbase: Create a syscons-data package

syscons is mostly deprecated and all it's files aren't needed for most
users so create a separate package for them.

Differential Revision:    https://reviews.freebsd.org/D31798
Reviewed by: emaste

(cherry picked from commit 27a7ae0ce00fbd6ab6e76e6dd3c51eadefff6f12)

2 years agopkgbase: Create a vt-data package
Emmanuel Vadot [Wed, 1 Sep 2021 17:56:55 +0000 (19:56 +0200)]
pkgbase: Create a vt-data package

vt files for either keyboards and fonts are totally optional
so create a separate package for them.

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

(cherry picked from commit 88ba5e8955518c1e032eafbce27d548eaf5a59ea)

2 years agopkgbase: Create a FreeBSD-dwatch package
Emmanuel Vadot [Wed, 1 Sep 2021 17:38:40 +0000 (19:38 +0200)]
pkgbase: Create a FreeBSD-dwatch package

While dwatch is useful some users might not want it by default.
Create a package for it.

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

(cherry picked from commit a3266ba2697a383d2ede56803320d941866c7e76)

2 years agopkgbase: Create a mlx-tools package
Emmanuel Vadot [Wed, 1 Sep 2021 17:12:09 +0000 (19:12 +0200)]
pkgbase: Create a mlx-tools package

mlx* are only useful for users who have a Mellanox card.
Create a package for it so users that don't have this card can
avoid having this program.

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

(cherry picked from commit 80645e1ce5574ce4d63f0a1cad287949440384da)

2 years agopkgbase: Create a cxgbe-tools package
Emmanuel Vadot [Wed, 1 Sep 2021 17:08:49 +0000 (19:08 +0200)]
pkgbase: Create a cxgbe-tools package

cxgbetool is only useful for users who have a Chelsio card.
Create a package for it so users that don't have this card can
avoid having this program.

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

(cherry picked from commit b8876cac2d230098b902e7f927ef170312a06c03)

2 years agopkgbase: Move spppcontrol to FreeBSD-ppp
Emmanuel Vadot [Wed, 1 Sep 2021 17:03:38 +0000 (19:03 +0200)]
pkgbase: Move spppcontrol to FreeBSD-ppp

This program belong with the other ppp-related programs.

Differential Revision:  https://reviews.freebsd.org/D31792
Reviewed by: emaste

(cherry picked from commit 0818f499bc28835c7db6df80d9aa5cc3dc99b2d9)

2 years agopkgbase: Create a FreeBSD-telnet package
Emmanuel Vadot [Wed, 1 Sep 2021 17:02:00 +0000 (19:02 +0200)]
pkgbase: Create a FreeBSD-telnet package

both telnet and telnetd aren't that useful nowadays but some
might want them.
Create a FreeBSD-telnet package so users have a choice to have
them or not.

Differential Revision: https://reviews.freebsd.org/D31791
Reviewed by: emaste

(cherry picked from commit c7fd29f0f29ae3eb9d86cc019f6c1bab35634548)

2 years agopkgbase: Remove FreeBSD-libregex package
Emmanuel Vadot [Thu, 2 Sep 2021 06:14:56 +0000 (08:14 +0200)]
pkgbase: Remove FreeBSD-libregex package

The only user of libregex is grep (and its variation), no need for a
dedicated package.
This moves libregex to the default package (FreeBSD-utilities).

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

(cherry picked from commit dfa9131d709121b2e502a82ff66cf3e376654942)

2 years agopkgbase: Create a FreeBSD-ggate package
Emmanuel Vadot [Wed, 1 Sep 2021 15:16:07 +0000 (17:16 +0200)]
pkgbase: Create a FreeBSD-ggate package

Move ggate* to it.

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

(cherry picked from commit d22072a7d5e671ca0883b93165e374d5f396e0f9)

2 years agopkgbase: Remove package name mangling in generate-ucl.sh
Mark Johnston [Mon, 26 Apr 2021 19:15:31 +0000 (15:15 -0400)]
pkgbase: Remove package name mangling in generate-ucl.sh

The mangling was present in the initial revision of the script, but its
purpose is not clear.  It may have been to avoid defining make(1)
variables with a dash in the name, but this is permitted.  Furthermore,
it results in invalid dependency information if a dependency's name
contains an underscore, causing e.g., libcompiler_rt-dev to depend on
libcompiler-rt, and resulting in warnings when installing base system
packages.  Remove the mangling.

Reviewed by: manu
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29883

(cherry picked from commit 09d83a060f37ba17b29c0e90f3a0e9aa9c735592)

2 years agolibrtld_db: Handle shlibs with discontiguous mappings.
Chuck Silvers [Fri, 3 Dec 2021 19:03:32 +0000 (11:03 -0800)]
librtld_db: Handle shlibs with discontiguous mappings.

Some shared libraries specify mappings that leave a gap (actually a
MAP_GUARD mapping) in between the file mappings (libcrypto.so was
the one I found), and this would cause rd_loadobj_iter() to report
the mapping info incorrectly, leaving out rdl_path and misreporting
rdl_offset for file mappings after the gap.  Fix rd_loadobj_iter()
to handle this situation.

Reviewed by: markj
Sponsored by: Netflix

(cherry picked from commit dfd00261c95a9839ba528f7e052d9bcac19f2b14)

2 years agotcp_bbr(4): Fix a few typos in sysctl descriptions
Gordon Bergling [Sun, 2 Jan 2022 17:03:10 +0000 (18:03 +0100)]
tcp_bbr(4): Fix a few typos in sysctl descriptions

- s/measurment/measurement/

(cherry picked from commit 1b90dfa5d2b01549b51d9829206acac39a432bbb)

2 years agoreadelf: add Go Build ID ELF note support
Ed Maste [Fri, 10 Dec 2021 20:11:45 +0000 (15:11 -0500)]
readelf: add Go Build ID ELF note support

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

(cherry picked from commit ca457394fccfc7d712cd9cc6a66e574767a0a32b)

2 years agoar: deprecate -T option
Ed Maste [Wed, 29 Dec 2021 19:59:06 +0000 (14:59 -0500)]
ar: deprecate -T option

Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR: 260523 [exp-run]
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit edadbb46065d9ee9559140b2522197fcdba57064)

2 years agoCheck cpu_softc is not NULL before dereferencing
Andrew Turner [Mon, 27 Sep 2021 11:22:15 +0000 (12:22 +0100)]
Check cpu_softc is not NULL before dereferencing

In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g.
on arm64 when booting from FDT. Check it is not NULL at the start of
the function so we don't try to dereference a NULL pointer.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4e50efb1944bffe6ae648c8c81bd0814c18474b9)

2 years agoamdtemp: Revert related part of "Make CPU children" commit.
Alexander Motin [Wed, 1 Dec 2021 18:00:17 +0000 (13:00 -0500)]
amdtemp: Revert related part of "Make CPU children" commit.

While it still looks like previous code worked by coincidence, this
change broke things even more instead of fixing.

Reported by: avg@
MFC after: 1 week

(cherry picked from commit 94a72c5ac4285b2940e5d2c7e53d21c84023defc)

2 years agoacpi_cpu: Fix panic if some CPU devices are disabled.
Alexander Motin [Sat, 25 Sep 2021 20:54:28 +0000 (16:54 -0400)]
acpi_cpu: Fix panic if some CPU devices are disabled.

While there, remove couple unneeded global variables.

(cherry picked from commit 695323ae88c71776e131940ed7dedd25365e932f)

2 years agoMake CPU children explicitly share parent unit numbers.
Alexander Motin [Sat, 25 Sep 2021 03:25:46 +0000 (23:25 -0400)]
Make CPU children explicitly share parent unit numbers.

Before this device unit number match was coincidental and broke if I
disabled some CPU device(s).  Aside of cosmetics, for some drivers
(may be considered broken) it caused talking to wrong CPUs.

(cherry picked from commit d3a8f98acbf51e728411f10c5f179a30b9ca683c)

2 years agoacpi_cpu: Make device unit numbers match OS CPU IDs.
Alexander Motin [Sat, 25 Sep 2021 01:03:02 +0000 (21:03 -0400)]
acpi_cpu: Make device unit numbers match OS CPU IDs.

There are already APIC ID, ACPI ID and OS ID for each CPU.  In perfect
world all of those may match, but at least for SuperMicro server boards
none of them do.  Plus none of them match the CPU devices listing order
by ACPI.  Previous code used the ACPI device listing order to number
cpuX devices.  It looked nice from NewBus perspective, but introduced
4th different set of IDs. Extremely confusing one, since in some places
the device unit numbers were treated as OS CPU IDs (coretemp), but not
in others (sysctl dev.cpu.X.%location).

(cherry picked from commit c8077ccd70cfcbcccb752e89b848f098abcb9309)

2 years agobus: Cleanup device_probe_child()
Alexander Motin [Sat, 25 Sep 2021 00:27:10 +0000 (20:27 -0400)]
bus: Cleanup device_probe_child()

When device driver probe method returns 0, i.e. absolute priority, do
not remove its class from the device just to set it back few lines
later, that may change the device unit number, etc. and after which
we'd better call the probe again.

If during search we found some driver with absolute priority, we do
not need to set device driver and class since we haven't removed them
before.

It should not happen, but if second probe method call failed, remove
the driver and possibly the class from the device as it was when we
started.

Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D32125

(cherry picked from commit f73c2bbf811ba77b2fe91b5bc0cbe19e9f7eb6c4)

2 years agobus: Fix LINT / BUS_DEBUG build
Warner Losh [Fri, 24 Sep 2021 20:03:10 +0000 (14:03 -0600)]
bus: Fix LINT / BUS_DEBUG build

Fix 0389e9be63c5e for LINT built. Removed an arg only from code
under BUS_DEBUG w/o rebuilding LINT...

Sponsored by: Netflix
Fixes: 0389e9be63c5e24ecedbb366c5682ddc2ff4de60
(cherry picked from commit 67a9e76da6e69ceee94a3b9c0fd490ed2f781938)

2 years agobus: retire DF_REBID
Warner Losh [Fri, 24 Sep 2021 18:10:18 +0000 (12:10 -0600)]
bus: retire DF_REBID

I did DF_REBID to allow for 'hoover' drivers that would attach to
otherwise unattached devices in the tree. This notion didn't catch on as
it was tricky to make work well and it was easier to just publish a /dev
node of some flavor by the parent device. It's been nothing but dead
weight for a long time.

Reviewed by: mav
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32056

(cherry picked from commit 0389e9be63c5e24ecedbb366c5682ddc2ff4de60)

2 years agoAllow ddb and dtrace use the DMAP region on arm64
Andrew Turner [Tue, 21 Sep 2021 17:10:57 +0000 (17:10 +0000)]
Allow ddb and dtrace use the DMAP region on arm64

When writing to memory on arm64 we may be trying to be accessing a
read-only page. In this case try to access via the DMAP region to
get a writable location.

While here simplify writing data in DDB and stop trashing the size as
it is passed into the cache handling functions.

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

(cherry picked from commit 3d2533f5c29fbf6e63c5e408ba13c2294a7612fd)

2 years agoAdd atomic_testandset_acq_* on arm64
Andrew Turner [Mon, 20 Dec 2021 13:49:59 +0000 (13:49 +0000)]
Add atomic_testandset_acq_* on arm64

We only need to include sys/_atomic_subword.h on arm64 to provide
atomic_testandset_acq_long. Add an implementation in the arm64 atomic.h
based on the existing atomic_testandset macro.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33587

(cherry picked from commit 02c16e2174baa756997600a8139f19f218da0a8f)

2 years agoAdd an loader command on arm64 to sync the cache
Andrew Turner [Mon, 20 Dec 2021 13:42:15 +0000 (13:42 +0000)]
Add an loader command on arm64 to sync the cache

On boot we don't need to perform any CPU cache management when the IDC
and DIC fields in the ctr_el0 register are set. Add a command to tell
loader to ignore these fields. This could be useful, for example, if the
hardware is misreporting the values and we are missing a quirk to enable
it.

It is not expected this will be needed, but is only intended as a
workaround to ensure the kernel can still boot.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c399283c71e310e1573e8d27f9cb9d27a4ea3376)

2 years agoDon't sync the I/D caches when they are coherent
Andrew Turner [Fri, 17 Dec 2021 09:33:57 +0000 (09:33 +0000)]
Don't sync the I/D caches when they are coherent

In the arm64 loader we need to syncronise the I and D caches. On some
newer CPUs the I and D caches are coherent so we don't need to perform
these operations.

While here remove the arguments to cpu_inval_icache as they are unneeded.

Reported by: cperciva
Tested by: cperciva
Sponsored by: Innovate UK

(cherry picked from commit c1381f07f61a66979f1569995f37f2a0413c0413)

2 years agoocs_fc: Add lancer G7 to the supported hardware in the man page.
Ram Kishore Vegesna [Fri, 24 Dec 2021 07:24:27 +0000 (12:54 +0530)]
ocs_fc: Add lancer G7 to the supported hardware in the man page.

Reviewed by: mav
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D33668

(cherry picked from commit f5e24f24c7cc217dbe328c1181b568b893da5dd1)

ocs_fc: Updated man page date.

MFC after: 3 days

(cherry picked from commit 99948907e3cbe58c2e3e27b19c79793db9b21ca0)

2 years agowpa: Import wpa_supplicant/hostapd commit 14ab4a816
Cy Schubert [Thu, 2 Dec 2021 23:00:32 +0000 (15:00 -0800)]
wpa: Import wpa_supplicant/hostapd commit 14ab4a816

This is the November update to vendor/wpa committed upstream 2021-11-26.

(cherry picked from commit 4b72b91a7132df1f77bbae194e1071ac621f1edb)

2 years agontp: Revert "Disable stack gap for ntpd during build."
Cy Schubert [Mon, 16 Aug 2021 14:46:31 +0000 (07:46 -0700)]
ntp: Revert "Disable stack gap for ntpd during build."

This reverts commit af949c590bd8a00a5973b5875d7e0fa6832ea64a because
889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 fixes the underlying problem.

(cherry picked from commit 733a832fb515ef9ebf9d584896962fd28e714d0b)

2 years agontp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV."
Cy Schubert [Mon, 16 Aug 2021 15:05:50 +0000 (08:05 -0700)]
ntp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV."

This reverts commit 55263180628a386ad38b4b6621919220b137f770 because the
underlying problem was fixed by 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021.

(cherry picked from commit fc393054398ea50fb0cee52704e9385afe888b48)

2 years agotests/libalias: Portrange
Lutz Donnerhacke [Sat, 3 Jul 2021 22:28:20 +0000 (00:28 +0200)]
tests/libalias: Portrange

Test ranges of allowed ports for aliasing.
 - Explicit default like ipfw(8) is doing
 - Regular range
 - Exhausting a very small range
 - Recovery

Includes a fix of an utility macro, which was not used before.

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

(cherry picked from commit 2c733b50c5a99cbe4f6eef437e1e3efd720ba306)

2 years agoaw_spi: improve I/O stability
Andriy Gapon [Mon, 20 Dec 2021 10:40:17 +0000 (12:40 +0200)]
aw_spi: improve I/O stability

This driver does not use DMA at the moment, so some care is needed to
prevent TX FIFO underruns and RX FIFO overflows.
Several improvements are done in oder to minimize chances of those.

First, the interrupt handling is moved to a filter to minimize latency.
Second, FIFO trigger thresholds are configured for both FIFOs.
The TX FIFO threshold is set to 3/4-th of its size and the RX FIFO
threshold is set to 1/4-th of its size.
The interrupt conditions are changed from the empty FIFO and full FIFO
for the TX and RX correspondingly to going below and above the thresholds.

While here I renamed AW_SPI_IER_RF_ERQ to AW_SPI_IER_RF_RDY which is
closer to what the documentation uses, RF_RDY_INT_EN in the interrupt
control register and RX_RDY in the interrupt status register.

(cherry picked from commit 08ff54dc5b5de85580044167e1714fb75df8e44f)

2 years agonfs: don't truncate directory cookies to 32-bits in the NFS server
Alan Somers [Mon, 13 Dec 2021 03:57:14 +0000 (20:57 -0700)]
nfs: don't truncate directory cookies to 32-bits in the NFS server

In NFSv2, the directory cookie was 32-bits.  NFSv3 widened it to
64-bits and SVN r22521 widened the corresponding argument in
VOP_READDIR, but FreeBSD's NFS server continued to treat the cookies as
32-bits, and 0-extended to fill the field on the wire.  Nobody ever
noticed, because every in-tree file system generates cookies that fit
comfortably within 32-bits.

Also, have better type safety for txdr_hyper.  Turn it into an inline
function that type-checks its arguments.  Prevents warnings about
shift-count-overflow.

PR: 260375
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D33404

(cherry picked from commit 32fbc5d824f51f97220bc5c61a23e0bf3ff2b470)

2 years agofusefs: invalidate the cache during copy_file_range
Alan Somers [Sun, 5 Dec 2021 20:39:10 +0000 (13:39 -0700)]
fusefs: invalidate the cache during copy_file_range

FUSE_COPY_FILE_RANGE instructs the server to write data to a file.
fusefs must invalidate any cached data within the written range.

PR: 260242
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33280

(cherry picked from commit 41ae9f9e644d1196bebacdb3748670f36b354384)

2 years agofusefs: inline fuse_io_dispatch
Alan Somers [Sun, 5 Dec 2021 21:25:17 +0000 (14:25 -0700)]
fusefs: inline fuse_io_dispatch

This function was always confusing, because it created an H-shaped
callgraph: two functions called in and left via different paths based on
which which called.

(cherry picked from commit dc433e1530af26b0430d66c06c342889e9609590)

2 years agofusefs: correctly handle an inode that changes file types
Alan Somers [Mon, 6 Dec 2021 05:43:17 +0000 (22:43 -0700)]
fusefs: correctly handle an inode that changes file types

Correctly handle the situation where a FUSE server unlinks a file, then
creates a new file of a different type but with the same inode number.
Previously fuse_vnop_lookup in this situation would return EAGAIN.  But
since it didn't call vgone(), the vnode couldn't be reused right away.
Fix this by immediately calling vgone() and reallocating a new vnode.

This problem can occur in three code paths, during VOP_LOOKUP,
VOP_SETATTR, or following FUSE_GETATTR, which usually happens during
VOP_GETATTR but can occur during other vops, too.  Note that the correct
response actually doesn't depend on whether the entry cache has expired.
In fact, during VOP_LOOKUP, we can't even tell.  Either it has expired
already, or else the vnode got reclaimed by vnlru.

Also, correct the error code during the VOP_SETATTR path.

PR: 258022
Reported by: chogata@moosefs.pro
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33283

(cherry picked from commit 25927e068fcbcac0a5111a881de723bd984b04b3)

2 years agofusefs: better debugging for FUSE_RENAME in the tests
Alan Somers [Fri, 3 Dec 2021 03:26:27 +0000 (20:26 -0700)]
fusefs: better debugging for FUSE_RENAME in the tests

(cherry picked from commit c2d342c509065bee6392624e95b75cf7b3bb9c45)

2 years agolorder: add note that it is no longer required
Ed Maste [Mon, 20 Dec 2021 17:57:34 +0000 (12:57 -0500)]
lorder: add note that it is no longer required

Use of lorder(1) is not required by contemporary linkers.

The GNU coreutils manual[1] has a good description of the use of lorder
and tsort:

    This whole procedure has been obsolete since about 1980, because
    Unix archives now contain a symbol table (traditionally built by
    ranlib, now generally built by ar itself), and the Unix linker uses
    the symbol table to effectively make multiple passes over an archive
    file.

See 0e1e341b486c for some more details.

[1] https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html

PR: 259254 [exp-run]
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 3e01ee76f2042fe07ad5cf8edeb5065bc0aba320)

2 years agofsutil: forward declare struct fstab
Warner Losh [Thu, 16 Dec 2021 02:38:28 +0000 (19:38 -0700)]
fsutil: forward declare struct fstab

Fix the build by forward declaring struct fstab.

Sponsored by: Netflix

(cherry picked from commit 7090cba410b3fcaa00d75e86eacd636501b1494b)

2 years agoUpdate fsck(8) to ignore failures from a check program for a filesystem
Kirk McKusick [Thu, 16 Dec 2021 00:51:55 +0000 (16:51 -0800)]
Update fsck(8) to ignore failures from a check program for a filesystem
when the fstab(5) entry for the filesystem has the "failok" attribute.

PR:           246201
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33424

(cherry picked from commit c72372c693b36058b58a525981e833515ce8e441)

2 years agoxen/blkfront: Remove CTLFLAG_NEEDGIANT from sysctl.
Alexander Motin [Sun, 26 Dec 2021 02:24:24 +0000 (21:24 -0500)]
xen/blkfront: Remove CTLFLAG_NEEDGIANT from sysctl.

It only converts bit field into string.  It does not need locking.

MFC after: 1 week

(cherry picked from commit 54daceab555cb56765a8d4e63071ea44cd877f53)

2 years agoamd64 sigtramp: comment-out annotations for registers with DWARF number >= 32
Konstantin Belousov [Sun, 2 Jan 2022 18:39:07 +0000 (20:39 +0200)]
amd64 sigtramp: comment-out annotations for registers with DWARF number >= 32

(cherry picked from commit 642f77be1d10b57cd7635573aa8a3757913778ad)

2 years agoEnforce that vdso does not contain runtime relocations
Konstantin Belousov [Wed, 1 Dec 2021 00:35:26 +0000 (02:35 +0200)]
Enforce that vdso does not contain runtime relocations

(cherry picked from commit d49b75d0d67f86265cfe9b8c83d3749c4a8d3e14)

2 years agoEnforce that vdso does not consume too much from the shared page
Konstantin Belousov [Thu, 18 Nov 2021 01:20:08 +0000 (03:20 +0200)]
Enforce that vdso does not consume too much from the shared page

(cherry picked from commit b0e0b4e7b3795e9beb0cddcfd75261cc9327b5b0)

2 years agoamd64 ia32 vdso: add unwind annotations to the signal trampoline
Konstantin Belousov [Mon, 15 Nov 2021 18:30:48 +0000 (20:30 +0200)]
amd64 ia32 vdso:  add unwind annotations to the signal trampoline

(cherry picked from commit 8a4bd7f818a0e361876ab05d49fd04e28ce05357)

2 years agoamd64 native vdso: add unwind annotations to the signal trampoline
Konstantin Belousov [Mon, 15 Nov 2021 18:29:45 +0000 (20:29 +0200)]
amd64 native vdso: add unwind annotations to the signal trampoline

(cherry picked from commit 5b8918fac6fa9c150f68a0ec0805385ee7029ec3)

2 years agoAdd kern.elf{32,64}.vdso knobs to enable/disable vdso preloading
Konstantin Belousov [Thu, 25 Nov 2021 01:31:27 +0000 (03:31 +0200)]
Add kern.elf{32,64}.vdso knobs to enable/disable vdso preloading

(cherry picked from commit eb029587481e8d6f610eb31d7f50d34b9240f2f2)

2 years agovdso for ia32 on amd64
Konstantin Belousov [Sun, 14 Nov 2021 00:26:55 +0000 (02:26 +0200)]
vdso for ia32 on amd64

(cherry picked from commit 98c8b6252496e874d337d9a7b565d9037609168f)

2 years agortld: load preloaded vdso
Konstantin Belousov [Thu, 11 Nov 2021 18:07:44 +0000 (20:07 +0200)]
rtld: load preloaded vdso

(cherry picked from commit c210ef1347929cb3a0f46cdfdb3d4ad738e3af74)

2 years agoFix assert check for SV_DSO_SIG in exec_sysvec_init_secondary()
Justin Hibbits [Thu, 9 Dec 2021 04:50:10 +0000 (22:50 -0600)]
Fix assert check for SV_DSO_SIG in exec_sysvec_init_secondary()

(cherry picked from commit d2de68811a80bffe20040592dca194238c5a5c86)

2 years agoPass vdso address to userspace
Konstantin Belousov [Thu, 11 Nov 2021 17:29:24 +0000 (19:29 +0200)]
Pass vdso address to userspace

(cherry picked from commit 01c77a436e35d6dc9660ec7bac477946f563c99d)

2 years agoamd64: wrap 64bit sigtramp into vdso
Konstantin Belousov [Fri, 5 Nov 2021 08:07:24 +0000 (10:07 +0200)]
amd64: wrap 64bit sigtramp into vdso

(cherry picked from commit ab4524b3d7fba872a143b03c9346cb04c3670efa)

2 years agoRemove bogus cast from exec_sysvec_init().
Dmitry Chagin [Tue, 20 Jul 2021 06:54:09 +0000 (09:54 +0300)]
Remove bogus cast from exec_sysvec_init().

(cherry picked from commit b39fa4770dd19ff32b2d70622521135dd384c7c1)

2 years agoModify exec_sysvec_init() to allow non-native abi to setup their sysentvecs.
Dmitry Chagin [Tue, 20 Jul 2021 06:53:21 +0000 (09:53 +0300)]
Modify exec_sysvec_init() to allow non-native abi to setup their sysentvecs.

(cherry picked from commit 21629e2a456446bff101813a16f8cba046f44176)

2 years agoamd64 get_mcontext(): third argument to get_fpcontext() is a pointer
Konstantin Belousov [Sat, 1 Jan 2022 03:55:59 +0000 (05:55 +0200)]
amd64 get_mcontext(): third argument to get_fpcontext() is a pointer

(cherry picked from commit 76ef4f6348ccad73317ce2d10ab7a78d8591ba1a)

2 years agoitimers: strip unused bits from struct itimer and struct itimers
Konstantin Belousov [Mon, 27 Dec 2021 18:29:22 +0000 (20:29 +0200)]
itimers: strip unused bits from struct itimer and struct itimers

(cherry picked from commit 23ba59fbfb6ad580c4f185ffea2fa8a32b4d131d)

2 years agoitimers_alloc: no need to initialize its_timers array
Konstantin Belousov [Mon, 27 Dec 2021 18:32:01 +0000 (20:32 +0200)]
itimers_alloc: no need to initialize its_timers array

(cherry picked from commit 3f1570847831e6dbcafc1f416f96404bf66048f2)

2 years agoAvoid emitting popcnt in libclang_rt.fuzzer*.a if unsupported
Dimitry Andric [Thu, 30 Dec 2021 09:53:25 +0000 (10:53 +0100)]
Avoid emitting popcnt in libclang_rt.fuzzer*.a if unsupported

Since popcnt is only supported by CPUTYPE=nehalem and later, ensure that
this instruction is only emitted when appropriate. Otherwise, programs
using the library can abort with SIGILL.

See also: https://github.com/llvm/llvm-project/issues/52893

PR: 258156
Reported by: Eric Rucker <bhtooefr@bhtooefr.org>
MFC after: 3 days

(cherry picked from commit 133180557479cd9676758e6f3f93a9d3e1c6b532)

2 years agolibc: Fix build with -DNS_REREAD_CONF.
Alexander Motin [Wed, 29 Dec 2021 22:00:17 +0000 (17:00 -0500)]
libc: Fix build with -DNS_REREAD_CONF.

MFC after: 3 days

(cherry picked from commit 62ed2d0152dce6da883fef753e0995e6d85e0cf1)

2 years agofd: Initialize more export_fd_buf fields in kern_proc_cwd_out()
Mark Johnston [Thu, 16 Dec 2021 21:53:59 +0000 (16:53 -0500)]
fd: Initialize more export_fd_buf fields in kern_proc_cwd_out()

In particular, we need to initialize efbuf->flags, since
export_vnode_to_sb() loads that field.  This was mostly harmless since
the flag only determines whether the output kinfo_file is packed, and
KERN_PROC_CWD only ever emits a single kinfo_file anyway.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 327060bd7799e5d4376693fba770a17b79e5a38d)

2 years agounix: Increase the default datagram recv buffer size
Mark Johnston [Fri, 17 Dec 2021 15:59:29 +0000 (10:59 -0500)]
unix: Increase the default datagram recv buffer size

syslog(3) was recently change to support larger messages, up to 8KB.
Our syslogd handles this fine, as it adjusts /dev/log's recv buffer to a
large size.  rsyslog, however, uses the system default of 4KB.  This
leads to problems since our syslog(3) retries indefinitely when a send()
returns ENOBUFS, but if the message is large enough this will never
succeed.

Increase the default recv buffer size for datagram sockets to support
8KB syslog messages without requiring the logging daemon to adjust its
buffers.

PR: 260126
Reviewed by: asomers
Sponsored by: The FreeBSD Foundation

(cherry picked from commit d157f2627b238ba38d1cad36f1aa165c42ce91ee)

2 years agoktls: Add a regression test to exercise socket error handling
Mark Johnston [Fri, 17 Dec 2021 16:00:19 +0000 (11:00 -0500)]
ktls: Add a regression test to exercise socket error handling

Prior to commit 916c61a5ed37 ("Fix handling of errors from
pru_send(PRUS_NOTREADY)") this test triggered a kernel panic due to an
mbuf double free.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ee5686c614ba7e11e8586b2e5b02dfc550679e96)

2 years agoiwlwifi: attach to the build
Bjoern A. Zeeb [Mon, 27 Dec 2021 18:46:04 +0000 (18:46 +0000)]
iwlwifi: attach to the build

Add iwlwifi and iwlwififw to the module builds.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7d4394cbe7072fff75a8fb94e0871c1408213f09)

2 years agoiwlwifi: plug memory modified after free
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:42:51 +0000 (17:42 +0000)]
iwlwifi: plug memory modified after free

In certain situations we saw a memory modified after free.  This was
tracked down to a pointer not NULLed after free and used in a different
code path.  It is unclear how the race happens pending further
investigation but setting the pointer to NULL after free and adding a
check in the 2nd code path handling the case gracefully helps for now.

While here improve another debug messge in sta handling.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 586c8e32330591693c5fca4e089d90340b313f5d)

2 years agoiwlwifi: cherry-pick fixes from upstream iwlwifi-next
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:41:19 +0000 (17:41 +0000)]
iwlwifi: cherry-pick fixes from upstream iwlwifi-next

Cherry-pick f973795a8d19cbf3d03807704eb7c6ff65788d5a (Fix a double free
in iwl_txq_dyn_alloc_dma), db66abeea3aefed481391ecc564fb7b7fb31d742
(synchronize with FW after multicast commands),
d5d8ee526d1401173ad1261c3b6388a4f947e0a3 (remove session protection
upon station removal), and 8e967c137df3b236d2075f9538cb888129425d1a
(avoid clearing a just saved session protection id).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8f06a2b550c6288b48996036c325a1999780cb6a)

2 years agoiwlwifi: add man pages
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:40:02 +0000 (17:40 +0000)]
iwlwifi: add man pages

Add and hook up man pages for iwlwifi and iwlwififw and install a copy
of the firmware license to /usr/share/docs/legal so it will always be
shipped with the installed system.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5a02ae5e8f2d74b7ac20fa2e0cd98c66d934905b)

2 years agoiwlwifi: turn off broadcast filtering for now
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:37:41 +0000 (17:37 +0000)]
iwlwifi: turn off broadcast filtering for now

Turn off broadcast filtering in iwlwifi for now as it gives me
or rather the firmware headaches.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c6ea5aed79a33ce3482c4e3fa2bf56a9ee495815)

2 years agoiwlwifi: also depend on linuxkpi_wlan
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:36:04 +0000 (17:36 +0000)]
iwlwifi: also depend on linuxkpi_wlan

The 802.11 compat code is split off linuxkpi.ko into linuxkpi_wlan.ko
in case it is built as a module.  Depend on that.
While here adjust our module to a longer version to avoid conflicts.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 81ff67ffbec066bc5014a64e67de0219d943156a)

2 years agoiwlwifi: remove copyright and license from Makefiles
Bjoern A. Zeeb [Mon, 27 Dec 2021 17:34:40 +0000 (17:34 +0000)]
iwlwifi: remove copyright and license from Makefiles

We do not generally protect the Makefiles like this.
Remove the details and go with project style.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ca8bf0e8d68398b1f1f50dad1432130360b0bbdc)

2 years agoLinuxKPI: add 802.11 compat code
Bjoern A. Zeeb [Sun, 26 Dec 2021 18:52:51 +0000 (18:52 +0000)]
LinuxKPI: add 802.11 compat code

Add 802.11 compat code for mac80211 and to a minimal degree cfg80211.
This allows us to compile and use basic functionality of wireless
drivers such as iwlwifi.

This is a constant work in progress but having it in the tree will
allow others to test and more easy to track changes and avoid having
snapshots no longer applying to branches.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6b4cac814e32f3b307720d6b880939fb1f21f3ac)

2 years agoLinuxKPI: import beginning of a new version of netdevice.h
Bjoern A. Zeeb [Sun, 26 Dec 2021 18:29:29 +0000 (18:29 +0000)]
LinuxKPI: import beginning of a new version of netdevice.h

Import a netdevice update complementing the last remaining bits of
the old ifnet derived implementation.  Along add a (for now) task
based NAPI implementation.

This is the minimal set of chnages which are needed for the initial
support of wireless drivers.  The NAPI implementation has an option to
still switch to "direct dispatch" as it had been used by these drivers
before not relying on a deferred context along with some printf tracing.
This has been helpful in the last weeks for debugging and will be
cleaned once we have had broader testing and are sure this is fine as-is.
Should we need a more time-sensitive or load-sensitive response
in the future we can always switch to something more sophisticated.

Sponsored by: The FreeBSD Foundation
X-Differential Revision: D33075 (abandoned without feedback a while ago)

(cherry picked from commit d105895844848ddba85d686e03e0d14c03ad4eb4)

2 years agoLinuxKPI: add a work-in-progress skbuff implementation
Bjoern A. Zeeb [Sun, 26 Dec 2021 18:26:26 +0000 (18:26 +0000)]
LinuxKPI: add a work-in-progress skbuff implementation

This is a work-in-progress implementation of sk_buff compat code
used for wireless drivers only currently.
Bring in this version of the code as it has proven to be good enough
to have packets going for a few months.

The current implementation has several drawbacks including the need
for us to copy data between sk_buffs and mbufs.
Do not rely on the internals of this implementation.  They are highly
likely to change as we will improve the integration to FreeBSD mbufs.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 49ed6e979c3b327ae466a559884802d901aa5792)

2 years agonet80211: adjust a printf to toeee80211_note
Bjoern A. Zeeb [Sun, 26 Dec 2021 17:26:58 +0000 (17:26 +0000)]
net80211: adjust a printf to toeee80211_note

Throughout net80211 there are multiple ways to log (debugging)
information.  Start to clenaup one as I kept hitting it to harmonize
the output.  The more we get away from printfs into either wrapper
functions or macros the more likely we can use holistic systematic
tracing in the future.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2e59c9c7f01e9e8878664f59438d1ed6c27d0e2b)

2 years agonet80211: add debugging information
Bjoern A. Zeeb [Sun, 26 Dec 2021 17:25:57 +0000 (17:25 +0000)]
net80211: add debugging information

Add more STATE / DEBUG probes and enhance the output of one in order
to track state changes triggered by "ack" (or not).
This helped to narrow down causes from drivers or the LinuxKPI 802.11
compat framework which kept us in a scan -> auth -> scan loop.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 04efa18f83d12dca2b69dd4cdb626f92e5ce64f0)

2 years agonet80211: format debug functions as single line
Bjoern A. Zeeb [Sun, 26 Dec 2021 17:24:04 +0000 (17:24 +0000)]
net80211: format debug functions as single line

Making use of the debug output was hard given debug lines were run in
parts through vlog (if_printf) and in (multiple) parts through printf(s).

Like some of the functions alreay have, use a local buffer to format
the string and then use a single if_printf;  in addition given these
functions are debug-only, add an extra printf in case we find our
buffers still to be too small so we can adjust for the future.
We already found that 128 characters are to short for some log messages.
Bump the buffer sizes collectively to 256 characters which also is
the maximum of if_vlog() so getting longer would need further changes
elsewhere.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 04435a1b145b310f8be62dd453e2f0c69d764cca)

2 years agonet80211: fix debug printf
Bjoern A. Zeeb [Thu, 23 Dec 2021 15:21:32 +0000 (15:21 +0000)]
net80211: fix debug printf

We are printing %p in _db_show_sta(), there is no need to prefix it
with 0x again to get a 0x0x...

Spsonsored by: The FreeBSD Foundation

(cherry picked from commit e51b46cefbfaab08f6e5cb402ebecbf1c0cba3c8)

2 years agomodules: increase MAXMODNAME and provide backward compat
Bjoern A. Zeeb [Wed, 17 Nov 2021 19:35:46 +0000 (19:35 +0000)]
modules: increase MAXMODNAME and provide backward compat

With various firmware files used by graphics and wireless drivers
we are exceeding the current 32 character module name (file path
in kldxref) length.
In order to overcome this issue bump it to the maximum path length
for the next version.
To be able to MFC provide backward compat support for another version
of the struct as the offsets for the second half change due to the
array size increase.

MAXMODNAME being defined to MAXPATHLEN needs param.h to be
included first.  With only 7 modules (or LinuxKPI module.h) not
doing that adjust them rather than including param.h in module.h [1].

Reported by: Greg V (greg unrelenting.technology)
Sponsored by: The FreeBSD Foundation
Suggested by: imp [1]
Reviewed by: imp (and others to different level)
Differential Revision: https://reviews.freebsd.org/D32383

(cherry picked from commit df38ada2931f95d07b65b19fcfb4c9845d656ba9)

2 years agoiwlwifi: import Intel's iwlwifi/mvm driver.
Bjoern A. Zeeb [Sun, 28 Nov 2021 18:35:53 +0000 (18:35 +0000)]
iwlwifi: import Intel's iwlwifi/mvm driver.

Over the past few months we published multiple snapshots for this
Linux derived driver and it has become fairly stable in terms of
minimal local changes needed for new updates.

The current version is based on iwlwifi-next update at
cbaa6aeedee5f92dafa5982eceea2a1f98ce4f7d with the addition of
a hand full of files replaced for FreeBSD.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Do not yet hook this to the build until the remaining compat code
is all in.  Along with the firmware import this will make publishing
the last bits and final testing a lot easier.

Sponsored by:   The FreeBSD Foundation
Approved by:    core (imp) [1]

(cherry picked from commit bfcc09ddd422c95a1a2e4e794b63ee54c4902398)

2 years agoiwlwifi: import firmware for Intel iwlwifi/mvm supported chipsets.
Bjoern A. Zeeb [Sun, 28 Nov 2021 18:34:19 +0000 (18:34 +0000)]
iwlwifi: import firmware for Intel iwlwifi/mvm supported chipsets.

Import the most recent versions of the firmware images for iwlwifi
chipsets supported by the "mvm" sub-driver.
This is based on linux-firmware at f5d519563ac9d2d1f382a817aae5ec5473811ac8.
The license of the firmware matches the previous iwnfw(4) and
iwmfw(4) firmware files and you can find a copy in
sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware .

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.
There is an open issue concerning kldxref that we need to resolve
(D32383).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit f4c129f5fb1669b284d76a838b1e509f97c2d299)

2 years agoLinuxKPI: USB return possible error from suspend/resume
Bjoern A. Zeeb [Wed, 24 Nov 2021 21:28:46 +0000 (21:28 +0000)]
LinuxKPI: USB return possible error from suspend/resume

USB suspend/resume cannot fail so we never returned the error which
resulted in a -Wunused-but-set-variable warning.
Initialize the return variable and return a possible error possibly
triggering a printf upstream to at least have a trace of the problem.
This also fixes the warning.

Suggested by: hselasky
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107

(cherry picked from commit 943df073a348bcb1e701c3677536f913761d4123)

2 years agoLinuxKPI: fix -Wunused-but-set-variable warnings
Bjoern A. Zeeb [Wed, 24 Nov 2021 21:20:52 +0000 (21:20 +0000)]
LinuxKPI: fix -Wunused-but-set-variable warnings

Handle write-only variables by removing the unused return value from void
functions or removing the unused variables entirely.

Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107

(cherry picked from commit 7043359ce3c1e56ed55c8b41867a14a418511a05)