]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
23 months agosqlite3: Vendor import of sqlite3 3.39.0
Cy Schubert [Thu, 7 Jul 2022 13:04:21 +0000 (06:04 -0700)]
sqlite3: Vendor import of sqlite3 3.39.0

Changes at https://www.sqlite.org/releaselog/3_39_0.html.

Obtained from https://www.sqlite.org/2022/sqlite-autoconf-3390000.tar.gz

MFC after:      1 month

Merge commit '2380f7c9781e64d137f0712a8fb185dee648ed8c' into new_merge

23 months agonetinet6: add ip6_output() tests.
Alexander V. Chernikov [Thu, 7 Jul 2022 10:09:28 +0000 (10:09 +0000)]
netinet6: add ip6_output() tests.

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

23 months agotesting: add ability to specify multi-vnet topologies in the pytest framework.
Alexander V. Chernikov [Thu, 7 Jul 2022 10:05:06 +0000 (10:05 +0000)]
testing: add ability to specify multi-vnet topologies in the pytest framework.

Notable amount of tests related to the packet IO require two VNET jails
 for proper testing and avoiding side effects for the host system.
Additionally, it is often required to run actions in the jails seme-sequentially
- waiting for the listener initialisation can be an example of such
  dependency.

This change extends pytest vnet framework to allow defining multi-vnet
 multi-epair topologies in declarative style, without any need to bother
 about jail or repair names. All jail creation/teardown, interface
 creation/teardown and address assignments are handled automatically.

Example:

TOPOLOGY = {
  "vnet1": {"ifaces": ["if1", "if2", "if3"]},
  "vnet2": {"ifaces": ["if1", "if2", "if3"]},
  "if1": {"prefixes6": [("2001:db8:a::1/64", "2001:db8:a::2/64")]},
  "if2": {"prefixes6": [("2001:db8:b::1/64", "2001:db8:b::2/64")]},
  "if3": {"prefixes6": [("2001:db8:c::1/64", "2001:db8:c::2/64")]},
}
def vnet2_handler(self, vnet, obj_map, pipe):
  ss = VerboseSocketServer("::", self.DEFAULT_PORT)
  pipe.send("READY")

def test_output6_base(self):
  self.wait_object(second_vnet.pipe)

The definitions above will create 2 vnets ("jail_test_output6_base",
 "jail_test_output6_base_2"), 3 epairs, attached to both first and
 second jails, set up the IP addresses for each epair, spawn another
 process for vnet2_handler and pass control to vnet2_handler and
 test_output6_base. Both processes can pass objects between each
 other using pre-created pipes.

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

23 months agoOnly add gicv3 fdt children with a compatible property
Andrew Turner [Wed, 6 Jul 2022 17:04:53 +0000 (18:04 +0100)]
Only add gicv3 fdt children with a compatible property

Not all gicv3 fdt children have a compatible property. Those that don't
are configuration data rather than something that should have a driver
attach.

Sponsored by: The FreeBSD Foundation

23 months agovnet: make VNET_FOREACH() always be a loop
Kristof Provost [Wed, 6 Jul 2022 09:13:52 +0000 (11:13 +0200)]
vnet: make VNET_FOREACH() always be a loop

VNET_FOREACH() is a LIST_FOREACH if VIMAGE is set, but empty if it's
not. This means that users of the macro couldn't use 'continue' or
'break' as one would expect of a loop.

Change VNET_FOREACH() to be a loop in all cases (although one that is
fixed to one iteration if VIMAGE is not set).

Reviewed by: karels, melifaro, glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35739

23 months agostress2: Added a mount(8) test scenario
Peter Holm [Thu, 7 Jul 2022 07:44:55 +0000 (09:44 +0200)]
stress2: Added a mount(8) test scenario

23 months agosqlite3: Vendor import of sqlite3 3.39.0
Cy Schubert [Thu, 7 Jul 2022 06:15:38 +0000 (23:15 -0700)]
sqlite3: Vendor import of sqlite3 3.39.0

Changes at https://www.sqlite.org/releaselog/3_39_0.html.

Obtained from https://www.sqlite.org/2022/sqlite-autoconf-3390000.tar.gz

23 months agosockstat(1): print PID adjusted to the right
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): print PID adjusted to the right

This allows for easy copy-and-paste of a unix(4) peer name for lookup.
With current implementation it is guaranteed that a peer listed could be
found in the output.

Differential revision: https://reviews.freebsd.org/D35727

23 months agosockstat(1): print out full connection graph for unix(4) sockets
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): print out full connection graph for unix(4) sockets

Kernel provides us with enough information to display all possible
connections between UNIX sockets.

o Store unp_conn, xu_firstref and xu_nextref in the faddr of a UNIX sock.
o Build tree of file descriptors, indexed by the socket pointer.
o In displaysock() print out all possible information:
  1) if socket is bound, print name of this socket
  2) if socket has connected to a peer with a name, print peers name
  3) if socket has connected to a peer without a name, print [pid fd]
  4) if a bound socket has received connections, print list of them
     as [pid fd]
  Previously, only 1) either 2) were printed.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35726

23 months agosockstat(1): widen the FD printing format
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): widen the FD printing format

Three digit file descriptors are very common these days.  So let the
columns not break with them.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35725

23 months agosockstat(1): use tree(3) rbtree instead of hash
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): use tree(3) rbtree instead of hash

o Use tree to lookup by socket kvaddr. The size of hash is too big for a
  small virtual machine and at the same time too little for a large
  production server.  A tree would better fit here.
o For those pcbs, that don't have a socket associated, use a list.
o Provide a second tree to lookup by pcb kvaddr.  These removes full hash
  traversal when printing every unix(4) socket.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35724

23 months agosockstat(1): we don't need kernel struct unpcb
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
sockstat(1): we don't need kernel struct unpcb

Fixes: 0e229f343f4e8791f84a7acc6300f0bd1476c7b5

23 months agotree(3): allow the compare function to return any signed type
Gleb Smirnoff [Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)]
tree(3): allow the compare function to return any signed type

This allows to write very short comparison function when we are
comparing just pointer values:

return ((intptr_t)((uintptr_t)a->ptr/2 - (uintptr_t)b->ptr/2));

Reviewed by: dougm, alc
Differential revision: https://reviews.freebsd.org/D35722

23 months agotcp: remove a condition in tcp_usr_detach() that never happens
Gleb Smirnoff [Thu, 7 Jul 2022 04:09:45 +0000 (21:09 -0700)]
tcp: remove a condition in tcp_usr_detach() that never happens

The comment from Robert Watson doubts that this condition ever happens.
Our analysis confirm that.  Also, we found that if you manage to create
such a connection with help of some other bug, then after the "second
case" code is executed, the kernel will panic in other part of the stack.

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D35714

23 months agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 6 Jul 2022 21:38:19 +0000 (14:38 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

Older versions of growfs(8) failed to correctly update fs_dsize.
Filesystems that have been grown fail the test for fs_dsize's correct
value. For now we exclude the fs_dsize test from the requirements.

Reported by: Edward Tomasz Napiera
Tested by:   Edward Tomasz Napiera
Tested by:   Peter Holm
MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

23 months agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 6 Jul 2022 21:31:00 +0000 (14:31 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

The original check verified that if an alternate superblock has not
been selected that the superblock is located in its standard location.
For UFS1 the with a 65536 block size, the first backup superblock
is at the same location as the UFS2 superblock. Since SBLOCK_UFS2
is the first location checked, the first backup is the superblock
that will be used for a UFS1 filesystems with a 65536 block size.
This patch allows the use of the first backup superblock in that
situation.

Reported by: Peter Holm
Tested by:   Peter Holm
MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

23 months agoBug fix to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 6 Jul 2022 20:28:07 +0000 (13:28 -0700)]
Bug fix to UFS/FFS superblock integrity checks when reading a superblock.

The tests for number of cylinder groups (fs_ncg), inodes per cylinder
group (fs_ipg), and the size and layout of the cylinder group summary
information (fs_csaddr and fs_cssize) were overly restrictive and
would exclude some valid filesystems. These updates avoid precluding
valid fiesystems while still detecting rogue values that can crash or
hang the kernel.

Reported by: Chuck Silvers
Tested by:   Peter Holm
MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

23 months agotesting: provide meaningful error when pytest is not available
Alexander V. Chernikov [Wed, 6 Jul 2022 19:55:48 +0000 (19:55 +0000)]
testing: provide meaningful error when pytest is not available

atf format does not provide any way of signalling any error message
 back to the atf runner when listing tests. Work this around by
 reporting "__test_cases_list_pytest_binary_not_found__" test instead.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D35721

23 months agolibpmc: add armv8 pmu-event aliases
Mitchell Horne [Wed, 6 Jul 2022 17:30:03 +0000 (14:30 -0300)]
libpmc: add armv8 pmu-event aliases

These are all "standard microarchitectural events", which in theory are
supported by every ARMv8 processor. In practice, it depends on the
pmu-event definitions being complete and accurate, which they are not
for every processor. Still, these aliases should be functional on the
majority of systems.

PR: 254532
Reported by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35550

23 months agolibpmc: import updated pmu-events for arm64
Mitchell Horne [Wed, 6 Jul 2022 17:29:55 +0000 (14:29 -0300)]
libpmc: import updated pmu-events for arm64

Thanks to the recently updated import of the jevents utility by mav@, we
can now compile the latest version of these event definitions. This
should support a wider set of common ARMv8 processors, for example, the
Cortex-A72 in the Raspberry Pi 4.

This brings this folder in sync with Linux commit 62e6eb8d5454.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35549

23 months agoena: Update driver version to v2.6.1
Michal Krawczyk [Mon, 4 Jul 2022 07:12:57 +0000 (09:12 +0200)]
ena: Update driver version to v2.6.1

Minor version update which improves styling of a printouts, fixes
the KASAN and KMSAN kernel builds and LLQ reconfiguration after the
device reset.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

23 months agoena: Fix LLQ descriptor reconfiguration
Michal Krawczyk [Tue, 5 Jul 2022 10:59:25 +0000 (12:59 +0200)]
ena: Fix LLQ descriptor reconfiguration

After the device reset, the LLQ configuration descriptor wasn't passed
to the hardware. On a 6-generation AWS instances (like C6gn), it is
required to pass the LLQ descriptor after the device reset, otherwise
the hardware will be missing the LLQ configuration resulting in
performance degradation.

This patch reconfigures the LLQ each time the ena_device_init() is
called. This means that the LLQ descriptor will be passed during the
initial configuration and after a reset.

The ena_map_llq_mem_bar() function call was moved before the
ena_device_init() call, to make sure that the mem bar is available.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

23 months agoena: Align req_id and qid print order
Michal Krawczyk [Mon, 4 Jul 2022 07:03:54 +0000 (09:03 +0200)]
ena: Align req_id and qid print order

In most places, the req_id is printed first, and the qid is printed as a
second. To align the driver, one printout was reworked and the print
order of those variables was changed.

Suggested by: rpokala
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

23 months agocddl/*: add a WITH(OUT)_DTRACE option
Brooks Davis [Wed, 6 Jul 2022 13:03:48 +0000 (14:03 +0100)]
cddl/*: add a WITH(OUT)_DTRACE option

Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_<FOO>}+= form rather than using intermediate
variables.

Reviewed by: markj
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D35718

23 months agoufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp
Konstantin Belousov [Mon, 4 Jul 2022 10:28:49 +0000 (13:28 +0300)]
ufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agoufs_rename(): do not treat ERELOOKUP specially
Konstantin Belousov [Sat, 2 Jul 2022 13:15:57 +0000 (16:15 +0300)]
ufs_rename(): do not treat ERELOOKUP specially

Delegate handling of it to the top VFS layer, as it is done everywhere.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

23 months agonetstat -i: do not truncate interface names
Mike Karels [Sat, 2 Jul 2022 16:03:36 +0000 (11:03 -0500)]
netstat -i: do not truncate interface names

The field for interface names for netstat -i was 5 characters by
default, which is no longer sufficient with names like "vlan1234"
and "vtnet0".  netstat -iW computed the necessary field width, but
also enlarged the address field by a lot (especially with IPv6 enabled).
Make netstat -i compute the field width for interface names with or
without -W.  Note that the existing default output does not fit in
80 columns in any case.  Update the man page accordingly, documenting
the remaining effect of -W with -i.  Also add -W to the list of
General Options, as there are numerous pointers to this.

Reported by: Chris Ross
Reviewed by: melifaro, rgrimes, cy
Differential Revision: https://reviews.freebsd.org/D35703
MFC after: 1 week

23 months agodwc3: add ACPI attachment
Bjoern A. Zeeb [Tue, 5 Jul 2022 01:07:07 +0000 (01:07 +0000)]
dwc3: add ACPI attachment

Split the current FDT-only implementation up into an FDT and an
ACPI part reusing and sharing as much code as possible (thanks mw!).

This makes the Synopsis XHCI root hubs attach correctly on SolidRun's
HoenyComb instead of just the generic XHCI root and this means we
are also doing proper chip setup and applying the quirk needed there [1].

There is one problem with ACPI attachment in that it uses the generic
XHCI PNP ID.  So we need to do extra checks in order to not claim
all xhci, which means we check for a known quirk to be present
in acpi_probe.  Long term this isn't scaling and this was discussed
in SolidRun's Discord Channel in 2021 with the intend that "jnettlet"
will take this to a steering committee.  Since then ACPI has kind-of
become a technology non grata (due to not getting changes into Linux
timely) so it is unclear if this will ever happen.  If there will be
further hardware with dwc3/ACPI we should go and make sure this problem
gets solved.

[1] https://github.com/SolidRun/edk2-platforms/blob/24698f90b79facfbbfc4067b39a4ddf8c7fdfa88/Silicon/NXP/LX2160A/AcpiTables/Dsdt/Usb.asl

Reviewed by: manu, mw
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D32256

23 months agodevinfo: xref devctl
Warner Losh [Tue, 5 Jul 2022 21:15:08 +0000 (15:15 -0600)]
devinfo: xref devctl

devctl has ways to get the different locator's paths to devices, while
devinfo does not. xref devctl in devinfo(8) as a hint.

Sponsored by: Netflix

23 months agoif_ovpn: deal with short packets
Kristof Provost [Tue, 5 Jul 2022 17:27:00 +0000 (19:27 +0200)]
if_ovpn: deal with short packets

If we receive a UDP packet (directed towards an active OpenVPN socket)
which is too short to contain an OpenVPN header ('struct
ovpn_wire_header') we wound up making m_copydata() read outside the
mbuf, and panicking the machine.

Explicitly check that the packet is long enough to copy the data we're
interested in. If it's not we will pass the packet to userspace, just
like we'd do for an unknown peer.

Extend a test case to provoke this situation.

Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agodummynet: fix ip_dn_vnet_init() / dummynet_task() race
Kristof Provost [Mon, 4 Jul 2022 20:36:43 +0000 (22:36 +0200)]
dummynet: fix ip_dn_vnet_init() / dummynet_task() race

If dummynet_task() is run on a vnet where dummynet is still initialising
(i.e. still running ip_dn_vnet_init()) we can attempt to use an
uninitialised mutex.

We can use the existing init_done field to check if the per-vnet
V_dn_cfg is fully set up, if we ensure that it's only set to 1 when
we've done all of the init work.

Reported by: Alfredo Dal'Ava Júnior <alfredo@freebsd.org>
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35716

23 months agoOpenSSL: Regen assembly file for OpenSSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 16:06:50 +0000 (12:06 -0400)]
OpenSSL: Regen assembly file for OpenSSSL 1.1.1q

23 months agoOpenSSL: Regen manual pages for OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 16:01:07 +0000 (12:01 -0400)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1q

23 months agoOpenSSL: Merge OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 15:47:01 +0000 (11:47 -0400)]
OpenSSL: Merge OpenSSL 1.1.1q

Merge commit 'f874e59ffcd8b5ecd018ad8311d78e866340f3e9'

23 months agoImport OpenSSL 1.1.1q
Jung-uk Kim [Tue, 5 Jul 2022 15:27:51 +0000 (11:27 -0400)]
Import OpenSSL 1.1.1q

23 months agoxargs: fix description of strnsubst return value
Tom Jones [Tue, 5 Jul 2022 15:27:15 +0000 (16:27 +0100)]
xargs: fix description of strnsubst return value

Reported by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574

23 months agoxargs: terminate if line replacement cannot be constructed
Tom Jones [Tue, 5 Jul 2022 15:03:51 +0000 (16:03 +0100)]
xargs: terminate if line replacement cannot be constructed

If the line with replacement cannot be constructed xargs should
terminate as documented in the man page

We encounter this error, but gnu/xargs doesn't because they have a much
larger limit for created outputs (~10000 lines).

Reviewed by: oshogbo
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35574

23 months agoDB_COMMAND(9): fix a typo
Mitchell Horne [Tue, 5 Jul 2022 15:14:44 +0000 (12:14 -0300)]
DB_COMMAND(9): fix a typo

Fixes: b83d53cb687e

23 months agoDB_COMMAND(9): update to mention additional macros
Mitchell Horne [Tue, 5 Jul 2022 14:55:18 +0000 (11:55 -0300)]
DB_COMMAND(9): update to mention additional macros

Document the existing alias definitions, and augment the example with
one of these. Also, describe the purpose of the newly added _FLAGS
variations of these command definitions.

Make some small style improvements to appease mandoc -Tlint.

Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35664

23 months agoddb: use _FLAGS command macros where appropriate
Mitchell Horne [Tue, 5 Jul 2022 14:47:55 +0000 (11:47 -0300)]
ddb: use _FLAGS command macros where appropriate

Some command definitions were forced to use DB_FUNC in order to specify
their required flags, CS_OWN or CS_MORE. Use the new macros to simplify
these.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35582

23 months agoddb: add _FLAGS command variants
Mitchell Horne [Thu, 30 Jun 2022 15:58:22 +0000 (12:58 -0300)]
ddb: add _FLAGS command variants

Provide _FLAGS variants of the various command definition macros, in
anticipation of adding a new flag. This can also be used for some
existing commands which require special flag values.

Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35581

23 months agodb_command.c: use designated initializers
Mitchell Horne [Tue, 5 Jul 2022 14:45:47 +0000 (11:45 -0300)]
db_command.c: use designated initializers

Provide separate helper macros for regular commands and next-level table
commands as they are mutually exclusive. This ensures proper
initialization of each element and allows us to exclude some redundant
fields, such as specifying .more = NULL for every regular command.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35580

23 months agodb_command.c: style
Mitchell Horne [Tue, 5 Jul 2022 14:44:36 +0000 (11:44 -0300)]
db_command.c: style

Reviewed by: jhb
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35368

23 months agoriscv: implement db_show_mdpcpu()
Mitchell Horne [Mon, 4 Oct 2021 20:47:49 +0000 (17:47 -0300)]
riscv: implement db_show_mdpcpu()

This prints the machine-dependent members of struct pcpu when executing
the 'show pcpu' or 'show all pcpu' ddb(4) commands.

MFC after: 3 days

23 months agosesutil.8: Polish
Mateusz Piotrowski [Tue, 5 Jul 2022 14:37:18 +0000 (16:37 +0200)]
sesutil.8: Polish

- Use right mdoc macros
- Fix synopsis. Some of the optional command modifiers were not optional
  after all.
- Sort options

MFC after: 1 week

23 months agorc.8: Reference the article about rc scripting
Mateusz Piotrowski [Mon, 4 Jul 2022 10:54:57 +0000 (12:54 +0200)]
rc.8: Reference the article about rc scripting

MFC after: 3 days

23 months agonetinet6: perform out-of-bounds check for loX multicast statistics
Alexander V. Chernikov [Mon, 4 Jul 2022 20:03:06 +0000 (20:03 +0000)]
netinet6: perform out-of-bounds check for loX multicast statistics

Currently, some per-mbuf multicast statistics is stored in
 the per-interface ip6stat.ip6s_m2m[] array of size 32 (IP6S_M2MMAX).
Check that loopback ifindex falls within 0.. IP6S_M2MMAX-1 range to
 avoid silent data corruption. The latter cat happen with large
 number of VNETs.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D35715
MFC after: 2 weeks

23 months agodiff3: make the eflag logic easier to follow
Tom Jones [Tue, 5 Jul 2022 11:33:55 +0000 (12:33 +0100)]
diff3: make the eflag logic easier to follow

Discussed with: dim
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35324

23 months agoarp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)
KUROSAWA Takahiro [Tue, 5 Jul 2022 03:56:29 +0000 (20:56 -0700)]
arp(8): use getifaddrs(3) instead of ioctl(SIOCGIFCONF)

The original code had used a fixed-size buffer for ioctl(SIOCGIFCONF),
that might cause the target ifreq spilled from the buffer.  Use the handy
getifaddrs(3) to fix the problem.

Reviewed by: glebius
Differential revision: https://reviews.freebsd.org/D35536

23 months agodwc3: fix from not working
Bjoern A. Zeeb [Tue, 5 Jul 2022 00:53:42 +0000 (00:53 +0000)]
dwc3: fix from not working

During the review of 09cdf4878c621be4cd229fa88cdccdcdc8c101f7 we
switched from cached registers to reading them as needed.
One read of the two reads was moved after the softreset got triggered
and as a result returned 0 rather than the proper register value.
Moving the read before the softreset gets initiated seems to make
things work again and xhci.c no longer complains about
"Controller does not support 4K page size.".

MFC after: 10 days
X-MFC with: 09cdf4878c621be4cd229fa88cdccdcdc8c101f7
Pointy hat to: bz

23 months agolinux(4): Use saved cpu feature bits
Dmitry Chagin [Mon, 4 Jul 2022 20:42:07 +0000 (23:42 +0300)]
linux(4): Use saved cpu feature bits

MFC after: 3 days

23 months agolinux(4): Implement __vdso_time
Dmitry Chagin [Mon, 4 Jul 2022 20:41:32 +0000 (23:41 +0300)]
linux(4): Implement __vdso_time

PR: 240769
MFC after: 3 days

23 months agosockets: use only soref()/sorele() as socket reference count
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
sockets: use only soref()/sorele() as socket reference count

o Retire SS_FDREF as it is basically a debug flag on top of already
  existing soref()/sorele().
o Convert SS_PROTOREF into soref()/sorele().
o Change reference model for the listen queues, see below.
o Make sofree() private.  The correct KPI to use is only sorele().
o Make soabort() respect the model and sorele() instead of sofree().

Note on listening queues.  Until now the sockets on a queue had zero
reference count.  And the reference were given only upon accept(2).  The
assumption was that there is no way to see the queued socket from anywhere
except its head.  This is not true, since queued sockets already have pcbs,
which are linked at least into the global pcb lists.  With this change we
put the reference right in the sonewconn() and on accept(2) path we just
hand the existing reference to the file descriptor.

Differential revision: https://reviews.freebsd.org/D35679

23 months agosockets: use positive flag for file descriptor socket reference
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
sockets: use positive flag for file descriptor socket reference

Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
Mark sockets created by socreate() with SS_FDREF.

This change is mostly illustrative. With it we see that SS_FDREF
is a debugging flag, since:
* socreate() takes a reference with soref().
* on accept path solisten_dequeue() takes a reference
  with soref() and then soaccept() sets SS_FDREF.
* soclose() checks SS_FDREF, removes it and does sorele().

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35678

23 months agotcp: use a TCP flag to check if connection has been close(2)d
Gleb Smirnoff [Mon, 4 Jul 2022 19:40:51 +0000 (12:40 -0700)]
tcp: use a TCP flag to check if connection has been close(2)d

The flag SS_NOFDREF is a private flag of the socket layer.  It also
is supposed to be read with SOCK_LOCK(), which we don't own here.

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D35663

23 months agopca954x: harmonize pca9547 and pca954x and add pca9540 support
Bjoern A. Zeeb [Sat, 2 Jul 2022 23:33:32 +0000 (23:33 +0000)]
pca954x: harmonize pca9547 and pca954x and add pca9540 support

The two implementations for the pca9548 switch and the pca9547 mux
seemed close enough so we can put them together and with a bit more
abstraction add pca9540 support.

While here apply a bit of consistency in variable and driver naming and
use device_has_property instead of the FDT-only OF_ variant.

This disconnects pca9547 from the build but does not yet delete it.

MFC after: 2 weeks
Reviewed by: mmel (earlier version), avg
Differential Revision: https://reviews.freebsd.org/D35701

23 months agorb_tree: fine-tune rebalancing code
Doug Moore [Mon, 4 Jul 2022 17:28:35 +0000 (12:28 -0500)]
rb_tree: fine-tune rebalancing code

Change parts of RB_INSERT_COLOR and RB_REMOVE_COLOR to reduce the
number of operations, by, in some cases, flipping two color bits at a
time instead of flipping each individually, in separate operations,
and by using a switch statement to replace a sequence of if-elses.
Rewrite RB_SET_PARENT to generate fewer instructions.  These changes
reduce the code size by over 100 bytes on some architectures.

Also, allow RB users to define a preprocessor symbol to generate
RB_REMOVE_COLOR code that matches the implementation described in the
original weak-AVL paper in one particular case, instead of the still
correct, but slightly more efficient implementation of that case
currently implemented.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35524

23 months agopmcstat: fix log analysis
Andrew Gallatin [Mon, 4 Jul 2022 16:40:35 +0000 (12:40 -0400)]
pmcstat: fix log analysis

pmcstat has been broken for analyzing logs since D35342 / b6e28991bf3aadb.

This is because the pmc for the first CPU is not added when reading logs
because unlike its clones, its event id is not invalid. That causes us
to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
when encountering samples from cpu0.

Fix this by removing the check that the PMC is invalid

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35709

23 months agoAdd Rockchip PCIe cleanup on attach faulure
Andrew Turner [Thu, 30 Jun 2022 18:16:34 +0000 (19:16 +0100)]
Add Rockchip PCIe cleanup on attach faulure

We should clean up on failure as it may panic the kernel later, e.g.
if we crate the rman, but fail to destroy it on attach faulure.

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

23 months agoFix ofw pcib when it rman_init fails
Andrew Turner [Thu, 30 Jun 2022 18:12:46 +0000 (19:12 +0100)]
Fix ofw pcib when it rman_init fails

rman_fini assumes rman_init has been called successfully. Clean up
init faulure by only calling rman_fini when rman_init has succeeded.

While here add ofw_pcib_fini that can be used by a sub-class to clean
up.

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

23 months agoSupport decoding mem32 memory in the rk pcie driver
Andrew Turner [Thu, 30 Jun 2022 18:08:32 +0000 (19:08 +0100)]
Support decoding mem32 memory in the rk pcie driver

This is needed with some dtb files.

While here use a switch statement as the two options are mutually
exclusive in any iteration of the loop.

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

23 months agoe6000sw: Fix direct register write logic
Kornel Dulęba [Mon, 4 Jul 2022 06:53:41 +0000 (08:53 +0200)]
e6000sw: Fix direct register write logic

When accessing a register directly from etherswitchcfg one must specify
a register group(e.g. registers of portN) and the register offset within
the group. The latter is passed as the 5 least significant bits.
Extract the former by dividing the register address by 32, not by 5.

Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35672

23 months agolockstat: Fix construction of comparision predicates
Kornel Dulęba [Mon, 4 Jul 2022 06:48:52 +0000 (08:48 +0200)]
lockstat: Fix construction of comparision predicates

Passing "0x%p" to sprintf results in double "0x" being printed.
This causes a dtrace script compilation failure when "-d" flag
is specified.
Fix that by removing the extraneous "0x".

Reviewed by: markj
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Alstom
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35690

23 months agomountd startup: enable NFSv4 if needed on restart
Mike Karels [Sun, 3 Jul 2022 23:04:41 +0000 (18:04 -0500)]
mountd startup: enable NFSv4 if needed on restart

The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly
when it is run at system startup, relying on the kernel default.
However, if NFSv4 was enabled in /etc/rc.conf later, and the script
was re-run to restart mountd, the sysctl was still set to 3.
Set the sysctl to the right value in all cases.

Reviewed by: rmacklem
MFC after: 1 week

23 months agorouting: hide notify_add and notify_del behind ROUTE_MPATH
Mateusz Guzik [Mon, 4 Jul 2022 08:38:13 +0000 (08:38 +0000)]
routing: hide notify_add and notify_del behind ROUTE_MPATH

Fixes a warn about unused routines without the option.

Sponsored by: Rubicon Communications, LLC ("Netgate")

23 months agoipmi: do not omit lun in BMC addresses
Yuri [Mon, 4 Jul 2022 06:29:52 +0000 (14:29 +0800)]
ipmi: do not omit lun in BMC addresses

Some systems put sensors on non-0 lun, so we should not omit it.  This
was the only difference with the Linux driver, where DIMM sensors could
be queried, but not on FreeBSD.

See this report[1] on the FreeBSD forums:
https://forums.freebsd.org/threads/freebsd-cannot-get-dimm-temperature-sensor-value.85166/

Reviewed by: philip
Tested by: Andrey Lanin[1]
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35612

23 months agoipmi: correctly handle ipmb requests
Yuri [Mon, 4 Jul 2022 04:55:18 +0000 (12:55 +0800)]
ipmi: correctly handle ipmb requests

Handle IPMB requests using SEND_MSG (sent as driver request as we do not
need to return anything back to userland for this) and GET_MSG (sent as
usual request so we can return the data for RECEIVE_MSG ioctl) pair.

This fixes fetching complete sensor data from boards (e.g. HP ProLiant
DL380 Gen10).

Reviewed by: philip
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35605

23 months agofile: upgrade to 5.42.
Xin LI [Mon, 4 Jul 2022 00:07:28 +0000 (17:07 -0700)]
file: upgrade to 5.42.

MFC after: 2 weeks

23 months agoVendor import of file 5.42.
Xin LI [Mon, 4 Jul 2022 00:05:11 +0000 (17:05 -0700)]
Vendor import of file 5.42.

23 months agodwc3: improve debugging
Bjoern A. Zeeb [Sat, 2 Jul 2022 21:10:00 +0000 (21:10 +0000)]
dwc3: improve debugging

Rather than hiding behind #if 0, hide the debugging behind DWC3_DEBUG
so it can be turned on with a single define.  Require bootverbose
to print anything so we can still avoid spamming the console if DWC3_DEBUG
is on.
Harmonize the format string in snsp_dwc3_dump_regs() to always print the
full register and also print the XHCI quirks.
Call snsp_dwc3_dump_regs() twice, before and after generic XHCI attachment
and initialisation as this may have an effect on the confirgumation state.

Obtained from: an old debug patch
MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35700

23 months agodwc3: add more quirks and checks
Bjoern A. Zeeb [Sat, 2 Jul 2022 20:56:07 +0000 (20:56 +0000)]
dwc3: add more quirks and checks

Rather than just printing the Global SNPS ID Register store it as well
so we can do a version check later.
In addition, for debugging purposes, read the Global Hardware Parameters
Registers and print them.

Based on the snpsid disable an XHCI feature using a quirk prepared
in 447c418da03454a2a00bc115a69c62055a6d5272.
Add the "snps,dis_u3_susphy_quirk" quirk and handle Suspend USB3.0 SS PHY
after power-on-reset/during core initialization (suggested to be cleared)
based on the DWC3_GHWPARAMS0 register.

MFC after: 2 weeks
Obtained from: an old debugging patch
Reviewed by: mw (earlier version), mmel
Differential Revision: https://reviews.freebsd.org/D35699

23 months agodwc3: uncondinationally enable Host IN Auto Retry
Bjoern A. Zeeb [Sat, 2 Jul 2022 19:14:39 +0000 (19:14 +0000)]
dwc3: uncondinationally enable Host IN Auto Retry

Enable dwc3's auto retry feature. For IN transfers with crc errors
or internal overruns this will make the host reply with a
non-terminating retry ACK.  I believe the hope was to improve
reliability after seeing occasional hiccups.

Obtained from: an old debugging patch
MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35698

23 months agodwc3: fix snps,dis-del-phy-power-chg-quirk
Bjoern A. Zeeb [Sat, 2 Jul 2022 18:17:13 +0000 (18:17 +0000)]
dwc3: fix snps,dis-del-phy-power-chg-quirk

If snps,dis-del-phy-power-chg-quirk is set, the register bit should be
cleared not ored on (it's the "dis" version).

MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35697

23 months agotca6416: add support for tca9539
Bjoern A. Zeeb [Sun, 3 Jul 2022 00:51:13 +0000 (00:51 +0000)]
tca6416: add support for tca9539

Programming-wise tca6416 and tca9539 seem identical so all we have to
do is add the extra ofw_compat_data line.

MFC after: 2 weeks
Reviewed by: mw
Differential Revision: https://reviews.freebsd.org/D35702

23 months agowpa_supplicant: Resolve secondary VAP association issue
J.R. Oldroyd [Sat, 2 Jul 2022 18:15:31 +0000 (11:15 -0700)]
wpa_supplicant: Resolve secondary VAP association issue

Association will fail on a secondary open unprotected VAP when the
primary VAP is configured for WPA. Examples of secondary VAPs are,
hotels, universities, and commodity routers' guest networks.

A broadly similar bug was discussed on Red Hat's bugzilla affecting
association to a D-Link DIR-842.

This suggests that as IEs were added to the 802.11 protocol the old code
was increasingly inadaquate to handle the additional IEs, not only a
secondary VAP.

PR: 264238
Reported by: Jaskie <jiangjun12321@gmail.com>
"J.R. Oldroyd" <fbsd@opal.com>
Submitted by: "J.R. Oldroyd" <fbsd@opal.com>
MFC after: 3 days

23 months agowpa: Enable WEP by default
Cy Schubert [Sun, 3 Jul 2022 18:41:00 +0000 (11:41 -0700)]
wpa: Enable WEP by default

As of hostap 2.10, WEP is disabled by default. This of course is not a
bad thing but requires some planning and an announcment to remove WEP
support by default. A possible src.conf knob or letting users know they
should use the port instead might different options.

MFC after: 3 days

23 months agomount_nfs.8: Update BUGS section for NFSv4.1/4.2
Rick Macklem [Sun, 3 Jul 2022 20:37:23 +0000 (13:37 -0700)]
mount_nfs.8: Update BUGS section for NFSv4.1/4.2

If the "intr" and/or "soft" mount options are used for
NFSv4 mounts, the protocol can be broken when the
operation returns without waiting for the RPC reply.
The likelyhood of failure increases for NFSv4.1/4.2
mounts, since the session slot will be broken when
an RPC reply is not processed.

This is mentioned in the BUGS section of "man mount_nfs",
but there was no specific mention of the session slot
problem.  This patch adds a sentence for this case.

PR: 260011
Reviewed by: gbe
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35693

23 months agoApply clang fix for assertion building llvm with libc++ 15
Dimitry Andric [Sun, 3 Jul 2022 19:33:22 +0000 (21:33 +0200)]
Apply clang fix for assertion building llvm with libc++ 15

Merge commit f1b0a4fc540f from llvm git (by Richard Smith):

  An expression should only contain an unexpanded parameter pack if it
  lexically contains a mention of the pack.

  Systematically distinguish between syntactic and semantic references to
  packs, especially when propagating dependence from a type into an
  expression. We should consult the type-as-written when computing
  syntactic dependence and should consult the semantic type when computing
  semantic dependence.

  Fixes #54402.

MFC after: 3 days

23 months agosockatmark(3): Add references to 4.4BSD IPC tutorials
Gordon Bergling [Sun, 3 Jul 2022 13:56:42 +0000 (15:56 +0200)]
sockatmark(3): Add references to 4.4BSD IPC tutorials

Obtained from: NetBSD
MFC after: 3 days

23 months agoif_clone: Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 13:13:32 +0000 (15:13 +0200)]
if_clone: Fix a typo in a source code comment

- s/fucntions/functions/

MFC ater: 3 days

23 months agojme(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 13:13:01 +0000 (15:13 +0200)]
jme(4): Fix a typo in a source code comment

- s/fuctions/functions/

MFC after: 3 days

23 months agoata(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 13:12:26 +0000 (15:12 +0200)]
ata(4): Fix a typo in a source code comment

- s/fuctions/functions/

MFC after: 3 days

23 months agosnmp_hostres(3): Fix a typo in a debug message
Gordon Bergling [Sun, 3 Jul 2022 12:57:12 +0000 (14:57 +0200)]
snmp_hostres(3): Fix a typo in a debug message

- s/atempt/attempt/

MFC after: 3 days

23 months agoaic7xxx: Fix a few common typo in source code comments
Gordon Bergling [Sun, 3 Jul 2022 12:10:30 +0000 (14:10 +0200)]
aic7xxx: Fix a few common typo in source code comments

- s/irrespecitve/irrespective/

Obtained from: NetBSD
MFC after: 3 days

23 months agoaic7xxx: Fix a few common typos in source code comments
Gordon Bergling [Sun, 3 Jul 2022 12:06:48 +0000 (14:06 +0200)]
aic7xxx: Fix a few common typos in source code comments

- s/ingnore/ignore/
- s/ingnored/ignored/

MFC after: 3 days

23 months agofreescale: Fix a typo in a source code comment
Gordon Bergling [Sun, 3 Jul 2022 11:55:40 +0000 (13:55 +0200)]
freescale: Fix a typo in a source code comment

- s/transistions/transitions/

MFC after: 3 days

23 months agopmc(3): Fix a common typo in a description
Gordon Bergling [Sun, 3 Jul 2022 11:53:01 +0000 (13:53 +0200)]
pmc(3): Fix a common typo in a description

- s/transistioned/transitioned/

MFC after: 3 days

23 months agopci(4): Fix a common typo in source code comments
Gordon Bergling [Sun, 3 Jul 2022 11:43:44 +0000 (13:43 +0200)]
pci(4): Fix a common typo in source code comments

- s/transistions/transitions/

MFC after: 3 days

23 months agopselect(2): Document what a null pointer for the signalmask means
Warner Losh [Sat, 2 Jul 2022 19:39:24 +0000 (13:39 -0600)]
pselect(2): Document what a null pointer for the signalmask means

When pselect is passed a null pointer for the signal mask, the standard
says it shall behave like select (except for the different timeout
arg). Make a note of that here.

Sponsored by: Netflix

2 years agoacpi: add sys/kernel.h
Warner Losh [Sat, 2 Jul 2022 16:35:04 +0000 (10:35 -0600)]
acpi: add sys/kernel.h

sys/kernel.h is needed for tunable fetching.

Sponsored by: Netflix

2 years agoarm64: NXP add LS1088a clockgen support
Bjoern A. Zeeb [Tue, 28 Jun 2022 00:02:17 +0000 (00:02 +0000)]
arm64: NXP add LS1088a clockgen support

Add a driver for NXP LS1088a clockgen support which passes
configuration information to QorIQ clockgen class.
The implementaiton started off as copy of ls1028 support and was
adjusted accordingly.

Reviewed by: dgr_semihalf.com (earlier), mmel
MFC after: 1 week
Sponsored by: Traverse Technologies (providing Ten64 HW for testing)
Differential Revision: https://reviews.freebsd.org/D35617

2 years agoamd64/efi: Remove setting hints for rsdp
Warner Losh [Sat, 2 Jul 2022 14:01:09 +0000 (08:01 -0600)]
amd64/efi: Remove setting hints for rsdp

Given that hints set this way don't work when a static kenv is compiled
into the kernel. acpi.rsdp has been set for this for the past 6 years,
and all kernels in that time have used it in preference to the hints. As
such, we no longer hints.*, so remove them.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35634

2 years agoamd64/efi: Stop falling back to hints for RSDP
Warner Losh [Sat, 2 Jul 2022 14:01:02 +0000 (08:01 -0600)]
amd64/efi: Stop falling back to hints for RSDP

All boot loaders for the last 6 years set acpi.rsdp in addition to the
hints. This was planned for removal ~5 years ago. Belatedly remove it
from here.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35633

2 years agoloader: Set preferred kenv for acpi.rsdp on arm64
Warner Losh [Sat, 2 Jul 2022 14:00:40 +0000 (08:00 -0600)]
loader: Set preferred kenv for acpi.rsdp on arm64

Several years ago, x86 moved from using hints to communicate this
information to using the simpler acpi.rsdp variables. If one compiles
static hints into the kernel, then these hints are ignored. We can
remove this when we branch FreeBSD 15. Thought about BURN_BRIDGES
here, but it's too messy.

Sponsored by: Netflix
Reviewed by: andrew, jhb
Differential Revision: https://reviews.freebsd.org/D35632

2 years agoarm64: Grab the RSDP from acpi.rsdp like x86
Warner Losh [Sat, 2 Jul 2022 14:00:27 +0000 (08:00 -0600)]
arm64: Grab the RSDP from acpi.rsdp like x86

arm64 wasn't updated to grab this from acpi.rsdp when x86 was
update. belatedly update the kernel to grab this information from the
preferred kenv.

Sponsored by: Netflix
Reviewed by: andrew, jhb
Differential Revision: https://reviews.freebsd.org/D35631

2 years agotty: Default to printing kernel stack traceback only on INVARIANT kernels
Warner Losh [Wed, 29 Jun 2022 14:26:58 +0000 (08:26 -0600)]
tty: Default to printing kernel stack traceback only on INVARIANT kernels

Change the default from printing a breif kernel thread stack informaton
back to omitting it for non-invariant kernels in response to
SIGINFO/^T. Full and brief stack support can be selected with the
kern.tty_info_kstacks sysctl.

MFC After: 2 weeks
Sponsored by: Netflix
Reviewed by: grembo, jhb
Differential Revision: https://reviews.freebsd.org/D35576

2 years agoApply llvm fix for assertion/crash building archivers/c-blosc2
Dimitry Andric [Fri, 1 Jul 2022 23:13:46 +0000 (01:13 +0200)]
Apply llvm fix for assertion/crash building archivers/c-blosc2

Merge commit 88ce403c6aab from llvm git (by Florian Hahn):

  [LV] Add new block to place recurrence splice, if needed.

  In some cases, a recurrence splice instructions needs to be inserted
  between to regions, for example if the regions get re-arranged during
  sinking.

  Fixes #56146.

PR: 264979
Reported by: Robert Clausecker <fuz@fuz.su>
MFC after: 3 days

2 years agomount_nfs: Warn that intr, soft are not safe for NFSv4
Rick Macklem [Fri, 1 Jul 2022 21:43:17 +0000 (14:43 -0700)]
mount_nfs: Warn that intr, soft are not safe for NFSv4

If the "intr" and/or "soft" mount options are used for
NFSv4 mounts, the protocol can be broken when the
operation returns without waiting for the RPC reply.
The likelyhood of failure increases for NFSv4.1/4.2
mounts, since the session slot will be broken when
an RPC reply is not processed.

This is mentioned in the BUGS section of "man mount_nfs",
but more needs to be done.  This patch adds code that
generates a warning message when the mount is done.

PR: 260011
Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35407

2 years agoMIMIMAL: add uart
Warner Losh [Fri, 1 Jul 2022 17:22:38 +0000 (11:22 -0600)]
MIMIMAL: add uart

While uart could be detected completely through plug and play means, add
it here for two reasons. First, we don't do that from the loader, so
it's not available as a console. Second, even if we did do it from the
loader, there's a limitation in the system today that console drivers
must be compiled into the kernel because the console is selected before
external modules are linked into the kernel. Adding it only increases
the kernel size by ~14k as well.

Sponsored by: Netflix
Idea liked by: des, rpokala, brooks, jhb

2 years agocrypto: Validate return values from CRYPTODEV_PROCESS()
Mark Johnston [Fri, 1 Jul 2022 15:09:39 +0000 (11:09 -0400)]
crypto: Validate return values from CRYPTODEV_PROCESS()

Errors are always handled by the completion callback, so we should check
that they're not also passed back to the caller.

No functional change intended.

Reviewed by: kp, mav, jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35382