]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 months agosplit: switch to getline() for line/pattern matching
Kyle Evans [Tue, 23 Aug 2022 02:05:58 +0000 (21:05 -0500)]
split: switch to getline() for line/pattern matching

Get rid of split's home-grown logic for growing the buffer; arbitrarily
breaking at LONG_MAX bytes instead of 65536 bytes gives us much more
wiggle room.  Additionally, we'll actually fail out entirely if we can't
fit a line, which makes noticing this class of problem much easier.

Reviewed by: bapt, emaste, pauamma
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D36323

21 months agonetmap(4): Fix a typo in a source code comment
Gordon Bergling [Tue, 25 Oct 2022 12:56:25 +0000 (14:56 +0200)]
netmap(4): Fix a typo in a source code comment

- s/microsconds/microseconds/

MFC after: 3 days

21 months agosmartpqi(4): Fix two typos in kernel error messages
Gordon Bergling [Tue, 25 Oct 2022 11:17:20 +0000 (13:17 +0200)]
smartpqi(4): Fix two typos in kernel error messages

- s/runnning/running/

MFC after: 2 weeks

21 months agodconschat(8): Fix a typo in an error message
Gordon Bergling [Tue, 25 Oct 2022 10:58:55 +0000 (12:58 +0200)]
dconschat(8): Fix a typo in an error message

- s/faild/failed/

MFC after: 1 week

21 months agoarcmsr(4): Fix a typo in a source code comment
Gordon Bergling [Tue, 25 Oct 2022 10:57:37 +0000 (12:57 +0200)]
arcmsr(4): Fix a typo in a source code comment

- s/faild/failed/

MFC after: 3 days

21 months agozfsd(8): Fix a typo in an error message
Gordon Bergling [Tue, 25 Oct 2022 10:55:42 +0000 (12:55 +0200)]
zfsd(8): Fix a typo in an error message

- s/faild/failed/

MFC after: 1 week

21 months agofirewire(4): Fix a typo in an error message
Gordon Bergling [Tue, 25 Oct 2022 10:54:15 +0000 (12:54 +0200)]
firewire(4): Fix a typo in an error message

- s/faild/failed/

MFC after: 5 days

21 months agoocs_fc(4): Fix a typo in an error message
Gordon Bergling [Tue, 25 Oct 2022 10:52:24 +0000 (12:52 +0200)]
ocs_fc(4): Fix a typo in an error message

- s/faild/failed/

MFC after: 5 days

21 months agoCMSG_DATA.3: Fix a typo in the EXAMPLES section
Gordon Bergling [Tue, 25 Oct 2022 10:49:21 +0000 (12:49 +0200)]
CMSG_DATA.3: Fix a typo in the EXAMPLES section

- s/faild/failed/

MFC after: 3 days

21 months agorun.4: Fix a typo in the DIAGNOSTICS section
Gordon Bergling [Tue, 25 Oct 2022 10:47:29 +0000 (12:47 +0200)]
run.4: Fix a typo in the DIAGNOSTICS section

- s/faild/failed/

MFC after: 3 days

21 months agoman: hook acpi_ged.4 to build.
Takanori Watanabe [Mon, 24 Oct 2022 23:11:49 +0000 (08:11 +0900)]
man: hook acpi_ged.4 to build.

Submittet by: yuri@astern.org

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

21 months agonetpfil: Fix two typos in source code comments
Gordon Bergling [Tue, 25 Oct 2022 02:32:59 +0000 (04:32 +0200)]
netpfil: Fix two typos in source code comments

- s/missmatch/mismatch/

MFC after: 3 days

21 months agonet8021: Fix a typo in a kernel error message
Gordon Bergling [Tue, 25 Oct 2022 02:31:51 +0000 (04:31 +0200)]
net8021: Fix a typo in a kernel error message

- s/missmatch/mismatch/

MFC after: 1 week

21 months agoopencrypto: fix null esp crypt
Konstantin Belousov [Mon, 24 Oct 2022 23:02:58 +0000 (02:02 +0300)]
opencrypto: fix null esp crypt

Fixes: 3e9470482a1357eef90d007b27ec5d9725ae1111
Reviewed by: jhb
Sponsored by: Nvidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37113

21 months agoLinuxKPI: seq_file add "private" versions.
Bjoern A. Zeeb [Sat, 22 Oct 2022 18:07:37 +0000 (18:07 +0000)]
LinuxKPI: seq_file add "private" versions.

Add __seq_open_private() and seq_release_private() needed by iwlwifi
debugfs support.

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

21 months agobhyve: Drop a bogus const qualifier
Mark Johnston [Mon, 24 Oct 2022 21:35:16 +0000 (17:35 -0400)]
bhyve: Drop a bogus const qualifier

No functional change intended.

MFC after: 1 week

21 months agobhyve: Use the new vm_limit_rights() interface
Mark Johnston [Mon, 24 Oct 2022 21:32:04 +0000 (17:32 -0400)]
bhyve: Use the new vm_limit_rights() interface

This addresses a compiler warning arising from the fact that bhyve
needs to cast away a const qualifier in order to call free().

No functional change intended.

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

21 months agolibvmmapi: Provide an interface for limiting rights on the device fd
Mark Johnston [Mon, 24 Oct 2022 21:31:11 +0000 (17:31 -0400)]
libvmmapi: Provide an interface for limiting rights on the device fd

Currently libvmmapi provides a way to get a list of the allowed ioctls
on the vmm device file, so that bhyve can limit rights on the device
file fd.  The interface is rather strange: it allocates a copy of the
list but returns a const pointer, so the caller has to cast away the
const in order to free it without aggravating the compiler.

As far as I can see, there's no reason to make a copy of the array, but
changing vm_get_ioctls() to not do that would break compatibility.  So
this change just introduces a better interface: move all rights-limiting
logic into libvmmapi.

Any new operations on the fd should be wrapped by libvmmapi, so also
discourage use of vm_get_device_fd().  Currently bhyve uses it only when
limiting rights on the device fd.

No functional change intended.

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

21 months agodpaa2: cleanup some include files
Bjoern A. Zeeb [Mon, 24 Oct 2022 20:54:20 +0000 (20:54 +0000)]
dpaa2: cleanup some include files

2782ed8f6cd3d7f59219a783bc7fa7bbfb1fe26f fixed the standalone module
build.  REmove the now duplicate includes for opt_acpi.h and
opt_platform.h.  Als remove the if_mdio.h again in both the Makefile
and the implementation file as it is not (currently) used.

X-MFC with: ba7319e9091b4f6ef15a9c4be3d3d076f3047f72
MFC after: 70 days

21 months agoRack and BBR broken with the new timewait state purge.
Randall Stewart [Mon, 24 Oct 2022 19:47:29 +0000 (15:47 -0400)]
Rack and BBR broken with the new timewait state purge.

We recently got rid of the explicit INP_TIMEWAIT state, this has caused some
minor breakage to both rack and bbr. Basically the timewait check that was
in tcp_lro.c is now gone. This means that compressed_ack and mbuf_queued
packets will arrive at TCP without going through tcp_input_with_port(). We need
to expand the check that was stripped to look at the tcp_state (t_state) and
not "LRO" packets that are in the TCPS_TIMEWAIT state.

Reviewed by: tuexen, gliebus
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D37080

21 months agoif_ovpn: avoid netisr_queue name conflicts
Kristof Provost [Mon, 24 Oct 2022 18:45:39 +0000 (20:45 +0200)]
if_ovpn: avoid netisr_queue name conflicts

Rename the netisr_queue variable in if_ovpn.c to avoid naming conflicts.

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

21 months agoacpi_ged: Module build no longer needs to define INTRNG
Warner Losh [Mon, 24 Oct 2022 18:12:29 +0000 (12:12 -0600)]
acpi_ged: Module build no longer needs to define INTRNG

Now that we properly define INTRNG generically on all the platforms that
need it in opt_global.h, we don't need to define it here.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D37110

21 months agoconfig.mk: All options in DEFAULTS are now defined in opt_global.h
Warner Losh [Mon, 24 Oct 2022 18:12:17 +0000 (12:12 -0600)]
config.mk: All options in DEFAULTS are now defined in opt_global.h

To simplify management of all the options that should be enabled for the
different architectures, adopt the convention that all options listed in
DEFAULTS will be #defined to 1 in opt_global.h for untied builds. Except
for GEOM_* and ISAPNP, they are all in opt_global.h. ISAPNP is a
opt_dontuse.h, so only filter GEOM_*.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D37108

21 months agoconfig: Make ISAPNP be in opt_dontuse.h
Warner Losh [Mon, 24 Oct 2022 18:12:09 +0000 (12:12 -0600)]
config: Make ISAPNP be in opt_dontuse.h

Nothing uses ISAPNP today, apart from bringing in files or not. There's
really no need to ever do #ifdef ISAPNP in drivers and such. It means
use the ISA bus plug and play isolation protocol to enumerate the bus,
not the more useful 'you might have devices with isa pnp ids' which all
drivers hide behind DEV_ISA and/or an isa clause in the files files.

Sponsored by: Netflix
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D37109

21 months agoDEFAULTS: move intrng to DEFAULTS for its platforms.
Warner Losh [Mon, 24 Oct 2022 18:11:58 +0000 (12:11 -0600)]
DEFAULTS: move intrng to DEFAULTS for its platforms.

Sponsored by: Netflix
Reviewed by: manu, kevans
Differential Revision: https://reviews.freebsd.org/D37107

21 months agostand/efi: Simpler construct
Warner Losh [Mon, 24 Oct 2022 18:11:50 +0000 (12:11 -0600)]
stand/efi: Simpler construct

Use 'sizeof(long) == 8' for a compile time constant that can be used as
an initializer rather than #ifdefs.

Sponsored by: Netflix

21 months agoman4: Hook mac_ddb.4 up to the build
Mark Johnston [Tue, 18 Oct 2022 16:49:25 +0000 (12:49 -0400)]
man4: Hook mac_ddb.4 up to the build

Fixes: 287d467c5db5 ("mac: add new mac_ddb(4) policy")
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.

21 months agozfs: Fix a pair of bugs in zfs_fhtovp()
Mark Johnston [Mon, 24 Oct 2022 15:55:48 +0000 (11:55 -0400)]
zfs: Fix a pair of bugs in zfs_fhtovp()

This cherry-picks upstream ed566bf1cd0bdbf85e8c63c1c119e3d2ef5db1f6

    - Add a zfs_exit() call in an error path, otherwise a lock is
      leaked.
    - Remove the fid_gen > 1 check.  That appears to be Linux-specific:
      zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether
      the snapshot directory is mounted.  On FreeBSD it fails, making
      snapshot dirs inaccessible via NFS.

PR: 266236
MFC after: 3 days

21 months agoacpi_ged: fix build with ACPI_DEBUG
Gleb Smirnoff [Mon, 24 Oct 2022 16:00:04 +0000 (09:00 -0700)]
acpi_ged: fix build with ACPI_DEBUG

21 months agoRELNOTES: Add an entry for if_bridge l3 filtering default change
Kristof Provost [Mon, 24 Oct 2022 15:58:00 +0000 (17:58 +0200)]
RELNOTES: Add an entry for if_bridge l3 filtering default change

21 months agocache: add cache_assert_no_entries
Mateusz Guzik [Mon, 24 Oct 2022 15:34:57 +0000 (15:34 +0000)]
cache: add cache_assert_no_entries

21 months agoacpi_ged: fix build, as module and non INTRNG case.
Takanori Watanabe [Mon, 24 Oct 2022 14:19:12 +0000 (23:19 +0900)]
acpi_ged: fix build, as module and non INTRNG case.

Reviewed-by: cy
Differential Revision: https://reviews.freebsd.org/D37104

21 months agobsd-family-tree: OpenBSD 7.2 and DragonFly BSD 6.0.1
Sergey A. Osokin [Mon, 24 Oct 2022 14:12:31 +0000 (10:12 -0400)]
bsd-family-tree: OpenBSD 7.2 and DragonFly BSD 6.0.1

Add two releases to the tree.

While I'm here correct DragonFly BSD 6.2.1 position, it's
been released after FreeBSD 12.3.

MFC after: 3 days

21 months agoOpenBSM: fix free() in au_read_rec error case
Ed Maste [Mon, 24 Oct 2022 13:45:59 +0000 (09:45 -0400)]
OpenBSM: fix free() in au_read_rec error case

buf is a char ** and *buf is the allocated buffer.

PR: 267050
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

21 months agoacpi_ged: New driver to ACPI generic event device
Takanori Watanabe [Tue, 18 Oct 2022 05:41:53 +0000 (14:41 +0900)]
acpi_ged:  New driver to ACPI generic event device

 New driver to ACPI generic event device, defined in ACPI spec.
Some ACPI power button may not work without this.

In qemu arm64 with "virt" machine, with ACPI firmware,
enable devd check devd message by
and invoke following command in qemu monitor
(qemu) system_powerdown
and make sure some power button input event appear.
(setting sysctl hw.acpi.power_button_state=S5 is not work,
because ACPI tree does not have \_S5 object.)

Reviewed by: andrew, hrs
Differential Revision: https://reviews.freebsd.org/D37032

21 months agobridge: default to not filtering L3
Kristof Provost [Fri, 14 Oct 2022 05:57:33 +0000 (07:57 +0200)]
bridge: default to not filtering L3

Change the default for net.link.bridge.pfil_member and
net.link.bridge.pfil_bridge to zero.

That is, default to not calling layer 3 firewalls on the bridge or its
member interfaces.

With either of these enabled the bridge will, during L2 processing,
remove the Ethernet header from packets, feed them to L3 firewalls,
re-add the Ethernet header and send them out.

Not only does this interact very poorly with firewalls which defer
packets, or reassemble and refragment IPv6, it also causes considerable
confusion for users, because the firewall gets called in unexpected
ways.

For example, a bridge which contains a bhyve tap and the host's LAN
interface. We'd expect traffic between the LAN and bhyve VM to pass, no
matter what (layer 3) firewall rules are set on the host. That's not the
case as long as pfil_bridge or pfil_member are set.

Reviewed by: Zhenlei Huang
MFC: never
Differential Revision: https://reviews.freebsd.org/D37009

21 months agoarm64: Hyper-V: fix couple more commit errors caused by duplicated lines
Wei Hu [Mon, 24 Oct 2022 07:55:15 +0000 (07:55 +0000)]
arm64: Hyper-V: fix couple more commit errors caused by duplicated lines

Remove those duplicated lines.

Reported by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Fixes: 6cf00ef80c20148
Sponsored by: Microsoft

21 months agoif_ovpn: add sysctls for netisr_queue() and crypto_dispatch_async()
Kristof Provost [Mon, 17 Oct 2022 09:06:34 +0000 (11:06 +0200)]
if_ovpn: add sysctls for netisr_queue() and crypto_dispatch_async()

Allow the choice between asynchronous and synchronous netisr and crypto
calls. These have performance implications, but depend on the specific
setup and OCF back-end.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D37017

21 months agostress2: Added a regression test for D37024
Peter Holm [Mon, 24 Oct 2022 07:48:09 +0000 (09:48 +0200)]
stress2: Added a regression test for D37024

21 months agostress2: Update tool to list both DATA and HOLES in a file.
Peter Holm [Mon, 24 Oct 2022 07:45:32 +0000 (09:45 +0200)]
stress2: Update tool to list both DATA and HOLES in a file.
Added a regression test.

21 months agoLinuxKPI: add MSEC_PER_SEC
Bjoern A. Zeeb [Sat, 22 Oct 2022 18:01:30 +0000 (18:01 +0000)]
LinuxKPI: add MSEC_PER_SEC

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

21 months agoLinuxKPI: 802.11: add MO tracing
Bjoern A. Zeeb [Sun, 23 Oct 2022 21:48:22 +0000 (21:48 +0000)]
LinuxKPI: 802.11: add MO tracing

Add a macro to each implemented mac80211 operation.  This currently
turns into a printf if LINUXKPI_80211_DEBUG is defined but in the
future could become a different probe as well.
This is helpful for quick analysis and boot-time problem debugging
when DTrace and other frameworks may be harder to use.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

21 months agobhyve: Handle snapshots of unconfigured virtio-net devices
Vitaliy Gusev [Sun, 23 Oct 2022 18:47:56 +0000 (14:47 -0400)]
bhyve: Handle snapshots of unconfigured virtio-net devices

In case of device reset or not configured - features_negotiated is not
set, calling calling pci_vtnet_neg_features is wrong and resume gets
"Segmentation fault".

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

21 months agotime(3): Fix spelling.
Hans Petter Selasky [Sun, 23 Oct 2022 16:41:28 +0000 (18:41 +0200)]
time(3): Fix spelling.

Noted by: Gary Jennejohn <garyj@gmx.de>
MFC after: 1 week
Sponsored by: NVIDIA Networking

21 months agobhyve: Annotate an unused function as such
Mark Johnston [Sun, 23 Oct 2022 14:46:39 +0000 (10:46 -0400)]
bhyve: Annotate an unused function as such

No functional change intended.

MFC after: 1 week

21 months agobhyve: Make hda_ops function tables const
Mark Johnston [Sun, 23 Oct 2022 14:43:06 +0000 (10:43 -0400)]
bhyve: Make hda_ops function tables const

No functional change intended.

MFC after: 1 week

21 months agobhyve: Put the prototype for vga_render() in a header
Mark Johnston [Sun, 23 Oct 2022 14:22:39 +0000 (10:22 -0400)]
bhyve: Put the prototype for vga_render() in a header

No functional change intended.

MFC after: 1 week

21 months agobhyve: Put the prototype for vmexit_task_switch() in a header
Mark Johnston [Sun, 23 Oct 2022 14:21:50 +0000 (10:21 -0400)]
bhyve: Put the prototype for vmexit_task_switch() in a header

No functional change intended.

MFC after: 1 week

21 months agobhyve: Fix some warnings in the snapshot code
Mark Johnston [Sat, 22 Oct 2022 17:41:33 +0000 (13:41 -0400)]
bhyve: Fix some warnings in the snapshot code

- Qualify unexported symbols with "static".
- Drop some unnecessary and incorrect casts.
- Avoid arithmetic on void pointers.
- Avoid signed/unsigned comparisons in loops which use nitems() as a
  bound.

No functional change intended.

MFC after: 1 week

21 months agobhyve: Avoid arithmetic on void pointers
Mark Johnston [Sat, 22 Oct 2022 17:40:20 +0000 (13:40 -0400)]
bhyve: Avoid arithmetic on void pointers

No functional change intended.

MFC after: 1 week

21 months agobhyve: USB device model structures can be qualified with "static"
Mark Johnston [Sat, 22 Oct 2022 17:39:01 +0000 (13:39 -0400)]
bhyve: USB device model structures can be qualified with "static"

No functional change intended.

MFC after: 1 week

21 months agobhyve: Use the proper type for string literals
Mark Johnston [Sat, 22 Oct 2022 17:37:46 +0000 (13:37 -0400)]
bhyve: Use the proper type for string literals

No functional change intended.

MFC after: 1 week

21 months agobhyve: Fix some warnings in the ps2 emulation code
Mark Johnston [Sat, 22 Oct 2022 17:35:40 +0000 (13:35 -0400)]
bhyve: Fix some warnings in the ps2 emulation code

- Include headers containing prototypes for exported functions.
- Initialize all fields of the extended translation table.
- Qualify an unexported translation table as static.
- Fix error handling for a read(2).
- Fix some style bugs.

No functional change intended.

MFC after: 1 week

21 months agobhyve: Address some warnings in bhyverun.c
Mark Johnston [Sat, 22 Oct 2022 17:34:00 +0000 (13:34 -0400)]
bhyve: Address some warnings in bhyverun.c

- Annotate unused parameters as such.
- Avoid shadowing the global "vmexit".

No functional change intended.

MFC after: 1 week

21 months agoacpi: Create cppc_notify sysctl before it is checked
Tom Jones [Sun, 23 Oct 2022 09:09:28 +0000 (10:09 +0100)]
acpi: Create cppc_notify sysctl before it is checked

Reported by: Henrix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D37081

21 months agotime(3): Optimize tvtohz() function.
Hans Petter Selasky [Thu, 20 Oct 2022 16:49:51 +0000 (18:49 +0200)]
time(3): Optimize tvtohz() function.

List of changes:
- Use integer multiplication instead of long multiplication, because the result is an integer.
- Remove multiple if-statements and predict new if-statements.
- Rename local variable name, "ticks" into "retval" to avoid shadowing
the system "ticks" global variable.

Reviewed by: kib@ and imp@
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision:  https://reviews.freebsd.org/D36859

21 months agotime(3): Declare the minimum and maximum hz values supported.
Hans Petter Selasky [Mon, 3 Oct 2022 09:08:53 +0000 (11:08 +0200)]
time(3): Declare the minimum and maximum hz values supported.

Reviewed by: kib@ and imp@
MFC after:      1 week
Sponsored by:   NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D37072

21 months agostand/efi: Call md_copymodules based on __LP64__ to fix 32-bit arm
Warner Losh [Sun, 23 Oct 2022 01:09:10 +0000 (19:09 -0600)]
stand/efi: Call md_copymodules based on __LP64__ to fix 32-bit arm

When I refactored everything, I neglected to pass in the proper is64
value on 32-bit platforms. This corrects that. This prevented armv7 and
armv6 platforms from booting due to misaligned data in the kernel.  The
only platform we support 32-bit booting in armv[67], which I apparently
neglected to test before commiting my refactoring.

Tested by: skibo
Fixes: 5d1531d9d4e7d
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37095

21 months agostand/kboot: hostdisk isn't a DEVT_DISK, use a different value.
Warner Losh [Sat, 22 Oct 2022 15:09:23 +0000 (09:09 -0600)]
stand/kboot: hostdisk isn't a DEVT_DISK, use a different value.

We assume in all the code that a DEVT_DISK uses common/disk.c and/or
common/part.c and we can access a struct disk_devdesc. hostdisk.c
opens raw devices directly, so has no such structures. Define a
kboot-specific DEVT_HOSTDISK and use that instead.

In addition, disk_fmtdev assumes it is working with a struct
disk_devdesc, so write hostdisk_fmtdev as well.

Sponsored by: Netflix

21 months agogeli: Move check for DEVT_DISK into geli_probe_and_attach
Warner Losh [Sat, 22 Oct 2022 00:16:56 +0000 (18:16 -0600)]
geli: Move check for DEVT_DISK into geli_probe_and_attach

We only work on DEVT_DISK disks, so move that into the probe to drive
the point home better.

Sponsored by: Netflix

21 months agoLinuxKPI: 802.11: add changes to support debugfs in iwlwifi
Bjoern A. Zeeb [Sat, 22 Oct 2022 20:42:35 +0000 (20:42 +0000)]
LinuxKPI: 802.11: add changes to support debugfs in iwlwifi

Add new fields (also have to move a struct up, no changes there)
in order to make iwlwifi debugfs support compile.

Sposnored by: The FreeBSD Foundation
MFC after: 3 days

21 months agoiwlwifi: prepare to support debugfs
Bjoern A. Zeeb [Sat, 22 Oct 2022 17:40:17 +0000 (17:40 +0000)]
iwlwifi: prepare to support debugfs

Import two files left out initially from the driver needed for debugfs
support [1].  Adjust the driver further to make it compile on FreeBSD.
This is currently turned off and needs more LinuxKPI/lindebugfs work.
Being in the tree will allow us to collaboratively work on it and
then we can enable it for good.

Obtained from: Linux wireless-testing (tag: wt-2022-10-19) [1]
2c9078b9abcb884e27360340aaa7dfd4c0de29b3
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

21 months agoiwlwifi: constify another argument of iwl_print_hex_dump()
Bjoern A. Zeeb [Sat, 22 Oct 2022 17:33:18 +0000 (17:33 +0000)]
iwlwifi: constify another argument of iwl_print_hex_dump()

This is needed when enabling debugfs as it passes a const in which
would otherwise be dropped.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

21 months agosh: when loading profile, read only .sh files.
Dag-Erling Smørgrav [Tue, 18 Oct 2022 13:28:23 +0000 (15:28 +0200)]
sh: when loading profile, read only .sh files.

Reviewers: jilles, eugen_grosbein.net, cy

Subscribers: imp

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

21 months agolinprocfs: Add net/route.
John Grafton [Sat, 22 Oct 2022 10:52:58 +0000 (13:52 +0300)]
linprocfs: Add net/route.

PR: 266482
Reviewed by: melifaro, me
Differential revision: https://reviews.freebsd.org/D36949
MFC after: 1 week

21 months agox86/busdma: Limit reserved pages if low nsegs
Colin Percival [Fri, 21 Oct 2022 18:13:36 +0000 (11:13 -0700)]
x86/busdma: Limit reserved pages if low nsegs

When bus_dmamap_create is called, if bouncing might be required we
reserve enough pages for a maximum-length request, subject to the
MAX_BPAGES constraint (32 MB on amd64; 32 MB or 2 MB on i386
depending on the amount of RAM).

Since pages used for bouncing are typically non-consecutive, each
bounced page will typically constitute a busdma segment; as such, we
are unlikely to ever successfully use more pages than the nsegments
limit.  Limit the number of pages reserved to nsegments.

On FreeBSD/Firecracker, this reduces bounce page memory consumption
from 32 MB to 512 kB, making VMs with 128 MB of RAM usable.

Reviewed by: imp, mav
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D37082

21 months agortld: remove unused macro FPTR_TARGET
Konstantin Belousov [Sat, 22 Oct 2022 02:15:06 +0000 (05:15 +0300)]
rtld: remove unused macro FPTR_TARGET

It is a remnant from the ia64 removal

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

21 months agoctld: if adding a target fails, retry it on the next reload
Alan Somers [Wed, 12 Oct 2022 22:44:09 +0000 (16:44 -0600)]
ctld: if adding a target fails, retry it on the next reload

If the admin creates more CTL ports than kern.cam.ctl.max_ports, then
adding some will fail.  If he then removes some ports and does
"service ctld reload", he would expect that the new ports would get
added in the newly-freed port space. But they don't, because ctld
assigned them port numbers during their first creation attempts.

Fix this bug by removing newly created ports from ctld's internal list
if the kernel rejects them for any reason.  That way, a subsequent
config reload will attempt to add them again, possibly with new port
numbers.

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: jhb, mav
Differential Revision: https://reviews.freebsd.org/D36974

21 months agostabd/geli: Bail out if you can't get the disks size
Warner Losh [Fri, 21 Oct 2022 23:39:34 +0000 (17:39 -0600)]
stabd/geli: Bail out if you can't get the disks size

If the DIOCGMEDIASIZE ioctl fails, assume the disk doesn't have geli
encryption. While all disks should implement this, fail safe for disks /
partitions that do not.

Sponsored by: Netflix

21 months agoIncrease the maximum size of the journaled soft-updates journal.
Kirk McKusick [Fri, 21 Oct 2022 18:00:00 +0000 (11:00 -0700)]
Increase the maximum size of the journaled soft-updates journal.

The size of the journaled soft-updates journal should be big enough
to hold two minutes of filesystem metadata-update activity. The
maximum size of the soft updates journal was set in the 1990s. At
the time it was assummed that disk arrays would top out at 16 drives
and disk writes per drive would top out at 500 per second. Today's
I/O subsystems are considerably bigger and faster than those limits.
Thus this delta removes the hard upper limit and lets tunefs(8) and
newfs(8) set the upper bound based on the size of the filesystem and
its cylinder groups.

Sponsored by: The FreeBSD Foundation

21 months agoAdd a description of soft updates journaling to newfs(8).
Kirk McKusick [Fri, 21 Oct 2022 17:56:20 +0000 (10:56 -0700)]
Add a description of soft updates journaling to newfs(8).

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

PR:           261944
Sponsored by: The FreeBSD Foundation

21 months agow: cosmetic fixes.
Dag-Erling Smørgrav [Fri, 21 Oct 2022 16:37:44 +0000 (16:37 +0000)]
w: cosmetic fixes.

Sponsored by: Klara, Inc.

21 months agoarm64: Hyper-V: fix a commit error caused duplicated lines in vmbus_aarch64.c
Wei Hu [Fri, 21 Oct 2022 11:09:17 +0000 (11:09 +0000)]
arm64: Hyper-V: fix a commit error caused duplicated lines in vmbus_aarch64.c

Remove those duplicated lines.

Reported by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Fixes: 6cf00ef80c20148
Sponsored by: Microsoft

21 months agoarm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 2)
Souradeep Chakrabarti [Fri, 21 Oct 2022 09:35:11 +0000 (09:35 +0000)]
arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 2)

This is the second part of the ARM64 Hyper-V enablement.
These changes here are mostly with Make, release changes and also
changes required in vmbus.c hyperv.c and common files in hyperv.

Reviewed by: whu
Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D36467

21 months agoarm64: Hyper-V: vmbus: use the IRQ resource from vmbus_res
Souradeep Chakrabarti [Fri, 21 Oct 2022 07:49:28 +0000 (07:49 +0000)]
arm64: Hyper-V: vmbus: use the IRQ resource from vmbus_res

In ARM64 gen2 Hyper-V, use IRQ resource from vmbus_res, which is owning
the IRQ for current device tree. It allows the MMIO resource to be
successfully allocated for vmbus from parent acpi_syscontainer.
Reviewed by: whu
Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D37064

21 months agoxhci(4): Fix spelling in manual page.
Hans Petter Selasky [Fri, 21 Oct 2022 05:47:54 +0000 (07:47 +0200)]
xhci(4): Fix spelling in manual page.

Noted by: Gary Jennejohn <garyj@gmx.de>
MFC after: 1 week
Sponsored by: NVIDIA Networking

21 months agotcp: ECN preparations for ECN++, AccECN (tcp_respond)
Richard Scheffenegger [Thu, 20 Oct 2022 19:20:13 +0000 (21:20 +0200)]
tcp: ECN preparations for ECN++, AccECN (tcp_respond)

tcp_respond is another function to build a tcp control packet
quickly. With ECN++ and AccECN, both the IP ECN header, and
the TCP ECN flags are supposed to reflect the correct state.

Also ensure that on receiving multiple ECN SYN-ACKs, the
responses triggered will reflect the latest state.

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

21 months agoAdd me as ports committer, update mentor/mentee
Ronald Klop [Thu, 20 Oct 2022 10:19:23 +0000 (12:19 +0200)]
Add me as ports committer, update mentor/mentee

This completes step 7 from Committer's Guide.

Approved by: rene (mentor)
Differential Revision: https://reviews.freebsd.org/D37066

21 months agoxhci(4): Update list of quirks in manual page.
Hans Petter Selasky [Thu, 20 Oct 2022 17:22:41 +0000 (19:22 +0200)]
xhci(4): Update list of quirks in manual page.

MFC after: 1 week
Sponsored by: NVIDIA Networking

21 months agoxhci(4): Don't allocate an IRQ vector if hw.usb.xhci.use_polling=1 is set.
Hans Petter Selasky [Thu, 20 Oct 2022 17:21:53 +0000 (19:21 +0200)]
xhci(4): Don't allocate an IRQ vector if hw.usb.xhci.use_polling=1 is set.

This is useful for debugging purposes.

MFC after: 1 week
Sponsored by: NVIDIA Networking

21 months agoarm: Remove unused ffs.S
Warner Losh [Thu, 20 Oct 2022 15:34:56 +0000 (09:34 -0600)]
arm: Remove unused ffs.S

We've not used ffs.S since we retired armv[45] support. Remove it from
the tree.

Suggested by: andrew in D37069
Sponsored by: Netflix

21 months agoconf: Document why we have ARM64 and RISCV options
Warner Losh [Thu, 20 Oct 2022 15:29:33 +0000 (09:29 -0600)]
conf: Document why we have ARM64 and RISCV options

These are needed for the 'cpu ARM64' and 'cpu RISCV' options in these
architecture's config files. cpu lines are non-optional in config(8), so
we must define them here. There's no other use for them in the tree.

Sponsored by: Netflix

21 months agoarm: Fix name of config file in comment
Warner Losh [Thu, 20 Oct 2022 15:25:57 +0000 (09:25 -0600)]
arm: Fix name of config file in comment

This file was never named GENERICV6 in the FreeBSD tree. It entered the
tree in b9413b551268 as GENERIC.

Sponsored by: Netflix

21 months agoarm: Remove useless armv6/armv7 options
Warner Losh [Thu, 20 Oct 2022 15:02:28 +0000 (09:02 -0600)]
arm: Remove useless armv6/armv7 options

Cleanup another remnant of the armv4/armv5 support. Now that we always
define armv6 or armv7, these lines can be deleted (execpt hwpmc_armv7.c
which now needs just one line). Since we don't do anything different
between armv6 and armv7 from a config file selection point of view,
delete them from options.arm. We are extremely unlikely to grow anything
new here during the remaining lifetime of 32-bit arm in FreeBSD.

Sponsored by: Netflix
Reviewed by: kevans, andrew
Differential Revision: https://reviews.freebsd.org/D37069

21 months agoriscv: fix relocation handling for R_RISCV_64
Mitchell Horne [Thu, 20 Oct 2022 14:56:59 +0000 (11:56 -0300)]
riscv: fix relocation handling for R_RISCV_64

It requires the addend. In practice this doesn't seem to be a problem,
since relocations of this type are all with an addend of zero.
Obviously, we still want to handle this correctly if that ever changes.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37039

21 months agokldxref: handle R_RISCV_64 relocation
Mitchell Horne [Thu, 20 Oct 2022 14:56:01 +0000 (11:56 -0300)]
kldxref: handle R_RISCV_64 relocation

These are emitted in at least two kmods, and kldxref prints a warning.
While here, remove the unneeded local variable 'val'.

Reviewed by: jrtc27, imp, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37038

21 months agoriscv: reject CPUs with mmu-type "riscv,none"
Mitchell Horne [Thu, 20 Oct 2022 14:57:43 +0000 (11:57 -0300)]
riscv: reject CPUs with mmu-type "riscv,none"

According to riscv/cpus.yaml in the device-tree docs, this property may
exist but indicate that the CPU does not have an MMU. Detect this
possibility.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36980

21 months agoriscv: drop a dead declaration
Mitchell Horne [Wed, 12 Oct 2022 20:03:29 +0000 (17:03 -0300)]
riscv: drop a dead declaration

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

21 months agoAdd random VMware device IDs.
Alexander Motin [Thu, 20 Oct 2022 14:19:24 +0000 (10:19 -0400)]
Add random VMware device IDs.

Just to make dmesg look nicer there.

MFC after: 1 week

21 months agoinpcb: provide pcbinfo pointer argument to inp_apply_all()
Gleb Smirnoff [Wed, 19 Oct 2022 22:15:53 +0000 (15:15 -0700)]
inpcb: provide pcbinfo pointer argument to inp_apply_all()

Allows to clear inpcb layer of TCP knowledge.

21 months agoinpcb: garbage collect so_sototcpcb()
Gleb Smirnoff [Wed, 19 Oct 2022 22:15:53 +0000 (15:15 -0700)]
inpcb: garbage collect so_sototcpcb()

It had very little use and required inpcb layer to know tcpcb.

21 months agocxgbe: include headers required to include t4_tom.h
Gleb Smirnoff [Wed, 19 Oct 2022 22:15:53 +0000 (15:15 -0700)]
cxgbe: include headers required to include t4_tom.h

Before the change we would get struct tcpcb forward declaration
only with help of pollution via in_pcb.h.

21 months agocxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb
Gleb Smirnoff [Wed, 19 Oct 2022 22:15:32 +0000 (15:15 -0700)]
cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb

Reviewed by: np
Differential revision: https://reviews.freebsd.org/D37041

21 months agopmc: remove write-only variable
Pawel Biernacki [Wed, 19 Oct 2022 20:59:23 +0000 (20:59 +0000)]
pmc: remove write-only variable

21 months agontp: retire now-unused MIPS cases
Ed Maste [Mon, 17 Oct 2022 18:20:15 +0000 (14:20 -0400)]
ntp: retire now-unused MIPS cases

21 months agouma: Never pass cache zones to memguard
Mark Johnston [Wed, 19 Oct 2022 18:27:49 +0000 (14:27 -0400)]
uma: Never pass cache zones to memguard

Items allocated from cache zones cannot usefully be protected by
memguard.

PR: 267151
Reported and tested by: pho
MFC after: 1 week

21 months agotmpfs: report minimal hole size
Konstantin Belousov [Mon, 17 Oct 2022 17:46:22 +0000 (20:46 +0300)]
tmpfs: report minimal hole size

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37024

21 months agotmpfs: implement FIOSEEKDATA and FIOSEEKHOLE
Konstantin Belousov [Mon, 17 Oct 2022 15:26:43 +0000 (18:26 +0300)]
tmpfs: implement FIOSEEKDATA and FIOSEEKHOLE

providing the support for lseek(2) SEEK_DATA and SEEK_HOLE.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37024

21 months agoAdd vm_page_any_valid()
Konstantin Belousov [Tue, 18 Oct 2022 09:16:36 +0000 (12:16 +0300)]
Add vm_page_any_valid()

Use it and several other vm_page_*_valid() functions in more places.

Suggested and reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37024

21 months agoswap_pager_find_least(): assert that the function is called on the right object type
Konstantin Belousov [Tue, 18 Oct 2022 08:21:14 +0000 (11:21 +0300)]
swap_pager_find_least(): assert that the function is called on the right object type

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37024