]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolibc __sfvwrite(): roll back FILE buffer pointer on fflush error
Konstantin Belousov [Sun, 6 Mar 2022 08:59:39 +0000 (10:59 +0200)]
libc  __sfvwrite(): roll back FILE buffer pointer on fflush error

__sfvwrite() advances the pointer before calling fflush.  If fflush()
fails, it is not enough to roll back inside it, because we cannot know
how much was advanced by the caller.

Reported by: Peter <pmc@citylink.dinoex.sub.org>
Approved by: re (gjb)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Fixes: 86a16ada1ea608408cec370171d9f59353e97c77

(cherry picked from commit bafaa70b6f9098d83d074968c8e6747ecec1e118)
(cherry picked from commit 647f02d68a60b66d063a15feed3c817966114d52)

2 years agobuf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS
Konstantin Belousov [Wed, 16 Feb 2022 15:30:17 +0000 (17:30 +0200)]
buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS

Despite the buffer taken from cache or free list, it still can be
locked, due to 'lockless lookup' in getblkx() potentially operating on
the freed buffers.  The lock is transient, but prevents the use of
LK_NOWAIT there for the goal of neutralizing WITNESS.

Just use LK_NOWITNESS.

Reported and tested by: pho
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1fb00c8f1060e18fed621f13d31db7b336d2267e)
(cherry picked from commit dd54e44a279fab567374d2eec9dd9cd6d04b7a43)

2 years agozfs: merge openzfs/zfs@ef83e07db (zfs-2.1-release) into releng/13.1
Martin Matuska [Fri, 11 Mar 2022 07:11:42 +0000 (08:11 +0100)]
zfs: merge openzfs/zfs@ef83e07db (zfs-2.1-release) into releng/13.1

OpenZFS release 2.1.3

Notable upstream pull request merges:
  #12569 FreeBSD: Really zero the zero page
  #12828 FreeBSD: Add vop_standard_writecount_nomsyn
  #12828 zfs: Fix a deadlock between page busy and the teardown lock
  #12828 FreeBSD: Catch up with more VFS changes
  #12851 FreeBSD: Provide correct file generation number
  #12857 Verify dRAID empty sectors
  #12874 FreeBSD: Update argument types for VOP_READDIR
  #12896 Reduce number of arc_prune threads
  #12934 FreeBSD: Fix zvol_*_open() locking
  #12961 FreeBSD: Fix leaked strings in libspl mnttab
  #12964 Fix handling of errors from dmu_write_uio_dbuf() on FreeBSD
  #12981 Introduce a flag to skip comparing the local mac when
         raw sending
  #12985 Avoid memory allocations in the ARC eviction thread
  #13014 Report dnodes with faulty bonuslen
  #13016 FreeBSD: Fix zvol_cdev_open locking
  #13027 Fix clearing set-uid and set-gid bits on a file when
         replying a write
  #13031 Add enumerated vdev names to 'zpool iostat -v' and
         'zpool list -v'
  #13074 Enable encrypted raw sending to pools with greater ashift
  #13076 Receive checks should allow unencrypted child datasets
  #13098 Avoid dirtying the final TXGs when exporting a pool
  #13172 Fix ENOSPC when unlinking multiple files from full pool

Obtained from: OpenZFS
OpenZFS commit: ef83e07db53e5d1017d3afbf376f4dbb2f6feada
OpenZFS tag: zfs-2.1.3
Relnotes: yes

(cherry picked from commit bd2e56ef47d5a2c69f6f8e092abfd27a4d469d1e)

Approved by: re (delphij)

2 years ago13.1: create releng/13.1 branch
Glen Barber [Thu, 10 Mar 2022 00:10:32 +0000 (19:10 -0500)]
13.1: create releng/13.1 branch

Update from PRERELEASE to BETA1
Switch pkg(8) configuration to use the quarterly repository
Bump __FreeBSD_version

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agocxgbe(4): dump_devlog should never fail silently.
Navdeep Parhar [Mon, 7 Mar 2022 19:17:05 +0000 (11:17 -0800)]
cxgbe(4): dump_devlog should never fail silently.

Do the same thing as dump_cimla and log a warning on failure.

Sponsored by: Chelsio Communications

(cherry picked from commit 9282f04ff0ee89cc4064e510f7fa505cfc890bf0)

2 years agotests: readlink: fix atf_test_case call [NFC]
Kyle Evans [Fri, 4 Mar 2022 03:48:21 +0000 (21:48 -0600)]
tests: readlink: fix atf_test_case call [NFC]

This was meant to read `basic`, rather than a duplicate of `f_flag`.  It
is largely irrelevant, though, as atf_test_case mostly just makes
sure that the proper functions are defined.

(cherry picked from commit 0e73b834f32224e3652f61e598c19f572a20cca3)

2 years agocp: Make -P work without -R as per POSIX
Cameron Katri [Wed, 23 Feb 2022 18:55:13 +0000 (12:55 -0600)]
cp: Make -P work without -R as per POSIX

According to POSIX, cp should allow the `-P` flag to work whether `-R`
is specified or not.  Currently, the `-P` option only works along with
`-R`.

PR: 199466

(cherry picked from commit 97e13037915c22162f199461f56951793d669f57)

2 years agocp: fix -R with links
Kyle Evans [Thu, 27 Jan 2022 18:02:17 +0000 (12:02 -0600)]
cp: fix -R with links

The traversal was previously not properly honoring -H/-L/-P.  Notably,
we should not have been resolving symlinks encountered during traversal
when either -H or -P are specified.

(cherry picked from commit 33ad990ce974be50abdc25427b0f365699d83a34)

2 years agolualoader: fix the autoboot_delay countdown message
Katsuyuki Miyoshi [Tue, 26 Oct 2021 16:21:34 +0000 (11:21 -0500)]
lualoader: fix the autoboot_delay countdown message

When the timer drops from double to single digits, a spare 'e' is left
on the end of the line as we don't overwrite it. Include an extra space
at the end to account for this and overwrite the leftover character.

PR: 259429

(cherry picked from commit bb4c691299c5d699cea29e18fef96bda1cef13da)

2 years agoAdd support for jail.conf.d
Antranig Vartanian [Wed, 8 Sep 2021 07:07:49 +0000 (02:07 -0500)]
Add support for jail.conf.d

Using /etc/jail.{jailname}.conf is nice, however it makes /etc/ very
messy if you have many jails.  This patch allows one to move these
config files out of the way into /etc/jail.conf.d/{jailname}.conf.

Note that the same caveat as /etc/jail.*.conf applies: the jail service
will not autodiscover all of these for starting 'all' jails.  This is
considered future work, since the behavior matches.

(cherry picked from commit 7955efd574b98601a95da45d6d8e7f452631fddd)

2 years agolibpmc: Allow specifying explicit EVENT_xxH events on armv7 and arm64
Jessica Clarke [Tue, 15 Feb 2022 16:10:34 +0000 (16:10 +0000)]
libpmc: Allow specifying explicit EVENT_xxH events on armv7 and arm64

This is useful for processors where we don't have an event table; in
those cases we default to a Cortex A8 (armv7) or Cortex A53 (arm64) in
order to attempt to provide something useful, but you're then limited to
the counters in those tables, some of which may also not be implemented
(e.g. LD/ST_RETIRED are no longer implemented in more recent cores,
replaced by LD/ST_SPEC).

Adding the raw EVENT_xxH event lists to each table ensures that you can
always request the exact events you want, regardless of what has been
detected or is known.

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

(cherry picked from commit 9f22e0959b1e2e3c9450f8b495d2c0c86699eb18)

2 years agoUpdate smartqpi driver to vendor's latest submission
Warner Losh [Wed, 9 Mar 2022 00:01:04 +0000 (17:01 -0700)]
Update smartqpi driver to vendor's latest submission

Newly added features & bug fixes

o Fixed an issue smartpqi debug log messages are flooding kernel logs.
o Fixed an issue where devices are shown as RAID 0 in display info.
o Feature: Changed 32 bit dma address to 64 bit address
o Added new controlller ids.

Submitted by: Microsemi
Reviewed by: Scott Benesh (Microsemi), imp
Differential Revision: https://reviews.freebsd.org/D34469
MFC After: 3 days

Sponsored by: Netflix

(cherry picked from commit 4f77349d5777c8ac504387e7e6d37c13da222294)

2 years agoFix "set but not used" in smartpqi. The PCI_MEM macros don't require a
Scott Long [Sat, 26 Feb 2022 17:25:43 +0000 (10:25 -0700)]
Fix "set but not used" in smartpqi.  The PCI_MEM macros don't require a
physical/absolute address in FreeBSD, but it looks like the calling
code might be somewhat portable to other OS's that do require this.
Therefore, set the variables to __unused instead of removing the code
entirely.

(cherry picked from commit e28289ca83673d753b7e479810947f6a1015ad39)

2 years agocamcontrol fwdownload minor improvements
Warner Losh [Tue, 22 Feb 2022 21:25:32 +0000 (14:25 -0700)]
camcontrol fwdownload minor improvements

Minor improvements to the fwdownload code suggested by chs@:
o Print the path_id/target we're rescanning so it's not invisible
o No need for XPT_GDEVLIST, all the info is filled in. Remove sending it
  as well as a comment related to it from a mistaken observation. libcam
  always fills these in properly, so use those for the ccb path/target.
o Don't leak /dev/xpt fd in success cases.
o Rename fw_rescan_lun to fw_rescan_target and pass sim_mode to
  only print path_id and target_id info.

Reviewed by: chs@
Fixes: 9835900cb95bcd068774934961fb1419719d595b
Sponsored by: Netflix
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D34348

(cherry picked from commit 78fbaa1fac2677feeb2094048d77587a2ab80d11)

2 years agosmartpqi: Remove stray declaration
Warner Losh [Thu, 3 Jun 2021 23:44:27 +0000 (17:44 -0600)]
smartpqi: Remove stray declaration

pqisrc_is_firmware_feature_enabled shouldn't be declared inline in a
header, and then static inline in the .c function. Remove this stray
declartion from the header. gcc6 complains, but clang does not.

Sponsored by: Netflix

(cherry picked from commit eae2ef5a010366c673ad912cae23b426ebb9a8a2)

2 years agobio: make _bio_cflags match bio_cflags
Warner Losh [Wed, 23 Feb 2022 21:28:16 +0000 (14:28 -0700)]
bio: make _bio_cflags match bio_cflags

While none of the in-tree geoms that modify the bio_cflags use the top
half of the word, were they to do this in the future, we'd hit false
positives for DIAGNOSTIC kernels. Make both uint16_t.

MFC After: 1 week
Sponsored by: Netflix

(cherry picked from commit 077ab5bd43aaeb955d84c501ddddc7533f0a06b9)

2 years agodtc.1: Mention the existence of -i flag
Jose Luis Duran [Sat, 19 Feb 2022 13:43:18 +0000 (10:43 -0300)]
dtc.1: Mention the existence of -i flag

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

(cherry picked from commit 62d16ad37df7d9efb6e329c9e7ca1fc3975a1966)

2 years agodtc.1: Appease mandoc -T lint
Jose Luis Duran [Sat, 19 Feb 2022 13:47:31 +0000 (10:47 -0300)]
dtc.1: Appease mandoc -T lint

Prefer .Fx to bare FreeBSD

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

(cherry picked from commit 7ae5d1f00f8770b53a631d16c4be7a7cad7b477d)

2 years agolibefivar: Correct the string expression of UTF8 vendor device path
Jose Luis Duran [Tue, 22 Feb 2022 11:39:03 +0000 (08:39 -0300)]
libefivar: Correct the string expression of UTF8 vendor device path

According to UEFI spec, the string expression of UTF8 vendor
device node should be displayed as: VenUtf8(). Current code
display it as: VenUft8() by mistake when convert device
path node to text.

This commit is to fix this bug.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1225
Obtained from: https://github.com/tianocore/edk2/commit/959be180e185869b71db9dad34c3f4bba660d724
Pull Request: https://github.com/freebsd/freebsd-src/pull/580

(cherry picked from commit 91a35e5803bef59b8ca67b0621216124cc2e42f8)

2 years agocamcontrol: Force a rescan of the lun after firmware download.
Warner Losh [Tue, 22 Feb 2022 17:34:36 +0000 (10:34 -0700)]
camcontrol: Force a rescan of the lun after firmware download.

After downloading the firmware to a device, it's inquiry data likely
will change. Force a rescan of the target with the CAM_EXPECT_INQ_CHANGE
flag to get it to record the new inqury data as being expected. This
avoids the need for a 'camcontrol rescan' on the device which detaches
and re-attaches the disk (da, ada) device. This brings fwdownload up to
nvmecontrol's ability to do the same thing w/o changing the exposed
nvme/nvd/nda device. We scan the target and not the LUN because dual
actuator drives have multiple LUNs, but the firmware is global across
many vendors' drives (and the so far theoretical ones that aren't won't
be harmed by the rescan).

Since the underlying struct disk is now preserved accross this
operation, it's now possible to upgrade firmware of a root device w/o
crashing the system.  On systems that are quite busy, the worst that
happens is that certain operaions are reported cancelled when the new
firmware is activated. These operations are retried with the normal CAM
recovery mechanisms and will work on the retry. The only visible hiccup
is the time that new firmware is flashing / initializing. One should not
consider this operation completely risk free, however, since not all
drives are well behaved after a firmware download.

MFC After: 1 week
Relnotes: yes
Sponsored by: Netflix
Feedback by: mav
Differential Revision: https://reviews.freebsd.org/D34325

(cherry picked from commit 9835900cb95bcd068774934961fb1419719d595b)

2 years agousb(4): Don't skip calling uhub_explore_sub() even on HUB port errors.
Hans Petter Selasky [Tue, 8 Mar 2022 18:57:38 +0000 (19:57 +0100)]
usb(4): Don't skip calling uhub_explore_sub() even on HUB port errors.

This should fix an issue where the "udev->re_enumerate_wait" field never gets
processed and reset. In this case usbconfig will wait forever and never return.

Sponsored by: NVIDIA Networking

(cherry picked from commit c7cd6f809d2ce6b7d331717c31ce51c631ae00d7)

2 years agomlx5/mlx4: Bump driver version to 3.7.1
Hans Petter Selasky [Tue, 8 Mar 2022 11:16:00 +0000 (12:16 +0100)]
mlx5/mlx4: Bump driver version to 3.7.1

Sponsored by: NVIDIA Networking

(cherry picked from commit b18c510844fb631ea571f7f3edad6372e91501fa)

2 years agou3g(4): Add new USB IDs.
Hans Petter Selasky [Tue, 8 Mar 2022 10:02:52 +0000 (11:02 +0100)]
u3g(4): Add new USB IDs.

Submitted by: Matthew Luckie <mjl@luckie.org.nz>
Sponsored by: NVIDIA Networking

(cherry picked from commit a75444c14304e63a3b0369d01c86a077e98fc9f9)

2 years agofusefs: fix a cached attributes bug during directory rename
Alan Somers [Tue, 22 Feb 2022 05:00:42 +0000 (22:00 -0700)]
fusefs: fix a cached attributes bug during directory rename

When renaming a directory into a different parent directory, invalidate
the cached attributes of the new parent.  Otherwise, stat will show the
wrong st_nlink value.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D34336

(cherry picked from commit e8553be9bcfc2c0d78e9f379bd166dc0a9cae719)

2 years agoAdd serial-number to hw.fdt sysctl area if found in fdt.
Mike Karels [Wed, 23 Feb 2022 20:42:30 +0000 (14:42 -0600)]
Add serial-number to hw.fdt sysctl area if found in fdt.

Add serial-number sysctl if that fdt property exists and is a printable
string.  While here, ensure that the hw.fdt sysctl values fit in the
buffers provided so that they will be NUL-terminated.  Tested on
Raspberry Pi 3B+ and 4.

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

(cherry picked from commit b8b0c65e8a43cab95b97e28d3e3d73fc7d9c0a5e)

2 years agofdt: Expose the model, compatible and freebsd dts brandind as sysctl
Emmanuel Vadot [Sat, 17 Jul 2021 15:19:22 +0000 (17:19 +0200)]
fdt: Expose the model, compatible and freebsd dts brandind as sysctl

This make it easier for script to get the hardware on which they are running.

Sponsored by: Diablotin Systems
Differential Revision:   https://reviews.freebsd.org/D31205
Reviewed by:    imp
Should be ok on powerpc:  jhibbits (over irc)

(cherry picked from commit 50e0dc0c4b46ee62b898ce2d92e52be4f77383d9)

2 years agodtrace tests: Fix expected outout for tst.system.d
Li-Wen Hsu [Wed, 9 Mar 2022 03:39:12 +0000 (11:39 +0800)]
dtrace tests: Fix expected outout for tst.system.d

This is follow up of d500a85e640d1cd270747c12e17c511b53864436

PR: 262415
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 16e02ae401ebd9aa7d47f46dc4905f4f8add70a8)

2 years agostats.7: Fix a typo
Mateusz Piotrowski [Fri, 4 Mar 2022 11:35:55 +0000 (12:35 +0100)]
stats.7: Fix a typo

MFC after: 3 days

(cherry picked from commit 5d3007c1a26966f6c61ba50bea180c2f89f32ff8)

2 years agozfs: Update test format strings to match variable typtes
Ed Maste [Mon, 28 Feb 2022 01:11:20 +0000 (20:11 -0500)]
zfs: Update test format strings to match variable typtes

And drop stray 'd' from the end of some printed numbers.  I assume this
was the result of someone thinking u is a printf length modifier for d,
not a format specifier itself.

Reviewed by: kevans, rew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34387

(cherry picked from commit f27fb06cadc6a8e75ebebd3b60c8a9dc9ae1b833)

2 years agopowerpc: enable initial-exec TLS
Piotr Kubaj [Fri, 18 Feb 2022 13:22:14 +0000 (14:22 +0100)]
powerpc: enable initial-exec TLS

Summary:
Use initial-exec, like other architectures.

While here, switch MACHINE_ARCH in lib/libc/Makefile to LIBC_ARCH and consistently use powerpc.

Subscribers: imp, #contributor_reviews_base

Differential Revision: https://reviews.freebsd.org/D34315
Reviewed by: luporl
MFC after: 2 weeks

(cherry picked from commit 884ba43116d4456d5900d3c8824153c604f132b8)

2 years agoopenssh: Add a note to check for deprecated and removed config options
Mark Johnston [Tue, 1 Mar 2022 14:36:23 +0000 (09:36 -0500)]
openssh: Add a note to check for deprecated and removed config options

Suggested by: emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9340d69e57764c6ead568dbf14a859d184c35b8e)

2 years agorelease: Remove references to ChallengeResponseAuthentication
Mark Johnston [Tue, 1 Mar 2022 13:54:55 +0000 (08:54 -0500)]
release: Remove references to ChallengeResponseAuthentication

This sshd_config keyword was replaced by KbdInteractiveAuthentication in
openssh 8.7, though ChallengeResponseAuthentication is silently accepted
as an alias.  However, this means that the code in ec2.conf which
modifies a commented-out line no longer does anything.  Apply a minimal
fix.

Reviewed by: cperciva, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c1b656ac55eca1fc191225bd715b31ff25be9031)

2 years agoix(4): Add control of 2.5/5G autonegotiation speeds
Piotr Pietruszewski [Fri, 4 Mar 2022 18:37:59 +0000 (10:37 -0800)]
ix(4): Add control of 2.5/5G autonegotiation speeds

This change enables the user to control 2.5G and 5G autonegotiation
speeds via advertise_speed sysctl for X550T devices. Due to reported
interoperability issues with switches, 2.5G and 5G speeds will not be
advertised by default.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Co-authored-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Tested by: gowtham.kumar.ks@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D26245

(cherry picked from commit d381c807510de2ebb453a563540bd17e344a2aab)

2 years agoixv(4): Allow PF to control the VF link state
Piotr Pietruszewski [Fri, 4 Mar 2022 18:33:02 +0000 (10:33 -0800)]
ixv(4): Allow PF to control the VF link state

This patch adds checks of a VF link state provided by PF via mailbox
API. Such change enables the PF to disable a VF administratively.

Since command needed by the PF to control the VF is introduced in
mailbox api version 1.2, this patch also bumps supported mailbox api
version to 1.2.

Co-authored-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed By: kbowling@
Tested by: lukasz.szczepaniak@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D32004

(cherry picked from commit a3e719bbc21a56230a5b8adeb4c531a6dfb77940)

2 years agoice(4): Update to 1.34.2-k
Eric Joyner [Fri, 4 Mar 2022 18:25:25 +0000 (10:25 -0800)]
ice(4): Update to 1.34.2-k

- Adds FW logging support
  - Once enabled, this lets the firmware print event and error messages
    to the log, increasing the visibility into what the hardware is
    doing; this is useful for debugging
- General bug fixes
- Adds inital DCB support to the driver
  - Notably, this adds support for DCBX to the driver; now with the
    fw_lldp sysctl set to 1, the driver and adapter will adopt a DCBX
    configuration sent from a link partner
  - Adds statistcs sysctls for priority flow control frames
  - Adds new configuration sysctls for DCB-related features: (VLAN) user
    priority to TC mapping; ETS bandwidth allocation; priority flow
    control
- Remove unused SR-IOV files (until support gets added)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Tested by: jeffrey.e.pieper@intel.com
MFC after: 3 days
MFC with: 213e91399be438f0a975
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D34024

(cherry picked from commit 56429daea255fa719169bb23ded66f8edb6f5408)
(cherry picked from commit 61d83041ab111fe491409f2eca2b528108b9ec29)

2 years agoice_ddp: Update to 1.3.27.0
Eric Joyner [Wed, 1 Dec 2021 20:48:36 +0000 (12:48 -0800)]
ice_ddp: Update to 1.3.27.0

This is intended to be used with forthcoming ice(4) driver version 1.34.2.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

(cherry picked from commit e438f0a97538bf5cf6f3ff70a65c4d1f96b766aa)

2 years agoiflib: Allow drivers to determine which queue to TX on
Eric Joyner [Thu, 29 Jul 2021 23:24:14 +0000 (16:24 -0700)]
iflib: Allow drivers to determine which queue to TX on

Adds a new function pointer to struct if_txrx in order to allow
drivers to set their own function that will determine which queue
a packet should be sent on.

Since this includes a kernel ABI change, bump the __FreeBSD_version
as well.

(This motivation behind this is to allow the driver to examine the
UP in the VLAN tag and determine which queue to TX on based on
that, in support of HW TX traffic shaping.)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@, stallamr@netapp.com
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D31485

(cherry picked from commit 213e91399b7998554d787bb290109ebe602aa279)

2 years agopowerpc: enable ice in GENERIC64LE
Piotr Kubaj [Thu, 20 Jan 2022 21:32:02 +0000 (22:32 +0100)]
powerpc: enable ice in GENERIC64LE

Approved by: erj
Differential Revision: https://reviews.freebsd.org/D33974

(cherry picked from commit a0f3abb098799ec05b6dd8a40363b1093cf81d49)

2 years agoixl(4): Remove unused function declaration
Eric Joyner [Wed, 12 Jan 2022 23:37:42 +0000 (15:37 -0800)]
ixl(4): Remove unused function declaration

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

(cherry picked from commit 0e8181c01237141ed94d2efbb5b7efae39e6232e)

2 years agoiavf(4): Include RSS header file when RSS is defined
Eric Joyner [Fri, 3 Dec 2021 20:02:42 +0000 (12:02 -0800)]
iavf(4): Include RSS header file when RSS is defined

This should unbreak the kernel build when "options RSS" is
defined in the kernel configuration, and make the feature work.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reported by: adrian@
Sponsored by: Intel Corporation

(cherry picked from commit 5577aa338a675f2a465a58356894fbe24ba20407)

2 years agoixl(4): Remove iavf(4) source files
Eric Joyner [Sat, 13 Feb 2021 00:04:54 +0000 (16:04 -0800)]
ixl(4): Remove iavf(4) source files

Since iavf(4) no longer shares code with ixl(4) as of commit
f2fbd56a8d07665bc0a5e8b7e40026b50a591e2a and now has its own directory,
remove these now-unused iavf(4)-only files.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28638

(cherry picked from commit 409b36ad911d0a12a45c1488369b458965691379)

2 years agoiavf(4): Split source and update to 3.0.26-k
Eric Joyner [Fri, 12 Feb 2021 21:28:18 +0000 (13:28 -0800)]
iavf(4): Split source and update to 3.0.26-k

The iavf(4) driver now uses a different source base from ixl(4), since
it will be the standard VF driver for new Intel Ethernet products going
forward, including ice(4). It continues to use the iflib framework
for network drivers.

Since it now uses a different source code base, this commit adds a new
sys/dev/iavf entry, but it re-uses the existing module name so no
configuration changes are necessary.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@
Tested by: lukasz.szczepaniak@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28636

(cherry picked from commit ca853dee3b8f26f53d48d685f32ec0b8396369e8)

2 years agoice(4): Update to version 0.29.4-k
Eric Joyner [Wed, 23 Jun 2021 20:41:54 +0000 (13:41 -0700)]
ice(4): Update to version 0.29.4-k

Includes various feature improvements and bug fixes.

Notable changes include:
- Firmware logging support
- Link management flow changes
- New sysctl to report aggregated error counts
- Health Status Event reporting from firmware (Use the new read-only
  tunables hw.ice.enable_health_events / dev.ice.#.enable_health_events
  to turn this off)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

(cherry picked from commit 9cf1841c4aaf8fbab06132ab9f76094f34ad7c7b)

2 years agoice_ddp: Update to 1.3.24.0
Eric Joyner [Fri, 25 Jun 2021 17:20:24 +0000 (10:20 -0700)]
ice_ddp: Update to 1.3.24.0

This version is intended to be used with the 0.29.4 version of the
ice(4) driver, which will be be committed afterwards.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: stallamr_netapp.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D30887

(cherry picked from commit 538ef055b7ea11326ba22197537e617587a0d677)
(cherry picked from commit 070f7812da16b692d4e65fdfd418654fdb42729d)

2 years agoFix ifa refcount leak in ifa_ifwithnet()
Ryan Stone [Thu, 11 Feb 2021 16:17:58 +0000 (11:17 -0500)]
Fix ifa refcount leak in ifa_ifwithnet()

In 4f6c66cc9c75c8, ifa_ifwithnet() was changed to no longer
ifa_ref() the returned ifaddr, and instead the caller was required
to stay in the net_epoch for as long as they wanted the ifaddr
to remain valid.  However, this missed the case where an AF_LINK
lookup would call ifaddr_byindex(), which still does ifa_ref()
the ifaddr.  This would cause a refcount leak.

Fix this by inlining the relevant parts of ifaddr_byindex() here,
with the ifa_ref() call removed.  This also avoids an unnecessary
entry and exit from the net_epoch for this case.

I've audited all in-tree consumers of ifa_ifwithnet() that could
possibly perform an AF_LINK lookup and confirmed that none of them
will expect the ifaddr to have a reference that they need to
release.

MFC after: 2 months
Sponsored by: Dell Inc
Differential Revision: https://reviews.freebsd.org/D28705
Reviewed by: melifaro

(cherry picked from commit 5adea417d494b9c0e186cf2d06f98873d02d1834)

2 years agovt_vga: fix colour in pixel blocks with more than 4 colours
Ed Maste [Wed, 2 Mar 2022 16:40:00 +0000 (11:40 -0500)]
vt_vga: fix colour in pixel blocks with more than 4 colours

VGA hardware provides many different graphics and data access modes,
each with different capabilities and limitations.

VGA vt(4) graphics mode operates on blocks of pixels at a time.  When a
given pixel block contains only two colours the vt_vga driver uses write
mode 3.  When the block contains more than two colours it uses write
mode 0.  This is done because two-colour write mode 3 is much more
efficient.

In practice write mode 3 is used most of the time, as there is often a
single foreground colour and single background colour across the entire
console.  One common exception requiring the use of mode 0 is when the
mouse cursor is drawn over a background other than black, as we need
black and white for the cursor in addition to the background colour.

VGA's default 16-colour palette provides the same set of colours as the
system console, but in a different order.  Previously we configured a
non-default VGA palette that had the same colours at the same indexes.
However, this caused anything drawn before the kernel started (drawn by
the loader, for instance) to change colours once the kernel configured
the new, non-default palette.

In 5e251aec8636 we switched to leaving the default VGA palette in place,
translating console colour indexes to VGA colour indexes as necessary.
This translation was missed for the write mode 0 case for pixel blocks
with more than two colours.

PR: 261751
Reviewed by: adrian
MFC after: 1 week
Fixes: 5e251aec8636 ("vt(4): Use default VGA palette")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34412

(cherry picked from commit f266082f113a6a110c28034c64693c2cc216fd9d)

2 years agovt(4): note that VGA palette configuration is not supported
Ed Maste [Thu, 3 Mar 2022 22:01:44 +0000 (17:01 -0500)]
vt(4): note that VGA palette configuration is not supported

PR: 261311
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34431

(cherry picked from commit b126b79b27d479a3bd91e7f58f95ba8ce6b5655a)

2 years agovt_vga: Correct "plane" spelling
Ed Maste [Wed, 2 Mar 2022 14:08:25 +0000 (09:08 -0500)]
vt_vga: Correct "plane" spelling

I suspect the variable names and comments were accidentally French.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 731a929ac908774cdb74f0444b075be6248190bd)

2 years agovt: whitespace and style(9) updates
Ed Maste [Tue, 22 Feb 2022 21:30:27 +0000 (16:30 -0500)]
vt: whitespace and style(9) updates

(cherry picked from commit 327da507f9df0eb4ab3b5621c5a38fb90d250e02)

2 years agosdhci_xenon: remove redundant code in property parsing
Bartlomiej Grzesik [Thu, 15 Jul 2021 15:20:46 +0000 (17:20 +0200)]
sdhci_xenon: remove redundant code in property parsing

Remove redundant ofw property parsing in driver code, is already
taken care of in mmc_fdt_helpers.

Move ofw parsing to attach method.

Reviewed by: manu
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D31409

(cherry picked from commit 6ad816a999171874c36c73d5794d0d25ff8fd311)

2 years agosdhci_xenon: add AP807 compatible string
Bartlomiej Grzesik [Wed, 14 Jul 2021 12:47:40 +0000 (14:47 +0200)]
sdhci_xenon: add AP807 compatible string

This patch adds compatible string for xenon controller found on
AP807 north brige. It is fully compatible with existing driver.

Reviewed by: manu
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D31407

(cherry picked from commit 1b9ce0885e5f53ea5818ee593babf11f6b5d5761)

2 years agosdhci_xenon: add UHS support
Marcin Wojtas [Tue, 4 May 2021 23:47:37 +0000 (01:47 +0200)]
sdhci_xenon: add UHS support

This patch adds the necessary methods resolution to the sdhci_xenon
driver which are required to configure UHS modes for SD/MMC devices.
Apart from the two generic routines, the custom sdhci_xenon_set_uhs_timing
function is responsible for setting the SDHCI_HOST_CONTROL2 register
with appropriate mode select values - in case of HS200 and HS400
they are non-standard.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30565
MFC after: 2 weeks

(cherry picked from commit 4fa977f854e27c93c22acfa6a3ba38f5c4959e15)

2 years agosdhci_xenon: improve the VCCQ voltage switch sequence
Marcin Wojtas [Thu, 27 May 2021 18:39:12 +0000 (20:39 +0200)]
sdhci_xenon: improve the VCCQ voltage switch sequence

Improve the VCCQ voltage switch, so that to properly
handle the SDHCI_HOST_CONTROL2 register signaling
flags and along with manipulating the regulator.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30564
MFC after: 2 weeks

(cherry picked from commit c80e2ca57e0c1b3647b55471584c6d32214232ea)

2 years agosdhci_xenon: allow to properly disable the UHS signaling
Marcin Wojtas [Thu, 27 May 2021 17:48:17 +0000 (19:48 +0200)]
sdhci_xenon: allow to properly disable the UHS signaling

Until now the "no-1-8-v" DT flag wrongly disabled the SDHCI_CAN_VDD_180
- slot 1.8V power supply capability, whereas it refers to the signaling
voltage. Fix the sdhci_xenon_read_4 and allow to disable the UHS modes
depending on the DT property or PHY slow mode. While at it - make sure
the unsupported 1.2V signaling is always disabled and not reported
in the bootverbose log.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30563
MFC after: 2 weeks

(cherry picked from commit df868762841b93d934413651818e510ea443def8)

2 years agosdhci_xenon: enable MMC FDT parsing
Marcin Wojtas [Sat, 1 May 2021 07:55:06 +0000 (09:55 +0200)]
sdhci_xenon: enable MMC FDT parsing

The mmc_fdt_parse allows to parse more MMC-related
FDT properties. Start using it. "wp-inverted" property,
VQMMC and newly added VMMC power supply parsing
is now done in a generic code.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30562
MFC after: 2 weeks

(cherry picked from commit 43e31350f8f67087b641d85520e20176e152dda7)

2 years agosdhci: allow setting MMC capabilities before sdhci_init_slot
Marcin Wojtas [Tue, 4 May 2021 22:57:50 +0000 (00:57 +0200)]
sdhci: allow setting MMC capabilities before sdhci_init_slot

With this change the host controller drivers can set the MMC capabilities
(e.g. using mmc_fdt_parse() helper) before calling sdhci_init_slot().
This way the configuration dump (eg. in bootverbose) can include the
possible additional information.

Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Marvell
Differential Revision: https://reviews.freebsd.org/D30561
MFC after: 2 weeks

(cherry picked from commit 5652be30a322f2543bc1e3bcc135abc56b3eb268)

2 years agormlock: Temporarily revert commit c84bb8cd771c
Mark Johnston [Mon, 7 Mar 2022 15:35:59 +0000 (10:35 -0500)]
rmlock: Temporarily revert commit c84bb8cd771c

It appears to have introduced a regression on arm64, possibly due to the
fact that the pcpu pointer is reloaded outside of the critical section
in _rm_rlock().  Until this is resolved one way or another, let's
revert.

Reported by: Ronald Klop <ronald-lists@klop.ws>
Sponsored by: The FreeBSD Foundation

(cherry picked from commit afb44cb01018eb1363cb4ee20a31534b844d00f7)

2 years agoipfilter: Print protocol when listing NAT table mappings
Cy Schubert [Mon, 28 Feb 2022 19:43:33 +0000 (11:43 -0800)]
ipfilter: Print protocol when listing NAT table mappings

NAT table mappings list only the source and destination IP, the source
and destinaion port numbers, and their mappings. But the protocol is not
listed. Now that Facebook and Google use QUIC, seeing port 443 in in a
list of active NAT sessions could mean 443/tcp or 443/udp. This patch
adds the protocol to the listing to aid in determining whether HTTPS is
TCP or QUIC in a NAT mapping listing. This also helps differentiatinete
between other protocols such as ICMP, ESP, and AH in ipnat list of active
sessions.

(cherry picked from commit 9291d079d54b828b43d3714a5f19f0ffe92837b8)

2 years agounbound: Vendor import 1.15.0
Cy Schubert [Fri, 18 Feb 2022 00:05:15 +0000 (16:05 -0800)]
unbound: Vendor import 1.15.0

Vendor import GA release of unbound 1.15.0.

(cherry picked from commit 9cf5bc93f6ba1711ae7bf96a982a2b3c8b073a18)

2 years agodhclient: support VID 0 (no vlan) decapsulation
Franco Fichtner [Mon, 14 Feb 2022 14:43:29 +0000 (09:43 -0500)]
dhclient: support VID 0 (no vlan) decapsulation

VLAN ID 0 is supposed to be interpreted as having no VLAN with a bit of
priority on the side, but the kernel is not able to decapsulate this on
the fly so dhclient needs to take care of it.

Reviewed by: markj

(cherry picked from commit abf5bff71d38da3c797a3b6decb426c375cc0f8f)

2 years agopci: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 15:54:42 +0000 (10:54 -0500)]
pci: Fix a -Wunused-but-set-variable warning

(cherry picked from commit 4db93fb278fce5f1034a9868413a641d9554214e)

2 years agoaxge: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 15:54:32 +0000 (10:54 -0500)]
axge: Fix a -Wunused-but-set-variable warning

(cherry picked from commit 9218449b98fdd176b9df1542551d0996aaa31f51)

2 years agobhnd: Fix some -Wunused-but-set-variable warnings
Mark Johnston [Mon, 28 Feb 2022 15:54:25 +0000 (10:54 -0500)]
bhnd: Fix some -Wunused-but-set-variable warnings

(cherry picked from commit 1db163b82565302edebcfde9aee3a77586bccb1f)

2 years agocdce: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 16:08:55 +0000 (11:08 -0500)]
cdce: Fix a -Wunused-but-set-variable warning

(cherry picked from commit ceb246c7b2834b40812ccd03a61d8c1cab6b5ca2)

2 years agoaxe: Fix a -Wunused-but-set-variable warning
Mark Johnston [Mon, 28 Feb 2022 16:07:19 +0000 (11:07 -0500)]
axe: Fix a -Wunused-but-set-variable warning

(cherry picked from commit f4a5d1f6c4405b0bdf62481617f66afa1da3527d)

2 years agoiwm: Fix -Wunused-but-set-variable warnings
Mark Johnston [Mon, 28 Feb 2022 15:54:15 +0000 (10:54 -0500)]
iwm: Fix -Wunused-but-set-variable warnings

(cherry picked from commit 1dc8ed06f37a0d5ff4b78791885d7ba6dd3e407b)

2 years agotests: Fix the test plan for closefrom_test
Mark Johnston [Sun, 6 Mar 2022 17:56:33 +0000 (12:56 -0500)]
tests: Fix the test plan for closefrom_test

Fixes: f3f3e3c44d3b ("fd: add close_range(..., CLOSE_RANGE_CLOEXEC)")
Reported by: Jenkins

(cherry picked from commit 3a01dcc99ff9044bbd46386a48ed870838cfb555)

2 years agofd: add close_range(..., CLOSE_RANGE_CLOEXEC)
Mateusz Guzik [Thu, 3 Mar 2022 12:45:11 +0000 (13:45 +0100)]
fd: add close_range(..., CLOSE_RANGE_CLOEXEC)

For compatibility with Linux.

MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34424

(cherry picked from commit f3f3e3c44d3b1776653bbf19eab17ce006a815d8)

2 years agouart_dev_ns8250: Switch ACPI UART subtype for Marvell SoCs
Marcin Wojtas [Thu, 20 May 2021 21:37:02 +0000 (23:37 +0200)]
uart_dev_ns8250: Switch ACPI UART subtype for Marvell SoCs

DBG2 ACPI table description [1] specifies three subtypes
related to 16550 UART:
0x0 - 16550 compatible
0x1 - 16550 subset
0x12 - 16550 compatible with parameters defined in Generic Address Structure (GAS)

It turned out however, that the Windows OS treats 0x0 subtype as
legacy x86 UART with 8-bit access. ARM SoCs can use types 0x1 (16550 with
fixed mmio32 access) or 0x12 (16550 with fully respected GAS contents).

Switch Marvell SoCs ACPI UART subtype to 0x1 - thanks to that the same firmware
can run properly with UART output in FreeBSD, Windows 10, Linux and ESXI
hypervisor. Tests showed the older firmware versions that use 0x0
UART subtype in SPCR table continue to display output properly.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table

Obtained from: Semihalf
Sponsored by: ARM
Differential revision: https://reviews.freebsd.org/D30386
MFC after: 2 weeks

(cherry picked from commit 9cf66a0458f4913d34cb3c5f6b653c78f70de8a8)

2 years agopci_host_generic: update Synopsys device description for ACPI
Marcin Wojtas [Thu, 16 Sep 2021 14:39:42 +0000 (16:39 +0200)]
pci_host_generic: update Synopsys device description for ACPI

The recent addition of Synopsys ECAM quirk set the
device description only for the DT variant.
Do the same in ACPI case.

Reported by: jrtc27

(cherry picked from commit e8a872536042970b4dbf14dc75755a352fb14488)

2 years agopci_host_generic: Add Synopsys Designware PCIe controller quirk
Pawel Anikiel [Mon, 13 Sep 2021 14:59:40 +0000 (16:59 +0200)]
pci_host_generic: Add Synopsys Designware PCIe controller quirk

Due to the quirky nature of the Synopsys Designware PCIe IP,
the type 0 configuration is broadcast and whatever device
is plugged into slot, will appear at each 32 device
positions of bus0. Mitigate the issue by filtering out
duplicated devices on this bus for both DT and ACPI cases.

Reviewed by: mw
Sponsored by: Semihalf
MFC: after 3 weeks
Differential revision: https://reviews.freebsd.org/D31887

(cherry picked from commit 2de4c7f6d08798fb6269582907155703d1ab5ef4)

2 years agommc: Fix HS200/HS400 capability check
Kornel Duleba [Sun, 28 Nov 2021 11:24:07 +0000 (12:24 +0100)]
mmc: Fix HS200/HS400 capability check

HS200 and HS400 speeds can be enabled either with 1.2, or 1.8V signaling voltage.
Because of that we have four cabability flags: MMC_CAP_MMC_HS200_120,
MMC_CAP_MMC_HS200_180, MMC_CAP_MMC_HS400_120, MMC_CAP_MMC_HS400_180.

MMC logic only enables HS200/HS400 mode if both flags are set for the corresponding speed.
Fix that by being more permissive in host timing cap check.

Reviewed by: manu, mw
MFC after: 2 weeks
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D33130

(cherry picked from commit 8661e085fb953855dbc7059f21a64a05ae61b22c)

2 years agoocs_fc: Ignore flogi failure when the remote node is pt2pt winner
Ram Kishore Vegesna [Fri, 4 Mar 2022 14:40:32 +0000 (20:10 +0530)]
ocs_fc: Ignore flogi failure when the remote node is pt2pt winner

Updated commit 79c56c9af583, do not proceed with discovery
if flogi fails in pt2pt winner case.

MFC after: 3 days

(cherry picked from commit 625a8bfb047a94459b4ab41f08fe5a2c23694039)

2 years agoocs_fc: Do not respond to unsolicited NOP BLS command.
Ram Kishore Vegesna [Thu, 3 Mar 2022 12:46:56 +0000 (18:16 +0530)]
ocs_fc: Do not respond to unsolicited NOP BLS command.

Summary: Drop unsolicited BLS commands other than ABTS.

Reviewed by: mav

MFC after: 3 days

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

(cherry picked from commit 57e4b677559a742031c7478d801c1e218afae239)

2 years agoocs_fc: Support persistent topology feature
Ram Kishore Vegesna [Thu, 3 Mar 2022 16:00:27 +0000 (21:30 +0530)]
ocs_fc: Support persistent topology feature

Summary: Enable persistent topology across power cycles/firmware resets.

Reviewed by: mav

MFC after: 3 days

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

(cherry picked from commit 965e2154e7682572e99e4c8fd4776dfe8f836b24)

2 years agoocs_fc: Ignore flogi failure when the discovery is already done.
Ram Kishore Vegesna [Thu, 3 Mar 2022 11:44:03 +0000 (17:14 +0530)]
ocs_fc: Ignore flogi failure when the discovery is already done.

Summary:
Some targets are not responding to the FLOGI in point-to-point topology,
If the pt2pt discovery is done, Ignore the FLOGI failure.

MFC after: 3 days

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

(cherry picked from commit 79c56c9af583b4c6e079594b7b6ff8176e6bff7d)

2 years agoRELNOTES: Note addition of zfskeys
Mateusz Piotrowski [Sun, 6 Mar 2022 20:28:29 +0000 (21:28 +0100)]
RELNOTES: Note addition of zfskeys

zfskeys is about to be released for the first time with FreeBSD
13.1-RELEASE.

This is a direct commit.

Reviewed by: allanjude
Sponsored: Modirum
Sponsored: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34428

2 years agorc.conf: Fix a typo
Mateusz Piotrowski [Fri, 4 Mar 2022 19:14:18 +0000 (20:14 +0100)]
rc.conf: Fix a typo

Reported by: Pau Amma <pauamma@gundo.com>
MFC after: 3 days
MFC with: 8719e8a951b78

(cherry picked from commit 9062598e748acdfc0fb5cf31fa10691d3513d814)

2 years agorc.conf: Document zfskeys
Mateusz Piotrowski [Thu, 3 Mar 2022 19:03:09 +0000 (20:03 +0100)]
rc.conf: Document zfskeys

Fixes: 33ff39796ffe Add zfskeys rc.d script for auto-loading encryption keys
MFC after: 3 days
Reviewed by: allanjude
Sponsored by: Modirum
Sponsored by: Klara, Inc
Differential Revision: https://reviews.freebsd.org/D34427

(cherry picked from commit 8719e8a951b78ca555ed777e99d5e2b90f3c4e7b)

2 years agozstd: build with C11
Mateusz Guzik [Tue, 1 Mar 2022 20:07:44 +0000 (20:07 +0000)]
zstd: build with C11

This enables thread-aware timers which in turn fixes benchmark result
reports.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D34238

(cherry picked from commit 6882d53b7fb884d9fe390d579d4e48ca21d1a48f)

2 years agouname: -v: strip final whitespace compatibly with uname(3)
наб [Fri, 18 Feb 2022 13:34:40 +0000 (14:34 +0100)]
uname: -v: strip final whitespace compatibly with uname(3)

This restores POSIX.1 conformance

PR: 260938
(cherry picked from commit 7e05fa3b449007adaa6e588ebb3b8d76f30b355c)

2 years agocache: improve vnode vs name assertion in cache_enter_time
Mateusz Guzik [Wed, 9 Feb 2022 20:41:24 +0000 (21:41 +0100)]
cache: improve vnode vs name assertion in cache_enter_time

(cherry picked from commit 1d65a9b47eab75f12fcb5cc7547a69441ef764a3)

2 years agocache: remove NOCACHE handling from cache_fplookup_noentry
Mateusz Guzik [Wed, 9 Feb 2022 20:39:28 +0000 (21:39 +0100)]
cache: remove NOCACHE handling from cache_fplookup_noentry

It was copy-pasted from locked lookup. As LOOKUP operation cannot have
the flag set it was always ending up setting MAKEENTRY.

(cherry picked from commit 611470a51560db61488b2d864176b8076eb5a65c)

2 years agocache: whack "set but not used" warnings
Mateusz Guzik [Sun, 14 Nov 2021 16:57:11 +0000 (16:57 +0000)]
cache: whack "set but not used" warnings

(cherry picked from commit 7e9680d3be484baac7fe78cef2be4e7ce4b4946f)

2 years agocache: only let non-dir descriptors through when doing EMPTYPATH lookups
Mateusz Guzik [Wed, 27 Oct 2021 18:17:59 +0000 (20:17 +0200)]
cache: only let non-dir descriptors through when doing EMPTYPATH lookups

Otherwise things like realpath against a file and '.' end up with an
illegal state of having a regular vnode for the parent.

Reported by: syzbot+9aa5439dd9c708aeb1a8@syzkaller.appspotmail.com

(cherry picked from commit 628c3b307fb29e9812008b8a0b3ccb73e0f0ecfa)

2 years agocache: only assert on flags when dealing with EMPTYPATH
Mateusz Guzik [Sun, 17 Oct 2021 08:40:16 +0000 (10:40 +0200)]
cache: only assert on flags when dealing with EMPTYPATH

Reported by: syzbot+bd48ee0843206a09e6b8@syzkaller.appspotmail.com
Fixes: 7dd419cabc6bb9e0 ("cache: add empty path support")

(cherry picked from commit 1045352f150346ba422b3a3ce6344fc694bc3aa4)

2 years agocache: add empty path support
Mateusz Guzik [Sun, 26 Sep 2021 13:00:24 +0000 (15:00 +0200)]
cache: add empty path support

This avoids spurious drop offs as EMPTY is passed regardless of the
actual path name.

Pushign the work inside the lookup instead of just ignorign the flag
allows avoid checking for empty pathname for all other lookups.

(cherry picked from commit 7dd419cabc6bb9e019c56d15f8e6a88ee2f46859)

2 years agocache: retire cache_fast_revlookup sysctl
Mateusz Guzik [Mon, 23 Aug 2021 13:29:42 +0000 (15:29 +0200)]
cache: retire cache_fast_revlookup sysctl

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

(cherry picked from commit b65ad70195d874ac28e6e65d2fd8acf5d9a79236)

2 years agolibusb(3): Ignore SIGPIPE when initializing the LibUSB v1.0 API.
Hans Petter Selasky [Wed, 2 Mar 2022 11:31:27 +0000 (12:31 +0100)]
libusb(3): Ignore SIGPIPE when initializing the LibUSB v1.0 API.

The LibUSB v1.0 emulation layer uses pipes internally to signal between
threads. When USB devices are reset, as part of loading firmware, SIGPIPE
may happen, and that is expected and should be ignored.

PR: 261891
Sponsored by: NVIDIA Networking

(cherry picked from commit d94d94e2c06b4331f706a3b4eca058041294ea05)

2 years agolinuxkpi: Add mmap_lock.h
Emmanuel Vadot [Wed, 16 Feb 2022 10:26:14 +0000 (11:26 +0100)]
linuxkpi: Add mmap_lock.h

This contain mmap_read_lock, mmap_read_unlock and mmap_write_lock_killable
which are abstraction around down_read, up_read and down_write_killable.
Note that in Linux 5.8 mmap_sem was renamed to mmap_lock.
We might want to do the same at some point but some drivers still uses
the old mmap locking API.

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

(cherry picked from commit 995c3b88d485b9b64ab94efe270d424b2526ade7)

2 years agolinuxkpi: Add atomic64_fetch_add
Emmanuel Vadot [Wed, 16 Feb 2022 09:44:55 +0000 (10:44 +0100)]
linuxkpi: Add atomic64_fetch_add

Linux variant of atomic_fetchadd_64.

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

(cherry picked from commit 1889bed23debb2029970c0f8e79db6b622c3cb09)

2 years agolinuxkpi: Add orderly_poweroff
Emmanuel Vadot [Tue, 15 Feb 2022 11:06:26 +0000 (12:06 +0100)]
linuxkpi: Add orderly_poweroff

This simply poweroff the system.
Needed by drm-kmod v5.8

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

(cherry picked from commit 8021ba67231de90f17a951497474ab017b7dab9e)

2 years agolinuxkpi: Add dev_emerg
Emmanuel Vadot [Tue, 15 Feb 2022 11:05:56 +0000 (12:05 +0100)]
linuxkpi: Add dev_emerg

Needed by drm-kmod v5.8

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

(cherry picked from commit e3f1af9b33e95b549ccc7363bd963cc50cd5b9d7)

2 years agolinuxkpi: Add backlight_device_set_brightness
Emmanuel Vadot [Tue, 15 Feb 2022 11:05:07 +0000 (12:05 +0100)]
linuxkpi: Add backlight_device_set_brightness

This simply set the brightness of a backlight device.
Needed by drm-kmod v5.8

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

(cherry picked from commit 2cc3af6e1d795c6d33afaf994c18abaab87a443b)

2 years agolinuxkpi: Add user_write_access_*
Emmanuel Vadot [Tue, 15 Feb 2022 11:04:40 +0000 (12:04 +0100)]
linuxkpi: Add user_write_access_*

Needed by drm-kmod v5.8

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

(cherry picked from commit 4f689b302fc49fc11d19169386f6ccfad05f47dd)

2 years agolinuxkpi: Add list_rotate_to_front
Emmanuel Vadot [Fri, 11 Feb 2022 15:10:08 +0000 (16:10 +0100)]
linuxkpi: Add list_rotate_to_front

This just calls list_move_tail.

Reviewed by: hselasky, bz
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34251

(cherry picked from commit bf7deecfe7604c394d0c89ca58ce5d22b0d5641c)

2 years agolinuxkpi: Add __var_waitqueue
Emmanuel Vadot [Fri, 11 Feb 2022 10:33:59 +0000 (11:33 +0100)]
linuxkpi: Add __var_waitqueue

This returns the wait queue based on the object but in LinuxKPI
we only have one waitqueue for this.

Reviewed by: hselasky, bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34250

(cherry picked from commit cb15ed7da2be02b108d732e41bb6e68febf93f90)

2 years agolindebugfs: Fix write
Emmanuel Vadot [Mon, 31 Jan 2022 13:46:16 +0000 (14:46 +0100)]
lindebugfs: Fix write

For write operation pseudofs creates an sbuf with the data.
Use this data instead of the uio as it's not usable anymore after
uiomove.

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

(cherry picked from commit 867b4decb4d50579152e52c594632cdc0f6266ff)

2 years agosystat: Display seconds in vmstat mode
Peter Jeremy [Sat, 29 Jan 2022 09:41:19 +0000 (20:41 +1100)]
systat: Display seconds in vmstat mode

Providing a timestamp with seconds granularity helps make it obvious
that the display is updating.

Reviewed by:    mckusick
Differential Revision:  https://reviews.freebsd.org/D29181

(cherry picked from commit c9d1fa7003d5def224e9cfa5d38314f187487eb9)

2 years agogeom_gate: Distinguish between classes of errors
Peter Jeremy [Sat, 29 Jan 2022 10:15:51 +0000 (21:15 +1100)]
geom_gate: Distinguish between classes of errors

The geom_gate API provides 2 distinct paths for exchanging error
details between the kernel and the userland client: Including an error
code in the g_gate_ctl_io structure passed in the ioctl(2) call or
having the ioctl(2) call return -1 with an error code in errno. The
latter reflects errors in the ioctl(2) call itself whilst the former
reflects errors within the geom_gate instance.

The G_GATE_CMD_START ioctl blocks waiting for an I/O request to be
directed to the geom_gate instance and the wait can fail
(necessitating an error return) if the geom_gate instance is destroyed
or if the msleep(9) fails. The code previously treated both error
cases indentically: Returning ECANCELED as a geom_gate instance error
(which the ggatec treats as a fatal error).  Whilst this is the correct
behaviour if the geom_gate instance is destroyed, a msleep(9) failure
is unrelated to the geom_gate instance itself and should be reported
as an ioctl(2) "failure".  The distinction is important because
msleep(9) can return ERESTART, which means the system call should be
retried (and this will occur automatically as part of the generic
syscall return processing).

This change alters the msleep(9) handling to directly return the error
code from msleep(9), which ensures ERESTART is correctly handled,
rather than being treated as a fatal error.

Reviewed by:    Johannes Totz <jo@bruelltuete.com>
Differential Revision:  https://reviews.freebsd.org/D33996

(cherry picked from commit afcd1210246bebd8ed9bdaf31bd5218630af4cdc)