]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
22 months agoAdd more Arm CPUs to the arm64 cpu ident
Andrew Turner [Tue, 11 Oct 2022 11:53:45 +0000 (12:53 +0100)]
Add more Arm CPUs to the arm64 cpu ident

These are based on CPUs found in https://github.com/ARM-software/data

Sponsored by: The FreeBSD Foundation

22 months agoMark 64-bit arm64 hypervisor registers with UL
Andrew Turner [Wed, 28 Sep 2022 13:39:45 +0000 (14:39 +0100)]
Mark 64-bit arm64 hypervisor registers with UL

These are 64-bit. Mark them as unsigned long so we don't rely on
undefined behaviour or shift a 32-bit value more than 32 bits.

Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation

22 months agoacpi: Put CPPC workaround behind i386/amd64 if def
Tom Jones [Tue, 11 Oct 2022 08:30:34 +0000 (09:30 +0100)]
acpi: Put CPPC workaround behind i386/amd64 if def

While CPPC is available on arm64 platforms with ACPI we don't know if we
need to work around issues with firmware there.

22 months agostress2: Temporarily removed the rename(2) tests as these seem to trigger a
Peter Holm [Tue, 11 Oct 2022 08:20:51 +0000 (10:20 +0200)]
stress2: Temporarily removed the rename(2) tests as these seem to trigger a
deadlock.  Count the number of CLEAN + MODIFIED reports from fsck_ffs and
flag counts > 1 as an error

22 months agoinit: allow to start script executions with sh -o verify
Sebastien Bini [Tue, 11 Oct 2022 07:48:04 +0000 (09:48 +0200)]
init: allow to start script executions with sh -o verify

On systems where mac_veriexec is enforced, init should run its scripts in verified mode.
This relies on the verify shell option introduced by D30464. init will detect if the shell
is /bin/sh, and in which case, add the verify option to the argument vector.
The verify option propagates to all files sourced by the shell, ensuring a better
protection than if the script was tested against an open(O_VERIFY) before running it.
This security can be bypassed with the kenv which overloads the shell to use.
However we feel confident that on systems running with mac_veriexec, this kenv will be blocked somehow.
Also, the verify option has no effect on systems where mac_veriexec is not loaded nor enforced.

Differential revision:  https://reviews.freebsd.org/D34622
Reviewed by: sjg, wma

22 months agopmc.sandybridge(3): Fix a few EVENT_ vs Event inconsistencies
Jessica Clarke [Mon, 10 Oct 2022 23:50:58 +0000 (00:50 +0100)]
pmc.sandybridge(3): Fix a few EVENT_ vs Event inconsistencies

Every event other than these four is listed as Event X, Umask Y; fix
these to conform to that style.

22 months agoigc: Fix up hw vlan ops
Kevin Bowling [Mon, 10 Oct 2022 23:09:21 +0000 (16:09 -0700)]
igc: Fix up hw vlan ops

Adapt 2796f7cab10785ef40efbba97ef67ab319c96e9c to igc(4)

* Don't reset the entire adapter for vlan changes, fix up the problems
* Remove the VFTA, this hardware doesn't seem to implement it

Approved by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31979

22 months agohwpmc: Define full set of Armv8.0 events
Jessica Clarke [Mon, 10 Oct 2022 22:34:08 +0000 (23:34 +0100)]
hwpmc: Define full set of Armv8.0 events

Like many of the other encodings here, none of these are actually used
by our tables. However, defining the EVENT_xH names allows them to be
used by the user (e.g. when trying to use an implementation-defined
event that they know about from their core's documentation but we don't)
and allows us to define PMC_EV_ARMV8_LAST appropriately.

Some of these are also used downstream in CheriBSD on Morello.

Reviewed by: andrew, tsoome
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D36926

22 months agohwpmc: Move DMC-620 and CMN-600 events to allow for full Armv8.0 space
Jessica Clarke [Mon, 10 Oct 2022 22:30:07 +0000 (23:30 +0100)]
hwpmc: Move DMC-620 and CMN-600 events to allow for full Armv8.0 space

The documented encoding space for Armv8 was only 8 bits, but v8.0 has
always had a 10-bit encoding space for its events, and downstream in
CheriBSD we relied on this full space. This worked until the DMC-620 and
CMN-600 events were added, trampling on what should have been reserved
for Armv8.0 right from the start. Thus, renumber the DMC-620 and CMN-600
events to not do this before they make it into a stable release,
allowing for the full Armv8.0 encoding space to be used without having
to split it across two different regions.

Note that Armv8.1 grows the encoding space to 16 bits, which doesn't fit
well with our current approach. No attempt is made to allow for these
events in this change, only the ones that have always been valid (according to
the hardware) from the first commit of Armv8 support to hwpmc.

Reviewed by: arichardson, tsoome
Differential Revision: https://reviews.freebsd.org/D36925

22 months agoamd64 pmap: add comment explaining why INVLPG is functional for PCID config
Konstantin Belousov [Mon, 10 Oct 2022 00:19:45 +0000 (03:19 +0300)]
amd64 pmap: add comment explaining why INVLPG is functional for PCID config

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

22 months agoamd64: remove useless addr2 variables in page range invalidation handlers
Konstantin Belousov [Sat, 8 Oct 2022 08:33:11 +0000 (11:33 +0300)]
amd64: remove useless addr2 variables in page range invalidation handlers

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

22 months agoacpi: Tell SMM we will handle CPPC notifications
Tom Jones [Mon, 10 Oct 2022 13:46:25 +0000 (14:46 +0100)]
acpi: Tell SMM we will handle CPPC notifications

Buggy SMM implementations can hang while processing CPPC notifications.
This leads to some laptops (notably Thinkpads) hanging when the
hwpstate_intel driver is loaded.

Tell the SMM that we will handle CPPC notifications as described in:

- Intel® Processor Vendor-Specific ACPI
- Intel® 64 and IA-32 Architectures Software Developer’s Manual

CPPC events default to masked (disabled) so while we do not do any
handling right now this does not seem to lead to any issues.

This approach was found via this Linux Kernel patch:
https://lkml.org/lkml/2016/3/17/563

PR: 253288
Reviewed by: imp, jhb
Sponsored by: Modirum
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D36699

22 months agoSync TCP related kernel config options
Michael Tuexen [Mon, 10 Oct 2022 13:40:26 +0000 (15:40 +0200)]
Sync TCP related kernel config options

Add TCP_BLACKBOX to the remaining platforms (arm64, RISC-V) and add
TCP_RFC7413 to the remaining platform (RISC-V).

Reviewed by: rscheff@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36918

22 months agoigc: remove unnecessary PHY ID checks
Mah Yock Gen [Fri, 2 Sep 2022 00:18:28 +0000 (08:18 +0800)]
igc: remove unnecessary PHY ID checks

I225 devices have only one PHY vendor. There is unnecessary to check
_I_PHY_ID during the link establishment and auto-negotiation process,
the checking also caused devices like i225-IT failed. This patch is to
remove the mentioned unnecessary checking.

Cc: stable@dpdk.org
Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Approved by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36923

22 months agodevice_get_property: add a HANDLE case
Bjoern A. Zeeb [Thu, 29 Sep 2022 12:41:58 +0000 (12:41 +0000)]
device_get_property: add a HANDLE case

This will resolve a reference and return the appropriate handle, a node
on the simplebus or an ACPI_HANDLE for ACPI.  For now we do not try to
further abstract the return type.

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

22 months agoipfilter: Removed unused ioctl typedef
Cy Schubert [Fri, 7 Oct 2022 10:05:53 +0000 (03:05 -0700)]
ipfilter: Removed unused ioctl typedef

Defunct operating systems no longer pollute the ipfilter sources. Remove
their typedefs.

MFC after: 1 week

22 months agoUpdate tip for adding a user to wheel:
Pau Amma [Sun, 25 Sep 2022 19:00:49 +0000 (19:00 +0000)]
Update tip for adding a user to wheel:

Use "pw groupmod" instead of hand-editing /etc/group

Reviewed by: bcr, gjb

Approved by: gjb (mentor)

22 months agorpc.tlsservd: Add an option to run multiple daemons
Rick Macklem [Sat, 8 Oct 2022 23:06:16 +0000 (16:06 -0700)]
rpc.tlsservd: Add an option to run multiple daemons

During discussions with someone that was doing NFS-over-TLS
development for Solaris, we had a concern that the server might
become overloaded after rebooting, due to a large number of
TLS handshake requests from clients.

To alleviate this potential problem, this patch modifies rpc.tlsservd
so that it supports the "-N/--numdaemons" command line option,
which specifies that up to RPCTLS_SRV_MAXNPROCS (currently defined
as 16 in the patch) may be started.

When there are multiple daemons, one is selected by the patched kernel
in a round-robin fashion, to serve a TLS handshake request.

The man page update will be done in a future commit.

Reviewed by: emaste, karels
Differential Revision: https://reviews.freebsd.org/D35886

22 months agozfs: mix mismerge in zfs_znode_free
Mateusz Guzik [Sat, 8 Oct 2022 20:43:33 +0000 (20:43 +0000)]
zfs: mix mismerge in zfs_znode_free

happens to be a noop

22 months agoinet: Simplify if_multiaddrs iteration.
Alexander Motin [Sat, 8 Oct 2022 17:10:07 +0000 (13:10 -0400)]
inet: Simplify if_multiaddrs iteration.

Similar to 2cd6ad766eb23 for inet6 drop ifma_restart use, creating more
problems than solving.  It is no longer needed after epoch introduction.

While there, add NULL check for ifma_ifp in igmp_change_state(), that
sometimes caused panics on interface destruction.

MFC after: 2 weeks

22 months agopf: atomically increment state ids
Kristof Provost [Fri, 7 Oct 2022 17:17:06 +0000 (19:17 +0200)]
pf: atomically increment state ids

Rather than using a per-cpu state counter, and adding in the CPU id we
can atomically increment the number.
This has the advantage of removing the assumption that the CPU ID fits
in 8 bits.

Event: Aberdeen Hackathon 2022
Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D36915

22 months agobhyve: Initialize the return value in blockif_register_resize_callback()
Mark Johnston [Sat, 8 Oct 2022 15:26:38 +0000 (11:26 -0400)]
bhyve: Initialize the return value in blockif_register_resize_callback()

MFC after: 1 week

22 months agobhyve: Make bc_magic unsigned
Mark Johnston [Sat, 8 Oct 2022 15:26:31 +0000 (11:26 -0400)]
bhyve: Make bc_magic unsigned

This addresses a number of compiler warnings about signed/unsigned
comparisons in assertions.

MFC after: 1 week

22 months agobhyve: Make pci_bars local to pci_emul.c
Mark Johnston [Sat, 8 Oct 2022 15:26:25 +0000 (11:26 -0400)]
bhyve: Make pci_bars local to pci_emul.c

MFC after: 1 week

22 months agobhyve: Annotate unused function parameters
Mark Johnston [Sat, 8 Oct 2022 15:22:38 +0000 (11:22 -0400)]
bhyve: Annotate unused function parameters

MFC after: 1 week

22 months agounr: remove UNR64_LOCKED
Mateusz Guzik [Sat, 8 Oct 2022 09:38:41 +0000 (09:38 +0000)]
unr: remove UNR64_LOCKED

All platforms support 64-bit atomics now.

22 months agoRevert "Add extra EINVAL information about wrong block size to read(2)/write(2)"
Benedict Reuschling [Sat, 8 Oct 2022 10:23:51 +0000 (10:23 +0000)]
Revert "Add extra EINVAL information about wrong block size to read(2)/write(2)"

This reverts commit 1c2be25f6080ee63baeae55e45761e1310d1b756.

kib@ pointed out that it is perfectly fine to write at arbitrary regular
file offsets. For example, in a 4K block size character device, geom
doesn't support writing / reading 515 byte blocks. The description is
perhaps not applicable to all EINVALs returned.

22 months agokboot: hostdisk add to lsdev output
Warner Losh [Sat, 8 Oct 2022 05:46:20 +0000 (23:46 -0600)]
kboot: hostdisk add to lsdev output

Not entirely sure what to do here, so just list that we're here.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36606

22 months agokboot: Move load address stuff to MD code
Warner Losh [Sat, 8 Oct 2022 05:40:56 +0000 (23:40 -0600)]
kboot: Move load address stuff to MD code

The load address computations are highly architecture specific. There
are generic ways that are augmented by specific constraints of specific
way things work on each architecture. Move the current load segment
computations into a MD routine load_addr.

As part of the move, I'm marking kboot_get_kernel_machine_bits as
unused. This arrived in a prior commit, but never seems to have been
connected, suggesting an incomplete merge at the time, or a path not yet
taken.

Create a stub for amd64 that will be filled in with a later commit.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36603

22 months agocam: Use FreeBSD standard copyright
Warner Losh [Sat, 8 Oct 2022 05:37:46 +0000 (23:37 -0600)]
cam: Use FreeBSD standard copyright

For CAM, move to the FreeBSD standard copyright rather than the 'put it
at the front' variation. This variaiton has been flagged as potentially
problematic in other contexts. Since this variation wasn't a conscious
decision on our part, use the standard license from src/COPYRIGHT.
Also, remove the -FreeBSD suffix in SPDX-License-Identifier. It's
obsolete at SPDX and even the original text didn't match it.

MFC After: 3 days
Sponsored by: Netflix

22 months agonvmecontrol: use uintmax_t for a size
Warner Losh [Sat, 8 Oct 2022 03:41:02 +0000 (21:41 -0600)]
nvmecontrol: use uintmax_t for a size

Use uintmax_t cast to print the size of the device for the non-humanize
case to avoid issues with 32-bit longs.

Fixes: 9c1bec9c21a2
Sponsored by: Netflix

22 months agons8250_drain: Drain without DELAY first
Colin Percival [Fri, 12 Aug 2022 23:45:17 +0000 (16:45 -0700)]
ns8250_drain: Drain without DELAY first

In virtual machines with virtual UARTs which have fictitious baud
rates, it may be possible to drain the receive queue very quickly,
without needing to DELAY after each character.  Attempt to read
(and discard) the receive queue as fast as possible, stopping for
a DELAY only when LSR_RXRDY is no longer asserted; assume that we
have finished draining the queue when LSR_RXRDY is asserted both
before and after a DELAY.

This speeds up the boot process in FreeBSD/Firecracker by 27 ms.

Reviewed by: imp, jrtc27
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D36184

22 months agonvmecontrol: improve namespace size unit of devlist command output
Wanpeng Qian [Fri, 7 Oct 2022 23:59:02 +0000 (17:59 -0600)]
nvmecontrol: improve namespace size unit of devlist command output

Add an option of -h --human to output human readable size unit instead
of the fixed unit (MB).

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by: imp, bcr
Differential Revision: https://reviews.freebsd.org/D32957

22 months agoEVENTHANDLER(9): drop the list of event handlers
Mitchell Horne [Fri, 7 Oct 2022 22:25:12 +0000 (19:25 -0300)]
EVENTHANDLER(9): drop the list of event handlers

Maintaining a comprehensive list of event handlers in this man page is a
futile endeavor. It is entirely detached from the source code, and
therefore requires that anyone adding/removing an event handler have
prior knowledge of the list. Many do not, so it will naturally become
stale (and is).

This is demonstrated by the fact that there are currently 88 instances
of EVENTHANDLER_DECLARE() in the source tree, but the list contains 66
items.

Many of the descriptions do not offer much detail that could not be
gleaned from the handler name alone. It is a more effective strategy to
document the purpose/details of the event handler in a comment alongside
its declaration.

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

22 months agobus.h: rewrite comment describing intr_type
Mitchell Horne [Fri, 7 Oct 2022 22:21:49 +0000 (19:21 -0300)]
bus.h: rewrite comment describing intr_type

Describe more clearly the purpose of these flags and where they are
used.

Remove grog's comment about revisiting the flags. At this point it does
not make sense to change this long-standing API, especially in light of
2cf7870864ea ("Collapse interrupt thread priorities").

Give a better example of a bus modifying these flags; I did not find any
existing instance where a bus changes the interrupt's type.

Reviewed by: imp, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36896

22 months ago<sys/_pv_entry>: Add a fallback for __LONG_WIDTH__ for older compilers.
John Baldwin [Fri, 7 Oct 2022 19:44:31 +0000 (12:44 -0700)]
<sys/_pv_entry>: Add a fallback for __LONG_WIDTH__ for older compilers.

clang only includes a __LONG_WIDTH__ builtin in clang 14 and later.

22 months agosys/_pv_entry.h: Drop UCB copyright as this is all Peter's code.
John Baldwin [Fri, 7 Oct 2022 19:18:28 +0000 (12:18 -0700)]
sys/_pv_entry.h: Drop UCB copyright as this is all Peter's code.

Reported by: alc

22 months agosys: Consolidate common implementation details of PV entries.
John Baldwin [Fri, 7 Oct 2022 17:14:03 +0000 (10:14 -0700)]
sys: Consolidate common implementation details of PV entries.

Add a <sys/_pv_entry.h> intended for use in <machine/pmap.h> to
define struct pv_entry, pv_chunk, and related macros and inline
functions.

Note that powerpc does not yet use this as while the mmu_radix pmap
in powerpc uses the new scheme (albeit with fewer PV entries in a
chunk than normal due to an used pv_pmap field in struct pv_entry),
the Book-E pmaps for powerpc use the older style PV entries without
chunks (and thus require the pv_pmap field).

Suggested by: kib
Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36685

22 months agoif_ovpn: remove an incorrect assertion
Kristof Provost [Fri, 7 Oct 2022 17:10:01 +0000 (19:10 +0200)]
if_ovpn: remove an incorrect assertion

netisr_dispatch() can fail, especially when under high traffic loads.
This isn't a fatal error, so simply don't check the return value.

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

22 months agow: don't truncate if we're writing libxo json/xml
Kristof Provost [Fri, 7 Oct 2022 16:14:02 +0000 (18:14 +0200)]
w: don't truncate if we're writing libxo json/xml

If we're writing structured output (i.e. json or xml) we shouldn't worry
about terminal width, and instead always output full width information.

This means that, for example, if we're called from crontab with 'w
--libxo json' we'll provide full the command field rather than
pointlessly truncating it.

Suggested by: Phil Shafer
Event: Aberdeen Hackathon 2022
Differential Revision: https://reviews.freebsd.org/D25013

22 months agoUpdate the organization graph for pkgmgr
Rene Ladan [Fri, 7 Oct 2022 15:26:42 +0000 (17:26 +0200)]
Update the organization graph for pkgmgr
Event: Aberdeen 2022 Hackathon

22 months agoBump MAC_VERSION to 5
Allan Jude [Fri, 7 Oct 2022 14:37:35 +0000 (14:37 +0000)]
Bump MAC_VERSION to 5

2449b9e5fe565be757a4b29093fd1c9c6ffcf3c9 introduced API changes
that require ensuring that loadable MAC modules use the matching API.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.

22 months agofusefs: during F_GETLK, don't change l_pid if no lock is found
Alan Somers [Fri, 7 Oct 2022 14:46:22 +0000 (08:46 -0600)]
fusefs: during F_GETLK, don't change l_pid if no lock is found

PR: 266885
MFC after: 2 weeks
Submitted by: John Millikin <jmillikin@gmail.com>
Sponsored by: Axcient
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D36905

22 months agotcp: update repeat <SYN,ACK> with latest IP ECN info
Richard Scheffenegger [Thu, 6 Oct 2022 23:50:02 +0000 (01:50 +0200)]
tcp: update repeat <SYN,ACK> with latest IP ECN info

When multiple <SYN> segments are received, update the <SYN,ACK>
sent in response to the latest IP ECN and TCP ECN information.

On retransmitting the <SYN,ACK>, once ECN maxtries are done, not
only disable RFC3168 ECN, but AccECN also.

Reviewed By:     tuexen, #transport
Sponsored by:    NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36875

22 months agotcp: honor rfc1323 sysctl on passive sessions
Richard Scheffenegger [Thu, 6 Oct 2022 23:43:14 +0000 (01:43 +0200)]
tcp: honor rfc1323 sysctl on passive sessions

On passive sessions, honor the local settings disabling or
enabling window scaling and timestamp options.

Reviewed By:     tuexen, #transport
Sponsored by:    NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36874

22 months agosiftr: apply filter early on
Richard Scheffenegger [Thu, 6 Oct 2022 23:31:48 +0000 (01:31 +0200)]
siftr: apply filter early on

Quickly check TCP port filter, before investing into
expensive operations.

No functional change.

Obtained from:   guest-ccui
Reviewed By:     #transport, tuexen, guest-ccui
Sponsored by:    NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36842

22 months agoif_vxlan(4): Correct the statistic for output bytes
Zhenlei Huang [Fri, 7 Oct 2022 11:37:12 +0000 (13:37 +0200)]
if_vxlan(4): Correct the statistic for output bytes

The vxlan interface encapsulates the Ethernet frame by prepending IP/UDP
and vxlan headers. For statistics, only the payload, i.e. the
encapsulated (inner) frame should be counted.

Event: Aberdeen Hackathon 2022
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D36855

22 months agousb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword.
Hans Petter Selasky [Fri, 7 Oct 2022 11:31:51 +0000 (13:31 +0200)]
usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword.

MFC after: 1 week
Sponsored by: NVIDIA Networking

22 months agousb(4): Make the enumeration thread nice time a variable.
Hans Petter Selasky [Fri, 7 Oct 2022 11:28:38 +0000 (13:28 +0200)]
usb(4): Make the enumeration thread nice time a variable.

Depends on "options USB_DEBUG".

Suggested by: koobs@
MFC after: 1 week
Sponsored by: NVIDIA Networking

22 months agoAdd extra EINVAL information about wrong block size to read(2)/write(2)
Benedict Reuschling [Fri, 7 Oct 2022 11:32:37 +0000 (11:32 +0000)]
Add extra EINVAL information about wrong block size to read(2)/write(2)

The read system call will return EINVAL if the current file offset is
not a multiple of the block size. This also applies to write(2). Add an
entry for EINVAL about this error to both man pages.

PR: 91149
Event: Aberdeen Hackathon 2022
Differential Revision: https://reviews.freebsd.org/D24617

22 months agotcp: remove INP_TIMEWAIT flag
Gleb Smirnoff [Fri, 7 Oct 2022 02:22:23 +0000 (19:22 -0700)]
tcp: remove INP_TIMEWAIT flag

Mechanically cleanup INP_TIMEWAIT from the kernel sources.  After
0d7445193ab, this commit shall not cause any functional changes.

Note: this flag was very often checked together with INP_DROPPED.
If we modify in_pcblookup*() not to return INP_DROPPED pcbs, we
will be able to remove most of this checks and turn them to
assertions.  Some of them can be turned into assertions right now,
but that should be carefully done on a case by case basis.

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

22 months agosystat: remove INP_TIMEWAIT
Gleb Smirnoff [Fri, 7 Oct 2022 02:22:23 +0000 (19:22 -0700)]
systat: remove INP_TIMEWAIT

22 months agotcp: in tcp_usr_detach() remove special handling of compressed time-wait
Gleb Smirnoff [Fri, 7 Oct 2022 02:22:23 +0000 (19:22 -0700)]
tcp: in tcp_usr_detach() remove special handling of compressed time-wait

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

22 months agotcp: remove tcptw, the compressed timewait state structure
Gleb Smirnoff [Fri, 7 Oct 2022 02:22:23 +0000 (19:22 -0700)]
tcp: remove tcptw, the compressed timewait state structure

The memory savings the tcptw brought back in 2003 (see 340c35de6a2) no
longer justify the complexity required to maintain it.  For longer
explanation please check out the email [1].

Surpisingly through almost 20 years the TCP stack functionality of
handling the TIME_WAIT state with a normal tcpcb did not bitrot.  The
existing tcp_input() properly handles a tcpcb in TCPS_TIME_WAIT state,
which is confirmed by the packetdrill tcp-testsuite [2].

This change just removes tcptw and leaves INP_TIMEWAIT.  The flag will
be removed in a separate commit.  This makes it easier to review and
possibly debug the changes.

[1] https://lists.freebsd.org/archives/freebsd-net/2022-January/001206.html
[2] https://github.com/freebsd-net/tcp-testsuite

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

22 months agoldd: ignore unverified files
Simon J. Gerraty [Fri, 7 Oct 2022 00:51:28 +0000 (17:51 -0700)]
ldd: ignore unverified files

When mac_veriexec is enforcing, we won't run unverified binaries,
don't let ldd examine them either.

Reviewed by: stevek emaste
MFC after: 1 week
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D36897

22 months agoamd64, arm64 pmap: fix a comment typo
Mitchell Horne [Tue, 4 Oct 2022 19:22:20 +0000 (16:22 -0300)]
amd64, arm64 pmap: fix a comment typo

There is no such error code.

Fixes: 1d5ebad06c20b ("pmap: optimize MADV_WILLNEED on existing superpages")

22 months agoriscv: handle kernel PTE edge-case in pmap_enter_l2()
Mitchell Horne [Wed, 5 Oct 2022 16:14:36 +0000 (13:14 -0300)]
riscv: handle kernel PTE edge-case in pmap_enter_l2()

Page table pages are never freed from the kernel pmap, instead they are
zeroed when a range is unmapped. This allows future mappings to be
constructed more quickly. Detect this scenario in pmap_enter_l2(), so we
don't fail to create a superpage mapping when the 2MB range is actually
available.

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

22 months agoriscv: add an assert to pmap_remove_pages()
Mitchell Horne [Thu, 25 Aug 2022 20:08:20 +0000 (17:08 -0300)]
riscv: add an assert to pmap_remove_pages()

Similar checks exist for both arm64 and amd64, but note that for amd64
it is a bare panic().

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

22 months agoriscv: handle superpage in pmap_enter_quick_locked()
Mitchell Horne [Wed, 5 Oct 2022 17:11:02 +0000 (14:11 -0300)]
riscv: handle superpage in pmap_enter_quick_locked()

Previously, if pmap_enter_l2() was asked to re-map an existing superpage
(the result of madvise(MADV_WILLNEED) on a mapped range), it could
'fail' to do so, falling back to trying pmap_enter_quick_locked() for
each 4K virtual page. Because this function does not check if the l2
entry it finds is a superpage, it would proceed, sometimes resulting in
the creation of false PV entries.

If the relevant range was later munmap'ed, the system would panic during
the process' exit in pmap_remove_pages(), while attempting to clean up
the PV entries for mappings which no longer exist.

Instead, we should return early in the presence of an existing
superpage, as is done in other pmaps.

PR:             266108
Reviewed by: markj, alc
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36563

22 months agoriscv: optimize MADV_WILLNEED on existing superpages
Mitchell Horne [Wed, 5 Oct 2022 17:10:45 +0000 (14:10 -0300)]
riscv: optimize MADV_WILLNEED on existing superpages

Specifically, avoid pointless calls to pmap_enter_quick_locked() when
madvise(MADV_WILLNEED) is applied to an existing superpage mapping.

1d5ebad06c20 made the change for amd64 and arm64.

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

22 months agoriscv: better CTR messages in pmap_enter_l2()
Mitchell Horne [Thu, 25 Aug 2022 20:08:41 +0000 (17:08 -0300)]
riscv: better CTR messages in pmap_enter_l2()

Disambiguate the failure cases.

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

22 months agozfs: powerpc: disable kernel floating point support
Alfredo Dal'Ava Junior [Thu, 6 Oct 2022 21:48:01 +0000 (18:48 -0300)]
zfs: powerpc: disable kernel floating point support

Powerpc* doesn't support support floating point in the kernel yet,
so disable it on zfs for now.

This fixes "panic: altivec unavailable trap" when loading zfs.ko

Approved by: jhibbits
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D36894

22 months agobsdinstall: Fix race condition when shutting down after installation
Jessica Clarke [Thu, 6 Oct 2022 19:04:04 +0000 (20:04 +0100)]
bsdinstall: Fix race condition when shutting down after installation

Whilst reboot(8) will block whilst it runs, shutdown(8) does not,
daemonizing instead. This means that we must wait after running it,
otherwise we will exit and cause the system to attempt to go multi-user
in parallel with the shutdown daemon killing init. With the new
multi-console support in the installer, runconsoles will immediately
kill this daemon, racing with the daemon being able to signal init as
desired, and I have seen this race be lost in QEMU with a single CPU. In
the past this wasn't such an issue, since shutdown's daemon puts itself
in a new session group immediately after fork (and the parent doesn't
wait until that has happened, so whilst there's technically a race
condition in there where it could receive a SIGHUP from the death of the
parent's session leader, in practice this is very unlikely to be hit.
This means that the only consequence of this oversight before was that
you might get the beginnings of more console output on the way to
multi-user and thus the console would look a little confusing.

Reviewed by: gjb
Fixes: e4505364c087 ("release/rc.local: Provide option to shutdown after installation complete")
Fixes: a09af1b7fd95 ("bsdinstall release: Start installer on multiple consoles")
Differential Revision: https://reviews.freebsd.org/D36879

22 months agonvmecontrol: Apply cast
Cy Schubert [Thu, 6 Oct 2022 18:56:11 +0000 (11:56 -0700)]
nvmecontrol: Apply cast

The proper fix also casts to uintmax_t.

Reported by: imp
Fixes: a7b568109ec7

22 months agoioat: Add Ice Lake ID.
Alexander Motin [Thu, 6 Oct 2022 18:44:10 +0000 (14:44 -0400)]
ioat: Add Ice Lake ID.

MFC after: 2 weeks

22 months agonvmecontrol: Fix i386 build
Cy Schubert [Thu, 6 Oct 2022 17:56:48 +0000 (10:56 -0700)]
nvmecontrol: Fix i386 build

Fix:

--- all_subdir_sbin ---
/opt/src/git-src/sbin/nvmecontrol/modules/samsung/samsung.c:149:64:
error: format specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
        printf("   Read Reclaim Count                       : %lu\n",
le64dec(&temp->rrc));
                                                              ~~~
^~~~~~~~~~~~~~~~~~~
                                                              %llu
/opt/src/git-src/sbin/nvmecontrol/modules/samsung/samsung.c:150:64:
error: forma t specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
        printf("   Lifetime Uncorrectable ECC Count         : %lu\n",
le64dec(&temp->lueccc));
                                                              ~~~
^~~~~~~~~~~~~~~~~~~~~~
                                                              %llu
2 errors generated.

Fixes: 84e86788705c176cc195e4a9831c0be08dcece31

22 months agoMakefile: replace mergemaster references with etcupdate
Dries Michiels [Tue, 4 Oct 2022 19:34:05 +0000 (21:34 +0200)]
Makefile: replace mergemaster references with etcupdate

Similar to UPDATING and handbook changes, treat Makefile the same.

PR: 260822
Approved by: jhb, philip
Differential Revision: https://reviews.freebsd.org/D36877

22 months agoarm64/machdep: Delete trailing whitespace
Warner Losh [Thu, 6 Oct 2022 03:06:31 +0000 (21:06 -0600)]
arm64/machdep: Delete trailing whitespace

No functional change.

Sponsored by: Netflix

22 months agocxgbe/cxgbei: Do not validate the hardware iSCSI tag mask.
Navdeep Parhar [Wed, 5 Oct 2022 18:05:12 +0000 (11:05 -0700)]
cxgbe/cxgbei: Do not validate the hardware iSCSI tag mask.

This was added in 7cba15b16eb2 in 2016 and firmwares at that time were
already setting up the iSCSI tag mask properly.  Since then it has also
become possible to split the iSCSI region between multiple PCIE PFs but
the driver's calculation takes only its own PF's allocation into account
and that means this code is incorrect and not just a harmless no-op.

MFC after: 1 week
Sponsored by: Chelsio Communications

22 months agoIgnore IPv6 NA and drop IPv6 NS when BACKUP CARP address is used
Andrey V. Elsukov [Thu, 6 Oct 2022 16:50:33 +0000 (19:50 +0300)]
Ignore IPv6 NA and drop IPv6 NS when BACKUP CARP address is used

When system acts as CARP BACKUP ignore received IPv6 Neighbor Advertisements
to ensure that neighbor cache will not be changed.
Also do not send IPv6 Neighbor Solicitation from CARP BACKUP source address.
Such packets can confuse network switch and it detects MAC addresses
flapping.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC
Differential Revision:     https://reviews.freebsd.org/D36649

22 months agovmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUs
Alexander Motin [Thu, 6 Oct 2022 16:44:59 +0000 (12:44 -0400)]
vmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUs

MFC after: 2 weeks

22 months agovmd: Bypass MSI/MSI-X remapping when possible.
Alexander Motin [Thu, 6 Oct 2022 16:15:25 +0000 (12:15 -0400)]
vmd: Bypass MSI/MSI-X remapping when possible.

By default all VMD devices remap children MSI/MSI-X interrupts into their
own.  It creates additional isolation, but also complicates things due to
sharing, etc.  Fortunately some VMD devices can bypass the remapping.
Add tunable to control it for remap testing or if something go wrong.

MFC after: 2 weeks

22 months agoldd: use direct exec mode unconditionally
Konstantin Belousov [Wed, 21 Sep 2022 13:55:44 +0000 (16:55 +0300)]
ldd: use direct exec mode unconditionally

Trying to exec malformed or unusual binary, for instance, a non-FreeBSD
ABI, or using a non-standard interpreter, might give unexpected outcome.

Reported by: The UK's National Cyber Security Centre (NCSC)
Reviewed by: emaste, markj, philip
Discussed with: jhb
Sponsored by: The FreeBSD Foundation
admbug: 991
PR: 127276, 175339, 231926
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36650

22 months agoif_ovpn: ensure we're in net_epoch when calling ovpn_encap()
Kristof Provost [Thu, 6 Oct 2022 15:01:47 +0000 (17:01 +0200)]
if_ovpn: ensure we're in net_epoch when calling ovpn_encap()

If the crypto callback is asynchronous we're no longer in net_epoch,
which ovpn_encap() (and ip_output() it calls) expect.

Ensure we've entered the epoch.

Do the same thing for the rx path.

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

22 months agouart_dev_snps: Fix device probing
Kornel Dulęba [Thu, 6 Oct 2022 14:25:47 +0000 (16:25 +0200)]
uart_dev_snps: Fix device probing

The "uart_bus_probe" function is used as a generic part of uart probe
logic. It returns a driver priority(negative number) if successful and
an error code otherwise.
Fix the error checking condition to account for that.
Also, while here return "BUS_PROBE_VENDOR", instead of "0".
This fixes uart on clearfog pro with recent DT.

PR: 266657
Reviewed by: mw
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D36880

22 months agotest/sys/opencrypto: Fix NIST KAT parser iterator
Kornel Dulęba [Thu, 6 Oct 2022 14:20:58 +0000 (16:20 +0200)]
test/sys/opencrypto: Fix NIST KAT parser iterator

When yield a.k.a "generator" iterator is used we need to return all
data using "yield", before returning from the function.
Because of that only encryption tests were run for AES-CBC, other modes
were affected as well.
Add one more loop to the iterator "next" routine to fix that.
This unveiled a problem in the GCM AEAD parser logic, which didn't
correctly handle tests cases with empty plaintext, i.e. AAD only.
Include the fix in this patch as it's a rather trivial one.

Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D36861

22 months agoMake #if and #endif do what people expect in *_if.m
Andrew Turner [Fri, 30 Sep 2022 16:02:36 +0000 (16:02 +0000)]
Make #if and #endif do what people expect in *_if.m

These are used in a few places. Pass them to the generated .c and .h
files to allow us to build the parts of the interface the kernel config
supports.

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

22 months agoStop relying on header pollution in sdhci_xenon.c
Andrew Turner [Wed, 5 Oct 2022 13:52:02 +0000 (14:52 +0100)]
Stop relying on header pollution in sdhci_xenon.c

Include sys/malloc.h directly in sdhci_xenon.c to get the malloc(9)
definition rather than depend on header pollution.

Sponsored by: The FreeBSD Foundation

22 months agoFix the options to build rk_usb2phy.c
Andrew Turner [Wed, 5 Oct 2022 10:45:45 +0000 (11:45 +0100)]
Fix the options to build rk_usb2phy.c

We need to check for fdt rk_usb2phy on both sides of the '|'.

Sponsored by: The FreeBSD Foundation

22 months agouslcom(4): Clear stall at every open.
Hans Petter Selasky [Wed, 5 Oct 2022 14:45:21 +0000 (16:45 +0200)]
uslcom(4): Clear stall at every open.

To avoid data loss, make sure both the receive and transmit data toggles
get reset, before trying to read or write any data.

MFC after: 1 week
Sponsored by: NVIDIA Networking

22 months agonvmecontrol: Add Samsung Extended SMART Information logpage support
Wanpeng Qian [Thu, 6 Oct 2022 10:10:06 +0000 (10:10 +0000)]
nvmecontrol: Add Samsung Extended SMART Information logpage support

Samsung PM983 SSD has a 0xca logpage. It has more information compared
to Intel's this patch tested on PM983 M2 SSD and works as expected.

Reviewed by: imp@
Approved by: kp@
Event: Aberdeen Hackathon 2022
Differential revision: https://reviews.freebsd.org/D33749

22 months agoLinuxKPI: Add pci_power querying for drm-kmod
Jake Freeland [Thu, 6 Oct 2022 08:15:41 +0000 (10:15 +0200)]
LinuxKPI: Add pci_power querying for drm-kmod

Adds a few struct members and a function to get i915_runtime_pm_status()
to compile in drm-kmod.

Differential Revision: https://reviews.freebsd.org/D36749
Sponsored by:   Google, Inc. (GSoC 2022)

22 months agors: Fix some pointer arith UB.
John Baldwin [Wed, 5 Oct 2022 23:48:05 +0000 (16:48 -0700)]
rs: Fix some pointer arith UB.

If the next column was blank, then the length of the following entry
was computed as the end of the following entry minus a global variable
"blank" which is not in the same string or allocation.  Instead, save
the start value of 'p' explicitly instead of abusing '*ep'.  Possibly
we should just increment p before saving it in sp in the 'blank' case,
but at worst that would just mean maxlen might be one char too large
which should be harmless.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D36832

22 months agors: Fix a use after free.
John Baldwin [Wed, 5 Oct 2022 23:47:40 +0000 (16:47 -0700)]
rs: Fix a use after free.

Using a pointer passed to realloc() after realloc() even for pointer
arithmetic is UB.  It also breaks in practice on CHERI systems as
the updated value of 'sp' in this case would have had the bounds from
the old allocation.

This would be much cleaner if elem were a std::vector<char *>.

Reviewed by: brooks, emaste
Reported by: GCC -Wuse-after-free
Differential Revision: https://reviews.freebsd.org/D36831

22 months agors: Fix various harmless warnings.
John Baldwin [Wed, 5 Oct 2022 23:47:21 +0000 (16:47 -0700)]
rs: Fix various harmless warnings.

- Add /* FALLTHROUGH */ comments for intentional fall throughs in
  getargs().

- Remove id strings to quiet -Wunused-const-variable warnings from
  GCC.

- While here, remove __FBSDID.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D36830

22 months agomsk: Use a void cast to mark values of dummy reads as unused.
John Baldwin [Wed, 5 Oct 2022 23:46:01 +0000 (16:46 -0700)]
msk: Use a void cast to mark values of dummy reads as unused.

Note that this required adding missing ()'s around the outermost level
of MSK_READ_MIB*.  Otherwise, the void cast was only applied to the
first register read.  This also meant that MSK_READ_MIB64 was pretty
broken as the uint64_t cast only applied to the first 16-bit register
read in each MSK_READ_MIB32 invocation and the 32-bit shift was only
applied to the second register read of the pair.

Reviewed by: imp, emaste
Reported by: GCC -Wunused-value
Differential Revision: https://reviews.freebsd.org/D36777

22 months agomsk: Don't bother reading spare stats registers.
John Baldwin [Wed, 5 Oct 2022 23:45:43 +0000 (16:45 -0700)]
msk: Don't bother reading spare stats registers.

msk_stats_update reads stats registers named "spare" whose values are
discarded.

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

22 months agoarm64: Simplify initialization of pc_freemask.
John Baldwin [Wed, 5 Oct 2022 23:20:55 +0000 (16:20 -0700)]
arm64: Simplify initialization of pc_freemask.

Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36502

22 months agoAdd mbuf_tstmp2timeval()
Konstantin Belousov [Mon, 3 Oct 2022 22:49:45 +0000 (01:49 +0300)]
Add mbuf_tstmp2timeval()

Reviewed by: hselasky, jkim, rscheff
Sponsored by: NVIDIA networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36870

22 months agovm_page: Fix a logic error in the handling of PQ_ACTIVE operations
Mark Johnston [Wed, 5 Oct 2022 19:12:46 +0000 (15:12 -0400)]
vm_page: Fix a logic error in the handling of PQ_ACTIVE operations

As an optimization, vm_page_activate() avoids requeuing a page that's
already in the active queue.  A page's location in the active queue is
mostly unimportant.

When a page is unwired and placed back in the page queues,
vm_page_unwire() avoids moving pages out of PQ_ACTIVE to honour the
request, the idea being that they're likely mapped and so will simply
get bounced back in to PQ_ACTIVE during a queue scan.

In both cases, if the page was logically in PQ_ACTIVE but had not yet
been physically enqueued (i.e., the page is in a per-CPU batch), we
would end up clearing PGA_REQUEUE from the page.  Then, batch processing
would ignore the page, so it would end up unwired and not in any queues.
This can arise, for example, when a page is allocated and then
vm_page_activate() is called multiple times in quick succession.  The
result is that the page is hidden from the page daemon, so while it will
be freed when its VM object is destroyed, it cannot be reclaimed under
memory pressure.

Fix the bug: when checking if a page is in PQ_ACTIVE, only perform the
optimization if the page is physically enqueued.

PR: 256507
Fixes: f3f38e2580f1 ("Start implementing queue state updates using fcmpset loops.")
Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: E-CARD Ltd.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D36839

22 months agogrep: Add quotes in manpage when using wildcards with --include
Daniel Engberg [Wed, 5 Oct 2022 17:04:52 +0000 (19:04 +0200)]
grep: Add quotes in manpage when using wildcards with --include

Examples uses --include=*.h which doesn't work as intended

Approved by: kevans
Differential Revision: https://reviews.freebsd.org/D36883

22 months agoAdd information on how to load gmirror on boot to auto activate mirrors
Benedict Reuschling [Wed, 5 Oct 2022 16:44:31 +0000 (16:44 +0000)]
Add information on how to load gmirror on boot to auto activate mirrors

PR: 234997
Reported by: Michiel van Baak <michiel@vanbaak.eu>
Event: Aberdeen Hackathon 2022
Differential Revision: https://reviews.freebsd.org/D20577

22 months agolibc: Include quad support on long32 ABIs
Brooks Davis [Wed, 5 Oct 2022 16:26:31 +0000 (17:26 +0100)]
libc: Include quad support on long32 ABIs

Rather than not including it on all 64-bit platforms, just include it on
32-bit ones.

Reviewed by: imp, jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D36422

22 months agobsd.cpu.mk: Introduce MACHINE_ABI
Brooks Davis [Wed, 5 Oct 2022 16:26:30 +0000 (17:26 +0100)]
bsd.cpu.mk: Introduce MACHINE_ABI

MACHINE_ABI is a list of properties of the ABI used for MACHINE_ARCH.
It should be used in place of long conditionals on MACHINE_ARCH where
practical.

The following properties are indicated with one of the follow values:

Byte order:                  big-endian, little-endian
Floating point ABI:          soft-float, hard-float
Size of long (size_t, etc):  long32, long64
Pointer type:                ptr32, ptr64
Size of time_t:              time32, time64

For example, i386 targets will be:
MACHINE_ABI= big-endian hard-float long32 ptr32 time32

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

22 months agoRename MACHINE_ABI and TARGET_ABI
Brooks Davis [Wed, 5 Oct 2022 16:26:30 +0000 (17:26 +0100)]
Rename MACHINE_ABI and TARGET_ABI

The MACHINE_ABI and TARGET_ABI variables are used to set the middle of
the target triple (e.g., "-unknown-" or "-gnueabihf-"). They are not set
by any tool in the base system and I've only found the latter mentioned
in one review online. As such, rename them to to MACHINE_TRIPLE_ABI and
TARGET_TRIPLE_ABI to clear the way to use MACHINE_ABI as a supplement to
MACHINE_CPU, etc.

Reviewed by: imp, jhb
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D36420

22 months agoRemove telnetd sources
Brooks Davis [Wed, 5 Oct 2022 16:26:30 +0000 (17:26 +0100)]
Remove telnetd sources

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

22 months agopf: use time_to for timestamps
Kristof Provost [Thu, 29 Sep 2022 12:45:03 +0000 (14:45 +0200)]
pf: use time_to for timestamps

Use time_t rather than uint32_t to represent the timestamps. That means
we have 64 bits rather than 32 on all platforms except i386, avoiding
the Y2K38 issues on most platforms.

Reviewed by: Zhenlei Huang
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36837

22 months agoif_vxlan(4): Add missing statistic for input packets
Zhenlei Huang [Wed, 5 Oct 2022 10:38:30 +0000 (12:38 +0200)]
if_vxlan(4): Add missing statistic for input packets

Event: Aberdeen hackathon 2022
Reviewed by: bryanv, kp
Differential Revision: https://reviews.freebsd.org/D36841

22 months agodhclient-script: cope with /32 address leases
Kristof Provost [Wed, 5 Oct 2022 10:11:07 +0000 (12:11 +0200)]
dhclient-script: cope with /32 address leases

On certain cloud platforms (Google Cloud, Packet.net and others) the
DHCP server offers a /32 address. This makes adding the default route
fail since it is not reachable via any interface. Linux's
dhclient-script seem to usually have a special case for that and
explicitly adds an interface route to the router's address.

FreeBSD's dhclient-script already has a special case for when the router
address is the same as the leased address. Now also add one for when
it's a different address that doesn't fall in the interface's subnet.

PR: 241792
Event: Aberdeen hackathon 2022
Submitted by: sigsys@gmail.com
Reviewed by: dch, kp, bz (+1 on the idea, not reviewed), thj
MFC after: 1 week

22 months agousb(4): Make sure the enumeration thread doesn't loop too fast.
Hans Petter Selasky [Thu, 9 Jun 2022 13:15:49 +0000 (15:15 +0200)]
usb(4): Make sure the enumeration thread doesn't loop too fast.

MFC after: 1 week
Sponsored by: NVIDIA Networking