]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agomvneta: Fix MTU update sequence
Kornel Duleba [Tue, 31 Aug 2021 06:22:29 +0000 (08:22 +0200)]
mvneta: Fix MTU update sequence

After MTU is updated we might start using allocating RX buffers from different pool. (MJUM9BYTES vs MCLBYTES)
Because of that we need to update the RX buffer size in hardware.
Previously it was done only when the interface was up, which is incorrect since MTU can be changed at any time.

Differential revision: https://reviews.freebsd.org/D31724
Sponsored by: Stormshield
Obtained from: Semihalf
MFC after: 2 weeks
Reviewed by: wma

(cherry picked from commit 5438ef47e377d659acf7f97a66fe418223f2c847)

2 years agoif_cdce: Add support for setting RX filtering
Kornel Duleba [Tue, 31 Aug 2021 12:22:30 +0000 (14:22 +0200)]
if_cdce: Add support for setting RX filtering

We can now set promisc and allmulti modes.
Filtering of given multicast addresses is not supported.
Changing the mode is done by sending a command described in:
"USB CDC Subclass Specification for Ethernet Devices v1.2, section 6.2.4".
This means that at least in theory this feature should work with all
modems that are using this driver.

This fixes Huawei E3372h-320 running new firmware in "HiLink" mode.
Previously it would reset a few seconds after its mode was changed
with "usb_modeswitch".
Setting RX filter to default value at the end of attach function
fixed that.

Sponsored by: Stormshield
Obtained from: Semihalf
Differential revision: https://reviews.freebsd.org/D31766
MFC after: 2 weeks
Reviewed by: hps

(cherry picked from commit f0c393f781f01ffa727f90a8593e26a20869438b)

2 years agoued may be NULL here which will cause a panic... reproducable by
John-Mark Gurney [Tue, 29 Jun 2021 01:09:14 +0000 (18:09 -0700)]
ued may be NULL here which will cause a panic... reproducable by
simply doing a usbconfig reset on a device which doesn't reset itself
properly...

(cherry picked from commit 3d5104182c2eb4336905e89aa0d089b67aa746e3)

2 years agoAdd support for link status, media and VLAN MTU (if supported) to if_cdce...
John-Mark Gurney [Sat, 26 Jun 2021 00:47:02 +0000 (17:47 -0700)]
Add support for link status, media and VLAN MTU (if supported) to if_cdce...

This makes it more usable in that dhclient will autolaunch from devd
now when cdce devices are plugged in..  It also sets the baudrate, but
this isn't exported via tools, and CDCE doesn't have a good way to
specify the media type, so there isn't a good way to tell userland
what the speed is currently...

Reviewed by: hps
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D30625

(cherry picked from commit b43d600c839a9a4d66139c93506e26128370ed7c)

2 years agoumodem: Add Huawei E3372h-320 device id
Kornel Duleba [Tue, 31 Aug 2021 06:44:36 +0000 (08:44 +0200)]
umodem: Add Huawei E3372h-320 device id

After switching the dongle to the Huawei alternate mode(modem mode)
with usb_modeswitch the serial interfaces had all of their ids set to
0xFF.
After modifying umodem to work with that it attached successfully and
I've managed to configure device with standard AT commands to get
internet connection.

(cherry picked from commit 28d549826844b89224f0335b6318eb277031ea78)

2 years agoEliminate snaplk / bufwait LOR when creating UFS snapshots
Kirk McKusick [Sat, 18 Sep 2021 23:51:07 +0000 (16:51 -0700)]
Eliminate snaplk / bufwait LOR when creating UFS snapshots

(cherry picked from commit d7770a5495b19a987dddc77cabcdeadf18413b4d)

2 years agoAllow setting NFS server scope and owner.
Alexander Motin [Tue, 14 Sep 2021 18:14:30 +0000 (14:14 -0400)]
Allow setting NFS server scope and owner.

By default NFS server reports as scope and owner major the host UUID
value and zero for owner minor.  It works good in case of standalone
server.  But in case of CARP-based HA cluster failover the values
should remain persistent, otherwise some clients like VMware ESXi
get confused by the change and fail to reconnect automatically.

The patch makes server scope, major owner and minor owner values
configurable via sysctls.  If not set (by default) the host UUID
value is still used.

Reviewed by: rmacklem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31952

(cherry picked from commit 272c4a4dc5fbe3d82d735c5b9a3b6faab052808b)

2 years agoRestrict spsr updated in the arm64 set_regs*
Andrew Turner [Mon, 13 Sep 2021 15:24:34 +0000 (15:24 +0000)]
Restrict spsr updated in the arm64 set_regs*

When using ptrace(2) on arm64 to set registers in a 32-bit program we
need to take care to only set some of the fields. Follow the existing
arm64 path and only let the user set the flags fields. This is also the
case in the arm kernel so fixes a change in behaviour between the two.

While here update set_regs to only set spsr and elr once.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit b029ef7fe618c6fa0482958422cc362905c15376)

2 years agoAdd arm64 ifunc support in static binaries
Andrew Turner [Fri, 20 Aug 2021 08:22:48 +0000 (09:22 +0100)]
Add arm64 ifunc support in static binaries

Add support for the R_AARCH64_IRELATIVE relocation type in static
binaries on arm64. This is based on the powerpc code, updating it to
use the arm64 resolver ABI, and use the arm64 relocation type.

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

(cherry picked from commit bc5304a006238115291e7568583632889dffbab9)

2 years agoEnable arm64 SError exceptions in the kernel
Andrew Turner [Mon, 9 Aug 2021 16:30:44 +0000 (16:30 +0000)]
Enable arm64 SError exceptions in the kernel

These are needed to signal to the kernel when a Reliability,
Availability, and Serviceability (RAS) exception has triggered.

Reviewed by: mhorne
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31477

(cherry picked from commit 17b6ee96138220a164d632f0be69d3df77bdd61a)

2 years agoAdd the Apple arm64 implementer ID
Andrew Turner [Wed, 11 Aug 2021 15:30:44 +0000 (16:30 +0100)]
Add the Apple arm64 implementer ID

Sponsored by: The FreeBSD Foundation

(cherry picked from commit a7fcda1b8c21a47ac8cdd2e7cfae298d67467e3b)

2 years agoSort the arm64 cpu_implementers list by name
Andrew Turner [Wed, 11 Aug 2021 15:29:09 +0000 (16:29 +0100)]
Sort the arm64 cpu_implementers list by name

We perform a linear search, so make it easier to add new entries in the
correct place.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 29b25b13c777a682e33edc9e2d05e87339b03cc3)

2 years agoRead the arm64 midr register earlier
Andrew Turner [Wed, 11 Aug 2021 15:01:25 +0000 (16:01 +0100)]
Read the arm64 midr register earlier

We use the midr_el1 register to decode which CPU type we are booting
from. Read it on the secondary CPUs before waiting for the boot CPU
to release us as it will need to use it before the release.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6b22840ed0e8f9ceb34465987b8469a43ebb4582)

2 years agoOnly use byte register access in legacy virtio pci
Andrew Turner [Thu, 5 Aug 2021 14:36:07 +0000 (14:36 +0000)]
Only use byte register access in legacy virtio pci

Some simulators don't implement arbitrary sized memory access to the
virtio PCI registers. Follow Linux and use single byte accesses to read
and write to these registers.

Reviewed by: bryanv, emaste (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31424

(cherry picked from commit 89c085b8993d7d1e7b137f99fa6df94c37c3a68a)

2 years agoRemove an unused arm64 panic string
Andrew Turner [Sun, 8 Aug 2021 21:28:25 +0000 (21:28 +0000)]
Remove an unused arm64 panic string

This was added early in the development of the arm64 port when
cpu_switch was just a stub. It should have been removed when cpu_switch
was implemented, however this didn't seem to be the case, and the '%p'
was added.

As this hasn't been needed in 7 years we can remove it.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 267d55fa2a74a6e04eb760e4cbb07c7f66729ac9)

2 years agoAdd macros for the arm64 daifset/daifclr flags
Andrew Turner [Tue, 3 Aug 2021 13:18:07 +0000 (13:18 +0000)]
Add macros for the arm64 daifset/daifclr flags

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 337eb2ab9549b230926ab52857d1ef86ba121366)

2 years agoClean up the arm64 fork_trampoline
Andrew Turner [Mon, 9 Aug 2021 10:03:57 +0000 (10:03 +0000)]
Clean up the arm64 fork_trampoline

When exiting to userspace the code is similar to the restore_registers
macro in exception.S. Rework it to remove most of the non-style
differences.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1791a628a13e0d6f69bc0b52934b05f09c986507)

2 years agoFix data race in scsi cd driver.
Alexander Motin [Mon, 13 Sep 2021 12:59:51 +0000 (08:59 -0400)]
Fix data race in scsi cd driver.

There is a data race between cdsysctlinit and cdcheckmedia.  Both
functions change softc->flags without synchronization.

Submitted by: Arseny Smalyuk <smalukav@gmail.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31726

(cherry picked from commit e76786909ce0195855196305a04d86b40f138894)

2 years agoopencrypto: Allow kern.crypto.allow_soft to be specified as a tunable
Mark Johnston [Mon, 20 Sep 2021 16:07:29 +0000 (12:07 -0400)]
opencrypto: Allow kern.crypto.allow_soft to be specified as a tunable

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9e0c051249e3832e0f6a0067058ff9735677f3d5)

2 years agoaio_fsync_vnode: handle ERELOOKUP after VOP_FSYNC()
Konstantin Belousov [Mon, 20 Sep 2021 09:32:28 +0000 (12:32 +0300)]
aio_fsync_vnode: handle ERELOOKUP after VOP_FSYNC()

(cherry picked from commit 2933a7ca03f16ba7b048a9bd2b3df1fc3cf9c344)

2 years agoaio_fsync_vnode: use for(;;) loop instead of label
Konstantin Belousov [Mon, 20 Sep 2021 09:30:54 +0000 (12:30 +0300)]
aio_fsync_vnode: use for(;;) loop instead of label

(cherry picked from commit 922bee44e400321ac98b3b371cde3f0ff6137dd0)

2 years agofreebsd32: Fix a double copyin in sendmsg() and recvmsg()
Mark Johnston [Sun, 19 Sep 2021 17:45:09 +0000 (13:45 -0400)]
freebsd32: Fix a double copyin in sendmsg() and recvmsg()

freebsd32_sendmsg() and freebsd32_recvmsg() both copyin the message
header twice, once directly and once in freebsd32_copyinmsghdr().  The
iovec length from the former is used when copying in msg_iov, but the
rest of the kernel uses the iovec length from the latter.  When
kern_sendit() and kern_recvit() iterate over the iovec to compute the
residual for I/O, they can therefore end up walking past the end of the
copied in iovec, either resulting in a system call error, userspace
memory corruption from uiomove() with invalid iovecs, or a kernel page
fault if the copied-in iovec is followed by an unmapped KVA region.

Reported by: syzbot+7cc64cd0c49605acd421@syzkaller.appspotmail.com
Reviewed by: kib, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit fea1a98ead918b39280b586773a923e76194400b)

2 years agofreebsd32: Provide an ANSI definition for freebsd32_recvmsg()
Mark Johnston [Sun, 19 Sep 2021 17:41:43 +0000 (13:41 -0400)]
freebsd32: Provide an ANSI definition for freebsd32_recvmsg()

Fix style in the freebsd32_sendmsg() definition.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 4bda16ff184bfca5ee4bf9709a06323d9cf5945b)

2 years agolibnetmap: reset errno in nmreq_register_decode()
Vincenzo Maffione [Fri, 2 Apr 2021 14:31:57 +0000 (14:31 +0000)]
libnetmap: reset errno in nmreq_register_decode()

The reset is necessary at the beginning of the function, because of
the errno logic in the error path (set errno to EINVAL if not set).
If errno is already set when calling the function, and the function
fails, the previous errno value will be inherited.

(cherry picked from commit ab639bb2873034786cd2ec4d2d9c4489fbf6f424)

2 years agonetmap: monitor: add a flag to distinguish packet direction
Vincenzo Maffione [Mon, 29 Mar 2021 16:32:54 +0000 (16:32 +0000)]
netmap: monitor: add a flag to distinguish packet direction

The netmap monitor intercepts any TX/RX packets on the monitored
port. However, before this change there was no way to tell
whether an intercepted packet was being transmitted or received
on the monitored port.
A TXMON flag in the netmap slot has been added for this purpose.

(cherry picked from commit 660a47cb991d5a7ca69cd8dd9c09a5288d49e405)

2 years agonfsd: Fix build after commit 103b207536f9 for 32bit arches
Rick Macklem [Thu, 9 Sep 2021 01:55:06 +0000 (18:55 -0700)]
nfsd: Fix build after commit 103b207536f9 for 32bit arches

(cherry picked from commit f1c8811d2d250aac5a59bb2109d905139c119925)

2 years agonfsd: Use the COPY_FILE_RANGE_TIMEO1SEC flag
Rick Macklem [Wed, 8 Sep 2021 21:29:20 +0000 (14:29 -0700)]
nfsd: Use the COPY_FILE_RANGE_TIMEO1SEC flag

Although it is not specified in the RFCs, the concept that
the NFSv4 server should reply to an RPC request within a
reasonable time is accepted practice within the NFSv4 community.

Without this patch, the NFSv4.2 server attempts to reply to
a Copy operation within 1 second by limiting the copy to
vfs.nfs.maxcopyrange bytes (default 10Mbytes). This is crude at
best, given the large variation in I/O subsystem performance.

This patch uses the COPY_FILE_RANGE_TIMEO1SEC flag added by
commit c5128c48df3c to limit the reply time for a Copy
operation to approximately 1 second.

(cherry picked from commit 103b207536f976cb350558769f5f428e05ec61dc)

2 years agovt: bound buffer access in redraw optimization
Ed Maste [Wed, 22 Sep 2021 18:41:00 +0000 (14:41 -0400)]
vt: bound buffer access in redraw optimization

PR: 248628
Reported by: oleg
Reviewed by: cem, oleg (both earlier)
Fixes: ee97b2336aa4 ("Speed up vt(4) by keeping...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32059

(cherry picked from commit dbc7ca59451561a179f9852642e13ef024169d84)

2 years agoEC2: Default to UEFI booting
Colin Percival [Thu, 16 Sep 2021 16:22:42 +0000 (09:22 -0700)]
EC2: Default to UEFI booting

This reduces the FreeBSD boot time by approximately 5 seconds,
roughly equally divided betwenn two factors:
* Disk I/O is faster in the EFI loader since it can perform larger
I/Os.  (The BIOS loader is limited due to the use of bounce buffers
in sub-1M memory.)
* The EFI console is much faster than the VGA console.

Note however that not all EC2 instance types support UEFI; as a
general rule the newer instances (based on Amazon's "Nitro" platform)
support UEFI but the older instances (based on Xen) do not.

Discussed with: re@, freebsd-cloud@, Amazon
Relnotes: yes
Sponsored by: https://www.patreon.com/cperciva

(cherry picked from commit b43d7aa09b3c91fb6b652306db2ac13e1459c497)

2 years agoEC2: Allow AMI boot mode to be specified
Colin Percival [Thu, 16 Sep 2021 02:15:44 +0000 (19:15 -0700)]
EC2: Allow AMI boot mode to be specified

The default boot method for amd64 AMIs is BIOS, but at AMI creation
time a flag can be set to specify that UEFI should be used instead.
This commit adds a variable AMIBOOTMETHOD which, if set to "UEFI",
causes the appropriate flag to be set during AMI creation.

The only boot method supported by EC2 for arm64 is UEFI.

The names of AMIs are also amended to include the boot method; they
now look like "FreeBSD 14.0-CURRENT-amd64-20210915 UEFI".

Sponsored by: https://www.patreon.com/cperciva

(cherry picked from commit 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0)

2 years agodiff3: document and test -T
Piotr Pawel Stefaniak [Mon, 23 Aug 2021 19:33:27 +0000 (21:33 +0200)]
diff3: document and test -T

(cherry picked from commit 9f7a81b133c715f649136dcd0ad004e4180c56c9)

2 years agodiff3: implement --strip-trailing-cr
Piotr Pawel Stefaniak [Sat, 21 Aug 2021 00:28:58 +0000 (02:28 +0200)]
diff3: implement --strip-trailing-cr

(cherry picked from commit 54a3415cb69e1ea0e6533ca3fc168deba64f249f)

2 years agodiff3.1: update manual page to match code
Piotr Pawel Stefaniak [Fri, 20 Aug 2021 22:50:05 +0000 (00:50 +0200)]
diff3.1: update manual page to match code

(cherry picked from commit e8ff95356ceaaa941251056e9d0a4211bf428e06)

2 years agodiff3: improve style
Piotr Pawel Stefaniak [Fri, 20 Aug 2021 21:50:20 +0000 (23:50 +0200)]
diff3: improve style

(cherry picked from commit 702dda4368dc2d07e8898fcfdddb12d730e6c174)

2 years agodiff3: sync with upstream
Piotr Pawel Stefaniak [Fri, 20 Aug 2021 21:35:24 +0000 (23:35 +0200)]
diff3: sync with upstream

 * replace realloc calls with reallocarray calls
 * fix merging of files that lack newlines

Obtained from: OpenBSD

(cherry picked from commit 7f7b03f3897f0196e3cc7a3b71c7359cc206ba61)

2 years agoRegister /usr/tests/usr.bin/diff3
Piotr Pawel Stefaniak [Sun, 22 Aug 2021 10:08:39 +0000 (12:08 +0200)]
Register /usr/tests/usr.bin/diff3

I wasn't able to make check to run diff3 tests, but kevans figured out
that I was missing diff3 in mtree.

(cherry picked from commit f8e50dd2c67baea2bbd75f94218911d5a4d39597)

2 years agodiff: read whole files to determine if they are ASCII text
Piotr Pawel Stefaniak [Sun, 22 Aug 2021 19:57:13 +0000 (21:57 +0200)]
diff: read whole files to determine if they are ASCII text

Before this change, only the first BUFSIZE bytes were checked.

(cherry picked from commit 3cbf98e2bee91db9ed9118ff557e02cdd449f49a)

2 years agodiff: don't output carriage returns that were stripped on input
Piotr Pawel Stefaniak [Sun, 22 Aug 2021 16:05:59 +0000 (18:05 +0200)]
diff: don't output carriage returns that were stripped on input

--strip-trailing-cr worked as intended for comparison between files,
but the characters were still present in final output.

(cherry picked from commit af2f0164318455433db95adce07af829285b78ad)

2 years agosh: improve command completion
Piotr Pawel Stefaniak [Wed, 22 Sep 2021 16:23:29 +0000 (18:23 +0200)]
sh: improve command completion

When there are many matches, find the longest common substring starting
from the beginning of each command and use that to replace input.

As an example: on my system, llv<tab> will be autocompleted to llvm-
and another <tab> will print all matching llvm commands.

(cherry picked from commit c866d0c798a20b8f0a92df524f4ddd0d81511c88)

2 years agosh: reset sh bindings on bind -e, bind -v
Piotr Pawel Stefaniak [Sun, 19 Sep 2021 20:17:01 +0000 (22:17 +0200)]
sh: reset sh bindings on bind -e, bind -v

Until this change, any bindings set in histedit() were lost on calls to
bindcmd().

Only bind -e and bind -v call libedit's keymacro_reset(). Currently you
cannot fool libedit/map.c:map_bind() by trying something like bind -le
as when p[0] == '-', it does a switch statement on p[1].

(cherry picked from commit 9413dfd331e705a1d7909fe41f06a30e43c442f7)

2 years agosh: improve command completion
Piotr Pawel Stefaniak [Sat, 18 Sep 2021 11:26:51 +0000 (13:26 +0200)]
sh: improve command completion

When multiple matches are found, we keep the provided string on the
input line and print unique matches as suggestions.

But the multiple matches might be the same command found in different
directories, so we should deduplicate the matches first and then decide
whether to autocomplete the command or not, based on the number of
unique matches.

(cherry picked from commit b8ff849cbddfee3404d6550cf98f53d6bb617707)

2 years agofstyp: bump WARNS to default and work around warnings
Piotr Pawel Stefaniak [Tue, 17 Aug 2021 15:46:08 +0000 (17:46 +0200)]
fstyp: bump WARNS to default and work around warnings

(cherry picked from commit da0c0e0121574a1d82f417cc7e245ecd5506325c)

2 years agoUpdate a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c
Piotr Pawel Stefaniak [Sat, 28 Aug 2021 08:01:19 +0000 (10:01 +0200)]
Update a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c

This change was missed in r333509 (e6b475e0af).

(cherry picked from commit 0939f965d80d00e783b3319a57e7d71e0b3f202e)

2 years agoUpdate leap-seconds to leap-seconds.3676924800.
Xin LI [Mon, 20 Sep 2021 05:26:22 +0000 (22:26 -0700)]
Update leap-seconds to leap-seconds.3676924800.

Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800.
MFC after: 3 days

(cherry picked from commit 7ba7bf48d5bd6ca89f4e81579456b74ee7aa9e4f)

2 years agounix: Fix a use-after-free in unp_drop()
Mark Johnston [Sat, 18 Sep 2021 14:38:39 +0000 (10:38 -0400)]
unix: Fix a use-after-free in unp_drop()

We need to load the socket pointer after locking the PCB, otherwise
the socket may have been detached and freed by the time that unp_drop()
sets so_error.

This previously went unnoticed as the socket zone was _NOFREE.

Reported by: pho

(cherry picked from commit 50b07c1f7131fd535bbe1b53a3a2e4dfcdcc2e51)

2 years agosocket: Add assertions around naked refcount decrements
Mark Johnston [Fri, 17 Sep 2021 16:26:56 +0000 (12:26 -0400)]
socket: Add assertions around naked refcount decrements

Sockets in a listen queue hold a reference to the parent listening
socket.  Several code paths release this reference manually when moving
a child socket out of the queue.

Replace comments about the expected post-decrement refcount value with
assertions.  Use refcount_load() instead of a plain load.  No functional
change intended.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6b288408ca32e68c74f6ab12324448ab4862a045)

2 years agosocket: Fix a use-after-free in soclose()
Mark Johnston [Fri, 17 Sep 2021 16:26:06 +0000 (12:26 -0400)]
socket: Fix a use-after-free in soclose()

After releasing the fd reference to a socket "so", we should avoid
testing SOLISTENING(so) since the socket may have been freed.  Instead,
directly test whether the list of unaccepted sockets is empty.

Fixes: f4bb1869ddd2 ("Consistently use the SOLISTENING() macro")
Pointy hat: markj
Sponsored by: The FreeBSD Foundation

(cherry picked from commit dfcef8771484271f2bccdb1dbc088a838441c5a7)

2 years agouma: Show the count of free slabs in each per-domain keg's sysctl tree
Mark Johnston [Fri, 17 Sep 2021 16:13:47 +0000 (12:13 -0400)]
uma: Show the count of free slabs in each per-domain keg's sysctl tree

This is useful for measuring the number of pages that could be freed
from a NOFREE zone under memory pressure.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit d6e77cda9be1509ea170142cca3ff0d3b9f12e35)

2 years agorpc: Convert an SOLISTENING check to an assertion
Mark Johnston [Fri, 17 Sep 2021 16:13:02 +0000 (12:13 -0400)]
rpc: Convert an SOLISTENING check to an assertion

Per the comment, this socket should always be a listening socket.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7fabaac2211e7ed1cec9650e46f4e03428411dcf)

2 years agoefi loader: Typo
Mark Johnston [Tue, 21 Sep 2021 16:09:55 +0000 (12:09 -0400)]
efi loader: Typo

(cherry picked from commit 0e3ce6d082b34154e41e220757c03d66d881a47b)

2 years agoe1000: Catch up commit with DPDK
Kevin Bowling [Fri, 17 Sep 2021 02:30:49 +0000 (19:30 -0700)]
e1000: Catch up commit with DPDK

Various syncs with the e1000 shared code from DPDK:
"cid-gigabit.2020.06.05.tar.gz released by ND"

Approved by: imp
Obtained from: DPDK
MFC after: 1 week

(cherry picked from commit 984d1616be883bc2c351aff9aa69b1abd7d1214c)

2 years agoe1000: prevent ULP flow if cable connected
Wenzhuo Lu [Fri, 16 Oct 2015 02:51:03 +0000 (10:51 +0800)]
e1000: prevent ULP flow if cable connected

Enabling ulp on link down when cable is connect caused an infinite
loop of linkup/down indications in the NDIS driver.
After discussed, correct flow is to enable ULP only when cable is
disconnected.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Approved by: imp
Obtained from: DPDK (4bff263d54d299269966365f9697941eecaa241b)
MFC after: 1 week

(cherry picked from commit 40fa6e53f53cde84f6f5c7330f89e4ae373d7d93)

2 years agoe1000: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:15 +0000 (16:03 +0100)]
e1000: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: 'link' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if (link) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Approved by: imp
Obtained from: DPDK (46136031f19107f4e9b6b3a952cb7f57877a7f0f)
MFC after: 1 week

(cherry picked from commit 089cdb3990f47be3cd34d1a57567a2e89c917929)

2 years agoe1000: fix multicast setting in VF
Yong Wang [Tue, 21 Feb 2017 09:33:23 +0000 (04:33 -0500)]
e1000: fix multicast setting in VF

In function e1000_update_mc_addr_list_vf(), "msgbuf[0]" is used prior
to initialization at "msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW".
And "msgbuf[0]" is overwritten at "msgbuf[0] = E1000_VF_SET_MULTICAST".

Fix it by moving the second line prior to the first one that mentioned
above.

Fixes: dffbaf7880a8 ("e1000: revert fix for multicast in VF")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Approved by: imp
Obtained from: DPDK (f58ca2f9ef6)
MFC after: 1 week

(cherry picked from commit ecf2a89a997ad4a14339b6a2f544e44b422620a0)

2 years agoe1000: fix timeout for shadow RAM write
Chengwen Feng [Wed, 21 Apr 2021 09:15:35 +0000 (17:15 +0800)]
e1000: fix timeout for shadow RAM write

This fixes the timed out for shadow RAM write EEWR can't be detected.

Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Approved by: imp
Obtained from: DPDK (4a8ab48ec47b3616272e50620b8e1a9599358ea6)
MFC after: 1 week

(cherry picked from commit f6517a7e69c10c6057d6c990a9f3ea22a2b62398)

2 years agoe1000: cleanup pre-processor tags
Guinan Sun [Mon, 6 Jul 2020 08:12:20 +0000 (08:12 +0000)]
e1000: cleanup pre-processor tags

The codes has been exposed correctly, so remove pre-processor tags.

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (a50e998a0fd94e5db508710868a3417b1846425c)
MFC after: 1 week

(cherry picked from commit 9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b)

2 years agoe1000: introduce DPGFR register
Guinan Sun [Mon, 6 Jul 2020 08:12:19 +0000 (08:12 +0000)]
e1000: introduce DPGFR register

Defined DPGFR, Dynamic Power Gate Force Control Register.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (1469e5aceffbdcebe834292aadb40b1bd1602867)
MFC after: 1 week

(cherry picked from commit 7fb2111413c799414c86d7bfdcc72bc1c6302726)

2 years agoe1000: expose FEXTNVM registers and masks
Guinan Sun [Mon, 6 Jul 2020 08:12:16 +0000 (08:12 +0000)]
e1000: expose FEXTNVM registers and masks

Adding defines for FEXTNVM8 and FEXTNVM12 registers with new masks for
future use.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (6d208ec099cd870a73c6b444b350a82c7a26c5e4)
MFC after: 1 week

(cherry picked from commit de965d042fa4d341cec3fa7cacac0f30f224bde4)

2 years agoe1000: add missed define for VFTA
Guinan Sun [Mon, 6 Jul 2020 08:12:13 +0000 (08:12 +0000)]
e1000: add missed define for VFTA

VLAN filtering using the VFTA (VLAN Filter Table Array) and
should be initialized prior to setting rx mode.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (fc9933953c90e99970aa867c38f9c6e6c5d0488d)
MFC after: 1 week

(cherry picked from commit a8bb4ab7cfb84195ef8af3c788fecdc8830fc960)

2 years agoe1000: increase timeout for ME ULP exit
Guinan Sun [Mon, 6 Jul 2020 08:12:09 +0000 (08:12 +0000)]
e1000: increase timeout for ME ULP exit

Due timing issues in WHL and since recovery by host is
not always supported, increased timeout for Manageability Engine(ME)
to finish Ultra Low Power(ULP) exit flow for Nahum before timer expiration.

Signed-off-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (cf1f3ca45d33e793ca581200b4000c39a798113e)
MFC after: 1 week

(cherry picked from commit e8e3171d992f3255cc8e5a0f59912d07679cc94c)

2 years agoe1000: add missing register defines
Guinan Sun [Mon, 6 Jul 2020 08:12:08 +0000 (08:12 +0000)]
e1000: add missing register defines

Added defines for the EEC, SHADOWINF and FLFWUPDATE registers needed for
the nvmupd_validate_offset function to correctly validate the NVM update
offset.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (2c7fe65ab9a31e6ebf438dad7ccc59bcde83a89f)
MFC after: 1 week

(cherry picked from commit 09888d4bc1a2c45d121046f79be5c01e4889a67e)

2 years agoe1000: add PCIm function state
Guinan Sun [Mon, 6 Jul 2020 08:12:07 +0000 (08:12 +0000)]
e1000: add PCIm function state

Added define to pcim function state.

Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (7ee1a3b273c7f321b50e6ba17c3d9537b1b08347)
MFC after: 1 week

(cherry picked from commit a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1)

2 years agoe1000: expose MAC functions
Guinan Sun [Mon, 6 Jul 2020 08:12:06 +0000 (08:12 +0000)]
e1000: expose MAC functions

Now the functions are being accessed outside of the file, we need
to properly expose them for silicon families to use.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (df01c0ee277d51f81d7d72501dba97550d3b6c4a)
MFC after: 1 week

(cherry picked from commit d1c37752e2afb51dfb2e08afe714a799788b6ede)

2 years agoe1000: update for i210 slow system clock
Guinan Sun [Mon, 6 Jul 2020 08:11:56 +0000 (08:11 +0000)]
e1000: update for i210 slow system clock

This code is required for the update for system clock.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (3f0188c8f29847038bc9f306b2570ace57e3811c)
MFC after: 1 week

(cherry picked from commit 1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9)

2 years agoe1000: remove duplicated phy codes
Guinan Sun [Mon, 6 Jul 2020 08:12:05 +0000 (08:12 +0000)]
e1000: remove duplicated phy codes

Add two files base.c and base.h to reduce the redundancy
in the silicon family code.
Remove the code duplication from e1000_82575 files.
Clean family specific functions from base.
Fix up a stray and duplicate function declaration.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (44dddd14059f151f39f7e075b887decfc9a10f11)
MFC after: 1 week

(cherry picked from commit 6b9d35fac12bf657cd1df8f1521c70704ff62b61)

2 years agoe1000: modify HW level time sync mechanisms
Guinan Sun [Mon, 6 Jul 2020 08:12:04 +0000 (08:12 +0000)]
e1000: modify HW level time sync mechanisms

Add additional configuration space access to allow HW
level time sync mechanism.

Signed-off-by: Evgeny Efimov <evgeny.efimov@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (d53391f1fe2e0eba8818517fdf285f893d95dcc8)
MFC after: 1 week

(cherry picked from commit d50f362b505e9026fbd33d00dc43e09cac26a209)

2 years agoe1000: fix minor issues and improve code style
Guinan Sun [Mon, 6 Jul 2020 08:12:03 +0000 (08:12 +0000)]
e1000: fix minor issues and improve code style

Fix typo in piece of code of NVM access for SPT.
And cleans up the remaining instances in the shared code
where it was not adhering to the Linux code standard.
Wrong description was found in the mentioned file, so fix them.
Remove shadowing variable declarations.

Relating to operands in bitwise operations having different sizes.
Unreachable code since *clock_in_i2c_* always return success.
Don't return unused s32 and don't check for constants.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (b8592c89c8fbc871d22313dcac0b86c89a7d5a62)
MFC after: 1 week

(cherry picked from commit 6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756)

2 years agoe1000: add function parameter descriptions
Guinan Sun [Mon, 6 Jul 2020 08:12:02 +0000 (08:12 +0000)]
e1000: add function parameter descriptions

Add function parameter descriptions to address gcc 7 warnings.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (1bf35d435c9764e83be76042fa6489dd127b6c40)
MFC after: 1 week

(cherry picked from commit 5b426b3e8cbd5abdb3a57ff49cd27c36cac03427)

2 years agoe1000: expose xMDIO methods
Guinan Sun [Mon, 6 Jul 2020 08:12:00 +0000 (08:12 +0000)]
e1000: expose xMDIO methods

Move read and write xmdio methods to e1000_phy.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (b14d20f1b2bb0e6d95f19963c5d7f55374e0ead9)
MFC after: 1 week

(cherry picked from commit da24467c7a162691a14f2f74d90ff8dedb816cfc)

2 years agoe1000: add missing device ID
Guinan Sun [Mon, 6 Jul 2020 08:12:10 +0000 (08:12 +0000)]
e1000: add missing device ID

Adding Intel(R) I210 Gigabit Network Connection 15F6 device ID for SGMII
flashless automotive device.

Signed-off-by: Kamil Bednarczyk <kamil.bednarczyk@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (586d770bfefc01d4af97c0ddf17c960c3e49ec22)
MFC after: 1 week

(cherry picked from commit 82a9d0c2c1ef75703d16e49e96d1e7b0bf046882)

2 years agoe1000: support flashless i211 PBA
Guinan Sun [Mon, 6 Jul 2020 08:11:59 +0000 (08:11 +0000)]
e1000: support flashless i211 PBA

Add support to print PBA when using flashless.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Approved by: imp
Obtained from: DPDK (d3c41d90dfd5b39dec14c74cf53086f4e6634aed)
MFC after: 1 week

(cherry picked from commit de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce)

2 years agoe1000: Update copyrights and readme
Kevin Bowling [Thu, 16 Sep 2021 11:35:45 +0000 (04:35 -0700)]
e1000: Update copyrights and readme

Copyrights in sync with "cid-gigabit.2020.06.05.tar.gz released by ND"
(from DPDK).

README from the latest em-7.7.8 on intel.com

Approved by: imp
MFC after: 1 week

(cherry picked from commit 702cac6c6bf20ca43db26c38185f65fc9ed1935e)

2 years agoreadelf: document that -u / --unwind is not yet implemented
Ed Maste [Fri, 17 Sep 2021 13:59:41 +0000 (09:59 -0400)]
readelf: document that -u / --unwind is not yet implemented

ELF tool chain readelf accepts -u / --unwind but just ignores the
option.  This was previously undocumented, which could be confusing for
someone encountering `readelf -u` (in a script or GNU readelf example).

Reported by: markj (in D32003)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8)

2 years agoreadelf: include notes (-n) and unwind (-u) in --all/-a
Ed Maste [Fri, 17 Sep 2021 12:06:27 +0000 (08:06 -0400)]
readelf: include notes (-n) and unwind (-u) in --all/-a

This matches the GNU and LLVM versions of readelf.

As markj noted in the review -u is not actually implemented yet and has
no effect.  The option is accepted and just ignored.

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

(cherry picked from commit f161abf9f2cd7fdd28543f9774de82c89675477c)

2 years agoproccontrol(1): Add wxmap control
Konstantin Belousov [Wed, 1 Sep 2021 23:27:58 +0000 (02:27 +0300)]
proccontrol(1): Add wxmap control

(cherry picked from commit ac8af1938085dae0df32db3229c9d5cb659b90a4)

2 years agoprocctl(2): Add PROC_WXMAP_CTL/STATUS
Konstantin Belousov [Thu, 2 Sep 2021 00:59:10 +0000 (03:59 +0300)]
procctl(2): Add PROC_WXMAP_CTL/STATUS

(cherry picked from commit 796a8e1ad1ae3f7b8e4c9f97bebbef5d7d5a2c16)

2 years agoStyle
Konstantin Belousov [Wed, 1 Sep 2021 23:23:02 +0000 (02:23 +0300)]
Style

(cherry picked from commit 1349891a0eed79625faafa5ad354d65ff9ea6012)

2 years agoproccontrol(1): implement 'nonewprivs'
Edward Tomasz Napierala [Fri, 2 Jul 2021 07:49:20 +0000 (08:49 +0100)]
proccontrol(1): implement 'nonewprivs'

(cherry picked from commit acb1f1269c6f4ff89a0d28ba742f6687e9ef779d)

2 years agoprocctl(2): add PROC_NO_NEW_PRIVS_CTL, PROC_NO_NEW_PRIVS_STATUS
Edward Tomasz Napierala [Thu, 1 Jul 2021 08:11:11 +0000 (09:11 +0100)]
procctl(2): add PROC_NO_NEW_PRIVS_CTL, PROC_NO_NEW_PRIVS_STATUS

(cherry picked from commit db8d680ebe9b12c7d9e0eb8bf9940fcef709f5ec)

2 years agobuffer pager: allow get_blksize method to return error
Konstantin Belousov [Thu, 16 Sep 2021 23:53:58 +0000 (02:53 +0300)]
buffer pager: allow get_blksize method to return error

(cherry picked from commit 197a4f29f39e6ae6215a6dbd28ef449d305e6d49)

2 years agoVOP_COPY_FILE_RANGE: Add a COPY_FILE_RANGE_TIMEO1SEC flag
Rick Macklem [Wed, 8 Sep 2021 00:35:26 +0000 (17:35 -0700)]
VOP_COPY_FILE_RANGE: Add a COPY_FILE_RANGE_TIMEO1SEC flag

Although it is not specified in the RFCs, the concept that
the NFSv4 server should reply to an RPC request within a
reasonable time is accepted practice within the NFSv4 community.

Without this patch, the NFSv4.2 server attempts to reply to
a Copy operation within 1second by limiting the copy to
vfs.nfs.maxcopyrange bytes (default 10Mbytes). This is crude at
best, given the large variation in I/O subsystem performance.

This patch adds a kernel only flag COPY_FILE_RANGE_TIMEO1SEC
that the NFSv4.2 can specify, which tells VOP_COPY_FILE_RANGE()
to return after approximately 1 second with a partial result and
implements this in vn_generic_copy_file_range(), used by
vop_stdcopyfilerange().

Modifying the NFSv4.2 server to set this flag will be done in
a separate patch.  Also under consideration is exposing the
COPY_FILE_RANGE_TIMEO1SEC to userland for use on the FreeBSD
copy_file_range(2) syscall.

Although this technically does change the VFS/VOP KAPI, I do not
think the MFC will cause problems.

(cherry picked from commit c5128c48df3c2f3828432aff2ea536bb9c887e14)

2 years agohkbd(4): Fix build on 32bit platforms
Vladimir Kondratyev [Thu, 9 Sep 2021 22:49:26 +0000 (01:49 +0300)]
hkbd(4): Fix build on 32bit platforms

(cherry picked from commit 38d2e9314b127b3466e8ae4120e21fe1ad076dfc)

2 years agohkbd(4): Fix key repeats on multireport keyboards
Vladimir Kondratyev [Thu, 9 Sep 2021 21:40:13 +0000 (00:40 +0300)]
hkbd(4): Fix key repeats on multireport keyboards

Currently hkbd counts all key states to be "Up" at the start of
interrupt callback. That results in generation of "Key Up" event for
each key that has been downed before but is not listed in current
report while is still downed.

Fix that with clearing of temporary key data storage bits only for
keys contained in processed report.

Reported by: Greg V
Obtained from: sysutils/iichid

(cherry picked from commit 598f0580f6822e2492231d055f49465a5b55d270)

2 years agohkbd(4): Use bitstring(3) KPI for key bitmaps processing.
Vladimir Kondratyev [Thu, 9 Sep 2021 21:39:46 +0000 (00:39 +0300)]
hkbd(4): Use bitstring(3) KPI for key bitmaps processing.

No functional changes intended.

(cherry picked from commit 04918395f18dfb115dc0fe2865780dc607c5dc71)

2 years agohkbd(4): Reduce diff with ukbd(4)
Vladimir Kondratyev [Thu, 9 Sep 2021 21:39:05 +0000 (00:39 +0300)]
hkbd(4): Reduce diff with ukbd(4)

(cherry picked from commit 3ef9023f935ff721f72ed44cf26911b9af72dba1)

2 years agopsm(4): Disable KVM switch "jitter" clamping for absolute touchpads.
Vladimir Kondratyev [Thu, 9 Sep 2021 21:37:40 +0000 (00:37 +0300)]
psm(4): Disable KVM switch "jitter" clamping for absolute touchpads.

r123442 introduced solution for clamping of PS/2 mice jitter when using
a KVM. Solution is to buffer mouse packets for 0.050ms if mouse activity
has not been seen for more than 0.5 seconds. Then flush that data to driver
if no validation errors found or drop the entire queue otherwise.

While it works well with relative devices it has issues with absolute ones
Depending on history buffering may results in delaying of the touch front
edge for 0.050ms that affects gesture processing (tap detection).

As absolute touchpads usually are built-in devices we can safely disable
bufferization and KVM jitter clamping to avoid such a delays.

(cherry picked from commit bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa)

2 years agodirect commit: fix KBI for pci_dev
Warner Losh [Wed, 22 Sep 2021 14:47:12 +0000 (08:47 -0600)]
direct commit: fix KBI for pci_dev

Move all the new elemenets to the end of the structure for 13. We
allocate this inside the linuxkpi code, so the size isn't enccoded in
client modules. However, the offsets to the different fields are
encoded. Tihs modifies 04456f71185340a215e38a4d, and 3a606aadf2e7
and will likely create merge conflicts there (and that's a good thing
since the elements need to be moved to the end of the structure when
merging).

Tweak irq_ent to be binary compatible. Since this is inlined into the
clients, all clients have to agree on the irq_ent offsets.

Restore visibility to linux_kmem_cache_free_rcu
linux_kmem_cache_free_rcu was made static in 10235ad0567f, however
client drivers depended on calling it directly. Make it visible again to
restore the 13.0-Release KBI for linuxkpi.

Bump FreeBSD_version to 1300515 for restoration of 13.0 KBI. Since this
commmit changes the linuxkpi KBI (this time back to 13.0 release to
restore the status quo of), you'll need to recompile everything that
uses it (you needed to earlier as well, but those were silent
recompilation events). The plus side is that our packages (built using
13.0) for drm-kmod 5.4 work again on -stable systems.

Reviewed by: bz, wulf
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31363

2 years agogenoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations
Warner Losh [Tue, 7 Sep 2021 16:08:51 +0000 (10:08 -0600)]
genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations

Linux fails to build now because the mkdtemp in the bootstrapped
environment wants 6 or more X's. Use 10 out of an abundance of caution.

Sponsored by: Netflix
Reviewed by: arichards
Differential Revision: https://reviews.freebsd.org/D31863

(cherry picked from commit ecfbb2e30241ee460617ad4e0c0be16d9930945a)

2 years agocdefs.h: Remove redundant #ifdefs
Warner Losh [Tue, 7 Sep 2021 15:34:02 +0000 (09:34 -0600)]
cdefs.h: Remove redundant #ifdefs

Remove redunant #ifdef __GNUC__ inside an #if defined(__GNUC__)
block. They are nops.

Sponsored by: Netflix

(cherry picked from commit 1e7b5f950b2d54ddb257d008592563c4d753aa54)

2 years agoppbus: Set the lock for pps interface, update to latest api
Warner Losh [Wed, 1 Sep 2021 19:37:27 +0000 (13:37 -0600)]
ppbus: Set the lock for pps interface, update to latest api

Since we take a lock when we enter the ioctl, we need to set driver_mtx
in the pps structure so it can be dropped while sleeping during a call
to timepps_fetch() with a non-zero timeout (PPS_CANWAIT feature).

MFC After: 5 days
Sponsored by: Netflix
Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D31763

(cherry picked from commit c62aa65b2a7a6492e712a69c58a35347aa441a98)

2 years agogrep: fix combination of quiet and count flag
Mariusz Zaborski [Fri, 9 Jul 2021 12:09:14 +0000 (14:09 +0200)]
grep: fix combination of quiet and count flag

When the quiet (-q) flag is provided, we don't expect any output.
Currently, the behavior is broken:
$ grep -cq flag util.c
1

$ grep -cs flag util.c
55

First of all, we print a number to stdout. Secondly, it just returns
0 or 1 (which is unexpected). GNU grep with c and q flags doesn't
print anything.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D31108

(cherry picked from commit 24c681a7f6d6c777221fdbd289da64ff65ad8785)

2 years agoCleanup unused USB enums.
Hans Petter Selasky [Thu, 15 Jul 2021 10:38:16 +0000 (12:38 +0200)]
Cleanup unused USB enums.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agosound(4): Implement playback and recording mode sysctl(8).
Hans Petter Selasky [Wed, 28 Jul 2021 11:22:52 +0000 (13:22 +0200)]
sound(4): Implement playback and recording mode sysctl(8).

The dev.pcm.<N>.mode sysctl(8) gives information if a sound device
supports hardware mixing, playback or recording.

Submitted by: Christos Margiolis <christos@freebsd.org>
Differential Revision: https://reviews.freebsd.org/D31320
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit ed2196e5df0c8b5b81563d2fffdcb32bb7ebe966)

2 years agoImplement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s.
Hans Petter Selasky [Tue, 20 Jul 2021 17:02:41 +0000 (19:02 +0200)]
Implement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s.

These two ioctls are not part of the current version of OSS and were
considered obsolete. However, their behaviour is not the same as their
old one, so this implementation is specific to FreeBSD.

Older OSS versions had the MUTE ioctls take and return an integer with
a value of 0 or 1, which meant that the _whole_ mixer is unmuted or
muted respectively. In my implementation, the ioctl takes and returns
a bitmask that tells us which devices are muted.

This allows us to mute and unmute only the devices we want, instead of the
whole mixer. The bitmask works the same way as in DEVMASK, RECMASK and
RECSRC.

Integrated the hardware volume feature with the new mute system.

Submitted by: Christos Margiolis <christos@freebsd.org>
Differential Revision: https://reviews.freebsd.org/D31130
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit 0f8dafb45859569aa36b63ca2bb4a1c35c970d1e)

2 years agosound(4): Fix typos.
Hans Petter Selasky [Wed, 28 Jul 2021 11:25:01 +0000 (13:25 +0200)]
sound(4): Fix typos.

Submitted by: Christos Margiolis <christos@freebsd.org>
Differential Revision: https://reviews.freebsd.org/D31320
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit 132fca6335939b308f230d4942ba15ba2b56ceb7)

2 years agoUpdate the mlx5en(4) manual page.
Hans Petter Selasky [Tue, 20 Jul 2021 16:00:13 +0000 (18:00 +0200)]
Update the mlx5en(4) manual page.

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

(cherry picked from commit 575945f10b9e11be0f217117c86dd480de6c5f30)

2 years agomlx5/mlx4: Bump driver version to 3.7
Hans Petter Selasky [Wed, 16 Jun 2021 13:02:03 +0000 (15:02 +0200)]
mlx5/mlx4: Bump driver version to 3.7

While at it only output driver version to dmesg(8) when hardware is present.

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

(cherry picked from commit d2cbfbc57b20700d6eb04dbfc4d636ce6c92997c)

2 years agoimport nvi 2.2.0-3bbdfe4
Baptiste Daroussin [Fri, 21 May 2021 20:50:50 +0000 (22:50 +0200)]
import nvi 2.2.0-3bbdfe4

(cherry picked from commit 6680e5a52f8abf059bbbd3e0be66d9dce476cdf9)

2 years agopci_vendors: update to 2021.09.19
Baptiste Daroussin [Tue, 27 Jul 2021 16:56:39 +0000 (18:56 +0200)]
pci_vendors: update to 2021.09.19

(cherry picked from commit 00582fa66051cbdf263a6ce0f10c64ea17a0e9a8)
(cherry picked from commit dcd882f30236fdac6ce7f42129462d72a64daf0c)

2 years agolibfetch: use more portable getline() interface
Daniel Kolesa [Tue, 17 Aug 2021 14:01:46 +0000 (16:01 +0200)]
libfetch: use more portable getline() interface

this is for better portability in order to avoid using a function
which is BSD-only or available via libbsd

(cherry picked from commit ee3ca711a898cf41330c320826ea1e0e6e451f1d)
(cherry picked from commit 635eb7ac7990a2bb29e1992b739617a9db012bf2)