]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoTemporarily skip flaky tset cases under sys.aio.aio_test in CI
Li-Wen Hsu [Tue, 28 Sep 2021 19:32:47 +0000 (03:32 +0800)]
Temporarily skip flaky tset cases under sys.aio.aio_test in CI

- sys.aio.aio_test.vectored_unaligned
- sys.aio.aio_test.vectored_zvol_poll

PR: 258766
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0b159faaca08e6cc89abcd29b4b1360f97e18245)

2 years agonfsclient: Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:17:00 +0000 (15:17 +0200)]
nfsclient: Fix a typo in a comment

- s/derefernce/dereference/

(cherry picked from commit 90d60ca8b7f2483cdc162633f7ea4738dad8fa0e)

2 years agopcm(4): Fix a common typo in source code comments
Gordon Bergling [Sun, 26 Sep 2021 09:21:16 +0000 (11:21 +0200)]
pcm(4): Fix a common typo in source code comments

- s/prefered/preferred/

(cherry picked from commit 513ee901eec639da45796d563168f0af966705e6)

2 years agosctp: Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:15:39 +0000 (15:15 +0200)]
sctp: Fix a typo in a comment

- s/assue/assume/

(cherry picked from commit d2e616147db7b688f2b6fa8ec6d545bc4253de92)

2 years agojail(9): Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:17:41 +0000 (15:17 +0200)]
jail(9): Fix a typo in a comment

- s/erorr/error/

(cherry picked from commit 8771ff75384dec8c9f95ce25b6ca9a639c4b208c)

2 years agocontrib/tzdata: correct DST in Jordan and Samoa
Philip Paeps [Wed, 29 Sep 2021 04:43:58 +0000 (12:43 +0800)]
contrib/tzdata: correct DST in Jordan and Samoa

Direct commit to stable/13.

The recent tzdata 2021b release includes several controversial changes
under active debate on the tz mailing list.  Pending consensus, and
hopefully a 2021c release reflecting it, only merge the DST changes for
Jordan and Samoa.  This corrects present and future timestamps in those
regions.

2 years agoFix false device_set_unit() error.
Alexander Motin [Wed, 22 Sep 2021 12:42:36 +0000 (08:42 -0400)]
Fix false device_set_unit() error.

It should silently succeed if the current unit number is the same as
requested, not fail immediately.

MFC after: 1 week

(cherry picked from commit 884f38590c3cc0b1a2c00904c1f1f6c791376308)

2 years agoipmi(4): Limit maximum watchdog pre-timeout interval.
Alexander Motin [Wed, 15 Sep 2021 01:06:39 +0000 (21:06 -0400)]
ipmi(4): Limit maximum watchdog pre-timeout interval.

Previous code by default setting pre-timeout interval to 120 seconds
made impossible to set timeout interval below that, resulting in error
0xcc (Invalid data field in Request) at least on Supermicro boards.

To fix that limit maximum pre-timeout interval to ~1/4 of the timeout
interval, that sounds like a reasonable default: not too short to fire
too late, but also not too long to give many false reports.

MFC after: 2 weeks

(cherry picked from commit 6c2d4404161aa2bac1c7992afbf5a763f1a6f66e)

2 years agoe1000: Fix tabstop width in if_em.h
Kevin Bowling [Sun, 26 Sep 2021 16:24:53 +0000 (09:24 -0700)]
e1000: Fix tabstop width in if_em.h

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

(cherry picked from commit 21ab8c75c940dd15343b4af28b18a66f377e670a)

2 years agouart: Add PCI ID for intel 100 Series/C230 Series AMT
Sean Bruno [Sat, 25 Sep 2021 22:23:08 +0000 (15:23 -0700)]
uart: Add PCI ID for intel 100 Series/C230 Series AMT

Reviewed by: kib
Tested by: kbowling
Differential Revision: https://reviews.freebsd.org/D32146

(cherry picked from commit fb640be4e9443f1890680c27b213825300bc65f4)

2 years agoe1000: Re-arm link changes
Kevin Bowling [Mon, 27 Sep 2021 16:17:48 +0000 (09:17 -0700)]
e1000: Re-arm link changes

A change to MSI-X link handler was somehow causing issues on
MSI-based em(4) NICs.

Revert the change based on user reports and testing.

PR: 258551
Reported by: Franco Fichtner <franco@opnsense.org>, t_uemura@macome.co.jp
Reviewed by: markj, Franco Fichtner <franco@opnsense.org>
Tested by: t_uemura@macome.co.jp
MFC after: 1 day

(cherry picked from commit 450c3f8b3d259c7eb82488319aff45f1f6554aaf)

2 years agoe1000: Rename 'struct adapter' to 'struct e1000_sc'
Kevin Bowling [Sat, 25 Sep 2021 00:09:43 +0000 (17:09 -0700)]
e1000: Rename 'struct adapter' to 'struct e1000_sc'

Rename the 'struct adapter' to 'struct e1000_sc' to avoid type ambiguity
in things like kgdb.

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

(cherry picked from commit dc9260515449cde9a4b26b5448f7386388c55bbd)

2 years agoe1000: Consistently use FALLTHROUGH
Kevin Bowling [Fri, 17 Sep 2021 03:13:26 +0000 (20:13 -0700)]
e1000: Consistently use FALLTHROUGH

Approved by: imp
MFC after: 1 week

(cherry picked from commit e05d9788b7e90ffd6405dc59656b52a63ba7ff3e)

2 years agoe1000: Use C99 bool types
Kevin Bowling [Fri, 17 Sep 2021 03:08:08 +0000 (20:08 -0700)]
e1000: Use C99 bool types

Approved by: imp
MFC after: 1 week

(cherry picked from commit 1bbdc25fc1edb43562bf2a5f30df7381078991d4)

2 years agoe1000: Fix up HW vlan ops
Kevin Bowling [Wed, 15 Sep 2021 14:47:19 +0000 (07:47 -0700)]
e1000: Fix up HW vlan ops

2796f7ca:
* Don't reset the entire adapter for vlan changes, fix up the problems
* Add some functions for vlan filter (vfta) manipulation
* Don't muck with the vfta if we aren't doing HW vlan filtering
* Disable interrupts when manipulating vfta on lem(4)-class NICs
* On the I350 there is a specification update (2.4.20) in which the
suggested workaround is to write to the vfta 10 times (if at first you
don't succeed, try, try again). Our shared code has the goods, use it
* Increase a VF's frame receive size in the case of vlans

From the referenced PR, this reduced vlan configuration from minutes
to seconds with hundreds or thousands of vlans and prevents wedging the
adapter with needless adapter reinitialization for each vlan ID.

PR: 230996
Reviewed by: markj
Tested by: Ozkan KIRIK <ozkan.kirik@gmail.com>
Differential Revision: https://reviews.freebsd.org/D30002

22b20b45:
e1000: Fix variable typo

Forgot to git add this in last commit

Reported by: jenkins
Fixes: 2796f7cab107

(cherry picked from commit 2796f7cab10785ef40efbba97ef67ab319c96e9c)
(cherry picked from commit 22b20b45c9118bf6ef313c074cdb107a1eaca78e)

2 years agobcm2835_sdhci: don't use DMA for kernel dumps
Mitchell Horne [Thu, 9 Sep 2021 18:07:06 +0000 (15:07 -0300)]
bcm2835_sdhci: don't use DMA for kernel dumps

When handling a data irq, the sdhci driver calls the
sdhci_platform_will_handle() method, to determine if it should allow the
platform driver to handle the transfer or fall back to programmed I/O.
While dumping, the data irq path may be invoked directly (not from an
interrupt context), which the bcm2835_sdhci DMA code is not prepared to
handle. Return early in this case, to force the fallback to PIO.

Otherwise, the KASSERT that follows will be triggered, and the dump will
fail. On non-INVARIANTS kernels, the system will hang, waiting for a DMA
interrupt that will never arrive.

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

(cherry picked from commit 806ebc9eba2a45638d63ae8a2ed20e6fb44dd06e)

2 years agosyslog.conf.5: Fix the message priority order
Felix Guest [Tue, 21 Sep 2021 15:29:39 +0000 (11:29 -0400)]
syslog.conf.5: Fix the message priority order

PR: 219942

(cherry picked from commit 8678140127296c15894094087b81f71fe79a21d9)

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)