]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoelf image activator: convert asserts into errors
Konstantin Belousov [Tue, 7 Dec 2021 09:29:53 +0000 (11:29 +0200)]
elf image activator: convert asserts into errors

(cherry picked from commit 9cf78c1cf6e8909e4b5eaedeb86482904c0bbdc4)

2 years agoexec_elf: assert that the image vnode is still locked on return
Konstantin Belousov [Thu, 9 Dec 2021 15:14:46 +0000 (17:14 +0200)]
exec_elf: assert that the image vnode is still locked on return

(cherry picked from commit b4b20492cd92b5ca7ff03f4140e88363449d3021)

2 years agoStyle
Konstantin Belousov [Wed, 8 Dec 2021 15:08:59 +0000 (17:08 +0200)]
Style

(cherry picked from commit 88dd7a0a39089b4c324cc83e0b0b4c089ca0501d)

2 years agoUPDATING: Add an entry for commit 18f5b477ee66
Rick Macklem [Sat, 18 Dec 2021 22:48:20 +0000 (14:48 -0800)]
UPDATING: Add an entry for commit 18f5b477ee66

This is a direct commit.

2 years agoparam.h: Bump __FreeBSD_version for commit 18f5b477ee66
Rick Macklem [Sat, 18 Dec 2021 22:44:46 +0000 (14:44 -0800)]
param.h: Bump __FreeBSD_version for commit 18f5b477ee66

Commit 18f5b477ee66 added two arguments to VOP_ALLOCATE().
As such, all NFS modules must be rebult from sources.

This is a direct commit.

2 years agovfs: Add "ioflag" and "cred" arguments to VOP_ALLOCATE
Rick Macklem [Sat, 6 Nov 2021 20:26:43 +0000 (13:26 -0700)]
vfs: Add "ioflag" and "cred" arguments to VOP_ALLOCATE

When the NFSv4.2 server does a VOP_ALLOCATE(), it needs
the operation to be done for the RPC's credential and not
td_ucred. It also needs the writing to be done synchronously.

This patch adds "ioflag" and "cred" arguments to VOP_ALLOCATE()
and modifies vop_stdallocate() to use these arguments.

The VOP_ALLOCATE.9 man page will be patched separately.

(cherry picked from commit f0c9847a6c477430d6fff647b12e9e9e2b461f2a)

2 years agoem: skip rxcsum offload processing when disabled
Vincenzo Maffione [Wed, 1 Dec 2021 21:10:46 +0000 (21:10 +0000)]
em: skip rxcsum offload processing when disabled

Similarly to the other Intel drivers, don't try to process
RX checksum offloads when this feature (IFCAP_RXCSUM) is
disabled.

Reviewed by: gallatin, kbowling, erj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33155

(cherry picked from commit d0633af7658fe02bc1af8639ef6dbb0d029c1b65)

2 years agoe1000: remove unused ifp backpointer
Vincenzo Maffione [Mon, 29 Nov 2021 21:28:26 +0000 (21:28 +0000)]
e1000: remove unused ifp backpointer

The ifp (struct ifnet) backpointer in the e1000 private ifnet
data is not used anymore since the iflib transition.
Remove it so that developers are not tempted to use it and
get a NULL pointer dereference.

Reviewed by: markj, kbowling, erj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33157

(cherry picked from commit d91559564dc647846479824340bdf94b7cf98c05)

2 years agoApply fix for clang incorrectly optimizing part of dns/bind916
Dimitry Andric [Wed, 15 Dec 2021 19:56:12 +0000 (20:56 +0100)]
Apply fix for clang incorrectly optimizing part of dns/bind916

Merge commit e5a8af7a90c6 from llvm git (by Gulfem Savrun Yeniceri):

  [Passes] Fix relative lookup table converter pass

  This patch fixes the relative table converter pass for the lookup table
  accesses that are resulted in an instruction sequence, where gep is not
  immediately followed by a load, such as gep being hoisted outside the loop
  or another instruction is inserted in between them. The fix inserts the
  call to load.relative.instrinsic in the original place of load instead of gep.
  Issue is reported by FreeBSD via https://bugs.freebsd.org/259921.

  Differential Revision: https://reviews.llvm.org/D115571

PR: 259921
Reported by: O. Hartmann <freebsd@walstatt-de.de>

(cherry picked from commit 5a925e4644665b9a7a5cdd664764fb0a4d1c5797)

2 years agonfsd: Fix Verify for attributes like FilesAvail
Rick Macklem [Sat, 4 Dec 2021 22:38:55 +0000 (14:38 -0800)]
nfsd: Fix Verify for attributes like FilesAvail

When the Verify operation calls nfsv4_loadattr(), it provides
the "struct statfs" information that can be used for doing a
compare for FilesAvail, FilesFree, FilesTotal, SpaceAvail,
SpaceFree and SpaceTotal.  However, the code erroneously
used the "struct nfsstatfs *" argument that is NULL.
This patch fixes these cases to use the correct argument
structure.  For the case of FilesAvail, the code in
nfsv4_fillattr() was factored out into a separate function
called nfsv4_filesavail(), so that it can be called from
nfsv4_loadattr() as well as nfsv4_fillattr().

In fact, most of the code in nfsv4_filesavail() is old
OpenBSD code that does not build/run on FreeBSD, but I
left it in place, in case it is of some use someday.

I am not aware of any extant NFSv4 client that does Verify
on these attributes.

PR: 260176

(cherry picked from commit 2d90ef47141d3ea0f88b43a1b6daf08d68ba8aba)

2 years agoMake msgbuf_peekbytes() not return leading zeroes.
Alexander Motin [Sat, 11 Dec 2021 04:18:52 +0000 (23:18 -0500)]
Make msgbuf_peekbytes() not return leading zeroes.

Introduce new MSGBUF_WRAP flag, indicating that buffer has wrapped
at least once and does not keep zeroes from the last msgbuf_clear().
It allows msgbuf_peekbytes() to return only real data, not requiring
every consumer to trim the leading zeroes after doing pointless copy.
The most visible effect is that kern.msgbuf sysctl now always returns
proper zero-terminated string, not only after the first buffer wrap.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 81dc00331d148fab19af24833521334e39f3692d)

2 years agonfsd: Sanity check the Layouttype count
Rick Macklem [Sat, 4 Dec 2021 22:18:48 +0000 (14:18 -0800)]
nfsd: Sanity check the Layouttype count

PR: 260155

(cherry picked from commit 480be96e1e24617f0f152256d7453f60774fd1f3)

2 years agoRemove set-but-unused variable from s_sincosl.c
Dimitry Andric [Tue, 14 Dec 2021 21:41:49 +0000 (22:41 +0100)]
Remove set-but-unused variable from s_sincosl.c

This look like a copy and paste leftover.

Reported by: enh@google.com (via freebsd-numerics@)
Reviewed by: Steve Kargl <sgk@troutmask.apl.washington.edu>

(cherry picked from commit 20d425842a4f80f9efc1de3f7a3b043435fe4b39)

2 years agoAdd genet.4 for RPi 4 Ethernet
Mike Karels [Thu, 9 Dec 2021 14:06:15 +0000 (08:06 -0600)]
Add genet.4 for RPi 4 Ethernet

Add new man page for genet(4) Ethernet on Raspberry Pi 4B, based on
several other Ethernet man pages.  Hook into build.

Note, this could potentially be added as an aarch64 man page; not
sure if that matters now.  Include if_genet(4) link as for other
network devices.

Copyright notice cloned from a recent FreeBSD Foundation copyright.

Reviewed by: imp bcr #manpages
Differential Revision: https://reviews.freebsd.org/D33360

(cherry picked from commit 61eaac599ce157b36796dcdac5fb2f420f4bfd8d)

2 years agoocs_fc: Remove unused function delarations.
Ram Kishore Vegesna [Mon, 6 Dec 2021 07:02:02 +0000 (12:32 +0530)]
ocs_fc: Remove unused function delarations.

Remove unused function declarations.
Changes required for internal tool.

Approved by: ken

(cherry picked from commit 6f78736cb12026fcb423e1b313e83efb80597f21)

2 years agoocs_fc: Fix device lost timer where device is not getting deleted.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:35:30 +0000 (15:05 +0530)]
ocs_fc: Fix device lost timer where device is not getting deleted.

Issue: Devices wont go away after the link down.

Device lost timer functionality in ocs_fc is broken,
`is_target` flag is not set in the target database and target delete is skipped.

Fix: Remove unused flags and delete the device when timer expires.

Reported by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit 41e946694333bcc6f64242f294312553f2ef2dcd)

2 years agoocs_fc: When commands complete with an error, freeze the device queue.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:32:09 +0000 (15:02 +0530)]
ocs_fc: When commands complete with an error, freeze the device queue.

Proper error recovery depends on freezing the device queue when an
error occurs, so we can recover from an error before sending
additional commands.

The ocs_fc(4) driver was not freezing the device queue for most
SCSI errors, and that broke error recovery.

sys/dev/ocs_fc/ocs_cam.c:
In ocs_scsi_initiator_io_cb(), freeze the device queue if
        we're passing back status other than CAM_REQ_CMP.

Submitted by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit d063d1bc928165e7798df5ec1c424794a1ec41e9)

2 years agoocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:19:49 +0000 (14:49 +0530)]
ocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned.

        In ocs_scsi_initiator_io_cb(), if the SCSI command that is
        getting completed had a residual equal to the transfer length,
        it was setting the CCB status to CAM_REQ_CMP.

        That breaks the expected behavior for commands like READ ATTRIBUTE.
        For READ ATTRIBUTE, if the first attribute requested doesn't exist,
        the command is supposed to return an error (Illegal Request,
        Invalid Field in CDB).  The broken behavior for READ ATTRIBUTE
        caused LTFS tape formatting to fail.  It looks for attribute
        0x1623, and expects to see an error if the attribute isn't present.

        In addition, if the residual is negative (indicating an overrun),
        only set the CCB status to CAM_DATA_RUN_ERR if we have not already
        reported an error.  The SCSI sense data will have more detail about
        what went wrong.

        sys/dev/ocs_fc/ocs_cam.c:
                In ocs_scsi_initiator_io_cb(), don't set the status to
                CAM_REQ_CMP if the residual is equal to the transfer length.

                Also, only set CAM_DATA_RUN_ERR if we didn't get SCSI
                status.

Submitted by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit 1af49c2eeb4a05f524ed9a6657c741bc96fbaf87)

2 years agoocs_fc: Increase maximum supported SG elements to support larger transfer sizes.
Ram Kishore Vegesna [Fri, 24 Sep 2021 09:05:03 +0000 (14:35 +0530)]
ocs_fc: Increase maximum supported SG elements to support larger transfer sizes.

Reported by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit 322dbb8ce8f63fd6f542309fd38324664ce8dd3f)

2 years agoocs_fc: Emulex Gen 7 HBA support.
Ram Kishore Vegesna [Thu, 23 Sep 2021 06:51:26 +0000 (12:21 +0530)]
ocs_fc: Emulex Gen 7 HBA support.

Emulex Gen7 adapter support in ocs_fc driver.

Reviewed by: mav, ken

(cherry picked from commit 3bf42363b02c9bd728c92b9d9c4a5d022982a21a)

2 years agoocs_fc: Add gendump and dump_to_host ioctl command support.
Ram Kishore Vegesna [Thu, 24 Jun 2021 07:05:00 +0000 (12:35 +0530)]
ocs_fc: Add gendump and dump_to_host ioctl command support.

Support to generate firmware dump.

Approved by: mav(mentor)

(cherry picked from commit 29e2dbd42c3e2e10e606b3414f4d0c53021d4e86)

Add ocs_gendump.c to the build, missed in 29e2dbd42c3e.

(cherry picked from commit d0732fa81963d336099a6b134a1eb4be867bfa8b)

2 years agoocs_fc: Fix use after free bug in ocs_hw_async_call()
Ram Kishore Vegesna [Fri, 28 May 2021 05:51:10 +0000 (11:21 +0530)]
ocs_fc: Fix use after free bug in ocs_hw_async_call()

Freed ctx is used in the later callee ocs_hw_command(),
which is a use after free bug.

Return error if sli_cmd_common_nop() failed.

PR: 255865
Reported by: lylgood@foxmail.com
Approved by:: markj

(cherry picked from commit 7377d3831bc8abec2d6e5fee359d7383d4551feb)

2 years agoocs_fc: Fix a use after free in ocs_sport_free
Ram Kishore Vegesna [Fri, 28 May 2021 05:26:13 +0000 (10:56 +0530)]
ocs_fc: Fix a use after free in ocs_sport_free

Domain which could be freed is used while freeing the sport.
Use ocs from sport.

PR: 255866
Reported by: lylgood@foxmail.com
Approved by:: markj

(cherry picked from commit dd722ccd6efcaed5c6056e51a044db7f1a5b4a0d)

2 years agoocs_fc: Fix memory leak in ocs_scsi_io_alloc()
Ram Kishore Vegesna [Mon, 19 Apr 2021 15:40:59 +0000 (21:10 +0530)]
ocs_fc: Fix memory leak in ocs_scsi_io_alloc()

PR: 254690
Approved by: mav(mentor)
MFC after: 2 weeks

(cherry picked from commit fc620f9782d1fda5a243fd51a93a0fb46bc80f64)

2 years agotwsi: support more message combinations in transfers
Andriy Gapon [Fri, 26 Nov 2021 09:48:21 +0000 (11:48 +0200)]
twsi: support more message combinations in transfers

Most prominently, add support for a transfer where a write with no-stop
flag is followed by a write with no-start flag.  Logically, it's a
single larger write, but consumers may want to split it like that
because one part can be a register ID and the other part can be data to
be written to (or starting at) that register.

Such a transfer can be created by i2c tool and iic(4) driver, e.g., for
an EEPROM write at specific offset:
    i2c -m tr -a 0x50 -d w -w 16 -o 0 -c 8 -v < /dev/random

This should be fixed by new code that handles the end of data transfer
for both reads and writes.  It handles two existing conditions and one
new.  Namely:
- the last message has been completed -- end of transfer;
- a message has been completed and the next one requires the start
  condition;
- a message has been completed and the next one should be sent without
  the start condition.

In the last case we simply switch to the next message and start sending
its data.  Reads without the start condition are not supported yet,
though.  That's because we NACK the last byte of the previous message,
so the device stops sending data.  To fix this we will need to add a
look-ahead at the next message when handling the penultimate byte of the
current one.

This change also fixed a bug where msg_idx was not incremented after a
read message.  Apparently, typically a read message is a last message in
a transfer, so the bug did not cause much trouble.

PR: 258994

(cherry picked from commit ff1e8581806f70e54fecddf8a6a23488dc7b968a)

2 years agotwsi: make data receiving code safer
Andriy Gapon [Fri, 26 Nov 2021 08:34:42 +0000 (10:34 +0200)]
twsi: make data receiving code safer

Assert that we are not receiving data beyond the requested length.
Assert that we have not NACK-ed incoming data prematurely.
Abort the current transfer if the incoming data is NACK-ed or not
NACK-ed unexpectedly.

Add debug logging of received data to complement logging of sent data.

(cherry picked from commit 00c07d9559c6197957b00811a0b29876a5c8b573)

2 years agotwsi: remove redundant write of control register
Andriy Gapon [Fri, 26 Nov 2021 08:09:59 +0000 (10:09 +0200)]
twsi: remove redundant write of control register

The write at the end of twsi_intr() already handles all cases, no need
to have another write for TWSI_STATUS_START / TWSI_STATUS_RPTD_START.

(cherry picked from commit aeacf172fd29b16b3661ff057c9abb238baba813)

2 years agotwsi: move handling of TWSI_CONTROL_ACK into the state machine
Andriy Gapon [Fri, 26 Nov 2021 08:07:27 +0000 (10:07 +0200)]
twsi: move handling of TWSI_CONTROL_ACK into the state machine

Previously the code set TWSI_CONTROL_ACK in twsi_transfer() based on
whether the first message had a length of one.  That was done regardless
of whether the message was a read or write and what kind of messages
followed it.
Now the bit is set or cleared while handling TWSI_STATUS_ADDR_R_ACK
state transition based on the current (read) message.

The old code did not correctly work in a scenario where a single byte
was read from an EEPROM device with two byte addressing.
For example:
    i2c -m tr -a 0x50 -d r -w 16 -o 0 -c 1 -v
The reason is that the first message (a write) has two bytes, so
TWSI_CONTROL_ACK was set and never cleared.
Since the controller did not send NACK the EEPROM sent more data resulting
in a buffer overrun.

While working on TWSI_STATUS_ADDR_R_ACK I also added support for
the zero-length read access and then I did the same for zero-length write
access.
While rare, those types of I2C transactions are completely valid and are
used by some devices.

PR: 258994

(cherry picked from commit 04622a7f21157827fe75276a4520a52d3a571a86)

2 years agokern_tc: unify timecounter to bintime delta conversion
Andriy Gapon [Tue, 30 Nov 2021 13:23:23 +0000 (15:23 +0200)]
kern_tc: unify timecounter to bintime delta conversion

There are two places where we convert from a timecounter delta to
a bintime delta: tc_windup and bintime_off.
Both functions use the same calculations when the timecounter delta is
small.  But for a large delta (greater than approximately an equivalent
of 1 second) the calculations were different.  Both functions use
approximate calculations based on th_scale that avoid division.  Both
produce values slightly greater than a true value, calculated with
division by tc_frequency, would be.  tc_windup is slightly more
accurate, so its result is closer to the true value and, thus, smaller
than bintime_off result.

As a consequence there can be a jump back in time when time hands are
switched after a long period of time (a large delta).  Just before the
switch the time would be calculated with a large delta from
th_offset_count in bintime_off.  tc_windup does the switch using its own
calculations of a new th_offset using the large delta.  As explained
earlier, the new th_offset may end up being less than the previously
produced binuptime.  So, for a period of time new binuptime values may
be "back in time" comparing to values just before the switch.

Such a jump must never happen.  All the code assumes that the uptime is
monotonically nondecreasing and some code works incorrectly when that
assumption is broken.  For example, we have observed sleepq_timeout()
ignoring a timeout when the sbinuptime value obtained by the callout
code was greater than the expiration value, but the sbinuptime obtained
in sleepq_timeout() was less than it.  In that case the target thread
would never get woken up.

The unified calculations should ensure the monotonic property of the
uptime.

The problem is quite rare as normally tc_windup should be called HZ
times per second (typically 1000 or 100).  But it may happen in VMs on
very busy hypervisors where a VM's virtual CPU may not get an execution
time slot for a second or more.

Reviewed by: kib
Sponsored by: Panzura LLC

(cherry picked from commit 3d9d64aa1846217eac9229f8cba5cb6646a688b7)

2 years agoREADME.md: correct GPL expansion
Fabian Keil [Tue, 14 Dec 2021 21:49:44 +0000 (16:49 -0500)]
README.md: correct GPL expansion

PR: 260404
MFC after: 3 days

(cherry picked from commit 8b9fe05a49d7cd8079e3364f75fd48b2f53bf696)

2 years agoAPEI: Improve multiple error sources handling.
Alexander Motin [Thu, 2 Dec 2021 23:01:02 +0000 (18:01 -0500)]
APEI: Improve multiple error sources handling.

Some AMD systems I have report 8 NMI and 3591 polled error sources.
Previous code could handle only one NMI source and used separate
callout for each polled source.  New code can handle multiple NMIs
and groups polled sources by power of 2 of the polling period.

MFC after: 2 weeks

(cherry picked from commit 2dfc1f73552d5aa5d9f6fa3e642f00e87952551c)

2 years agoRevert clang change that breaks CTF on aarch64
Dimitry Andric [Sun, 12 Dec 2021 20:11:40 +0000 (21:11 +0100)]
Revert clang change that breaks CTF on aarch64

Revert commit e655e74a318e from llvm git (by Peter Collingbourne):

  AST: Create __va_list in the std namespace even in C.

  This ensures that the mangled type names match between C and C++,
  which is significant when using -fsanitize=cfi-icall. Ideally we
  wouldn't have created this namespace at all, but it's now part of
  the ABI (e.g. in mangled names), so we can't change it.

  Differential Revision: https://reviews.llvm.org/D104830

As reported by Jessica in https://reviews.llvm.org/D104830#3129527, this
upstream change is implemented in such a way that it breaks DTrace's
CTF. Since a proper fix has not yet been forthcoming, and we are
unaffected by the (CFI-related) problem upstream was trying to address,
revert the change for now.

Requested by: jrtc27
MFC after: 3 days

(cherry picked from commit da2012af42fb704365cfaff7ae68fc7de59981da)

2 years agoamd64: Reduce the amount of cpuset copying done for TLB shootdowns
Mark Johnston [Mon, 15 Nov 2021 17:52:03 +0000 (12:52 -0500)]
amd64: Reduce the amount of cpuset copying done for TLB shootdowns

We use pmap_invalidate_cpu_mask() to get the set of active CPUs.  This
(32-byte) set is copied by value through multiple frames until we get to
smp_targeted_tlb_shootdown(), where it is copied yet again.

Avoid this copying by having smp_targeted_tlb_shootdown() make a local
copy of the active CPUs for the pmap, and drop the cpuset parameter,
simplifying callers.  Also leverage the use of the non-destructive
CPU_FOREACH_ISSET to avoid unneeded copying within
smp_targeted_tlb_shootdown().

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ab12e8db292c386a33445dcd95fa629413954192)

2 years agopci: Don't try to read cfg registers of non-existing devices
Kornel Duleba [Tue, 23 Nov 2021 08:13:56 +0000 (09:13 +0100)]
pci: Don't try to read cfg registers of non-existing devices

Instead of returning 0xffs some controllers, such as Layerscape generate
an external exception when someone attempts to read any register
of config space of a non-existing device other than PCIR_VENDOR.
This causes a kernel panic.
Fix it by bailing during device enumeration if a device vendor register
returns invalid value. (0xffff)
Use this opportunity to replace some hardcoded values with a macro.

I believe that this change won't have any unintended side-effects since
it is safe to assume that vendor == 0xffff -> hdr_type == 0xffff.

Sponsored by: Alstom
Obtained from: Semihalf
Reviewed by: jhb
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D33059

(cherry picked from commit 68cbe189fdd3c572476f8af9219a5d335f05b51a)

2 years agomca: Switch to using taskqueue_enqueue_timeout_sbt().
Alexander Motin [Wed, 8 Dec 2021 17:29:15 +0000 (12:29 -0500)]
mca: Switch to using taskqueue_enqueue_timeout_sbt().

Previously it was not allowed on fast taskqueues.  It was fixed in
4730a8972b1f.  This should make no functional change, just a bit
cleaner and efficient code.

MFC after: 1 week

(cherry picked from commit 9a128e1678d1d22a2d4855784b511c0cb370189e)

2 years agomca: Decode new Intel status bits.
Alexander Motin [Wed, 8 Dec 2021 17:01:48 +0000 (12:01 -0500)]
mca: Decode new Intel status bits.

MFC after: 1 week

(cherry picked from commit 3bdba24c74604b1bb27623cd8304476bbbed69d1)

2 years agomca: Remove excessively verbose debug messages.
Alexander Motin [Wed, 8 Dec 2021 03:27:09 +0000 (22:27 -0500)]
mca: Remove excessively verbose debug messages.

Expecially in case of AMD there was more than dozen lines per CPU.

MFC after: 1 week

(cherry picked from commit 935dc0de88195e8ce62be085ddfb002eb19ca17f)

2 years agomca: Make some sysctls also a loader tunables.
Alexander Motin [Wed, 8 Dec 2021 03:20:59 +0000 (22:20 -0500)]
mca: Make some sysctls also a loader tunables.

MFC after: 1 week

(cherry picked from commit c2003f268480f040f422c4d7e2d5f590e7084ba2)

2 years agoKernel linkers: add emergency sysctl to restore old behavior
Konstantin Belousov [Sun, 7 Nov 2021 09:26:26 +0000 (11:26 +0200)]
Kernel linkers: add emergency sysctl to restore old behavior

PR: 207898

(cherry picked from commit ecd8245e0d7784bcd78dafce233f303eee765068)

2 years agokernel linker: do not read debug symbol tables for non-debug symbols
Konstantin Belousov [Sun, 7 Nov 2021 08:37:48 +0000 (10:37 +0200)]
kernel linker: do not read debug symbol tables for non-debug symbols

PR: 207898

(cherry picked from commit 95c20faf11a1af6924f97ec4aafc32d899fea8b0)

2 years agolinker_debug_symbol_values(): use proper linker interface to get debug values
Konstantin Belousov [Tue, 16 Nov 2021 17:57:32 +0000 (19:57 +0200)]
linker_debug_symbol_values(): use proper linker interface to get debug values

(cherry picked from commit 72f6662662de61ba9a221a3dd59adea115ad4646)

2 years agox86: add a comment providing source for numbers in legacy XSAVE area layout
Konstantin Belousov [Mon, 13 Dec 2021 23:25:36 +0000 (01:25 +0200)]
x86: add a comment providing source for numbers in legacy XSAVE area layout

(cherry picked from commit 0e6b06d5c8719597b2ec59e6856b5decbd9e65f6)

2 years agoamd64: correct size of the SSE area in the xsave layout
Konstantin Belousov [Sun, 12 Dec 2021 02:49:50 +0000 (04:49 +0200)]
amd64: correct size of the SSE area in the xsave layout

(cherry picked from commit 73b357be92385cbb70ba19e7023a736af2c6b493)

2 years agonfsd: Do not try to cache a reply for NFSERR_BADSLOT
Rick Macklem [Wed, 1 Dec 2021 21:46:41 +0000 (13:46 -0800)]
nfsd: Do not try to cache a reply for NFSERR_BADSLOT

When nfsrv_checksequence() replies NFSERR_BADSLOT,
the value of nd_slotid is not valid.  As such, the
reply cannot be cached in the session.
Do not set ND_HASSEQUENCE for this case.

PR: 260076

(cherry picked from commit 33d0be8a923a840ec0724d50815890c5ffe0e884)

2 years agonfsd: Sanity check the ACL attribute
Rick Macklem [Wed, 1 Dec 2021 21:55:17 +0000 (13:55 -0800)]
nfsd: Sanity check the ACL attribute

When an ACL is presented to the NFSv4 server in
Setattr or Verify, parsing of the ACL assumed a
sane acecnt and sane sizes for the "who" strings.
This patch adds sanity checks for these.

The patch also fixes handling of an error
return from nfsrv_dissectacl() for one broken
case.

PR: 260111

(cherry picked from commit fd020f197d6ac481d36171ea69fe555eb911d673)

2 years agoOpenSSL: Merge OpenSSL 1.1.1m
Jung-uk Kim [Tue, 14 Dec 2021 21:01:07 +0000 (16:01 -0500)]
OpenSSL: Merge OpenSSL 1.1.1m

(cherry picked from commit 754c4757c9cb225c66eb3297f2a8be198786fcc9)

2 years agoOpenSSL: Merge OpenSSL 1.1.1m
Jung-uk Kim [Tue, 14 Dec 2021 19:04:30 +0000 (14:04 -0500)]
OpenSSL: Merge OpenSSL 1.1.1m

(cherry picked from commit b2bf0c7e5f4037d63458def91a026592468afd2f)

2 years agofusefs: update atime on reads when using cached attributes
Alan Somers [Mon, 29 Nov 2021 01:53:31 +0000 (18:53 -0700)]
fusefs: update atime on reads when using cached attributes

When using cached attributes, whether or not the data cache is enabled,
fusefs must update a file's atime whenever it reads from it, so long as
it wasn't mounted with -o noatime.  Update it in-kernel, and flush it to
the server on close or during the next setattr operation.

The downside is that close() will now frequently trigger a FUSE_SETATTR
upcall.  But if you care about performance, you should be using
-o noatime anyway.

Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33145

(cherry picked from commit 91972cfcddf950d7a9c33df5a9171ada1805a144)

fusefs: fix 32-bit build of the tests after 91972cfcddf

(cherry picked from commit d109559ddbf7afe311c1f1795ece137071406db8)

2 years agofusefs: fix copy_file_range when extending a file
Alan Somers [Mon, 29 Nov 2021 01:35:58 +0000 (18:35 -0700)]
fusefs: fix copy_file_range when extending a file

When copy_file_range extends a file, it must update the cached file
size.

Reviewed by: rmacklem, pfg
Differential Revision: https://reviews.freebsd.org/D33151

(cherry picked from commit 65d70b3bae0c70798b0a2b8ed129bc146fed1cce)

2 years agofusefs: delete a redundant getnanouptime
Alan Somers [Sun, 28 Nov 2021 23:05:30 +0000 (16:05 -0700)]
fusefs: delete a redundant getnanouptime

It's been redundant since SVN r346060 added another getnanouptime just
above.

(cherry picked from commit 8fbae6c7bd63fca64b898843f63cb24269a7dd46)

2 years agosbin/mount_fusefs/mount_fusefs.8: Fix typos
Elyes HAOUAS [Fri, 8 Oct 2021 16:44:48 +0000 (18:44 +0200)]
sbin/mount_fusefs/mount_fusefs.8: Fix typos

"expicitly" --> "explicitly"
"uknown" --> "unknown"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/552

(cherry picked from commit c8a45820e0d94892c1a632d49ccfddd8f559801e)

2 years agofusefs: fix intermittency in the dev_fuse_poll test
Alan Somers [Sat, 25 Sep 2021 16:16:20 +0000 (10:16 -0600)]
fusefs: fix intermittency in the dev_fuse_poll test

The DevFusePoll::access/select test would occasionally segfault.  The
cause was a file descriptor that was shared between two threads.  The
first thread would kill the second and close the file descriptor.  But
it was possible that the second would read the file descriptor before it
shut down.  That did not cause problems for kqueue, poll, or blocking
operation, but it triggered segfaults in select's macros.

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

(cherry picked from commit f44a448709d3b77508fd59ee28201ae1666387c2)

2 years agoif_epair: MFC: fix module build outside of kernel build environment
Eugene Grosbein [Sat, 11 Dec 2021 04:07:50 +0000 (11:07 +0700)]
if_epair: MFC: fix module build outside of kernel build environment

(cherry picked from commit 7a382e744b0b0ba9b51dc34bfa0cd1515f744f25)

2 years agoRevert "Switch to Arm Optimized Routines for mem* & str*"
Andrew Turner [Tue, 14 Dec 2021 12:34:09 +0000 (12:34 +0000)]
Revert "Switch to Arm Optimized Routines for mem* & str*"

The Arm Optimized Routines don't exist in 13. I missed this as my
builds succeeded, likely due to stale depends files.

This reverts commit bfd10d146ba4f8dc26e8b9bb9013a9316105f11a.

2 years agoRemove redundant declarations
Andrew Turner [Tue, 23 Nov 2021 17:26:35 +0000 (17:26 +0000)]
Remove redundant declarations

These are already defined in the same file.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit dd978721a223e3f9d35a7be5407c52a281fcec8f)

2 years agoMove the arm64 identify_cpu SYSINIT earlier
Andrew Turner [Mon, 22 Nov 2021 10:25:01 +0000 (10:25 +0000)]
Move the arm64 identify_cpu SYSINIT earlier

It is used by late ifunc resolvers so needs to be at an earlier stage
of the boot. Previously it was at the same stage so may not have run
before the ifunc resolvers.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 44ca3690519b653c7293c2366b6c47d8f510ff26)

2 years agoUse a builtin where possible in msun
Andrew Turner [Tue, 2 Nov 2021 11:31:17 +0000 (11:31 +0000)]
Use a builtin where possible in msun

Some of the functions in msun can be implemented using a compiler
builtin function to generate a small number of instructions. Implement
this support in fma, fmax, fmin, and sqrt on arm64.

Care must be taken as the builtin can be implemented as a function
call on some architectures that lack direct support. In these cases
we need to use the original code path.

As we don't set errno on failure build with -fno-math-errno so the
toolchain doesn't convert a builtin into a function call when it
detects a failure, e.g. gcc will add a call to sqrt when the input
is negative leading to an infinite loop.

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

(cherry picked from commit b2e843161dc3b79777e873183447c92ed9c3703a)

2 years agoSwitch to Arm Optimized Routines for mem* & str*
Andrew Turner [Mon, 1 Nov 2021 13:06:56 +0000 (13:06 +0000)]
Switch to Arm Optimized Routines for mem* & str*

These are the updated version of the older Cortex Strings Library we
previously used. The Arm Optimized Routines also support CPU features
that are currently in development on FreeBSD, e.g. Branch Target
Identification (BTI). Rather than add BTI support to the old code it's
easier to just use the maintained version.

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

(cherry picked from commit 2e8ff4d1d5b9d32b29287efb414449121733544a)

2 years agoMove KHELP_DECLARE_MOD_UMA later in the boot
Andrew Turner [Fri, 12 Nov 2021 18:28:18 +0000 (18:28 +0000)]
Move KHELP_DECLARE_MOD_UMA later in the boot

Both KHELP_DECLARE_MOD_UMA and the kernel linker SYSINIT to find
in-kernel modules run at SI_SUB_KLD, SI_ORDER_ANY. As the former
depends on the latter running first move it later in the boot,
to the new SI_SUB_KHELP. This ensures KHELP_DECLARE_MOD_UMA
module SYSINIT functions will be after the kernel linker.

Previously we may have received a panic similar to the following if
the order was incorrect:

panic: module_register_init: module named ertt not found

Reported by: bob prohaska <fbsd AT www.zefox.net>
Discussed with: imp, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ae062ff2695f61e43e23e144db62cb251b2cf599)

2 years agoPrint the correct register for the arm64 elr
Andrew Turner [Mon, 1 Nov 2021 11:19:57 +0000 (11:19 +0000)]
Print the correct register for the arm64 elr

In 7ec86b6609912 ("Also print symbols when printing arm64 registers")
a new function was created to print most registers. Unfortunately the
Link Register (LR) was being printed when we should have printed the
Exception Link Register (ELR).

Fix this by adding the missing 'e'.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 62cbc00d2f57785c747632b1a5ba7571281d17c4)

2 years agoOnly change the fadt revision in acpidump on i386
Andrew Turner [Wed, 20 Oct 2021 09:19:55 +0000 (10:19 +0100)]
Only change the fadt revision in acpidump on i386

There is a workaround in acpidump for an old IBM laptop. This is being
hit on a modern arm64 system causing acpidump to use the wrong field
when reading a later address.

As the laptop has a 32-bit CPU the only FreeBSD support for it is i386.
As such limit the workaround to that architecture.

Reviewed by: emaste, jkim, jhb (all earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32573

(cherry picked from commit 01593a0ff9f16e2cb23ab2ebc4ca3b8bd2434425)

2 years agoPass the ACPI ID when reading the ACPI domain
Andrew Turner [Mon, 18 Oct 2021 09:04:06 +0000 (10:04 +0100)]
Pass the ACPI ID when reading the ACPI domain

The ACPI ID may not be the same as the FreeBSD CPU id. Use the former
when finding the CPU domain as there is no requirement for it to be
identical to the latter.

Reported by: dch, kevans
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32546

(cherry picked from commit 4fb002805e0dc0d08825bce65a0f4e533c53ec54)

2 years agoStop reading the arm64 domain when it's known
Andrew Turner [Tue, 12 Oct 2021 11:39:14 +0000 (12:39 +0100)]
Stop reading the arm64 domain when it's known

There is no need to read the domain on arm64 when there is only one
in the ACPI tables. This can also happen when the table is missing
as it is unneeded.

Reported by: dch
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0906563718d35643789fc2b3c4cf1fc6884755e5)

2 years agoAllocate arm64 per-CPU data in the correct domain
Andrew Turner [Wed, 6 Oct 2021 15:08:04 +0000 (15:08 +0000)]
Allocate arm64 per-CPU data in the correct domain

To minimise NUMA traffic allocate the pcpu, dpcpu, and boot stacks in
the correct domain when possible.

Submitted by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32338

(cherry picked from commit a90ebeb5feea63c9d8377cbc74e0442156a0ed15)

2 years agoSet uninitialized popmap bits in vm_reserv_init
Doug Moore [Sun, 5 Dec 2021 23:17:25 +0000 (17:17 -0600)]
Set uninitialized popmap bits in vm_reserv_init

In vm_reserv_init, set all the marker popmap bits in vm_reserv_init,
and not just the bits of the first popmap entry.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33258

(cherry picked from commit 9f32cb5b1c81ceed28491c031cd109811a5f5d7a)

2 years agoipfilter printfieldhdr: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:51:01 +0000 (20:51 -0800)]
ipfilter printfieldhdr: remove set-but-not-unused vars

(cherry picked from commit edcdd4f6445ad50c8f7c6e974d0216c5be9356d5)

2 years agoipft_pc: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:48:17 +0000 (20:48 -0800)]
ipft_pc: remove set-but-not-unused vars

(cherry picked from commit 712b938661f98a66180832632550060c7ba387df)

2 years agoipft_tx: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:49:22 +0000 (20:49 -0800)]
ipft_tx: remove set-but-not-unused vars

(cherry picked from commit 9018f7fa45c0bc66cfdd4496e695218be3d37a33)

2 years agoip_log: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 05:11:45 +0000 (21:11 -0800)]
ip_log: remove set-but-not-unused vars

(cherry picked from commit 664882ab168f7328c23ceaadb473dab794f835d8)

2 years agoipfcomp: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:56:10 +0000 (20:56 -0800)]
ipfcomp: remove set-but-not-unused vars

(cherry picked from commit fe5b077c9efcbcc9e92d0d7d877d1e16afc563ce)

2 years agoipft_hx: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:46:11 +0000 (20:46 -0800)]
ipft_hx: remove set-but-not-unused vars

(cherry picked from commit ece1946c1fbd8d42d621fd59028488a3e71aae65)

2 years agoippool: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 05:01:14 +0000 (21:01 -0800)]
ippool: remove set-but-not-unused vars

Display of stats from a kernel core dump was never fully implemented.
Remove the dangling vars and remove the documentation.

(cherry picked from commit 2169572e743edf05696c04c641a6413a474cbf12)

2 years agoamd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled
Konstantin Belousov [Mon, 6 Dec 2021 23:11:10 +0000 (01:11 +0200)]
amd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled

(cherry picked from commit 0f2d88d1ebbba796adb0492781b683cbfe25bd2d)

2 years agoApply only the libadd/libnames part of dbf05458e3bd
Dimitry Andric [Mon, 13 Dec 2021 21:23:44 +0000 (22:23 +0100)]
Apply only the libadd/libnames part of dbf05458e3bd

Add libz to the dependencies for libdwarf. Otherwise, building older
branches on recent -CURRENT might fail in the cross-tools stage with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233 (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive /usr/lib/libdwarf.a

Direct commit to stable/13, since dbf05458e3bd has other libdwarf
changes to support compressed ELF sections, which are more intrusive.

2 years agopf tests: more thorough pfsync defer test
Kristof Provost [Thu, 2 Dec 2021 17:47:40 +0000 (18:47 +0100)]
pf tests: more thorough pfsync defer test

Add a somewhat more extensive pfsync defer mode test. Ensure that pfsync
actually delays the state creating packet until after it has sent the
pfsync update and given the peer time to create the state.

Ideally the test should validate the pfsync state update and generate an
ack message, but to keep the test simple we rely on the timeout of the
deferred packet instead.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33245

(cherry picked from commit 60a3a371afa73ddbc085a7af044a4a860a998c57)

2 years agopfsync: fix incorrect enabling of defer mode
Kristof Provost [Thu, 2 Dec 2021 17:39:23 +0000 (18:39 +0100)]
pfsync: fix incorrect enabling of defer mode

When we exposed the PFSYNCF_OK flag to userspace in 5f5bf88949d we
unintentionally caused defer mode to always be enabled.
The ioctl check only looked for nonzero, not for the PFSYNCF_DEFER flag.

Fix this check and ensure ifconfig sets the flag.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33244

(cherry picked from commit 73fd0eaf5930c5b8844ca122dd3068145ccef02c)

2 years agopfsync: locking fixes
Kristof Provost [Thu, 2 Dec 2021 16:42:56 +0000 (17:42 +0100)]
pfsync: locking fixes

 * Ensure we unlock the pfsync lock in pfsync_defer()
 * We must hold the bucket lock when calling pfsync_push()
 * The pfsync_defer_tmo() callout locks the bucket lock, not the pfsync
   lock

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33243

(cherry picked from commit 41c4f1987243cefe81adcc31d5401e7a80a0428c)

2 years agopfsync: fix defer timeout
Kristof Provost [Thu, 2 Dec 2021 16:30:36 +0000 (17:30 +0100)]
pfsync: fix defer timeout

Don't use a fixed number of ticks, but take hz into account so we have a
consistent timeout, regardless of what hz is set up.
Use a 20ms timeout, becaues that's what OpenBSD uses.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33242

(cherry picked from commit 93a3fa41dcff274180133712a13392d17a3e75a1)

2 years agopfsync: check IFF_DRV_RUNNING in the correct field
Kristof Provost [Thu, 2 Dec 2021 13:36:12 +0000 (14:36 +0100)]
pfsync: check IFF_DRV_RUNNING in the correct field

This flag is stored in if_drv_flags, not if_flags.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33241

(cherry picked from commit 7b02a551f78ed5c4bd55d3b33da55524cd2317a6)

2 years agopfsync: NULL check sc before using it
Kristof Provost [Thu, 2 Dec 2021 13:32:21 +0000 (14:32 +0100)]
pfsync: NULL check sc before using it

In pfsync_defer() we must wait to lock sc until we've ensured it's not
NULL.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33240

(cherry picked from commit 27bd812c5c92af9e7acdbf100bd98166a717bb76)

2 years agodepend-cleanup.sh: Make the output message more precise
Mark Johnston [Tue, 7 Dec 2021 18:01:05 +0000 (13:01 -0500)]
depend-cleanup.sh: Make the output message more precise

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 73db11a4d1e1940b6be65e72bb02bb0d4a701b95)

2 years agodepend-cleanup.sh: Handle commit cbdec8db18b5
Mark Johnston [Tue, 7 Dec 2021 16:18:45 +0000 (11:18 -0500)]
depend-cleanup.sh: Handle commit cbdec8db18b5

That commit changed libc to use the MI pdfork implementation, but with
an incremental build the object file for the pdfork.S stub lingers and
causes a linker error.

Cleaning the depend file is not enouch, so modify clean_deps() to remove
object files as well, and add a call to ensure that pdfork.*o is
cleaned.  The new file is _pdfork.o.

Reported by: jhb
Reviewed by: emaste
Fixes: cbdec8db18b5 ("libc: Add pdfork to the list of interposed system calls")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 187fe192ce0ab1fc9787840ddb4f721a72de5942)

2 years agolibc: Add pdfork to the list of interposed system calls
Mark Johnston [Mon, 6 Dec 2021 23:02:25 +0000 (18:02 -0500)]
libc: Add pdfork to the list of interposed system calls

Otherwise the asm stub is used and libthr interposition does not work.

Reviewed by: kib
Fixes: 21f749da82e7 ("libthr: wrap pdfork(2), same as fork(2).")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit cbdec8db18b533f6d7be329da151d6b61df3f98b)

2 years agovm_page: Tighten the object lock assertion in vm_page_invalid()
Mark Johnston [Sun, 5 Dec 2021 15:39:58 +0000 (10:39 -0500)]
vm_page: Tighten the object lock assertion in vm_page_invalid()

A page must not become invalid while vm_fault_soft_fast() is attempting
to map unbusied pages for reading.

Note that all callers hold the object write lock already, and
vm_page_set_invalid() asserts the object write lock.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 39a7396f5d0c3eac4401229e1b24fb8b89efc862)

2 years agong_ubt: Avoid attaching to several newer Intel controllers
Mark Johnston [Sun, 5 Dec 2021 15:45:12 +0000 (10:45 -0500)]
ng_ubt: Avoid attaching to several newer Intel controllers

Like other Intel controllers, these require firmware to be loaded, and
generic ng_ubt attach causes them to lock up until a power cycle.
However, their firmware interface for querying version info and loading
operational firmware is different from that implemented by ng_ubt_intel
and iwmbtfw, so they are not usable yet.  Just disable attach for now to
avoid stalls during USB device enumeration.

PR: 260161
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b25ba58adc04ca475df1e8125d2a16a07d68b49d)

2 years agortwn/usb: add product ID for Asus USB N10 Nano Rev. B1
Andreas Wetzel [Mon, 6 Dec 2021 07:21:38 +0000 (09:21 +0200)]
rtwn/usb: add product ID for Asus USB N10 Nano Rev. B1

According to information found on the internet the following products
use exactly the same hardware but probably different USB IDs:
- Edimax EW-7811Un V2 (v2)
- Edimax EW-7811GLN 2.0A (v2)
I am not adding them as I cannot verify.

PR: 254280

(cherry picked from commit cd6f0b47692cb004b1e52a28cbd853f251b99c93)

2 years agoxhci: Add PCI IDs for Thunderbolt 3/4 USB controllers.
Alexander Motin [Mon, 29 Nov 2021 02:29:26 +0000 (21:29 -0500)]
xhci: Add PCI IDs for Thunderbolt 3/4 USB controllers.

MFC after: 2 weeks

(cherry picked from commit cfb0e4d76cc61b81ef367337676a7fc51c3b062d)

2 years agosbin: build ping if at least one of INET & INET6 is enabled
Ed Maste [Sun, 28 Nov 2021 17:50:13 +0000 (12:50 -0500)]
sbin: build ping if at least one of INET & INET6 is enabled

It does not build (and serves no purpose) if neither is true (i.e.,
building WITHOUT_INET and WITHOUT_INET6).  Also add an explicit error
in ping to make this case clear.

PR: 260082
Sponsored by: The FreeBSD Foundation

(cherry picked from commit a4ef9e58bc0c07110a54ba0fa88eb118c5377e6f)

OptionalObsoleteFiles: remove ping with INET & INET6 disabled

Reported by: kevans
Fixes: a4ef9e58bc0c ("sbin: build ping if at least one of...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0179739a0096c62cb3c9665d68246046255ab849)

2 years agoping: fix parsing of options including '4' and '6'
Alan Somers [Wed, 6 Oct 2021 22:54:59 +0000 (16:54 -0600)]
ping: fix parsing of options including '4' and '6'

ping uses a two-pass option parser.  The first pass determines whether
ipv4 or ipv6 is desired, and the second parses the rest of the options.
But the first pass wrongly detects a '4' or '6' in an option's value as
a request to use ipv6 or ipv6 respectively, for example in an invocation
like "ping -c6 1.2.3.4".

Fix this confusion by including all options in the first round of
parsing, but ignoring those unrelated to ipv4/ipv6 selection.

PR: 258048
Reported by: ghuckriede@blackberry.com
Submitted by: ghuckriede@blackberry.com
MFC after: 2 weeks
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D32344

(cherry picked from commit 9ce201f2ee3ca340032d9cc71d91a36b3b45a4c3)

2 years agoinetd: Use the synopsis from the manual page
Mateusz Piotrowski [Mon, 6 Dec 2021 21:09:32 +0000 (22:09 +0100)]
inetd: Use the synopsis from the manual page

Also, document -s in the usage message.

MFC after: 7 days

(cherry picked from commit 648b9ce80e0a65258213e36bc2437e1b25fe9bde)

2 years agogmultipath.8: Fix a typo
Mateusz Piotrowski [Fri, 10 Dec 2021 13:32:33 +0000 (14:32 +0100)]
gmultipath.8: Fix a typo

It's Word Wide Port Name, not World Word Port Name.

MFC after: 3 days

(cherry picked from commit 58d60030ff24fa818e3e2b0e5551503b7279b8cc)

2 years agokern.pre.mk: allow to use and customize elfdump during kernel build
Konstantin Belousov [Wed, 1 Dec 2021 00:51:01 +0000 (02:51 +0200)]
kern.pre.mk: allow to use and customize elfdump during kernel build

(cherry picked from commit 9b135747a326080f0ffc96ddc3e0d7a4fbc1dfe1)

2 years agokern.pre.mk: trim space at EoL
Konstantin Belousov [Mon, 6 Dec 2021 23:10:12 +0000 (01:10 +0200)]
kern.pre.mk: trim space at EoL

(cherry picked from commit 610173c59380e5ddbad4977c119da47f969f087c)

2 years agortld: extract header validation into new helper check_elf_headers()
Konstantin Belousov [Thu, 11 Nov 2021 17:51:26 +0000 (19:51 +0200)]
rtld: extract header validation into new helper check_elf_headers()

(cherry picked from commit 63fc4e820c86f5dedb80cc31b7918deb284b455e)

2 years agoStyle
Konstantin Belousov [Wed, 8 Dec 2021 19:01:14 +0000 (21:01 +0200)]
Style

(cherry picked from commit c37c6f994fca1474a0e73f437056e5ca6a766b49)

2 years agofcntl(2): be more precise about third arg type
Konstantin Belousov [Mon, 6 Dec 2021 20:14:25 +0000 (22:14 +0200)]
fcntl(2): be more precise about third arg type

(cherry picked from commit 97722455cce4f8398f6411eaaa80d595dcb5fb3c)

2 years agofcntl(2): add F_KINFO operation
Konstantin Belousov [Sun, 5 Dec 2021 18:45:50 +0000 (20:45 +0200)]
fcntl(2): add F_KINFO operation

(cherry picked from commit 794d3e8e63f4a6ebc8926030b6c937109ddc5485)

2 years agoAdd declaration for static export_file_to_kinfo()
Konstantin Belousov [Mon, 6 Dec 2021 17:42:20 +0000 (19:42 +0200)]
Add declaration for static export_file_to_kinfo()

(cherry picked from commit 6e51d61a96c09d7c6785844602d0bb67d30b7f21)

2 years agoRemove FREEBSD-vendor files
Ed Maste [Mon, 6 Dec 2021 21:27:48 +0000 (16:27 -0500)]
Remove FREEBSD-vendor files

These files were intended to track version and perhaps maintainership
information for contrib software.  However, they were never used beyond
bzip2, netcat, and OpenSSH, and generally haven't been kept up to date
recently (my OpenSSH 8.7p1 update notwithstanding).  Just remove them to
avoid having confusing or outdated information.

Suggested by: des
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit bdcfd222ce6369e7aeaceb9a92ffdde84bdbf6cd)

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

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

(cherry picked from commit 8cba2003e85b49a482ca623945209ca537374229)