]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 months agoofw_cpu: whitespace cleanup
Mitchell Horne [Wed, 24 May 2023 13:27:34 +0000 (10:27 -0300)]
ofw_cpu: whitespace cleanup

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

(cherry picked from commit 5edffecc4b4ec6c3e1f09174f155a3abdd928d01)

14 months agohwpmc: remove stub pmd_switch_{in,out} methods
Mitchell Horne [Fri, 5 May 2023 21:59:41 +0000 (18:59 -0300)]
hwpmc: remove stub pmd_switch_{in,out} methods

Most platforms (non-x86) don't require these methods and implement stub
versions. If we initialize the pmc_mdep structure to always point to the
generic versions, then we can purge the duplicate stubs.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39913

(cherry picked from commit fa88954fd8f16ef60084a73d446a23e791ed22e5)

14 months agohwpmc: remove pmd_pcpu_{init,fini} callbacks
Mitchell Horne [Fri, 5 May 2023 21:59:33 +0000 (18:59 -0300)]
hwpmc: remove pmd_pcpu_{init,fini} callbacks

These are unused on all platforms.

Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39912

(cherry picked from commit 772b2dc3abc5072743e7598d35e0a8ad621e7b0d)

14 months agohwpmc: pass pmc pointer to more class methods
Mitchell Horne [Fri, 5 May 2023 22:00:02 +0000 (19:00 -0300)]
hwpmc: pass pmc pointer to more class methods

In many cases this avoids an extra lookup, since the callers always have
pm at hand. We can also eliminate several assertions, mostly for pm !=
NULL. The class methods are an internal interface, and the callers
already handle such a scenario. No functional change intended.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39915

(cherry picked from commit 39f92a76a99a2ceb747250da4f2d627b9c317f8c)

14 months agohwpmc: unused/diagused annotations in tsc class
Mitchell Horne [Fri, 5 May 2023 21:59:53 +0000 (18:59 -0300)]
hwpmc: unused/diagused annotations in tsc class

These are preferred over casts to void. No functional change.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39914

(cherry picked from commit a35453b9c7644f11df83d0c7e73da488f521e56e)

14 months agopmcstat: augment an error message
Mitchell Horne [Fri, 5 May 2023 21:58:23 +0000 (18:58 -0300)]
pmcstat: augment an error message

It also applies to the -t argument.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39907

(cherry picked from commit bf66159342e86b1dba02f1c463b47dd96fb09969)

14 months agohwpmc: use kstack_contains()
Mitchell Horne [Fri, 5 May 2023 21:59:01 +0000 (18:59 -0300)]
hwpmc: use kstack_contains()

This existing helper function is preferable to the hand-rolled
calculation of the kstack bounds.

Make some small style improvements while here. Notably, rename every
instance of "r", the return address, to "ra". Tidy the includes in the
affected files.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39909

(cherry picked from commit aba91805aa92a47b2f3f01741a55ff9f07c42d04)

14 months agohwpmc: purge EOL release compatibility
Elliott Mitchell [Thu, 8 Sep 2022 16:16:03 +0000 (16:16 +0000)]
hwpmc: purge EOL release compatibility

(cherry picked from commit cb6abe87cf1c178ea1b9cd8a385e53459aef96e8)

14 months agohwpmc: simplify arm64 kernel stack unwinding
Mitchell Horne [Fri, 5 May 2023 21:58:40 +0000 (18:58 -0300)]
hwpmc: simplify arm64 kernel stack unwinding

Use the unwind_frame() function, which properly validates the frame
pointer and uses ADDR_MAKE_CANONICAL() for the pc, required when PAC is
enabled.

Reviewed by: andrew, markj, jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39934

(cherry picked from commit 5387495773e9e92441b795c0eb8c2a3ecc25708a)

14 months agohwpmc_logging: less macro magic for type names
Mitchell Horne [Fri, 5 May 2023 21:59:27 +0000 (18:59 -0300)]
hwpmc_logging: less macro magic for type names

Provide the log type names in their entirely, rather than relying on the
macro to prepend the prefix. This improves their searchability; for
example, if I see PMCLOG_TYPE_PMCALLOCATE in libpmc I will now be able
to find where that is emitted in the kernel with a simple grep.

Reviewed by: jkoshy, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39911

(cherry picked from commit 3a7c9fc01bdae13edbd5724745b748e6a61065eb)

14 months agohwpmc: don't use deprecated copystr(9)
Mitchell Horne [Fri, 5 May 2023 21:59:15 +0000 (18:59 -0300)]
hwpmc: don't use deprecated copystr(9)

It is just wrapper around strlcpy(), but results in more complicated
code. Clean this up to use strlcpy() or snprintf() as appropriate.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39910

(cherry picked from commit 31610e34b7e39d573d927ea98346c88f23cabdab)

14 months agohwpmc: formatting of CPU and class lists
Mitchell Horne [Fri, 5 May 2023 21:58:13 +0000 (18:58 -0300)]
hwpmc: formatting of CPU and class lists

The end result is much more legible in both cases.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39906

(cherry picked from commit 7253dc57a0b400ff745a43017928304ff8dcf33f)

14 months agohwpmc: trim obsolete Intel CPU and class defs
Mitchell Horne [Fri, 5 May 2023 21:57:38 +0000 (18:57 -0300)]
hwpmc: trim obsolete Intel CPU and class defs

No functional change.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39904

(cherry picked from commit ca43b2ae3ef2ed86b0df36296464d7830b61b944)

14 months agopmccontrol: drop Pentium 4 special case
Mitchell Horne [Fri, 5 May 2023 21:57:23 +0000 (18:57 -0300)]
pmccontrol: drop Pentium 4 special case

This is dead code; we no longer support Pentium hardware in libpmc or
hwpmc.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 8bd4459560f39bdbccba76a21539136a7a44b9d7)

14 months agopmc_events.h: event list formatting
Mitchell Horne [Fri, 5 May 2023 21:57:14 +0000 (18:57 -0300)]
pmc_events.h: event list formatting

Improve the legibility of the list. Bump overall indentation, fix some
whitespace, and sort the IAF block.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39903

(cherry picked from commit b6c9d2a3f892169d4a6acc92869f9d9db52876ea)

14 months agopmc_events.h: update event list comment
Mitchell Horne [Fri, 5 May 2023 21:56:55 +0000 (18:56 -0300)]
pmc_events.h: update event list comment

This comment is no longer in sync with the contents of __PMC_EVENTS().
Update to reflect the removal of various Intel event definitions from
this list; these event definitions now come from Linux and live in
lib/libpmc/pmu-events/.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39902

(cherry picked from commit 6bdf067890ed1d1515ad0dbd105848bb11711210)

14 months agohwpmc: remove remaining UCP event definitions
Mitchell Horne [Fri, 5 May 2023 21:56:34 +0000 (18:56 -0300)]
hwpmc: remove remaining UCP event definitions

Although this block has remained in __PMC_EVENTS(), there is no handling
of UCP in libpmc/libpmc.c, so it is not possible to select one of these
events. It should therefore be impossible to trigger the code removed
from ucp_start_pmc(). Note that the GQ_SNOOP_MSF MSR exists only for
Nehalem and Westmere architectures, and the related events do not exist
for later generations.

The Uncore support in hwpmc has severely atrophied in general. We have
uncore event definitions in pmu-events, but the kernel support was
written against Intel Performance Measurement Architecture version 2,
and is disabled for processor generations later than Westmere. Nehalem
and Westmere lack uncore event definitions in pmu-events. I'd be
surprised if Uncore support is usable on any machine in its current
state.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39901

(cherry picked from commit d71a439020721a9abea5c353b9e03b5dc29d253e)

14 months agohwpmc: drop vestigial IAP event definitions
Mitchell Horne [Fri, 5 May 2023 21:55:54 +0000 (18:55 -0300)]
hwpmc: drop vestigial IAP event definitions

These are maintained elsewhere. No functional change.

Reviewed by: jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39900

(cherry picked from commit 1be8ef26794dcf93e2f4851474808dc3b34dbcbd)

14 months agoprintf(9): clarify the description of %b
Mitchell Horne [Tue, 25 Apr 2023 20:26:36 +0000 (17:26 -0300)]
printf(9): clarify the description of %b

The bit values are numbers given in octal representation, not decimal,
as one might assume from the description. Same goes for the base,
although this has an example.

Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39815

(cherry picked from commit 82bc33d5ad2e00179ea7026c496a35b00550da15)

14 months agoarm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02
Mykola Hohsadze [Tue, 18 Apr 2023 15:50:58 +0000 (12:50 -0300)]
arm64/disassem.c: Fix typo sxts to sxts and amount for TYPE_02

The current implementation is wrong, since it unconditionally sets the
amount equal to the <size> field of the instruction. However, when the
<S> bit (scale) is not set, it must be zero.

Also fix a typo, sxts to sxtx, according to the Arm64 documentation.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39334

(cherry picked from commit cb923f03faa068f0c8ed5ffa7c3485ad7918be10)

14 months agoarm64/disassem.c: Add support str/strb/strh instructions
Mykola Hohsadze [Tue, 18 Apr 2023 15:51:15 +0000 (12:51 -0300)]
arm64/disassem.c: Add support str/strb/strh instructions

Added disassembly support for each type of str/strb/strh instruction
encoding.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39336

(cherry picked from commit 7edb7adf8c8b0615c6d845ca789d4f527f8b18a3)

14 months agoarm64/disassem.c: style and formatting
Mykola Hohsadze [Tue, 18 Apr 2023 15:50:33 +0000 (12:50 -0300)]
arm64/disassem.c: style and formatting

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38899

(cherry picked from commit 5b61ad4b005d73b497537fcb41e3557314d18ddd)

14 months agotop: Use a cpuset_t to represent a CPU mask
Mark Johnston [Fri, 26 May 2023 19:14:21 +0000 (15:14 -0400)]
top: Use a cpuset_t to represent a CPU mask

The code attempts to detect holes in the CPU ID space, but previously
this would only work for up to sizeof(long)*8 CPUs.

MFC after: 2 weeks

(cherry picked from commit e96ed177465ee59fcc43dd0696106e5342e28c27)

14 months agoktrace: Make sys/ktrace.h self-contained
Mark Johnston [Thu, 1 Jun 2023 21:10:44 +0000 (17:10 -0400)]
ktrace: Make sys/ktrace.h self-contained

MFC after: 2 weeks

(cherry picked from commit c8a383396888d897d057088d7f84fb57de40807e)

14 months agosysarch: Add includes required for ktrcapfail() calls to be compiled
Mark Johnston [Thu, 1 Jun 2023 21:13:09 +0000 (17:13 -0400)]
sysarch: Add includes required for ktrcapfail() calls to be compiled

Reported by: jfree
MFC after: 1 week

(cherry picked from commit 18282c4772fb68a0e076d17f30de9749190542f4)

14 months agox86: Mark the CPU idle function table as const
Mark Johnston [Fri, 2 Jun 2023 17:22:32 +0000 (13:22 -0400)]
x86: Mark the CPU idle function table as const

No functional change intended.

MFC after: 1 week

(cherry picked from commit 7266f5249848512b99d4dc78256af148f9df986e)

14 months agoipsec: Make algorithm tables read-only
Mark Johnston [Fri, 2 Jun 2023 17:22:56 +0000 (13:22 -0400)]
ipsec: Make algorithm tables read-only

No functional change intended.

MFC after: 1 week

(cherry picked from commit 056305d3aa2bdb93e57c7a3d369e5742b1b404b8)

14 months agontp: import ntp-4.2.8p17
Cy Schubert [Tue, 6 Jun 2023 12:43:04 +0000 (05:43 -0700)]
ntp: import ntp-4.2.8p17

Fixes two small bugs including one regression.

Merge commit 'ab1f1aa8333369a83ff284848fc3fc2e52d5f29f'

(cherry picked from commit e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)

ntp: Fix build

Two files used to obtain time from reference clocks did not include
ntp_types.h resulting in an undefined NONEMPTY_TRANSLATION_UNIT.

Fixes: e6bfd18d21b2

(cherry picked from commit 82aa1470c94c55db31c0168d65f8a08fa1d41378)

14 months agousr.bin/bc: fix build issue of version 6.6.0 on MIPS
Stefan Eßer [Thu, 8 Jun 2023 14:45:11 +0000 (16:45 +0200)]
usr.bin/bc: fix build issue of version 6.6.0 on MIPS

The update removed MIPS and POWERPC64 from the list of architectures
that cannot use LTO to build this software.

Restore the previous exception list and do not use LTO on MIPS,
MIPS64, POWERPC64, and RISCV64. This is necessary due to differences
in compiler support for LTO in -CURRENT vs. 13-STABLE.

14 months agosignal: Make the signal disposition table const
Mark Johnston [Thu, 1 Jun 2023 21:11:55 +0000 (17:11 -0400)]
signal: Make the signal disposition table const

No functional change intended.

MFC after: 1 week

(cherry picked from commit 0d3f1b4f25150c3c5afaa669715421821323ead1)

14 months agoktrace: Make the data lengths table const
Mark Johnston [Thu, 1 Jun 2023 21:12:42 +0000 (17:12 -0400)]
ktrace: Make the data lengths table const

No functional change intended.

MFC after: 1 week

(cherry picked from commit 3080f82b8b644809d8731c4f5c72f1530c400eb3)

14 months agovendor/bc: import version 6.3.1
Stefan Eßer [Fri, 24 Feb 2023 22:14:58 +0000 (23:14 +0100)]
vendor/bc: import version 6.3.1

This version adds a command to dc to query whether extended registers
are enabled or not.

(cherry picked from commit 103d7cdfb7435591049413e1bc39482cb316efb7)

contrib/bc: import version 6.5.0

This release that fixes an infinite loop bug in the (non-standard)
extended math library functions root() and cbrt(), fixes a bug with
BC_LINE_LENGTH=0, and adds the fib() function to the extended math
library to calculate Fibonacci numbers.

(cherry picked from commit 8c48f4c5377ddc3dc55388f181f23111145f7099)

contrib/bc: upgrade to version 6.6.0

This update removes printing of a leading zero in scientific or
engineering output modes (which are an extended feature of this
implementation).

(cherry picked from commit 76238846ad3e9e271a3d1f792f72beab727fd153)

14 months agonfsstat.1: Add a missing argument to -w
Mateusz Piotrowski [Mon, 5 Jun 2023 12:32:46 +0000 (14:32 +0200)]
nfsstat.1: Add a missing argument to -w

MFC after: 3 days
Sponsored by: Klara Inc.

(cherry picked from commit 979754a15ae4c507cd739163331cbaef7b100e23)

14 months agoUpdates to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Wed, 7 Jun 2023 23:12:12 +0000 (16:12 -0700)]
Updates to UFS/FFS superblock integrity checks when reading a superblock.

Reported-by: Robert Morris
PR:           271351
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit c79a1416955a260424a5dd2013b114ff864bc926)

14 months agoFix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Mon, 29 May 2023 21:58:20 +0000 (14:58 -0700)]
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

Reported-by: Robert Morris
PR:           271414
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 6a71277c3037df2c3a70464c2e2bf20dec2c128a)

14 months agoCleanups to fsck_ffs(8).
Kirk McKusick [Mon, 29 May 2023 21:54:52 +0000 (14:54 -0700)]
Cleanups to fsck_ffs(8).

Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 5267120645fa52eac771c9bd8e28d68620a3bb89)

14 months agoFix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Sun, 28 May 2023 22:23:16 +0000 (15:23 -0700)]
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

Reported-by: Robert Morris
PR:           271383
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit b796bfce48698449470b751de6b0d96ae7047202)

14 months agoFix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Sun, 28 May 2023 00:09:02 +0000 (17:09 -0700)]
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

Reported-by: Robert Morris
PR:           271378
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 101a9ac07128a17d8797cc3e93978d2cfa457e99)

14 months agoFix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Sat, 27 May 2023 23:07:09 +0000 (16:07 -0700)]
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

The last valid inode in the filesystem is maxino - 1, not maxino.
Thus validity checks should ino < maxino, not ino <= maxino.

Reported-by: Robert Morris
PR:           271312
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 11ce203e0535c1c8f520c9bda81ab9326cf5db80)

14 months agoCorrect two bugs in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Sat, 27 May 2023 05:41:57 +0000 (22:41 -0700)]
Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems.

Reported-by: Robert Morris
PR:           271310
PR:           271354
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 03a8680202ef7d7e68adc70625633c490b4ed637)

14 months agoDo not try to adjust a directory depth when its reconnection is declined.
Kirk McKusick [Sat, 27 May 2023 05:55:11 +0000 (22:55 -0700)]
Do not try to adjust a directory depth when its reconnection is declined.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 49943856eb2710c6a6debdfa40d89d31d3fdb8ea)

14 months agoAdd the ability to adjust directory depths to background fsck_ffs(8).
Kirk McKusick [Fri, 26 May 2023 02:27:04 +0000 (19:27 -0700)]
Add the ability to adjust directory depths to background fsck_ffs(8).

Sponsored by: The FreeBSD Foundation

(cherry picked from commit e4a905d1e0d94ddb8e15de50d37e67f13e058047)

14 months agossh: fix leak and apply style(9) to hostname canonicalization
Ed Maste [Wed, 8 Feb 2023 13:16:53 +0000 (08:16 -0500)]
ssh: fix leak and apply style(9) to hostname canonicalization

Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...")
Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...")
Reviewed by: rew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38441

(cherry picked from commit 19aba210e1a1b5999bff10cccab5a277060c4d46)

14 months agoCirrus-CI: move arch and toolchain to beginning of task names
Ed Maste [Fri, 26 May 2023 17:58:04 +0000 (13:58 -0400)]
Cirrus-CI: move arch and toolchain to beginning of task names

This is the key difference between the tasks, so make it the most
prominent.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 98c5211847afbfef54cf7446a4a94a6aad6a31bd)

14 months agoCirrus-CI: switch to -lite LLVM package for native run
Ed Maste [Wed, 17 May 2023 18:16:06 +0000 (14:16 -0400)]
Cirrus-CI: switch to -lite LLVM package for native run

This reduces CI cycle time (a small amount).

Suggested by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40136

(cherry picked from commit f326a83c857066754cbc92c59e1904a68af37deb)

14 months agoCirrus-CI: hide manual tasks from official runs
Ed Maste [Thu, 11 May 2023 15:16:51 +0000 (11:16 -0400)]
Cirrus-CI: hide manual tasks from official runs

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9244506a1b314d9ad5bcb1bd5cc0b75939464174)

14 months agoCirrus-CI: move QEMU pkg installation to test script
Ed Maste [Wed, 7 Sep 2022 14:12:37 +0000 (10:12 -0400)]
Cirrus-CI: move QEMU pkg installation to test script

Occasionally the QEMU package fails to build and isn't available on
-CURRENT using the Latest package set.  Move the package installation
to the test script, so that if the package isn't available we at least
still perform a build test.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 612f254c82468d037fccb6c26dc0a7e37a73a53e)

14 months agoCirrus-CI: add gcc12 automatic task on primary GitHub mirror
Ed Maste [Tue, 9 May 2023 18:26:47 +0000 (14:26 -0400)]
Cirrus-CI: add gcc12 automatic task on primary GitHub mirror

We want to get GCC coverage via Cirrus-CI, but don't want to trigger
excessive runs across all forks and branches.  Create a duplicate gcc12
task to run automatically for freebsd/freebsd-src.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f5f1b9a9828a4fdf5b0ba51b291e0e1e7ac7b55f)

14 months agonproc.1: Fix "first appeared in" details
Mateusz Piotrowski [Fri, 2 Jun 2023 16:49:36 +0000 (18:49 +0200)]
nproc.1: Fix "first appeared in" details

nproc(1) has been MFC'ed into 13-STABLE and made it into 13.2-RELEASE.

MFC after: 3 days

(cherry picked from commit 1e078fb6021ebb5ccfb092fe9e5befcf4054ac0b)

14 months agops: Add libxo to usage message
Mateusz Piotrowski [Tue, 25 Apr 2023 11:55:17 +0000 (13:55 +0200)]
ps: Add libxo to usage message

MFC after: 1 week
Sponsored by: Klara Inc.

(cherry picked from commit 820ac126795b8b1c55009676fad3dfe5c7834b0b)

14 months agops: Fix synopsis
Mateusz Piotrowski [Tue, 25 Apr 2023 11:38:10 +0000 (13:38 +0200)]
ps: Fix synopsis

In the -L mode, the -L flag is not optional.

MFC after: 3 days
Sponsored by: Klara Inc.

(cherry picked from commit 3f46bf40a1b26c49b53df4ec504757c5d8c9f921)

14 months agocd9660.5: Fix the history section
Mateusz Piotrowski [Tue, 25 Apr 2023 17:36:34 +0000 (19:36 +0200)]
cd9660.5: Fix the history section

MFC after: 7 days
Sponsored by: Klara Inc.

(cherry picked from commit 5212225753e965c87ae4a7fe5f8a7d9a8b6d04af)

14 months agoopen(2): fix typo
Konstantin Belousov [Tue, 30 May 2023 09:17:26 +0000 (12:17 +0300)]
open(2): fix typo

(cherry picked from commit 1fc174cba6e0b949f7499d195dc36bf8df15df4f)

14 months ago__acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors
Konstantin Belousov [Mon, 29 May 2023 15:07:18 +0000 (18:07 +0300)]
__acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors

PR: 271704

(cherry picked from commit 7a292504bad8467915f072f0576b2a07c76de1f5)

14 months agoreapkill: handle possible pid reuse after the pid was recorded as signalled
Konstantin Belousov [Fri, 12 May 2023 22:36:52 +0000 (01:36 +0300)]
reapkill: handle possible pid reuse after the pid was recorded as signalled

(cherry picked from commit 8164032a495b53b9176814f7b08e093961fabdca)

14 months agounr(9): document iterators
Konstantin Belousov [Sun, 14 May 2023 01:40:08 +0000 (04:40 +0300)]
unr(9): document iterators

(cherry picked from commit ea95173dbb3b67019a83155e55f798d4618f18c7)

14 months agounr(9) iterator: add naive test
Konstantin Belousov [Sat, 13 May 2023 01:32:25 +0000 (04:32 +0300)]
unr(9) iterator: add naive test

(cherry picked from commit 12db3c914fe0a985de1e393ee964c9cda5b3e0ca)

14 months agounr(9): add 'show unrhdr_iter' command
Konstantin Belousov [Thu, 25 May 2023 18:09:27 +0000 (21:09 +0300)]
unr(9): add 'show unrhdr_iter' command

(cherry picked from commit c4cc0cab1ea619e07b52ce4c3825e7941996cb49)

14 months agounr(9): add iterator interface
Konstantin Belousov [Fri, 12 May 2023 22:49:29 +0000 (01:49 +0300)]
unr(9): add iterator interface

(cherry picked from commit a014e0a3987a277a0e56c7fa5b9d895f735a8d1e)

14 months agounr(9): add 'show unrhdr' ddb command
Konstantin Belousov [Thu, 25 May 2023 11:14:19 +0000 (14:14 +0300)]
unr(9): add 'show unrhdr' ddb command

(cherry picked from commit f386b27736fe6dee535a530d5c7610d8a9827758)

14 months agounr(9): document clean_unrhdr()
Konstantin Belousov [Sun, 14 May 2023 00:43:54 +0000 (03:43 +0300)]
unr(9): document clean_unrhdr()

(cherry picked from commit f8c37080853c13ada935e7fe3d53286c1d9220f1)

14 months agosubr_unit.c: explain first/last special ranges
Konstantin Belousov [Sun, 14 May 2023 23:11:17 +0000 (02:11 +0300)]
subr_unit.c: explain first/last special ranges

(cherry picked from commit d44f477038d3ede5fe62fa19c9301b43455cd8f1)

14 months agokern/subr_unit.c: more uses for is_bitmap()
Konstantin Belousov [Fri, 12 May 2023 22:39:35 +0000 (01:39 +0300)]
kern/subr_unit.c: more uses for is_bitmap()

(cherry picked from commit 36b1f8a81ef96b42ce446efb79cffd577f1819f7)

14 months agokern/subr_unit.c: some style
Konstantin Belousov [Fri, 12 May 2023 22:37:35 +0000 (01:37 +0300)]
kern/subr_unit.c: some style

(cherry picked from commit 042ec55f9df769697feb6cee472959d001a0f033)

14 months agosetkey(8): document NAT-T and NAT-T MTU extensions syntax
Konstantin Belousov [Sat, 27 May 2023 06:00:24 +0000 (09:00 +0300)]
setkey(8): document NAT-T and NAT-T MTU extensions syntax

(cherry picked from commit cf85818e05a9349dfba040fb32e752d3c691ed1f)

14 months agosetkey(8): NAT-T manual configuration support
Konstantin Belousov [Thu, 25 May 2023 10:41:15 +0000 (13:41 +0300)]
setkey(8): NAT-T manual configuration support

(cherry picked from commit 2fa1b8617fdf68d0043efb7ae7c524702afba27c)

14 months agosetkey(8): extract prefixlen calculation info helper
Konstantin Belousov [Thu, 25 May 2023 12:20:00 +0000 (15:20 +0300)]
setkey(8): extract prefixlen calculation info helper

(cherry picked from commit 2c1296a3c5473651aa87eefea25e7b7475e9e16c)

14 months agosetkey(8): ansify parser
Konstantin Belousov [Mon, 3 Apr 2023 02:00:25 +0000 (05:00 +0300)]
setkey(8): ansify parser

(cherry picked from commit bef81bc0aef9dd4cd772b292d81bcc0ff7151d9f)

14 months agosetkey(8): remove redundand returns
Konstantin Belousov [Mon, 3 Apr 2023 01:59:07 +0000 (04:59 +0300)]
setkey(8): remove redundand returns

(cherry picked from commit 462c3d3cf45eca034683d9793b9ce09381346744)

14 months agosqlite3: Vendor import of sqlite3 3.42.0
Cy Schubert [Sun, 28 May 2023 14:31:36 +0000 (07:31 -0700)]
sqlite3: Vendor import of sqlite3 3.42.0

Release notes at https://www.sqlite.org/releaselog/3_42_0.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz

Merge commit '92b2b066353ddd32e1d59f8c52c430d552d9a9a5' into sqlite3/main

(cherry picked from commit 402cee1f19b613bae844a176156a41cdfa507585)

14 months agoffs: restore backward compatibility of newfs and makefs with older binaries
Chuck Silvers [Tue, 30 May 2023 02:26:28 +0000 (19:26 -0700)]
ffs: restore backward compatibility of newfs and makefs with older binaries

The previous change to CGSIZE had the unintended side-effect of allowing
newfs and makefs to create file systems that would fail validation when
examined by older commands and kernels, by allowing newfs/makefs to pack
slightly more blocks into a CG than those older binaries think is valid.
Fix this by having newfs/makefs artificially restrict the number of blocks
in a CG to the slightly smaller value that those older binaries will accept.
The validation code will continue to accept the slightly larger value
that the current newfs/makefs (before this change) could create.

Fixes: 0a6e34e950cd5889122a199c34519b67569be9cc
Reviewed by: mckusick
MFC after: 3 days
Sponsored by: Netflix

(cherry picked from commit d464a7698de8fe18530ea65fac90dce56b860a59)

14 months agoports(7): '*-list' targets: Add/fix doc on whether they are recursive
Olivier Certner [Sat, 3 Jun 2023 20:27:49 +0000 (14:27 -0600)]
ports(7): '*-list' targets: Add/fix doc on whether they are recursive

Signed-off-by: Olivier Certner <olce.freebsd@certner.fr>
Reviewed-by: imp
Pull-request: https://github.com/freebsd/freebsd-src/pull/691

(cherry picked from commit d0b0bc37a3a5655c4979fbed206cfb6a30210ac0)

14 months agoixgbe: Change if condition for RSS and rxcsum
Przemyslaw Lewandowski [Wed, 24 May 2023 23:24:54 +0000 (16:24 -0700)]
ixgbe: Change if condition for RSS and rxcsum

This patch fixes TCP connection hangs for 1 rxq and 1 txq without rxcsum
enabled. Documentation for 10G cards and other drivers suggest enabling
rxcsum for RSS and disabling otherwise. When PCSD bit is not set then
fragment checksum and IP identification are reported in the rx
descriptor. When PCSD bit is set then RSS hash value is reported in the
rx descriptor. RSS and RX IPP checksum are mutually exclusive.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
PR: 268910
Reviewed by: erj@
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38621

(cherry picked from commit 156424fce98a0240c702da0a918b027d1979bfdb)

14 months agoice(4): Update to 1.37.11-k
Eric Joyner [Wed, 24 May 2023 23:38:02 +0000 (16:38 -0700)]
ice(4): Update to 1.37.11-k

This driver update has no corresponding ice_ddp update, and doesn't
contain very many functional changes:
- Some refactoring for future SR-IOV PF support
- Various minor fixes

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39821

(cherry picked from commit 9dc2f6e26fc24b88f9046667708a5555c63fb461)

14 months agolinuxkpi: Use modern function declarations
Mark Johnston [Fri, 2 Jun 2023 19:03:55 +0000 (15:03 -0400)]
linuxkpi: Use modern function declarations

This is a direct commit to stable/13.

Reported by: Jenkins

14 months agotests: Fix format strings
Mark Johnston [Fri, 26 May 2023 21:38:06 +0000 (17:38 -0400)]
tests: Fix format strings

Reported by: Jenkins
Fixes: 844942888f7d ("tests: Add a simple regression test for ptrace(PT_SC_REMOTE)")

(cherry picked from commit da8c3d21490fe791f8e4405216d5490dbea4dbe5)

14 months agotests: Add a simple regression test for ptrace(PT_SC_REMOTE)
Mark Johnston [Fri, 26 May 2023 19:13:20 +0000 (15:13 -0400)]
tests: Add a simple regression test for ptrace(PT_SC_REMOTE)

MFC after: 1 week

(cherry picked from commit 844942888f7d87885c79d87d808311086c664417)

14 months agonexus: Consistently return a pointer in failure paths
Mark Johnston [Wed, 26 Apr 2023 21:19:28 +0000 (17:19 -0400)]
nexus: Consistently return a pointer in failure paths

No functional change intended.

MFC after: 1 week

(cherry picked from commit ca4c7859009549975229d854888231e48938035e)

14 months agobitset: Remove BITSET_FOREACH_ADVANCE
Mark Johnston [Wed, 24 May 2023 17:05:03 +0000 (13:05 -0400)]
bitset: Remove BITSET_FOREACH_ADVANCE

__BITSET_FOREACH_ADVANCE is a helper macro for
__BITSET_FOREACH_IS(SET|CLR) and wasn't meant to be used directly by
consumers.

While here, fix some whitespace and move a comment back to where it
belongs.

Fixes: 5e04571cf3cf ("sys/bitset.h: reduce visibility of BIT_* macros")
MFC after: 1 week

(cherry picked from commit 44866dfb44178c86b6f380eb713a8f07c3d3b566)

14 months agoposixshmcontrol.1: Document posixshmcontrol create -l
Mark Johnston [Thu, 25 May 2023 21:08:55 +0000 (17:08 -0400)]
posixshmcontrol.1: Document posixshmcontrol create -l

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40270

(cherry picked from commit db289ababf9053236deb945e70167947d36b8692)

14 months agontp: Update version string
Cy Schubert [Thu, 1 Jun 2023 21:40:00 +0000 (14:40 -0700)]
ntp: Update version string

Chase a466cc55373f, updating the version string in the local config.h.

Reported by:  Trond Endrestol <Trond.Endrestol@ximalas.info>
Fixes: a466cc55373f

(cherry picked from commit 4d780613774c28a1efe4dc6272ae5fbc09d999f4)

14 months agoApply clang fixes for crashes compiling ARM/AArch64 CRC intrinsics
Dimitry Andric [Mon, 29 May 2023 14:27:58 +0000 (16:27 +0200)]
Apply clang fixes for crashes compiling ARM/AArch64 CRC intrinsics

Merge commit 069ecd0c6e2c from llvm-project (by Fangrui Song):

  [ARM] Check target feature support for __builtin_arm_crc*

  `__builtin_arm_crc*` requires the target feature crc which is available on armv8
  and above. Calling the fuctions for armv7 leads to a SelectionDAG crash.

  ```
  % clang -c --target=armv7-unknown-linux-gnueabi -c a.c
  fatal error: error in backend: Cannot select: intrinsic %llvm.arm.crc32b
  PLEASE submit a bug report to ...
  ```

  Add `TARGET_BUILTIN` and define required features for these builtins to
  report an error in `CodeGenFunction::checkTargetFeatures`. The problem is quite widespread.
  I will add `TARGET_BUILTIN` for more builtins later.

  Fix https://github.com/llvm/llvm-project/issues/57802

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

Merge commit b2d7a0dcf1ff from llvm-project (by Fangrui Song):

  [AArch64] Check target feature support for __builtin_arm_crc*

  This is the AArch64 counterpart of D134127.
  Daniel Kiss will change more `BUILTIN` to `TARGET_BUILTIN`.

  Fix #57802

Note that programs attempting to use ARM/AArch64 CRC intrinsics, when
they are not supported by the targeted CPU, will still receive a regular
compilation error (instead of a fatal backend error) similar to:

  7zCrc.c:4:10: error: '__builtin_arm_crc32b' needs target feature crc
    return __builtin_arm_crc32b(a, b);
           ^

Reported by: Alastair Hogge <agh@riseup.net>
PR: 271624
MFC after: 3 days

(cherry picked from commit 8792c03886d9e6df10fbac825819603dc059c7ea)

14 months agoApply libc++ fix for compiling <type_traits> with clang 16
Dimitry Andric [Sat, 27 May 2023 16:19:37 +0000 (18:19 +0200)]
Apply libc++ fix for compiling <type_traits> with clang 16

Merge commit 0e7971154ecb from llvm-project (by Christopher Di Bella):

  [libcxx][NFC] utilises compiler builtins for unary transform type-traits

  Depends on D116203

  Reviewed By: #libc, philnik

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

Clang 16 got new builtins that are equivalent to hand-written parts of
<type_traits>. When building world with the devel/llvm16 package
installed and CROSS_TOOLCHAIN=llvm16 set, this would lead to -Werror
warnings about those builtins being overridden.

Reported by: emaste
MFC after: 3 days

(cherry picked from commit 1f571f8767e6e48e7175cdaa27ed11d0c473d4c2)

14 months agontp: import ntp-4.2.8p16
Cy Schubert [Thu, 1 Jun 2023 14:04:37 +0000 (07:04 -0700)]
ntp: import ntp-4.2.8p16

Security:       NtpBUg3767, NtpBug3808, NtpBug3807 (CVE-2023-26555)

(cherry picked from commit a466cc55373fc3cf86837f09da729535b57e69a1)

14 months agoOpenSSL: Regen manual pages for OpenSSL 1.1.1u
Jung-uk Kim [Tue, 30 May 2023 15:03:10 +0000 (11:03 -0400)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1u

(cherry picked from commit 5b1268252c56d96d3858969108a8cd6add9d5776)

14 months agoOpenSSL: Merge OpenSSL 1.1.1u
Jung-uk Kim [Tue, 30 May 2023 15:14:28 +0000 (11:14 -0400)]
OpenSSL: Merge OpenSSL 1.1.1u

(cherry picked from commit 84ffbd7782d2e98e440782b453f4e64cd1026d33)

14 months agoOpenSSL: Merge OpenSSL 1.1.1u
Jung-uk Kim [Tue, 30 May 2023 14:24:15 +0000 (10:24 -0400)]
OpenSSL: Merge OpenSSL 1.1.1u

(cherry picked from commit 8ecb489345f08012fdc92a202a40119891cac330)
(cherry picked from commit 8f1ef87a6b93af292e68f8e33087e2df6325e9bb)

14 months agolisten(2): fix wrong MFC
Eugene Grosbein [Tue, 30 May 2023 09:27:25 +0000 (16:27 +0700)]
listen(2): fix wrong MFC

Direct commit: fix wrong conflict resolution in previous
MFC: listen(2): improve administrator control over logging

Fixes: 773c91ccc8922c047d3632ae5849cd824992c313

14 months agoMFC: listen(2): improve administrator control over logging
Eugene Grosbein [Sun, 30 Apr 2023 20:14:30 +0000 (03:14 +0700)]
MFC: listen(2): improve administrator control over logging

As documented in listen.2 manual page, the kernel emits a LOG_DEBUG
syslog message if a socket listen queue overflows. For some appliances,
it may be desirable to change the priority to some higher value
like LOG_INFO while keeping other debugging suppressed.

OTOH there are cases when such overflows are normal and expected.
Then it may be desirable to suppress overflow logging altogether,
so that dmesg buffer is not flooded over long run.

In addition to existing sysctl kern.ipc.sooverinterval,
introduce new sysctl kern.ipc.sooverprio that defaults to 7 (LOG_DEBUG)
to preserve current behavior. It may be changed to any value
in a range of 0..7 for corresponding priority or to -1 to suppress logging.
Document it in the listen.2 manual page.

(cherry picked from commit 4824d788725987bccff53dec8c103cbac455b3ed)

14 months agogeli: fix typo
Mariusz Zaborski [Mon, 15 May 2023 08:44:17 +0000 (10:44 +0200)]
geli: fix typo

PR: 271396
Reported by: Tim Chase <freebsd@tim.thechases.com>
MFC after: 1 week

(cherry picked from commit 06db6a9dce81ceb696ee9c542637a4d80e0316a7)

14 months agofusefs: Remove an unused pbuf zone
Mark Johnston [Mon, 22 May 2023 13:33:57 +0000 (09:33 -0400)]
fusefs: Remove an unused pbuf zone

The zone has been dead ever since commit
b9e20197551d ("fusefs: rewrite vop_getpages and vop_putpages")

No functional change intended.

Reviewed by: asomers
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40143

(cherry picked from commit e3f7081b1c54fae55cb443a39c2ad44ac3ed4a75)

14 months agoloader.efi: Fix some arm64 PE metadata
Mark Johnston [Tue, 18 Apr 2023 18:32:04 +0000 (14:32 -0400)]
loader.efi: Fix some arm64 PE metadata

- Mark the file as an executable in the COFF header.
- Provide separate .text and .data sections.
- Provide sane file and section alignment values.  These values are the
  defaults defined in the PE specification.
- Set appropriate characteristics for each of .text and .data.

This is required for the MS devkit to load our UEFI image.

Obtained from: OpenBSD via allanjude
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D37765

(cherry picked from commit 21d56b796634bda628b149c717461bf88c23677d)

14 months agolibthr rtld locks: do not leak URWLOCK_READ_WAITERS into child
Konstantin Belousov [Sat, 20 May 2023 08:11:54 +0000 (11:11 +0300)]
libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child

PR: 271490

(cherry picked from commit 6f49eafb056cfa0703dfc97a731cabe4ed2596b8)

14 months agonvmecontrol: Fix power subcommand output.
Alexander Motin [Mon, 15 May 2023 20:48:50 +0000 (16:48 -0400)]
nvmecontrol: Fix power subcommand output.

The returned value consists of two fields.  Report them separately.

MFC after: 2 weeks

(cherry picked from commit f409f11bc556e6da4c4cdb9f20a2ba3b0977fb32)

14 months agoLinuxKPI: Use modern function declarations for kernel_fpu_begin/end.
John Baldwin [Sat, 27 May 2023 19:32:41 +0000 (12:32 -0700)]
LinuxKPI: Use modern function declarations for kernel_fpu_begin/end.

This fixes a -Wstrict-prototype error from GCC 12.

This is a direct commit to stable/13 as it was fixed differently in
main.

14 months agoRevert "LinuxKPI: Make FPU sections thread-safe and use the NOCTX flag."
John Baldwin [Sat, 27 May 2023 19:23:20 +0000 (12:23 -0700)]
Revert "LinuxKPI: Make FPU sections thread-safe and use the NOCTX flag."

This broke part of the KBI used by drm-kmod.

This reverts commit 8ca78eb03fd4b3c9f514ea6c075fc44dc9c02d27.

Reported by: manu

14 months agoroute.8: mention DXR in FIB_ALGO section
Marko Zec [Sat, 27 May 2023 08:31:42 +0000 (10:31 +0200)]
route.8: mention DXR in FIB_ALGO section

While here, add a sentence describing DPDK DIR24-8 principle of
operation.

MFC after: 7 days

14 months agoRELNOTES: Add an entry for the NFS "syskrb5" mount option
Rick Macklem [Fri, 26 May 2023 23:05:00 +0000 (16:05 -0700)]
RELNOTES: Add an entry for the NFS "syskrb5" mount option

14 months agoUpdates to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Fri, 26 May 2023 21:37:23 +0000 (14:37 -0700)]
Updates to UFS/FFS superblock integrity checks when reading a superblock.

Reinstall MFC commit 4660b60a00c as it has should now work correctly
with fix for CGSIZE macro in MFC 4a3834e31fd.

14 months agoFix size differences between architectures of the UFS/FFS CGSIZE macro value.
Kirk McKusick [Mon, 15 May 2023 19:56:27 +0000 (12:56 -0700)]
Fix size differences between architectures of the UFS/FFS CGSIZE macro value.

Reported-by: Tijl Coosemans
Tested-by: Tijl Coosemans and Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 0a6e34e950cd5889122a199c34519b67569be9cc)