]> xenbits.xensource.com Git - people/royger/freebsd.git/log
people/royger/freebsd.git
3 years agovt/vga: ignore ACPI_FADT_NO_VGA unless running virtualized releng-13.1b
Roger Pau Monné [Thu, 24 Feb 2022 15:53:30 +0000 (16:53 +0100)]
vt/vga: ignore ACPI_FADT_NO_VGA unless running virtualized

There's too many broken hardware out there that wrongly has the
ACPI_FADT_NO_VGA bit set. Ignore it unless running as a virtualized
guest, as then the expectation would be that the hypervisor does
provide correct ACPI tables.

Reviewed by: emaste, 0mp, eugen
Sponsored by: Citrix Systems R&D
PR: 230172

(cherry picked from commit 0518832011caba1e9dcee054d7884797ed8a74c2)

3 years agoBump version.
Gordon Tetlow [Tue, 22 Mar 2022 16:26:07 +0000 (09:26 -0700)]
Bump version.

Approved by: re (implicit), so

3 years agocontrib/tzdata: import tzdata 2022a
Philip Paeps [Tue, 22 Mar 2022 15:54:06 +0000 (15:54 +0000)]
contrib/tzdata: import tzdata 2022a

Merge commit '971fa603f2bdf16273135a00ff16c5585520c53f'

Changes: https://github.com/eggert/tz/blob/2022a/NEWS

With this merge, we return to our previous long-standing practice of
distributing the IANA Time Zone Database unmodified.

Releases of tzdb since 2021b have merged some time zones where clocks
have agreed since 1970.  The overwhelming majority of users will not be
affected by this change.  A port of the newly created global-tz fork of
the IANA Time Zone database (misc/global-tz) is available for users who
need more granular pre-1970 time zone history.

Approved by: re (gjb)

(cherry picked from commit 8ea5af2b77f2b43c250cacb257f42c0a54d644c4)
(cherry picked from commit 5dbd160076c09b0a3c7b175b506a57bd8b71f22a)

3 years agoUpdate leap-seconds to leap-seconds.3676924800
Xin LI [Mon, 14 Mar 2022 06:37:56 +0000 (23:37 -0700)]
Update leap-seconds to leap-seconds.3676924800

Obtained from: ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
Approved by: re (gjb)
(cherry picked from commit 1d333074349abb736ffdca9e6baf6c71aef4553b)
(cherry picked from commit 08038f3cbf197cc90b0ba89bb0e4d0e9cc287366)

3 years ago13.1: Enable REPRODUCIBLE_BUILD by default
Glen Barber [Mon, 21 Mar 2022 13:50:10 +0000 (09:50 -0400)]
13.1: Enable REPRODUCIBLE_BUILD by default

This was missed when branching releng/13.1.

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

3 years agoif_epair: build fix
Kristof Provost [Thu, 17 Mar 2022 02:35:13 +0000 (03:35 +0100)]
if_epair: build fix

66acf7685b failed to build on riscv (and mips). This is because the
atomic_testandset_int() (and friends) functions do not exist there.
Happily those platforms do have the long variant, so switch to that.

PR: 262571
MFC after: 3 days
Approved by:    re (gjb)

(cherry picked from commit 0bf7acd6b7047537a38e2de391a461e4e8956630)

3 years agovirtio_random(8): MFC: avoid deadlock at shutdown time (regression fix)
Eugene Grosbein [Wed, 16 Mar 2022 04:41:51 +0000 (11:41 +0700)]
virtio_random(8): MFC: avoid deadlock at shutdown time (regression fix)

FreeBSD 13+ running as virtual guest may load virtio_random(8) driver
by means of devd(8) unless the driver is blacklisted or disabled
via device.hints(5). Currently, the driver may prevent
the system from rebooting or shutting down correctly.

This change deactivates virtio_random at very late stage
during system shutdown sequence to avoid deadlock
that results in kernel hang.

PR: 253175
Tested by: tom
Relnotes: yes
Approved by: re (gjb)

(cherry picked from commit adbf7727b3a2aad3c2faa6e543ee7fa7a6c9a3d5)
(cherry picked from commit 4a11315a2c3fc55333772f48aaef32ae1eb11ceb)

3 years agoWITHOUT_BOOT build option appears to include stand, failing on libsa
Toomas Soome [Thu, 17 Mar 2022 17:42:05 +0000 (19:42 +0200)]
WITHOUT_BOOT build option appears to include stand, failing on libsa

building libsa needs to use -I${LDRSRC} for some files.

PR: 260083
Submitted by: Ivan Rozhuk
Approved by: re (gjb, early MFC)

(cherry picked from commit 9633c3d87476f72375f13942b55a4c9a7a00c7d8)

3 years agoOpenSSL: Merge OpenSSL 1.1.1n
Jung-uk Kim [Tue, 15 Mar 2022 23:35:22 +0000 (19:35 -0400)]
OpenSSL: Merge OpenSSL 1.1.1n

Approved by: re (delphij)

(cherry picked from commit 5ac766ab8ec23e780f108b7903d46e553d5e39d1)
(cherry picked from commit 97fe61d5bfdee2adc4d6ffb9b65a0cfb5bc5d317)

3 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.

Approved by: re (gjb)
MFC after: 3 days

(cherry picked from commit 7ecd99fa424df001028c5cddc52d25b29232f1af)
(cherry picked from commit 4c622a8f051d8dd9fab0719b00a6eccdbd13ac62)

3 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
Approved by: re (gjb)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34488

(cherry picked from commit 72df847a94bccee245a3316e4f848482b9ac2ac2)
(cherry picked from commit 93779214f1c64c0713f7c900021e35d4e4e49697)

3 years agoLinuxKPI: Add comment describing proper use of the on_each_cpu() function.
Hans Petter Selasky [Wed, 16 Mar 2022 14:40:09 +0000 (15:40 +0100)]
LinuxKPI: Add comment describing proper use of the on_each_cpu() function.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit c6cf874c7de3bcc092a58a932c732221b2933043)
(cherry picked from commit d17c5a4f62157c665ecc187e676d52c07e841923)

3 years agolindebugfs: Make single_release() NULL safe.
Hans Petter Selasky [Fri, 11 Mar 2022 16:39:44 +0000 (17:39 +0100)]
lindebugfs: Make single_release() NULL safe.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit a23e475c48da7a3751ffdc689be01d514ea2857c)
(cherry picked from commit d67b2c96153fcef344648d907893b50e30817a38)

3 years agolindebugfs: The Linux file operations use negative return values in the kernel.
Hans Petter Selasky [Fri, 11 Mar 2022 16:37:46 +0000 (17:37 +0100)]
lindebugfs: The Linux file operations use negative return values in the kernel.

Fix sign.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 68ec2949ad3411aa8a684dfca2cae90cbe202675)
(cherry picked from commit a16772a8111095a0358be9c046d321988f2696c2)

3 years agolindebugfs: Zero the linux_file structure before use.
Hans Petter Selasky [Fri, 11 Mar 2022 16:29:54 +0000 (17:29 +0100)]
lindebugfs: Zero the linux_file structure before use.

This avoids clients using garbage values on the stack and makes
debugging easier.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 88a29d89ebab1ed60607c3dab73143c3b59a0f83)
(cherry picked from commit b5cc52c21d7d34eae93c996cee09e7d2896afa6e)

3 years agonewfs(8): Fix a bug in initialization of sblock.fs_maxbsize .
Wuyang Chung [Tue, 8 Mar 2022 13:52:17 +0000 (21:52 +0800)]
newfs(8): Fix a bug in initialization of sblock.fs_maxbsize .

Fixes: 1c85e6a35d93195e896b030d9a55f7ac4ccee2c3 (SVN r98542)
Pull Request: https://github.com/freebsd/freebsd-src/pull/587
Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit c5f549c1e0c9aa1764e87d55f183053c1545b1fc)
(cherry picked from commit 4391c305e83552ed7801525723ff6c10a4efdf5e)

3 years agousbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.
Hans Petter Selasky [Sun, 13 Mar 2022 14:17:06 +0000 (15:17 +0100)]
usbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.

When there are multiple devices sharing the same USB vendor and product ID,
the wrong device may be selected. Fix this by also matching the bus and
device address, ugen<X>.<Y> .

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 16346e1401b8b369e251bc70781349fb9b813cef)
(cherry picked from commit 90afe1886f5250dc32134b5851adf6cffa4a46d4)

3 years agoxhci(4): Add quirk for "Fresco Logic FL1009 USB3.0 xHCI Controller".
Hans Petter Selasky [Wed, 16 Mar 2022 15:48:12 +0000 (16:48 +0100)]
xhci(4): Add quirk for "Fresco Logic FL1009 USB3.0 xHCI Controller".

Submitted by: John F Carr <jfc@mit.edu>
Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 19837718ab51756183046e5162b8b3b7b3cb8c3d)
(cherry picked from commit 19b779498ca7c2ea1cc24cf1ede62c22b4d09a42)

3 years agoxhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller".
Hans Petter Selasky [Thu, 3 Mar 2022 16:32:20 +0000 (17:32 +0100)]
xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller".

Tested by: br@
Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit 33cbbf268f7d0f3daff0c2aa06836d932faf56a9)
(cherry picked from commit ea318f1ad17ee599f0eeda8a3fb07f7b81699c6f)

3 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
Approved by: re (gjb)

(cherry picked from commit 3f5054862a4603116bb872cf8b7b3cc946e93741)
(cherry picked from commit cea6dbdf1bae404ac7299e5f3a7755b81b2d23e5)

3 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
Approved by: re (gjb)

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

3 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
Approved by: re (gjb)

(cherry picked from commit d038463bd269031fa8f13c0951b223bcae02bbca)
(cherry picked from commit 2db063c4cea9ae46493dab19d70499e06f0e1ed0)

3 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
Approved by: re (gjb)

(cherry picked from commit e036ee6ce2e4d6fe0564f8bb3aa99a2f61d48fc6)
(cherry picked from commit afeeccfbed271f4f6ba7b300d01eea34281395fd)

3 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
Approved by: re (gjb)

(cherry picked from commit fc99316ef97c3d21cc46f4459f3c2853f2e5be1a)
(cherry picked from commit 2c268e712719cf0ff876f4aa6bfc72a319f0164f)

3 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
Approved by: re (gjb)

(cherry picked from commit 8ed5bb59e913c61e61a4232e8221f35256f72ad2)
(cherry picked from commit 9157566d7ad58560c6fa0ba6c2b88587688ee02c)

3 years ago13.1: update to BETA2
Glen Barber [Thu, 17 Mar 2022 00:06:38 +0000 (20:06 -0400)]
13.1: update to BETA2

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

3 years agoif_epair: fix race condition on multi-core systems
Michael Gmelin [Wed, 16 Mar 2022 22:08:55 +0000 (23:08 +0100)]
if_epair: fix race condition on multi-core systems

As an unwanted side effect of the performance improvements in
24f0bfbad57b9, epair interfaces stop forwarding traffic on higher
load levels when running on multi-core systems.

This happens due to a race condition in the logic that decides when to
place work in the task queue(s) responsible for processing the content
of ring buffers.

In order to fix this, a field named state is added to the epair_queue
structure. This field is used by the affected functions to signal each
other that something happened in the underlying ring buffers that might
require work to be scheduled in task queue(s), replacing the existing
logic, which relied on checking if ring buffers are empty or not.

epair_menq() does:
  - set BIT_MBUF_QUEUED
  - queue mbuf
  - if testandset BIT_QUEUE_TASK:
      enqueue task

epair_tx_start_deferred() does:
  - swap ring buffers
  - process mbufs
  - clear BIT_QUEUE_TASK
  - if testandclear BIT_MBUF_QUEUED
      enqueue task

PR: 262571
Approved by:    re (gjb, early MFC)
Reported by: Johan Hendriks <joh.hendriks@gmail.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34569

(cherry picked from commit 66acf7685bcd8cf23b6c658a991637238a01859e)
(cherry picked from commit bb9ad300f029d57c84804702daa2652542a2535f)

3 years agoEnsure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices.
Kirk McKusick [Wed, 16 Mar 2022 18:37:15 +0000 (11:37 -0700)]
Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices.

PR:          262580
Approved by: re (gjb, early MFC)

(cherry picked from commit 2983ec0a87a18943564548c5c00c879c8db83edf)
(cherry picked from commit 934ba51bc929ee23248353a081a4cc4327a4ec54)

3 years agoFix a bug in BN_mod_sqrt() that can cause it to loop forever.
Gordon Tetlow [Tue, 15 Mar 2022 16:48:59 +0000 (09:48 -0700)]
Fix a bug in BN_mod_sqrt() that can cause it to loop forever.

Approved by: re (implicit)
Obtained from: OpenSSL Project
Security: CVE-2022-0778
Security: FreeBSD-SA-22:03.openssl

(cherry picked from commit fdc418f15e92732a3551832bcb625ba9b47242df)
(cherry picked from commit 5f3d952f6e6bce1151ab4a260c6922ba10d7a7ba)

3 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), re (delphij)
Differential Revision: https://reviews.freebsd.org/D20780

3 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)

3 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)

3 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)

3 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")

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)

3 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)