]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoriscv: Add support for enabling SV48 mode
Mark Johnston [Tue, 1 Mar 2022 14:07:14 +0000 (09:07 -0500)]
riscv: Add support for enabling SV48 mode

This increases the size of the user map from 256GB to 128TB.  The kernel
map is left unchanged for now.

For now SV48 mode is left disabled by default, but can be enabled with a
tunable.  Note that extant hardware does not implement SV48, but QEMU
does.

- In pmap_bootstrap(), allocate a L0 page and attempt to enable SV48
  mode.  If the write to SATP doesn't take, the kernel continues to run
  in SV39 mode.
- Define VM_MAX_USER_ADDRESS to refer to the SV48 limit.  In SV39 mode,
  the region [VM_MAX_USER_ADDRESS_SV39, VM_MAX_USER_ADDRESS_SV48] is not
  mappable.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 31218f3209acf0f8f0dc54e436342c8fa604d279)

2 years agoriscv: Add support for dynamically allocating L1 page table pages
Mark Johnston [Tue, 1 Mar 2022 14:06:57 +0000 (09:06 -0500)]
riscv: Add support for dynamically allocating L1 page table pages

This is required in SV48 mode.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6ce716f7c31a0a1b5ca8224cbb627632f44e4e6c)

2 years agoriscv: Handle four-level page tables in various pmap traversal routines
Mark Johnston [Tue, 1 Mar 2022 14:06:42 +0000 (09:06 -0500)]
riscv: Handle four-level page tables in various pmap traversal routines

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1321117200de1d1796adad856f7e04a66850e992)

2 years agoriscv: Maintain the allpmaps list only in SV39 mode
Mark Johnston [Tue, 1 Mar 2022 14:06:31 +0000 (09:06 -0500)]
riscv: Maintain the allpmaps list only in SV39 mode

When four-level page tables are used, there is no need to distribute
updates to the top-level page to all pmaps.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ceed61483ca9c3c0bf44e37118ae9c8377e6b9ff)

2 years agoriscv: Add pmap helper functions required by four-level page tables
Mark Johnston [Tue, 1 Mar 2022 14:06:15 +0000 (09:06 -0500)]
riscv: Add pmap helper functions required by four-level page tables

No functional change intended.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5cf3a8216e3adad06f1ab02c9a9b201cebcd4809)

2 years agoriscv: Try to improve the comments for locore's page table setup
Mark Johnston [Tue, 1 Mar 2022 14:06:03 +0000 (09:06 -0500)]
riscv: Try to improve the comments for locore's page table setup

No functional change intended.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 43379792365130b1fa338c310f00aa6821493ead)

2 years agoriscv: Conditionally modify the ELF64 sysentvec for SV48
Mark Johnston [Tue, 1 Mar 2022 14:05:02 +0000 (09:05 -0500)]
riscv: Conditionally modify the ELF64 sysentvec for SV48

A sysinit determines whether the pmap has enabled SV48 mode and modifies
the corresponding fields which describe the user memory map.

Reviewed by: kib, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ecaf115434cf5b427339d27860bcbee3e9f48e39)

2 years agoriscv: Define a SV48 memory map
Mark Johnston [Tue, 1 Mar 2022 14:04:38 +0000 (09:04 -0500)]
riscv: Define a SV48 memory map

No functional change intended.

Reviewed by: kib, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 35d0f443cfaaa32afa43f4ffca986590fc56d827)

2 years agoriscv: Add various pmap definitions needed to support SV48 mode
Mark Johnston [Tue, 1 Mar 2022 14:04:01 +0000 (09:04 -0500)]
riscv: Add various pmap definitions needed to support SV48 mode

No functional change intended.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 59f192c507c49990b603f774bbb824fab71ee4c3)

2 years agoriscv: Use generic CSR macros for writing SATP
Mark Johnston [Tue, 1 Mar 2022 14:03:44 +0000 (09:03 -0500)]
riscv: Use generic CSR macros for writing SATP

Instead of having the one-off load_satp(), just use csr_write().  No
functional change intended.

Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2e956c30cab6a36fee9a3d5159c3903406e3e5e7)

2 years agoriscv: Rename struct pmap's pm_l1 field to pm_top
Mark Johnston [Tue, 1 Mar 2022 14:03:30 +0000 (09:03 -0500)]
riscv: Rename struct pmap's pm_l1 field to pm_top

In SV48 mode, the top-level page will be an L0 page rather than an L1
page.  Rename the field accordingly.  No functional change intended.

Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 82f4e0d0f06456f2d070d2e0692a8f318f4eb90b)

2 years agormlock: Add required compiler barriers to _rm_runlock()
Mark Johnston [Tue, 1 Mar 2022 13:55:43 +0000 (08:55 -0500)]
rmlock: Add required compiler barriers to _rm_runlock()

Also remove excessive whitespace in _rm_rlock().

Reviewed by: jah, mjg
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 89ae8eb74e87ac19aa2d7abe4ba16bcccd32bb9f)

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>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Fixes: 86a16ada1ea608408cec370171d9f59353e97c77

(cherry picked from commit bafaa70b6f9098d83d074968c8e6747ecec1e118)

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
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1fb00c8f1060e18fed621f13d31db7b336d2267e)

2 years agolinuxkpi: fix module build outside of kernel build environment
Eugene Grosbein [Thu, 10 Mar 2022 21:31:23 +0000 (04:31 +0700)]
linuxkpi: fix module build outside of kernel build environment

(cherry picked from commit f5a2e7b0e8483bf51519046fd149a6a31acef6b1)

2 years agoBuild compiler-rt against libunwind, not libcxxrt
Dimitry Andric [Wed, 9 Mar 2022 21:23:35 +0000 (22:23 +0100)]
Build compiler-rt against libunwind, not libcxxrt

Parts of compiler-rt are also built for libgcc_eh and libgcc_s, and
these were already pointing to the libunwind unwind.h. For the sake of
consistency, also build compiler-rt itself against the libunwind
unwind.h, not the libcxxrt one.

MFC after: 3 days

(cherry picked from commit 7ecd99fa424df001028c5cddc52d25b29232f1af)

2 years agoRemove compat hacks from libcxxrt's _Unwind_Exception
Dimitry Andric [Tue, 8 Mar 2022 21:53:16 +0000 (22:53 +0100)]
Remove compat hacks from libcxxrt's _Unwind_Exception

This reverts 9097e3cbcac4, which was in itself a revert of upstream
libcxxrt commits 88bdf6b290da ("Specify double-word alignment for ARM
unwind") and b96169641f79 ("Updated Itanium unwind"), and a
reapplication of our commit 3c4fd2463bb2 ("libcxxrt: add padding in
__cxa_allocate_* to fix alignment").

The editors/libreoffice port will be patched to be able to cope with the
standards-compliant alignment of _Unwind_Exception and consequently,
that of __cxa_exception. The layouts and sizes of these structures
should then be completely the same for libcxxrt, libunwind and
libc++abi.

PR: 262008
Reviewed by: emaste, jhb, theraven
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34488

(cherry picked from commit 72df847a94bccee245a3316e4f848482b9ac2ac2)

2 years agoFix indentation in usr.bin/diff/pr.c
Dimitry Andric [Mon, 28 Feb 2022 20:06:19 +0000 (21:06 +0100)]
Fix indentation in usr.bin/diff/pr.c

In commit 6fa5bf0832ef the pr(1) related code in diff was moved around,
but some part of the indentation was messed up, and one line was
duplicated. Remove the duplicated line, and fix up the indentation.

Reviewed by: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34398

(cherry picked from commit f7d6e97e4bf1fe4c70d5b0ef9fdf649bf07e1c91)

2 years agocap_net: plug memory leak
Mariusz Zaborski [Tue, 14 Dec 2021 10:57:36 +0000 (11:57 +0100)]
cap_net: plug memory leak

MFC after: 5 days

(cherry picked from commit 88910b8b7b14386e05bccda0317ace2bfd383ef5)

2 years agocap_net: fix verification of bind permission
Mariusz Zaborski [Tue, 14 Dec 2021 11:01:10 +0000 (12:01 +0100)]
cap_net: fix verification of bind permission

MFC after: 5 days

(cherry picked from commit f45ca435bd2cba2ea6d9b79dbef275bc5ea4036a)

2 years agotslog.4: Document TSLOG
Mateusz Piotrowski [Fri, 4 Mar 2022 19:33:22 +0000 (20:33 +0100)]
tslog.4: Document TSLOG

Based on commit messages and Colin Percival's presentation
from BSDCan 2018 [1].

[1]: https://papers.freebsd.org/2018/bsdcan/percival-Profiling_the_FreeBSD_kernel_boot.files/percival-Profiling_the_FreeBSD_kernel_boot.pdf

Reviewed by: cperciva, debdrup
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34430

(cherry picked from commit 5675bb582985654b172a4c1dd191e2b3bb8e78bb)

2 years agotime.3: Update ERRORS section
Mateusz Piotrowski [Fri, 4 Mar 2022 14:09:32 +0000 (15:09 +0100)]
time.3: Update ERRORS section

time() is now implemented using clock_gettime(2) instead of
gettimeofday(2).

Reviewed by: debdrup
Fixes: 358ed16f7505 Use clock_gettime(CLOCK_SECOND)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34438

(cherry picked from commit 413045a52c5f14ac22516b4f622d0132dc34e882)

2 years agoctime.3: Add a cross-reference to clock_gettime(2)
Mateusz Piotrowski [Fri, 4 Mar 2022 16:48:02 +0000 (17:48 +0100)]
ctime.3: Add a cross-reference to clock_gettime(2)

MFC after: 1 week

(cherry picked from commit dd74471e49fd927d5a3a16fcdf94243cdd34c3f3)

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

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

2 years agoAdd support for getting early entropy from UEFI
Colin Percival [Thu, 17 Feb 2022 21:01:11 +0000 (13:01 -0800)]
Add support for getting early entropy from UEFI

UEFI provides a protocol for accessing randomness. This is a good way
to gather early entropy, especially when there's no driver for the RNG
on the platform (as is the case on the Marvell Armada8k (MACCHIATObin)
for now).

If the entropy_efi_seed option is enabled in loader.conf (default: YES)
obtain 2048 bytes of entropy from UEFI and pass is to the kernel as a
"module" of name "efi_rng_seed" and type "boot_entropy_platform"; if
present, ingest it into the kernel RNG.

Submitted by: Greg V
Reviewed by: markm, kevans
Approved by: csprng (markm)
Differential Revision: https://reviews.freebsd.org/D20780

2 years agoif_epair: fix build with RSS and INET or INET6 disabled
Santiago Martinez [Thu, 3 Mar 2022 09:44:43 +0000 (10:44 +0100)]
if_epair: fix build with RSS and INET or INET6 disabled

Reviewed by: kp
MFC after: 1 week

(cherry picked from commit 52bcdc5b809ea56cbdce0bd36499e4ae74780d2b)

2 years agoMake sure the avr32dci_odevd structure is used.
Hans Petter Selasky [Sat, 10 Jul 2021 16:13:21 +0000 (18:13 +0200)]
Make sure the avr32dci_odevd structure is used.
This fixes a compilation error.

Sponsored by: NVIDIA Networking

(cherry picked from commit 3f5054862a4603116bb872cf8b7b3cc946e93741)

2 years agoFactor out repeated code in the USB controller drivers to avoid bugs
Hans Petter Selasky [Sat, 10 Jul 2021 16:17:51 +0000 (18:17 +0200)]
Factor out repeated code in the USB controller drivers to avoid bugs
computing the same isochronous start frame number over and over again.

PR: 257082
Sponsored by: NVIDIA Networking

(cherry picked from commit 8fc2a3c41791b205a107dc2bec16ac7514a57958)
(cherry picked from commit f52783fcf5cc60734121d061beef0d4ea47b224a)
(cherry picked from commit cf48d1f77126d8de4c03c4dd7c8502be2b5f1954)

2 years agoMake sure the XHCI driver obeys the isochronous scheduling threshold value
Hans Petter Selasky [Sat, 10 Jul 2021 16:09:56 +0000 (18:09 +0200)]
Make sure the XHCI driver obeys the isochronous scheduling threshold value
as given by the XHCI hardware parameters to avoid scheduling isochronous
transfers too early.

Sponsored by: NVIDIA Networking

(cherry picked from commit d038463bd269031fa8f13c0951b223bcae02bbca)

2 years agoLet the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing
Hans Petter Selasky [Sat, 10 Jul 2021 12:14:11 +0000 (14:14 +0200)]
Let the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing
the number of completion event TRBs. This avoids wasting memory.

Sponsored by: NVIDIA Networking

(cherry picked from commit e036ee6ce2e4d6fe0564f8bb3aa99a2f61d48fc6)

2 years agoibcore: Fix multiple includes of same header file.
Hans Petter Selasky [Thu, 3 Mar 2022 11:51:05 +0000 (12:51 +0100)]
ibcore: Fix multiple includes of same header file.

Sponsored by: NVIDIA Networking

(cherry picked from commit fc99316ef97c3d21cc46f4459f3c2853f2e5be1a)

2 years agousb(4): Factor out the usb_check_request() function.
Hans Petter Selasky [Thu, 3 Mar 2022 09:22:41 +0000 (10:22 +0100)]
usb(4): Factor out the usb_check_request() function.

No functional change.

Sponsored by: NVIDIA Networking

(cherry picked from commit 8ed5bb59e913c61e61a4232e8221f35256f72ad2)

2 years agoipfilter: Reliably print the interface name
Cy Schubert [Thu, 3 Mar 2022 06:43:48 +0000 (22:43 -0800)]
ipfilter: Reliably print the interface name

When printing the interface name from the ipstate_t struct the interface
name in is_ifp may not always be avaiable when reading it from kmem
(tested on FreeBSD and NetBSD). However the is_ifname (the interface
name character string) is almost always available -- it is not available
when the source of the packet is a process running on the firewall
itself. Rather than print both interface name strings, print only the
one.

(cherry picked from commit 93c1048a1360c3a0f1a6a9248916ef06c52b4504)

2 years agoipfilter: Obtain the interface name more efficiently
Cy Schubert [Thu, 3 Mar 2022 06:40:18 +0000 (22:40 -0800)]
ipfilter: Obtain the interface name more efficiently

Rather than use a kmem read to determine the interface name used by a
nat_t structure through a pointer, nat_ipfs->netif->if_xname, obtain it
directly from nat_ifnames in the nat_t structure itself using the new
FORMAT_IF macro.

(cherry picked from commit ec793543feff027f0de9dff3708ab86f5e567d15)

2 years agoipfilter: Introduce the new FORMAT_IF macro
Cy Schubert [Thu, 3 Mar 2022 06:21:59 +0000 (22:21 -0800)]
ipfilter: Introduce the new FORMAT_IF macro

Interface names stored in the ipstate_t and ipnat_t structures can be
NULL. This occurs when an application, such as named, is running on the
firewall machine itself. For example an application, i.e. named, running
on the firewall itself will cause a state table display and NAT mapping
display to show a null ingress interface and its egress interface. This
is perfectly valid but confusing to human eyes. Rather than print
nothing, print "(null)".

(cherry picked from commit 915395a2800a09a64ae41ca96eabcb5e16b44309)

2 years agoRename stable/13 to -STABLE now that releng/13.1 has branched
Glen Barber [Thu, 10 Mar 2022 00:11:29 +0000 (19:11 -0500)]
Rename stable/13 to -STABLE now that releng/13.1 has branched

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 agoTag zfs-2.1.3
Tony Hutter [Wed, 9 Mar 2022 02:03:54 +0000 (18:03 -0800)]
Tag zfs-2.1.3

META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
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 agoFix ENOSPC when unlinking multiple files from full pool
Brian Behlendorf [Tue, 8 Mar 2022 17:16:35 +0000 (09:16 -0800)]
Fix ENOSPC when unlinking multiple files from full pool

When unlinking multiple files from a pool at 100% capacity, it was
possible for ENOSPC to be returned after the first unlink.  e.g.

    rm -f /mnt/fs/test1.0.0 /mnt/fs/test1.1.0 /mnt/fs/test1.2.0
    rm: cannot remove '/mnt/fs/test1.1.0': No space left on device
    rm: cannot remove '/mnt/fs/test1.2.0': No space left on device

After waiting for the pending deferred frees from the first unlink to
be processed the remaining files can then be unlinked.  This is caused
by the quota limit in dsl_dir_tempreserve_impl() being temporarily
decreased to the allocatable pool capacity less any deferred free
space.

This is resolved using the existing mechanism of returning ERESTART
when over quota as long as we know enough space will shortly be
available after processing the pending deferred frees.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13172

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 agoZTS: deadman_sync fix
Brian Behlendorf [Mon, 11 Oct 2021 17:49:13 +0000 (10:49 -0700)]
ZTS: deadman_sync fix

In the CI environment it's possible for events to be slightly
delayed resulting in 4, instead of 5, events appearing in the
log file.  This isn't a problem and should be considered a
success to avoid false positive test results.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12625

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)