]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

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

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

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

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

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

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

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

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

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

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

2 years agoe1000: Revert Update intel shared code
Kevin Bowling [Wed, 8 Sep 2021 22:43:13 +0000 (15:43 -0700)]
e1000: Revert Update intel shared code

This reverts commit fc7682b17f3738573099b8b03f5628dcc8148adb.

This will be done incrementally to help with bisecting an issue in
later I21x devices (ich8lan).

PR: 258153
Approved by: imp
MFC after: 1 day

2 years agovfs: Permit unix sockets to be opened with O_PATH
Mark Johnston [Fri, 17 Sep 2021 16:34:21 +0000 (12:34 -0400)]
vfs: Permit unix sockets to be opened with O_PATH

As with FIFOs, a path descriptor for a unix socket cannot be used with
kevent().

In principle connectat(2) and bindat(2) could be modified to support an
AT_EMPTY_PATH-like mode which operates on the socket referenced by an
O_PATH fd referencing a unix socket.  That would eliminate the path
length limit imposed by sockaddr_un.

Update O_PATH tests.

Reviewed by: kib
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31970

2 years agoaio_test: Validate interactions between AIO on sockets and shutdown(2)
Mark Johnston [Fri, 17 Sep 2021 16:31:59 +0000 (12:31 -0400)]
aio_test: Validate interactions between AIO on sockets and shutdown(2)

Reviewed by: asomers, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31976

2 years agosocket: Synchronize soshutdown() with listen(2) and AIO
Mark Johnston [Fri, 17 Sep 2021 16:29:28 +0000 (12:29 -0400)]
socket: Synchronize soshutdown() with listen(2) and AIO

To handle shutdown(SHUT_RD) we flush the receive buffer of the socket.
This may involve searching for control messages of type SCM_RIGHTS,
since we need to close the file references.  Closing arbitrary files
with socket buffer locks held is undesirable, mainly due to lock
ordering issues, so we instead make a copy of the socket buffer and
operate on that without any locks.  Fields in the original buffer are
cleared.

This behaviour clobbered the AIO job queue associated with a receive
buffer.  It could also cause us to leak a KTLS session reference.
Reorder socket buffer fields to address this.

An alternate solution would be to remove the hack in sorflush(), but
this is not quite feasible (yet).  In particular, though sorflush()
flags the sockbuf with SBS_CANTRCVMORE, it is possible for more data to
be queued - the flag just prevents userspace from reading more data.  I
suspect we should fix this; SBS_CANTRCVMORE represents a terminal state
and protocols can likely just drop any data destined for such a buffer.
Many of them already do, but in some cases the check is racy, and some
KPI churn will be needed to fix everything.  This approach is more
straightforward for now.

Reported by: syzbot+104d8ee3430361cb2795@syzkaller.appspotmail.com
Reported by: syzbot+5bd2e7d05f84a59d0d1b@syzkaller.appspotmail.com
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31976

2 years agosocket: Remove NOFREE from the socket zone
Mark Johnston [Fri, 17 Sep 2021 16:27:26 +0000 (12:27 -0400)]
socket: Remove NOFREE from the socket zone

This flag was added during the transition away from the legacy zone
allocator, commit c897b81311792ccf6a93feff2a405e2ae53f664e.  The old
zone allocator effectively provided _NOFREE semantics, but it seems that
they are not required for sockets.  In particular, we use reference
counting to keep sockets live.

One somewhat dangerous case is sonewconn(), which returns a pointer to a
socket with reference count 0.  This socket is still effectively owned
by the listening socket.  Protocols must therefore be careful to
synchronize sonewconn() calls with their pru_close implementations,
since for listening sockets soclose() will abort the child sockets.  For
example, TCP holds the listening socket's PCB read locked across the
sonewconn() call, which blocks tcp_usr_close(), and sofree()
synchronizes with a concurrent soabort() of the nascent socket.
However, _NOFREE semantics are not required here.

Eliminating _NOFREE has several benefits: it enables use-after-free
detection (e.g., by KASAN) and lets the system reclaim memory from the
socket zone under memory pressure.  No functional change intended.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31975

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.

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

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
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31973

2 years agoktls: Fix error/mode confusion in TCP_*TLS_MODE getsockopt handlers
Mark Johnston [Fri, 17 Sep 2021 16:14:29 +0000 (12:14 -0400)]
ktls: Fix error/mode confusion in TCP_*TLS_MODE getsockopt handlers

ktls_get_(rx|tx)_mode() can return an errno value or a TLS mode, so
errors are effectively hidden.  Fix this by using a separate output
parameter.  Convert to the new socket buffer locking macros while here.

Note that the socket buffer lock is not needed to synchronize the
SOLISTENING check here, we can rely on the PCB lock.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31977

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.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

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.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agokcov: Disable address and memory sanitizers in get_kinfo()
Mark Johnston [Fri, 17 Sep 2021 16:12:02 +0000 (12:12 -0400)]
kcov: Disable address and memory sanitizers in get_kinfo()

get_kinfo() is only called from the coverage sanitizer callbacks, which
are similarly uninstrumented.

Sponsored by: The FreeBSD Foundation

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

Reported and reviewed by: asomers
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31998

2 years agobhyve: Support setting the disk serial number for VirtIO block devices.
John Baldwin [Fri, 17 Sep 2021 16:55:06 +0000 (09:55 -0700)]
bhyve: Support setting the disk serial number for VirtIO block devices.

Reviewed by: allanjude
Obtained from: illumos
Differential Revision: https://reviews.freebsd.org/D31983

2 years agolibc/locale: Fix races between localeconv(3) and setlocale(3)
Mark Johnston [Fri, 17 Sep 2021 14:44:23 +0000 (10:44 -0400)]
libc/locale: Fix races between localeconv(3) and setlocale(3)

Each locale embeds a lazily initialized lconv which is populated by
localeconv(3) and localeconv_l(3).  When setlocale(3) updates the global
locale, the lconv needs to be (lazily) reinitialized.  To signal this,
we set flag variables in the locale structure.  There are two problems:

- The flags are set before the locale is fully updated, so a concurrent
  localeconv() call can observe partially initialized locale data.
- No barriers ensure that localeconv() observes a fully initialized
  locale if a flag is set.

So, move the flag update appropriately, and use acq/rel barriers to
provide some synchronization.  Note that this is inadequate in the face
of multiple concurrent calls to setlocale(3), but this is not expected
to work regardless.

Thanks to Henry Hu <henry.hu.sh@gmail.com> for providing a test case
demonstrating the race.

PR: 258360
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31899

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

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

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

Reviewed by: brooks, emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31779

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

It allows to override kern.elf{32,64}.allow_wx on per-process basis.
In particular, it makes it possible to run binaries without PT_GNU_STACK
and without elfctl note while allow_wx = 0.

Reviewed by: brooks, emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31779

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

Reviewed by: brooks, emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31779

2 years agoChange lowest address on subnet (host 0) not to broadcast by default.
Mike Karels [Sun, 5 Sep 2021 18:14:04 +0000 (13:14 -0500)]
Change lowest address on subnet (host 0) not to broadcast by default.

The address with a host part of all zeros was used as a broadcast long
ago, but the default has been all ones since 4.3BSD and RFC1122.  Until
now, we would broadcast the host zero address as well as the configured
address.  Change to not broadcasting that address by default, but add a
sysctl (net.inet.ip.broadcast_lowest) to re-enable it.  Note that the
correct way to use the zero address for broadcast would be to configure
it as the broadcast address for the network.

See https:/datatracker.ietf.org/doc/draft-schoen-intarea-lowest-address/
and the discussion in https://reviews.freebsd.org/D19316.  Note, Linux
now implements this.

Reviewed by: rgrimes, tuexen; melifaro (previous version)
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D31861

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.

X-MFC: TBD based on tradeoff between performance and compatibility
Relnotes: yes
Sponsored by: https://www.patreon.com/cperciva

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

MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva

2 years agoopenssh: use global state for blacklist in grace_alarm_handler
Ed Maste [Thu, 16 Sep 2021 18:08:27 +0000 (14:08 -0400)]
openssh: use global state for blacklist in grace_alarm_handler

Obtained from: security/openssh-portable
Fixes: 19261079b743 ("openssh: update to OpenSSH v8.7p1")
Sponsored by: The FreeBSD Foundation

2 years agonanobsd: Provide empty routines for new embedded scheme
Warner Losh [Thu, 16 Sep 2021 16:18:32 +0000 (10:18 -0600)]
nanobsd: Provide empty routines for new embedded scheme

calculate_partitioning and create_code_slice are now required in
nanobsd.sh. While things work with the ones provided by legacy.sh, it's
fighting embedded/common's other actions. Instead, replace them with
stubs.

Sponsored by: Netflix

2 years agotest/ptrace/scescx.c: fix printing of braces for syscalls without args
Konstantin Belousov [Thu, 16 Sep 2021 17:23:11 +0000 (20:23 +0300)]
test/ptrace/scescx.c: fix printing of braces for syscalls without args

Also do not print stray closing brace for error condition.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoRemove PT_GET_SC_ARGS_ALL
Konstantin Belousov [Wed, 15 Sep 2021 13:24:09 +0000 (16:24 +0300)]
Remove PT_GET_SC_ARGS_ALL

Reimplement bdf0f24bb16d556a5b by checking for the caller' ABI in
the implementation of PT_GET_SC_ARGS, and copying out everything if
it is Linuxolator.

Also fix a minor information leak: if PT_GET_SC_ARGS_ALL is done on the
thread reused after other process, it allows to read some number of that
thread last syscall arguments. Clear td_sa.args in thread_alloc().

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D31968

2 years agovm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys...
Konstantin Belousov [Tue, 14 Sep 2021 12:25:37 +0000 (15:25 +0300)]
vm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys segments

If phys_avail[] segment only intersect with some vm_phys segment, add
pages from it to the free list that belong to the given vm_phys_seg,
instead of dropping them.

The vm_phys segments are generally result of subdivision of phys_avail
segments, for instance DMA32 or LOWMEM boundaries split them. On
amd64, after UEFI in-place kernel activation (copy_staging disable)
was enabled, we typically have a large phys_avail[] segment below 4G
which crosses LOWMEM (1M) boundary. With the current way of requiring
phys_avail[] fully fit into vm_phys_seg, this memory was ignored.

Reported by: madpilot
Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31958

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

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

Reported by: jrtc27

2 years agoena: fix building in-kernel driver
Artur Rojek [Thu, 16 Sep 2021 12:14:54 +0000 (14:14 +0200)]
ena: fix building in-kernel driver

When building ENA as compiled into the kernel, the driver would fail to
build. Resolve the problem by introducing the following changes:
1. Add missing `ena_rss.c` entry in `sys/conf/files`.
2. Prevent SYSCTL_ADD_INT from throwing an assert due to an extra
CTLTYPE_INT flag.

Fixes: 986e7b92276 ("ena: Move RSS logic into its own source files")
Fixes: 6d1ef2abd33 ("ena: Implement full RSS reconfiguration")
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
MFC after: 1 week

2 years ago[fib algo][dxr] Fix division by zero.
Marko Zec [Thu, 16 Sep 2021 14:34:05 +0000 (16:34 +0200)]
[fib algo][dxr] Fix division by zero.

A division by zero would occur if DXR would be activated on a vnet
with no IP addresses configured on any interfaces.

PR: 257965
MFC after: 3 days
Reported by: Raul Munoz

2 years agodiff: link with libm for sqrt()
Piotr Pawel Stefaniak [Thu, 16 Sep 2021 07:27:29 +0000 (09:27 +0200)]
diff: link with libm for sqrt()

Reported by: Jenkins
Fixes: bcf2e78dc48378456798191f1c15cb76d6221a65

2 years agostress2: Added more unionfs tests
Peter Holm [Thu, 16 Sep 2021 06:29:07 +0000 (06:29 +0000)]
stress2: Added more unionfs tests

2 years agonfscl: Add vfs.nfs.maxalloclen to limit Allocate/Deallocate RPC RTT
Rick Macklem [Thu, 16 Sep 2021 00:29:45 +0000 (17:29 -0700)]
nfscl: Add vfs.nfs.maxalloclen to limit Allocate/Deallocate RPC RTT

Unlike Copy, the NFSv4.2 Allocate and Deallocate operations do not
allow a reply with partial completion.  As such, the only way to
limit the time the operation takes to provide a reasonable RPC RTT
is to limit the size of the allocation/deallocation in the NFSv4.2
client.

This patch adds a sysctl called vfs.nfs.maxalloclen to set
the limit on the size of the Allocate operation.
There is no way to know how long a server will take to do an
allocate operation, but 64Mbytes results in a reasonable
RPC RTT for the slow hardware I test on, so that is what
the default value for vfs.nfs.maxalloclen is set to.

For an 8Gbyte allocation, the elapsed time for doing it in 64Mbyte
chunks was the same as the elapsed time taken for a single large
allocation operation for a FreeBSD server with a UFS file system.

MFC after: 2 weeks

2 years agodiff: implement option -F (--show-function-line)
Piotr Pawel Stefaniak [Sun, 5 Sep 2021 14:54:07 +0000 (16:54 +0200)]
diff: implement option -F (--show-function-line)

With unified and context diffs, show the last line that matches the
provided pattern before the context.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D31714

2 years agodiff(1): Add --color support
Cameron Katri [Sun, 5 Sep 2021 00:10:41 +0000 (02:10 +0200)]
diff(1): Add --color support

Adds a --color flag to diff(1) that supports the same options as GNU's
diff(1). The colors are customizable with the env var DIFFCOLORS in
a format similar to grep(1)'s GREPCOLORS. An example would be 04;36:41
for additions to be underlined light blue, and deletions have a red
background.

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

2 years agodiff: decrease indent level
Piotr Pawel Stefaniak [Sun, 5 Sep 2021 14:26:23 +0000 (16:26 +0200)]
diff: decrease indent level

An upcoming change will add more code in the loop.

2 years agodiff: avoid applying offsets to null pointer
Piotr Pawel Stefaniak [Sun, 5 Sep 2021 16:59:08 +0000 (18:59 +0200)]
diff: avoid applying offsets to null pointer

This was the only instance of undefined behavior I could find so far.

2 years agodiff: replace isqrt() with sqrt()
Piotr Pawel Stefaniak [Sun, 5 Sep 2021 00:42:56 +0000 (02:42 +0200)]
diff: replace isqrt() with sqrt()

Remove cruft and use a system-provided and maintained function instead.

2 years agodiff: move functions around and reduce their visibility
Piotr Pawel Stefaniak [Sat, 4 Sep 2021 23:50:58 +0000 (01:50 +0200)]
diff: move functions around and reduce their visibility

Most of them become static. There will be more such functions added in
upcoming commits, so they would be inconsistent with existing code.
Improve the existing code instead of reinforcing the unwanted pattern.

2 years agodiff: convert boolean flag variables to bool
Piotr Pawel Stefaniak [Sat, 4 Sep 2021 23:44:26 +0000 (01:44 +0200)]
diff: convert boolean flag variables to bool

There will be more boolean flags added in upcoming commits and they
would have to be stored in ints in order to be consistent with existing
code. Change the existing code to use the bool type.

2 years agodiff: improve code style
Piotr Pawel Stefaniak [Sun, 29 Aug 2021 09:15:45 +0000 (11:15 +0200)]
diff: improve code style

Reflow comments, strip trailing space, improve wrapping of lines.

2 years agoe1000: Fix variable typo
Kevin Bowling [Wed, 15 Sep 2021 16:18:59 +0000 (09:18 -0700)]
e1000: Fix variable typo

Forgot to git add this in last commit

Reported by: jenkins
Fixes: 2796f7cab107
MFC after: 2 week

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

* 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>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D30002

2 years ago[fib algo][dxr] Optimize trie updating.
Marko Zec [Wed, 15 Sep 2021 20:36:59 +0000 (22:36 +0200)]
[fib algo][dxr] Optimize trie updating.

Don't rebuild in vain trie parts unaffected by accumulated incremental
RIB updates.

PR: 257965
Tested by: Konrad Kreciwilk
MFC after: 3 days

2 years ago[fib algo][dxr] Fix undefined behavior.
Marko Zec [Wed, 15 Sep 2021 20:23:17 +0000 (22:23 +0200)]
[fib algo][dxr] Fix undefined behavior.

The result of shifting uint32_t by 32 (or more) is undefined: fix it.

2 years agoiscsi: Abort data-out tasks queued on a terminating session.
John Baldwin [Wed, 15 Sep 2021 20:25:30 +0000 (13:25 -0700)]
iscsi: Abort data-out tasks queued on a terminating session.

cfiscsi_datamove_out() can race with cfiscsi_session_terminate_tasks()
and enqueue a new task after the latter function has aborted existing
tasks.  This could result in a deadlock as
cfiscsi_session_terminate_tasks() waited forever for this task to
complete.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31892

2 years agoiscsi: Add a helper routine to abort a data-out task.
John Baldwin [Wed, 15 Sep 2021 20:25:04 +0000 (13:25 -0700)]
iscsi: Add a helper routine to abort a data-out task.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31891

2 years agostress2: replace fuse.ko with fusefs.ko
Alan Somers [Tue, 14 Sep 2021 22:00:53 +0000 (16:00 -0600)]
stress2: replace fuse.ko with fusefs.ko

It got renamed in FreeBSD 13

Reviewed by: pho
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D31963

2 years agopowerpc64: change CAS to support Radix MMU
Leandro Lupori [Wed, 15 Sep 2021 18:12:37 +0000 (15:12 -0300)]
powerpc64: change CAS to support Radix MMU

Use radix_mmu environment variable to select between Hash or Radix
MMU, when performing the CAS method call. This matches kernel's
behavior, by selecting Hash MMU by default and Radix if radix_mmu
is not zero, to make sure that both loader and kernel always select
the same MMU.

The device tree is queried to detect Radix/GTSE support and to
find out if CAS is supported, making the old CPU version and HV
bit checks unnecessary now.

Reviewed by: jhibbits
MFC after: 2 weeks
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D31951

2 years agoarm: rockchip: rk3288: Use the macros that already exists in rk_cru.h
Emmanuel Vadot [Wed, 15 Sep 2021 18:10:42 +0000 (20:10 +0200)]
arm: rockchip: rk3288: Use the macros that already exists in rk_cru.h

2 years agoarm64: rockchip: rk3328: Add watchdog clock
Emmanuel Vadot [Wed, 15 Sep 2021 17:09:56 +0000 (19:09 +0200)]
arm64: rockchip: rk3328: Add watchdog clock

The watchdog clock is controlled by the secure world but we need a clock
to sastify the driver so add a fixed clock for it.

Reported by:   avg

2 years agoarm64: rockchip: rk3328: Finish implementing clocks
Emmanuel Vadot [Wed, 15 Sep 2021 16:33:38 +0000 (18:33 +0200)]
arm64: rockchip: rk3328: Finish implementing clocks

This finish (almost) the clocks implementations for the RK3328 SoC.
The clocks are now correctly implemented respecting the clock hiearchy.
The missing clocks are mostly the DDR clocks, implementing those is only
useful for debugging as we will never set them in the kernel.
The ARMCLK still needs to be rewritten so it looks closer to how the
hardware is done.

Tested-on: Rock64

2 years agoarm64: rockchip: clk: Add MUXRAW macros
Emmanuel Vadot [Wed, 15 Sep 2021 16:25:09 +0000 (18:25 +0200)]
arm64: rockchip: clk: Add MUXRAW macros

Some clocks in the RK3328 SoC (and possibly others) have registers not in
the CLKSEL_CON range. Add a macros for muxes which lives not in the range
of CLKSEL_CON which just takes a raw offset.

2 years agoarm64: rockchip: clk_mux: Add support for mux in GRF type clock
Emmanuel Vadot [Thu, 9 Sep 2021 16:24:33 +0000 (18:24 +0200)]
arm64: rockchip: clk_mux: Add support for mux in GRF type clock

Some clocks have their mux register in the GRF and not in the CRU.
Add support for that in the rk_clk_mux clock type.

2 years agotcp: Avoid division by zero when KERN_TLS is enabled in tcp_account_for_send().
Hans Petter Selasky [Wed, 15 Sep 2021 16:03:38 +0000 (18:03 +0200)]
tcp: Avoid division by zero when KERN_TLS is enabled in tcp_account_for_send().

If the "len" variable is non-zero, we can assume that the sum of
"tp->t_snd_rxt_bytes + tp->t_sndbytes" is also non-zero.

It is also assumed that the 64-bit byte counters will never wrap around.

Differential Revision: https://reviews.freebsd.org/D31959
Reviewed by: gallatin, rrs and tuexen
Found by: "I told you so", also called hselasky
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoarm64: Pass the right label to END() for handle_empty_exception.
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
arm64: Pass the right label to END() for handle_empty_exception.

GNU as reported an error for the argument to .size not being a constant.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D31950

2 years agoarm64: Fix a logic bug in is_load_instr().
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
arm64: Fix a logic bug in is_load_instr().

Logical and ('&&') was used to join two conditions instead of logical
or ('||') causing some store instructions to not be recognized.

Reported by: GCC 9 -Wparentheses

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D31949

2 years agoevdev: Add parentheses around '-' expression in operand of '&'.
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
evdev: Add parentheses around '-' expression in operand of '&'.

This fixes a -Wparentheses error with GCC 9.

Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D31947

2 years agoposixshmtest: Fix various warnings raised by GCC.
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
posixshmtest: Fix various warnings raised by GCC.

- Remove unused format string arguments.

- Remove a set but unused variable.

Reviewed by: khng, kib
Differential Revision: https://reviews.freebsd.org/D31946

2 years agopf: Remove duplicate declaration of pf_ioctl_maxcount.
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
pf: Remove duplicate declaration of pf_ioctl_maxcount.

Fixes a -Wredundant-decls warning with GCC 9.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D31944

2 years agoinfiniband: Disable -Wredundant-decl warnings.
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
infiniband: Disable -Wredundant-decl warnings.

ib_uverbs_flow_resources_free() is declard in two header files in
upstream OFED.  Disable the warning to avoid introducing diffs to fix
the build on GCC 9.

While here, fix the ibcore module to disable the same warnings
disabled in OFED_CFLAGS.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D31943

2 years ago<linux/overflow.h>: Don't use __has_builtin().
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
<linux/overflow.h>: Don't use __has_builtin().

GCC only added support for __has_builtin in GCC 10.  However, all
supported versions of GCC and clang include these builtins so just use
them unconditionally.

This fixes the build with GCC 9.

Reviewed by: manu, hselasky, imp
Differential Revision: https://reviews.freebsd.org/D31942

2 years agoefitable: Don't pass NULL as a format string to xo_err().
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
efitable: Don't pass NULL as a format string to xo_err().

This fixes a -Wformat error reported by GCC 9.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31939

2 years agotop: Remove a duplicate extern declaration for show_args.
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
top: Remove a duplicate extern declaration for show_args.

This fixes a -Wnested-extern error with GCC 9.  There is an existing
extern declaration in top.h.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D31937

2 years agoRemove an always-true check.
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
Remove an always-true check.

This fixes a -Wtype-limits error from GCC 9.

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

2 years agoOnly define sanitizer wrappers for unsized bus space operations once.
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
Only define sanitizer wrappers for unsized bus space operations once.

Previously, this was defining duplicate definitions for each size.

This fixes a redundant definition warning from GCC.

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

2 years agoOnly define sanitizer wrappers for atomic fences once.
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
Only define sanitizer wrappers for atomic fences once.

Previously, this was defining duplicate definitions for each type.

This fixes a redundat definition warning from GCC.

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

2 years agoAssert that invalid bus widths can't be passed to bus_width_str().
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
Assert that invalid bus widths can't be passed to bus_width_str().

This appeases a -Wreturn-type warning from GCC.

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

2 years agoRemove nonexistent include path for arm64 crypto files.
John Baldwin [Wed, 15 Sep 2021 16:03:17 +0000 (09:03 -0700)]
Remove nonexistent include path for arm64 crypto files.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D31932

2 years agozfs: merge openzfs/zfs@4a1195ca5 (master) into main
Martin Matuska [Wed, 15 Sep 2021 15:30:07 +0000 (17:30 +0200)]
zfs: merge openzfs/zfs@4a1195ca5 (master) into main

Notable upstream pull request merges:
  #11312 Temporarily use root credentials to mount snapshots in .zfs
  #12246 arc: Drop an incorrect assert
  #12443 Fixed data integrity issue when underlying disk returns error
         to zfs
  #12522 Compressed receive with different ashift can result in incorrect
         PSIZE on disk
  #12535 Verify embedded blkptr's in arc_read()
  #12541 Allow sending corrupt snapshots even if metadata is corrupted

Obtained from: OpenZFS
OpenZFS commit: 4a1195ca5041cbff2a6b025a31937fef84876c52

2 years agomount: improve error message for invalid filesystem names
Piotr Pawel Stefaniak [Sat, 14 Aug 2021 20:06:08 +0000 (22:06 +0200)]
mount: improve error message for invalid filesystem names

For an invalid filesystem name used like this:
mount -t asdfs /dev/ada1p5 /usr/obj

emit an error message like this:
mount: /dev/ada1p5: Invalid fstype: Invalid argument

instead of:
mount: /dev/ada1p5: Operation not supported by device

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

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

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

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

2 years agotee: use queue(9) in place of a custom linked list
Pietro Cerutti [Wed, 15 Sep 2021 11:04:24 +0000 (11:04 +0000)]
tee: use queue(9) in place of a custom linked list

Approved by: cognet

2 years agoUse a 64 bit read to access GICR_TYPER
Andrew Turner [Wed, 15 Sep 2021 09:13:41 +0000 (09:13 +0000)]
Use a 64 bit read to access GICR_TYPER

The GICv3 ITS only needs to implement 32 bit access to the GICR_TYPER
when the CPU implements AArch32. As this may not always be the case
use a 64 bit read when checking if the ITS is enabled on the CPU.

PR: 258217
Reported by: Olivier Delande <olivier.delande@provenrun.com>
Sponsored by: The FreeBSD Foundation

2 years agosctp: cleanup, no functional change intended
Michael Tuexen [Wed, 15 Sep 2021 08:18:11 +0000 (10:18 +0200)]
sctp: cleanup, no functional change intended

MFC after: 1 week

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

2 years agoTemporarily use root credentials to mount snapshots in .zfs
Allan Jude [Tue, 14 Sep 2021 23:10:00 +0000 (19:10 -0400)]
Temporarily use root credentials to mount snapshots in .zfs

When mounting a snapshot in the .zfs/snapshots control directory,
temporarily assume roots credentials to perform the VFS_MOUNT().

This allows regular users and users inside jails to access these
snapshots.

The regular usermount code is not helpful here, since it requires
that the user performing the mount own the mountpoint, which won't
be the case for .zfs/snapshot/<snapname>

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Sponsored-By: Modirum MDPay
Sponsored-By: Klara Inc.
Closes #11312

2 years agomps/mpr(4): Move xpt_register_async() out of lock.
Alexander Motin [Tue, 14 Sep 2021 21:37:02 +0000 (17:37 -0400)]
mps/mpr(4): Move xpt_register_async() out of lock.

It fixes lock ordere reversal between SIM and device locks.  Also
remove registration for AC_FOUND_DEVICE, unused for a while now.

MFC after: 1 month

2 years agotools/test/upsdl: fix compiler warnings
Alan Somers [Tue, 14 Sep 2021 20:50:01 +0000 (14:50 -0600)]
tools/test/upsdl: fix compiler warnings

MFC after: 2 weeks
Sponsored by: Axcient

2 years agocxgbe tom: Enter network epoch in t4_aiotx_task().
John Baldwin [Tue, 14 Sep 2021 20:46:15 +0000 (13:46 -0700)]
cxgbe tom: Enter network epoch in t4_aiotx_task().

While here, don't restore the old vnet until after sorele().

Sponsored by: Chelsio Communications

2 years agocxgbe tom: Update rcv_nxt for a FIN after handle_ddp_close().
John Baldwin [Tue, 14 Sep 2021 20:46:14 +0000 (13:46 -0700)]
cxgbe tom: Update rcv_nxt for a FIN after handle_ddp_close().

For TCP DDP, handle_ddp_close() needs to see the pre-FIN rcv_nxt to
determine how much data was placed in the local buffer before the FIN
was received.  The changes in d59f1c49e26b broke this by updating
rcv_nxt before calling handle_ddp_close().

Fixes: d59f1c49e26b cxgbe tom: Permit rcv_nxt mismatches on FIN for iSCSI connections on T6.
Sponsored by: Chelsio Communications

2 years agocxgbe tom: Don't queue AIO requests on listen sockets.
John Baldwin [Tue, 14 Sep 2021 20:46:14 +0000 (13:46 -0700)]
cxgbe tom: Don't queue AIO requests on listen sockets.

This is similar to the fixes in 141fe2dceeae.  One difference is that
TOE sockets do not change states (listen vs non-listen) once created,
so no lock is needed for SOLISTENING().

Sponsored by: Chelsio Communications

2 years agolinux: implement PTRACE_GET_SYSCALL_INFO
Edward Tomasz Napierala [Sun, 12 Sep 2021 11:31:10 +0000 (11:31 +0000)]
linux: implement PTRACE_GET_SYSCALL_INFO

This is one of the pieces required to make modern (ie Focal)
strace(1) work.

Reviewed By: jhb (earlier version)
Sponsored by: EPSRC
Differential Revision: https://reviews.freebsd.org/D28212

2 years agotzcode: Fix operation without WITH_DETECT_TZ_CHANGES
Edward Tomasz Napierala [Tue, 14 Sep 2021 20:17:45 +0000 (20:17 +0000)]
tzcode: Fix operation without WITH_DETECT_TZ_CHANGES

Reviewed By: bdrewery, kevans, cy
Reported By: lwhsu, bdrewery
Fixes: ddedf2a11eb
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31961

2 years agoctl(4): Do hole-punching for UNMAP to file-backed LUNs
Ka Ho Ng [Tue, 14 Sep 2021 19:51:58 +0000 (03:51 +0800)]
ctl(4): Do hole-punching for UNMAP to file-backed LUNs

This adds support for SCSI UNMAP command to file-backed LUNs, if the
underlying file system has a non-zerofilling VOP_DEALLOCATE
implementation where some or all parts of the requested operation range
may be deallocated.

Sponsored by: The FreeBSD Foundation
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D31922

2 years agoCirrus-CI: add a manually triggered arm64 task
Ed Maste [Wed, 23 Jun 2021 19:24:36 +0000 (15:24 -0400)]
Cirrus-CI: add a manually triggered arm64 task

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31953

2 years agoRemove a bogus assertion from the gic drivers
Andrew Turner [Tue, 14 Sep 2021 19:03:30 +0000 (19:03 +0000)]
Remove a bogus assertion from the gic drivers

When setting a message based interrupt range we set the base and count.
In an earlier the count was implemented as an end value, however the
asserts used to check this value was correct were incorrectly left in.

Reported by: emaste
Sponsored by: The FreeBSD Foundation

2 years agoAdd a switch structure for send tags.
John Baldwin [Tue, 14 Sep 2021 18:43:41 +0000 (11:43 -0700)]
Add a switch structure for send tags.

Move the type and function pointers for operations on existing send
tags (modify, query, next, free) out of 'struct ifnet' and into a new
'struct if_snd_tag_sw'.  A pointer to this structure is added to the
generic part of send tags and is initialized by m_snd_tag_init()
(which now accepts a switch structure as a new argument in place of
the type).

Previously, device driver ifnet methods switched on the type to call
type-specific functions.  Now, those type-specific functions are saved
in the switch structure and invoked directly.  In addition, this more
gracefully permits multiple implementations of the same tag within a
driver.  In particular, NIC TLS for future Chelsio adapters will use a
different implementation than the existing NIC TLS support for T6
adapters.

Reviewed by: gallatin, hselasky, kib (older version)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31572

2 years agokcov: Integrate with KMSAN
Mark Johnston [Tue, 14 Sep 2021 18:29:27 +0000 (14:29 -0400)]
kcov: Integrate with KMSAN

- kern_kcov.c needs to be compiled with -fsanitize=kernel-memory when
  KMSAN is configured since it calls into various other subsystems.
- Disable address and memory sanitizers in kcov(4)'s coverage sanitizer
  callbacks, as they do not provide useful checking.  Moreover, with
  KMSAN we may otherwise get false positives since the caller (coverage
  sanitizer runtime) is not instrumented.
- Disable KASAN and KMSAN interceptors in subr_coverage.c, as they do
  not provide any benefit but do introduce overhead when fuzzing.

Sponsored by: The FreeBSD Foundation