]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 months agovm_map_growstack(): handle max protection for stacks
Konstantin Belousov [Tue, 25 Jul 2023 13:56:29 +0000 (16:56 +0300)]
vm_map_growstack(): handle max protection for stacks

(cherry picked from commit aa928a52164fe57965491d63e57de66e9c078e1a)

10 months agovm_map.c: add CONTAINS_BITS macro
Konstantin Belousov [Sat, 29 Jul 2023 17:52:52 +0000 (20:52 +0300)]
vm_map.c: add CONTAINS_BITS macro

(cherry picked from commit 0fb6aae7f0e19c0628c398bbe30297ef9245030e)

10 months agoAdd vm_map_insert1(9)
Konstantin Belousov [Wed, 19 Jul 2023 16:44:18 +0000 (19:44 +0300)]
Add vm_map_insert1(9)

(cherry picked from commit ba41b0de3ef2b29c5c1155c7550785ed4b491bd8)

10 months agovm_map_insert(): update herald comment
Konstantin Belousov [Thu, 10 Aug 2023 07:59:25 +0000 (10:59 +0300)]
vm_map_insert(): update herald comment

(cherry picked from commit 3b44ee50be815a93d4e2b5d34d1cfc77268f6000)

10 months agovmspace_fork(): do not override offset for the guard entries
Konstantin Belousov [Thu, 20 Jul 2023 17:45:01 +0000 (20:45 +0300)]
vmspace_fork(): do not override offset for the guard entries

(cherry picked from commit db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0)

10 months agommap(MAP_STACK): on stack grow, use original protection
Konstantin Belousov [Wed, 19 Jul 2023 11:05:32 +0000 (14:05 +0300)]
mmap(MAP_STACK): on stack grow, use original protection

PR: 272585

(cherry picked from commit 21e45c30c35c9aa732073f725924caf581c93460)

10 months agoufs: try to elide the interlock in ufs_itimes
Mateusz Guzik [Mon, 12 Sep 2022 23:20:59 +0000 (23:20 +0000)]
ufs: try to elide the interlock in ufs_itimes

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36522

(cherry picked from commit 04f095a49165cf4903fda0f21271be5c6bfa5857)

10 months agoufs: always call ufs_itimes on close
Mateusz Guzik [Mon, 12 Sep 2022 23:19:42 +0000 (23:19 +0000)]
ufs: always call ufs_itimes on close

While here dedup code with fifo.

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36522

(cherry picked from commit be931de6c99f346cedb7a364602f1cb654a32caf)

10 months agoiflib: Fix white space and reduce some line lengths
Eric Joyner [Fri, 4 Aug 2023 17:53:29 +0000 (10:53 -0700)]
iflib: Fix white space and reduce some line lengths

This helps align some of the code with the rest of the style used in
iflib, but as marius@ points out, this is not style(9).

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41324

(cherry picked from commit 7f527d48124bd03fcfb946ce2d5d0c7bc71e099d)

10 months agoiflib: Remove redundant variable
Eric Joyner [Fri, 4 Aug 2023 17:57:11 +0000 (10:57 -0700)]
iflib: Remove redundant variable

In iflib_init_locked(), sctx and scctx both point to the same value,
which is the ifc_softc_ctx field in the iflib softc. Remove the
declaration and assignment to sctx since scctx can be used instead, and
the name of scctx follows the naming convention used for local variables
that point to ifc_softc_ctx.

In theory there should be no functional impact with this change.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41325

(cherry picked from commit d2dd3d5a989d1a2c9ebfbb90a1e682d3ad9db3c3)

10 months agoiflib: Fix panic during driver reload stress test
Przemyslaw Lewandowski [Thu, 27 Jul 2023 22:47:12 +0000 (15:47 -0700)]
iflib: Fix panic during driver reload stress test

During a driver reload stress test, after 50-300 reloads a panic occurs.
After adding sleeps in between loading and unloading the driver, the
issue does not occur.  It's possible that loading/unloading too fast may
cause the gt_taskqueue pointer to be freed earlier than expected;
checking for a null pointer first fixes it.

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

(cherry picked from commit 04d4e34538cf8f8ac99b5aa1c6c50b626d976dfd)

10 months agovmm: Fix VM_GET_CPUS compatibility
Mark Johnston [Thu, 17 Aug 2023 18:49:54 +0000 (14:49 -0400)]
vmm: Fix VM_GET_CPUS compatibility

bhyve in a 13.x jail fails to boot guests with more than one vCPU
because they pass too small a buffer to VM_GET_CPUS, causing the ioctl
handler to return ERANGE.  Handle this the same way as cpuset system
calls: make sure that the result can fit in the truncated space, and
relax the check on the cpuset buffer.

As a side effect, fix an insufficient bounds check on "size".  The
signed/unsigned comparison with sizeof(cpuset_t) fails to exclude
negative values, so we can end up allocating impossibly large amounts of
memory.

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

10 months agoossl: Add missing labels to bsaes-armv7.S
Mark Johnston [Mon, 7 Aug 2023 14:17:16 +0000 (10:17 -0400)]
ossl: Add missing labels to bsaes-armv7.S

There is a bug in the OpenSSL script which generates this file; the bug
is in the process of being fixed upstream.

Specifically, when generating the output, bsaes-armv7.pl strips some
labels that are used when the output asm is compiled with __KERNEL__
defined, resulting in a build error.  As a step towards adding armv7
support to ossl(4), manually patch the generated asm.  The upstream fix
will be imported later.

Reviewed by: andrew, jhb, emaste
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D41303

(cherry picked from commit 454c425dbed1d341025c71a8645011a980e20ccd)

10 months agoarm/unwind: Check stack pointer boundaries before dereferencing
Mark Johnston [Thu, 27 Jul 2023 19:44:00 +0000 (15:44 -0400)]
arm/unwind: Check stack pointer boundaries before dereferencing

If the unwinder somehow ends up with a stack pointer that lies outside
the stack, then an attempt to dereference can lead to a fault, which
causes the kernel to panic again and unwind the stack, which leads to a
fault...

Add kstack_contains() checks at points where we dereference the stack
pointer.  This avoids the aforementioned infinite loop in one case I hit
where some OpenSSL assembly code apparently confuses the unwinder.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D41210

(cherry picked from commit 1be56e0bb1e8bd8373e446ff9386bcdd764935aa)

10 months agoopencrypto: Respect alignment constraints in xor_and_encrypt()
Mark Johnston [Thu, 27 Jul 2023 19:44:52 +0000 (15:44 -0400)]
opencrypto: Respect alignment constraints in xor_and_encrypt()

Copy operands to an aligned buffer before performing operations which
require alignment.  Otherwise it's possible for this code to trigger an
alignment fault on armv7.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D41211

(cherry picked from commit 96c2538121390c872f68ac48f97b35fb973c11dc)

10 months agosh tests: Update $LINENO tests after $FreeBSD$ removal
Mark Johnston [Wed, 23 Aug 2023 17:24:36 +0000 (13:24 -0400)]
sh tests: Update $LINENO tests after $FreeBSD$ removal

Fixes: d0b2dbfa0ecf ("Remove $FreeBSD$: one-line sh pattern")
(cherry picked from commit c903f664780e2df7aff9ca84089d55dec5ff1dae)

10 months agolibcrypto: Don't embed $FreeBSD$ in generated assembly files
John Baldwin [Tue, 22 Aug 2023 04:01:48 +0000 (21:01 -0700)]
libcrypto: Don't embed $FreeBSD$ in generated assembly files

Reviewed by: gallatin, ngie, emaste
Differential Revision: https://reviews.freebsd.org/D41536

(With ppc assembler stuff removed, since that's no in stable/13 yet)

(cherry picked from commit 7a56f5af71851c8b502720ca956629c302821430)

10 months agoFix partially removed comment by removing the rest
Warner Losh [Wed, 16 Aug 2023 20:17:33 +0000 (14:17 -0600)]
Fix partially removed comment by removing the rest

Fixes: 2a63c3be1582
(cherry picked from commit ddb5480ec67a44a28316724397fd6609354c4558)

10 months agoRestore blank line after #include
John Baldwin [Thu, 17 Aug 2023 18:32:14 +0000 (11:32 -0700)]
Restore blank line after #include

(cherry picked from commit ece58eaf500974ba4ab1b56420414bf971a17ef7)

10 months agoshare/examples/tests: fix comments after $FreeBSD$ removal
Ed Maste [Wed, 16 Aug 2023 21:37:21 +0000 (17:37 -0400)]
share/examples/tests: fix comments after $FreeBSD$ removal

Fixes: 2a63c3be1582 ("Remove $FreeBSD$: one-line .c comment pattern")
(cherry picked from commit d1d7a273707a50d4ad1691b2c4dbf645dfa253ea)

10 months agomakefs: clean up some leftovers after $FreeBSD$ tag removal
Ed Maste [Thu, 30 Mar 2023 14:02:02 +0000 (10:02 -0400)]
makefs: clean up some leftovers after $FreeBSD$ tag removal

Fixes: 2a63c3be1582
(cherry picked from commit 90aad5d3e44d137ce80d2ec257de07c7c1367bd3)

10 months agoDelete trailing whitespace from $FreeBSD$ removal
Warner Losh [Tue, 22 Aug 2023 01:34:15 +0000 (19:34 -0600)]
Delete trailing whitespace from $FreeBSD$ removal

Fixes: d4bf8003ee42
Sponsored by: Netflix

(cherry picked from commit 682d5a87e51966939710fb52cc4e8fbb7bff04b5)

10 months agoRemove $FreeBSD$: one-line xdr pattern
Warner Losh [Tue, 22 Aug 2023 01:32:41 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line xdr pattern

Remove /^\s*%\s*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in main:
(cherry picked from commit 9524e274b548)

10 months agoRemove $FreeBSD$: one-line forth tag
Warner Losh [Tue, 22 Aug 2023 01:32:37 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line forth tag

Remove /^\\[\s*]*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 26a58599a09a)

10 months agoRemove $FreeBSD$: one-line ps tag
Warner Losh [Tue, 22 Aug 2023 01:32:34 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line ps tag

Remove /^%\s*RCSID:\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 401ab69cff8f)

10 months agoRemove $FreeBSD$: one-line lua tag
Warner Losh [Tue, 22 Aug 2023 01:32:30 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line lua tag

Remove /^--\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 6ef644f5889a)

10 months agoRemove $FreeBSD$: two-line lua tag
Warner Losh [Tue, 22 Aug 2023 01:32:26 +0000 (19:32 -0600)]
Remove $FreeBSD$: two-line lua tag

Remove /^--\n--\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 9636a14538f5)

10 months agosys: Remove $FreeBSD$: two-line lua tag
Warner Losh [Tue, 22 Aug 2023 01:32:23 +0000 (19:32 -0600)]
sys: Remove $FreeBSD$: two-line lua tag

Remove /^--\n--\s*\$FreeBSD\$.*$\n/

Similar commit in current:
(cherry picked from commit 8c99d94c900f)

10 months agoRemove $FreeBSD$: one-line catalog
Warner Losh [Tue, 22 Aug 2023 01:32:22 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line catalog

Remove /^\s*\$\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit ae992a336e8d)

10 months agosys: Remove $FreeBSD$: one-line catalog
Warner Losh [Tue, 22 Aug 2023 01:32:19 +0000 (19:32 -0600)]
sys: Remove $FreeBSD$: one-line catalog

Remove /^\s*\$\s*\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 2063df147163)

10 months agoRemove $FreeBSD$: one-line bare tag
Warner Losh [Tue, 22 Aug 2023 01:32:18 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line bare tag

Remove /^\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit 05248206f720)

10 months agosys: Remove $FreeBSD$: one-line bare tag
Warner Losh [Tue, 22 Aug 2023 01:32:14 +0000 (19:32 -0600)]
sys: Remove $FreeBSD$: one-line bare tag

Remove /^\s*\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 78d146160dc5)

10 months agoRemove $FreeBSD$: one-line nroff pattern
Warner Losh [Tue, 22 Aug 2023 01:32:13 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line nroff pattern

Remove /^\.\\"\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit b2c76c41be32)

10 months agoRemove $FreeBSD$: two-line nroff pattern
Warner Losh [Tue, 22 Aug 2023 01:32:08 +0000 (19:32 -0600)]
Remove $FreeBSD$: two-line nroff pattern

Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit fa9896e082a1)

10 months agosys: Remove $FreeBSD$: two-line nroff pattern
Warner Losh [Tue, 22 Aug 2023 01:32:04 +0000 (19:32 -0600)]
sys: Remove $FreeBSD$: two-line nroff pattern

Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 9e7892125655)

10 months agoRemove $FreeBSD$: one-line sh pattern
Warner Losh [Tue, 22 Aug 2023 01:32:01 +0000 (19:32 -0600)]
Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d0b2dbfa0ecf)

10 months agosys: Remove $FreeBSD$: one-line sh pattern
Warner Losh [Tue, 22 Aug 2023 01:31:56 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/

Similar commit in current:
(cherry picked from commit 031beb4e239b)

10 months agoRemove $FreeBSD$: one-line .S pattern
Warner Losh [Tue, 22 Aug 2023 01:31:54 +0000 (19:31 -0600)]
Remove $FreeBSD$: one-line .S pattern

Remove /^\s\.(asciz|ident)\s+\"\$FreeBSD\$\".*\n/

Similar commit in main:
(cherry picked from commit b1cfcffa89e6)

10 months agosys: Remove $FreeBSD$: one-line .S pattern
Warner Losh [Tue, 22 Aug 2023 01:31:51 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: one-line .S pattern

Remove /^\s\.(asciz|ident)\s+\"\$FreeBSD\$\".*\n/

Similar commit in current:
(cherry picked from commit d4bf8003ee42)

10 months agoRemove $FreeBSD$: alt one-line .c pattern
Warner Losh [Tue, 22 Aug 2023 01:31:50 +0000 (19:31 -0600)]
Remove $FreeBSD$: alt one-line .c pattern

Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n/

Similar commit in main:
(cherry picked from commit c8573564095b)

10 months agoRemove $FreeBSD$: alt two-line .c pattern
Warner Losh [Tue, 22 Aug 2023 01:31:46 +0000 (19:31 -0600)]
Remove $FreeBSD$: alt two-line .c pattern

Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n\n/

Similar commit in main:
(cherry picked from commit da5432eda807)

10 months agoRemove $FreeBSD$: one-line .c pattern
Warner Losh [Tue, 22 Aug 2023 01:31:41 +0000 (19:31 -0600)]
Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in main:
(cherry picked from commit 1d386b48a555)

10 months agosys: Remove $FreeBSD$: one-line .c pattern
Warner Losh [Tue, 22 Aug 2023 01:31:27 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in current:
(cherry picked from commit 685dc743dc3b)

10 months agoRemove $FreeBSD$: two-line .c pattern
Warner Losh [Tue, 22 Aug 2023 01:31:23 +0000 (19:31 -0600)]
Remove $FreeBSD$: two-line .c pattern

Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/

Similar commit in main:
(cherry picked from commit e5d258c9e599)

10 months agosys: Remove $FreeBSD$: two-line .c pattern
Warner Losh [Tue, 22 Aug 2023 01:31:20 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: two-line .c pattern

Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/

Similar commit in current:
(cherry picked from commit dfc016587a1e)

10 months agoRemove $FreeBSD$: one-line .c comment pattern
Warner Losh [Tue, 22 Aug 2023 01:31:18 +0000 (19:31 -0600)]
Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in main:
(cherry picked from commit 2a63c3be1582)

10 months agosys: Remove $FreeBSD$: one-line .c comment pattern
Warner Losh [Tue, 22 Aug 2023 01:31:15 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in current:
(cherry picked from commit 71625ec9ad2a)

10 months agoRemove $FreeBSD$: one-line .h pattern
Warner Losh [Tue, 22 Aug 2023 01:31:13 +0000 (19:31 -0600)]
Remove $FreeBSD$: one-line .h pattern

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit 42b388439bd3)

10 months agosys: Remove $FreeBSD$: one-line .h pattern
Warner Losh [Tue, 22 Aug 2023 01:31:09 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: one-line .h pattern

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/

Similar commit in current:
(cherry picked from commit 2ff63af9b88c)

10 months agoRemove $FreeBSD$: two-line .h pattern
Warner Losh [Tue, 22 Aug 2023 01:31:07 +0000 (19:31 -0600)]
Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in main:
(cherry picked from commit b3e7694832e8)

10 months agosys: Remove $FreeBSD$: two-line .h pattern
Warner Losh [Tue, 22 Aug 2023 01:31:02 +0000 (19:31 -0600)]
sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 95ee2897e98f)

10 months agoRemove $FreeBSD$: one-line m4 tag
Warner Losh [Tue, 22 Aug 2023 01:30:59 +0000 (19:30 -0600)]
Remove $FreeBSD$: one-line m4 tag

Remove /^dnl\s*\$FreeBSD\$.*$\n/

Similar commit in main:
(cherry picked from commit d54a7d337331)

10 months agosys: Remove $FreeBSD$: sound driver version
Warner Losh [Tue, 22 Aug 2023 01:30:48 +0000 (19:30 -0600)]
sys: Remove $FreeBSD$: sound driver version

Remove /SND_DECLARE_FILE\("\$FreeBSD\$"\);/

Similar commit in current:
(cherry picked from commit )

10 months agopowerpc/ata: Remove non-standard __FBSDID()
Warner Losh [Wed, 16 Aug 2023 07:42:59 +0000 (01:42 -0600)]
powerpc/ata: Remove non-standard __FBSDID()

This one has an extra '* ' at the front, so isn't picked up by the
scripts

Sponsored by: Netflix

(cherry picked from commit 77a999ef2f0c3003822ef2085752a4373f3af148)

10 months agoglob.h: Remove $FreeBSD$
Warner Losh [Wed, 16 Aug 2023 07:42:14 +0000 (01:42 -0600)]
glob.h: Remove $FreeBSD$

This likely documented where this file was copied, but the $FreeBSD$
tag was lost as soon as it was committed. Just remove it. Also remove
the one that looked like it was intended to track versions. That will
simplify the MFC.

Sponsored by: Netflix

(cherry picked from commit c25155762166bd03329667e525b2e2c1253a4d6a)

10 months agompool: Remove $FreeBSD$ comment
Warner Losh [Wed, 16 Aug 2023 07:37:16 +0000 (01:37 -0600)]
mpool: Remove $FreeBSD$ comment

Remove non-standard $FreeBSD$ comment. It's not useful

Sponsored by: Netflix

(cherry picked from commit be6151e43cffa86cea04212ccb212222e608614e)

10 months agocursor.bdf: Remove $FreeBSD$ tag
Warner Losh [Wed, 16 Aug 2023 07:36:00 +0000 (01:36 -0600)]
cursor.bdf: Remove $FreeBSD$ tag

Remove $FreeBSD$ tag COMMENT

Sponsored by: Netflix

(cherry picked from commit 19fae0f66023a97a9b464b3beeeabb2081f575b3)

10 months agops3: Don't add $FreeBSD$ to generated file
Warner Losh [Wed, 16 Aug 2023 07:30:04 +0000 (01:30 -0600)]
ps3: Don't add $FreeBSD$ to generated file

Sponsored by: Netflix

(cherry picked from commit fba400ef51d5e5701f752000e62e3a9dd59ab751)

10 months agogenerate-hfs.sh: don't embed $FreeBSD$ in generated code
Warner Losh [Wed, 16 Aug 2023 07:24:03 +0000 (01:24 -0600)]
generate-hfs.sh: don't embed $FreeBSD$ in generated code

Sponsored by: Netflix

(cherry picked from commit bed13771a3596e9501adec2f133db1b511c05b7e)

10 months agovnode_if: Don't add $FreeBSD$ to the output
Warner Losh [Wed, 16 Aug 2023 06:22:54 +0000 (00:22 -0600)]
vnode_if: Don't add $FreeBSD$ to the output

Sponsored by: Netflix

(cherry picked from commit 750a49b606f173fdc2a53461882260fcf6a407f1)

10 months agofw_stub: Don't add $FreeBSD$ to generated file
Warner Losh [Wed, 16 Aug 2023 06:21:20 +0000 (00:21 -0600)]
fw_stub: Don't add $FreeBSD$ to generated file

Sponsored by: Netflix

(cherry picked from commit fa12e8fe5145722728bac4e394edb11b2a86c675)

10 months agopccard: Don't include version information.
Warner Losh [Tue, 22 Aug 2023 13:16:30 +0000 (07:16 -0600)]
pccard: Don't include version information.

$FreeBSD$ is about to be removed, so don't include the next line.

Sponsored by: Netflix

10 months agomiidevs2h: Ignore the first line
Warner Losh [Wed, 16 Aug 2023 05:33:18 +0000 (23:33 -0600)]
miidevs2h: Ignore the first line

The first line hasn't contained version information in years. Ignore it
entirely.

Sponsored by: Netflix

(cherry picked from commit 021c4fa6b04ced4bed9a4937086c62ebbe571f63)

10 months agousbdevs2h: Ignore First Line and stop generating $FreeBSD$
Warner Losh [Wed, 16 Aug 2023 05:32:04 +0000 (23:32 -0600)]
usbdevs2h: Ignore First Line and stop generating $FreeBSD$

Just ignore the first line of the usbdevs file. And stop recording what
the usbdevs* files were generated from. It's said '$FreeBSD$' for years
now...

Sponsored by: Netflix

(cherry picked from commit 94b73d30ef2b0d85d4834a1e4dc29e0457a8faef)

10 months agosystat: Remove obsolete copyright string
Warner Losh [Wed, 16 Aug 2023 03:22:50 +0000 (21:22 -0600)]
systat: Remove obsolete copyright string

This is unused, so remove it. We don't put a copyright string in most of
the other binaries. This one doesn't need one either.

Sponsored by: Netflix

(cherry picked from commit bf46512a54cdf9a5b2e4f520be860add21efbfd5)

10 months agolinux(4): Fix linker warning about undefined vdso symbols
Dmitry Chagin [Sat, 19 Aug 2023 21:48:36 +0000 (00:48 +0300)]
linux(4): Fix linker warning about undefined vdso symbols

Pointed out by: bz
MFC after: 3 days

(cherry picked from commit a129642ced9e6ceacf98c7663bc1178eb32a78be)

10 months agolinux(4): Fix MSG_CTRUNC handling in recvmsg()
Dmitry Chagin [Mon, 14 Aug 2023 12:46:12 +0000 (15:46 +0300)]
linux(4): Fix MSG_CTRUNC handling in recvmsg()

The MSG_CTRUNC flag of the msg_flags member of the message header is
set uppon successful completition if the control data was truncated.
Upon return from a successful call msg_controllen should contain the
length of the control message sequence.

Fixes: 0eda2cea
MFC after: 1 week

(cherry picked from commit 2467ccddc0e0f5c719eddaece69a7aa0589b6449)

10 months agolinux(4): Add a comment explaining udata freeing on error
Dmitry Chagin [Mon, 14 Aug 2023 12:46:12 +0000 (15:46 +0300)]
linux(4): Add a comment explaining udata freeing on error

MFC after: 1 week

(cherry picked from commit 9d0c9b6d6a6a90f626088308dfb895221bf6d36f)

10 months agolinux(4): Refactor recvmsg
Dmitry Chagin [Mon, 14 Aug 2023 12:46:12 +0000 (15:46 +0300)]
linux(4): Refactor recvmsg

As the amount of handled anxiliary messages grows move they handlers
into a separate functions.

MFC after: 1 week

(cherry picked from commit de20eb26d014f7d9ba81fd1f84636609c8efa8e1)

10 months agolinux(4): Skip unsupported anxiliary message
Dmitry Chagin [Mon, 14 Aug 2023 12:46:12 +0000 (15:46 +0300)]
linux(4): Skip unsupported anxiliary message

Instead of returning error, skip unsupported anxiliary messages and
fail if no one handled.

MFC after: 1 week

(cherry picked from commit bbaa5523c01a11e1e322928639522b9ccfd19978)

10 months agolinux(4): Improve readability of recvmsg control buffer copyout code
Dmitry Chagin [Mon, 14 Aug 2023 12:46:12 +0000 (15:46 +0300)]
linux(4): Improve readability of recvmsg control buffer copyout code

MFC after: 1 week

(cherry picked from commit a21238d843ebe02e696cdc30b008382dfca5612e)

10 months agolinux(4): Drop bogus empty line in linux_socket.c
Dmitry Chagin [Mon, 14 Aug 2023 12:46:12 +0000 (15:46 +0300)]
linux(4): Drop bogus empty line in linux_socket.c

MFC after: 1 week

(cherry picked from commit 43c3beb7414e1cf031fe8e32e7ec1876a5b20610)

10 months agolinux(4): Fix control message size calculation again
Dmitry Chagin [Mon, 14 Aug 2023 12:46:11 +0000 (15:46 +0300)]
linux(4): Fix control message size calculation again

It looks Linux recvmsg allows msg_controllen size less then CMSG_SPACE
buffer, at least for case with one cmsghdr. Glibc misc/tst-scm_rights
test succed on Ubuntu 23.04

Fixes:   67116c69 "linux(4): Fix control message size calculation"
MFC after: 1 week

(cherry picked from commit 7d561928e65af6fe90ff9e316b2d50668c53b464)

10 months agopci: return 0 for pci_remap_intr_method MSI-X non-error case
Ed Maste [Mon, 14 Aug 2023 20:35:34 +0000 (16:35 -0400)]
pci: return 0 for pci_remap_intr_method MSI-X non-error case

When remapping a MSI-X vector, we would always return ENOENT, even if
successful.  This didn't really matter, as the sole caller of
BUS_REMAP_INTR also didn't check for errors.

Return 0 if there's no error, so that we can start handling (or at least
warning about) actual failures.

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

(cherry picked from commit 43e545e8e016d22346a4fe278ea2570328b20cc1)

10 months agoSet UFS/FFS file type to snapshot before changing its block pointers.
Kirk McKusick [Sat, 12 Aug 2023 18:20:08 +0000 (11:20 -0700)]
Set UFS/FFS file type to snapshot before changing its block pointers.

Reported-by: Peter Holm
Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 220427da0e9b2c1d8e964120becc17eb7524e46f)

10 months agoOptimize operations on UFS/FFS filesystems with bad cylinder group(s).
Kirk McKusick [Fri, 11 Aug 2023 06:02:47 +0000 (23:02 -0700)]
Optimize operations on UFS/FFS filesystems with bad cylinder group(s).

Reported-by: Peter Holm
Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit c3046779b241768394a336de115e88cc7c10d922)

10 months agoCleanups to UFS/FFS ffs_checkblk().
Kirk McKusick [Fri, 11 Aug 2023 05:38:56 +0000 (22:38 -0700)]
Cleanups to UFS/FFS ffs_checkblk().

No functional change intended.

Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 677023529d6a46da52ed780eb299c6754a75f6ef)

10 months agoClean up and document UFS/FFS error returns.
Kirk McKusick [Fri, 11 Aug 2023 00:50:23 +0000 (17:50 -0700)]
Clean up and document UFS/FFS error returns.

Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 886fd36e1ac2082f1b0decb89d70e1e7a0dc3043)

10 months agoRemove a partial UFS/FFS snapshot if it fails to build successfully.
Kirk McKusick [Wed, 9 Aug 2023 23:43:41 +0000 (16:43 -0700)]
Remove a partial UFS/FFS snapshot if it fails to build successfully.

Reported-by: Peter Holm
Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit c52b5d16ccf29ad0e999a1f5f813ed6472aa3771)

10 months agoRate limit kernel UFS/FFS cylinder group check-hash error messages.
Kirk McKusick [Wed, 9 Aug 2023 00:10:07 +0000 (17:10 -0700)]
Rate limit kernel UFS/FFS cylinder group check-hash error messages.

Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 6dff61a1d1878ea5e9f6e5c36521b3f39cd34b33)

10 months agoHandle UFS/FFS file deletion from cylinder groups with check-hash failure.
Kirk McKusick [Mon, 7 Aug 2023 23:27:39 +0000 (16:27 -0700)]
Handle UFS/FFS file deletion from cylinder groups with check-hash failure.

Reported-by: Peter Holm
Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit d4a8f5bf133956e71c05edff6fa20b156e5f1bbf)

10 months agoSupport background fsck_ffs(8) on filesystems using journaled soft updates
Kirk McKusick [Tue, 1 Aug 2023 20:16:11 +0000 (13:16 -0700)]
Support background fsck_ffs(8) on filesystems using journaled soft updates

Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 344b5bf82528575ada304f0df356d2f045772328)

10 months agoUpdate newfs(8) and tunefs(8) manual pages.
Kirk McKusick [Sun, 6 Aug 2023 06:40:26 +0000 (23:40 -0700)]
Update newfs(8) and tunefs(8) manual pages.

Sponsored-by: The FreeBSD Foundation
(cherry picked from commit 4ce2a2db41f9a18cdcec088b330899a8d830c2be)

10 months agotftpd: fix wrong conflict resolution
Eugene Grosbein [Sat, 19 Aug 2023 06:43:08 +0000 (13:43 +0700)]
tftpd: fix wrong conflict resolution

This is direct commit to stable/13 after wrong previous one.

Fixes: b71dde1aeba2972522a6742bbae77c2c6497eb01

10 months agotftpd: introduce new option -S
Eugene Grosbein [Thu, 20 Jul 2023 20:11:33 +0000 (03:11 +0700)]
tftpd: introduce new option -S

Historically, tftpd disallowed write requests to existing files
that are not publicly writable. Such requirement is questionable at least.
Let us make it possible to run tftpd in chrooted environment
keeping files non-world writable.

New option -S enables write requests to existing files
for chrooted run according to generic file permissions.
It is ignored unless tftpd runs chrooted.

Requested by: marck
Differential: https://reviews.freebsd.org/D41090 (based on)

(cherry picked from commit 273a307d0b80743fb08e23237b3f74dc94a8fa2a)
(cherry picked from commit 03c2616dc530e5b23f06f9aa421012154590e578)

10 months agotc_fill_vdso_timehands32(): fix
Konstantin Belousov [Sat, 12 Aug 2023 19:51:37 +0000 (22:51 +0300)]
tc_fill_vdso_timehands32(): fix

PR: 273085

(cherry picked from commit 93626d54370292b09cd0ca604b144737109e9071)

10 months agolibc vdso time functions: correctly convert errors into errnos
Konstantin Belousov [Sat, 12 Aug 2023 15:45:43 +0000 (18:45 +0300)]
libc vdso time functions: correctly convert errors into errnos

(cherry picked from commit 41acfee690da6289d570338e6365c1d7ef61dad5)

10 months agogve: Simplify tx loop over buffer ring
Shailend Chand [Sat, 12 Aug 2023 07:59:26 +0000 (00:59 -0700)]
gve: Simplify tx loop over buffer ring

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

(cherry picked from commit 543cf924bcdcf064fed417ec3d66000ef66194d2)

10 months agogve: Fix Tx tcpdump panic
Shailend Chand [Thu, 27 Jul 2023 05:22:31 +0000 (22:22 -0700)]
gve: Fix Tx tcpdump panic

Ringing the doorbell before making the BPF call can result in the
mbuf being freed before the BPF call.

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

(cherry picked from commit 74861578d95573e13a2099143f9d4e7edbb82806)

10 months agogve: Unobfuscate code by using nitems directly for loop.
Xin LI [Wed, 7 Jun 2023 04:14:30 +0000 (21:14 -0700)]
gve: Unobfuscate code by using nitems directly for loop.

While there, also make MODULE_PNP_INFO to reflect that the device
description is provided.

Reported-by: jrtc27
Reviewed-by: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D40430

(cherry picked from commit 1177a6c8dcfd6625c541d6ffc3c6915b8b6354f7)

10 months agogve: Add PNP info to PCI attachment of gve(4) driver.
Xin LI [Tue, 6 Jun 2023 00:58:43 +0000 (17:58 -0700)]
gve: Add PNP info to PCI attachment of gve(4) driver.

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

(cherry picked from commit 1bbdfb0b438689a839e29094fcb582a104cbabd9)

10 months agogve: Fix build on i386 and enable LINT builds.
Xin LI [Sun, 4 Jun 2023 23:35:00 +0000 (16:35 -0700)]
gve: Fix build on i386 and enable LINT builds.

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

(cherry picked from commit 4d779448adb32ef6424abb781dab87065964d42f)

10 months agoAdd gve, the driver for Google Virtual NIC (gVNIC)
Shailend Chand [Fri, 2 Jun 2023 18:58:24 +0000 (11:58 -0700)]
Add gve, the driver for Google Virtual NIC (gVNIC)

gVNIC is a virtual network interface designed specifically for
Google Compute Engine (GCE). It is required to support per-VM Tier_1
networking performance, and for using certain VM shapes on GCE.

The NIC supports TSO, Rx and Tx checksum offloads, and RSS.
It does not currently do hardware LRO, and thus the software-LRO
in the host is used instead. It also supports jumbo frames.

For each queue, the driver negotiates a set of pages with the NIC to
serve as a fixed bounce buffer, this precludes the use of iflib.

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

(cherry picked from commit 54dfc97b0bd99f1c3bcbb37357cf28cd81a7cf00)

10 months agoCirrus update to new freebsd instance version
QWERTIOX [Wed, 19 Apr 2023 13:01:15 +0000 (15:01 +0200)]
Cirrus update to new freebsd instance version

MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/718

(cherry picked from commit 5e2ba9cb6b0bc097f6ed176894cfee3b5bd405f4)

10 months agoldns: Upgrade to 1.8.3.
Dag-Erling Smørgrav [Wed, 24 May 2023 15:50:18 +0000 (15:50 +0000)]
ldns: Upgrade to 1.8.3.

Merge commit 'cf3e3d5bd0a1fae39c74c7db5a4e8b10732d0766'

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

(cherry picked from commit 5afab0e5e56fe90a378fb57249600e7924e1cab2)

ldns: Remove a set but unused variable.

Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D40695

(cherry picked from commit 2e1665ff345498c3f99ffd07b6e90669172d2df2)

10 months agopkgbase: move libcom_err from kerberos to kerberos-lib
Doug Rabson [Wed, 9 Aug 2023 07:42:16 +0000 (08:42 +0100)]
pkgbase: move libcom_err from kerberos to kerberos-lib

This makes it possible to install kerberos-lib (which is used by common
utilities such as curl) without pulling in the rest of kerberos.

MFC after: 1 week

(cherry picked from commit 54cfeb848468b8086fd046bdb94a0ed30f6dec15)

10 months agomd driver compat32: fix structure padding for arm, powerpc
Mike Karels [Tue, 8 Aug 2023 14:09:03 +0000 (09:09 -0500)]
md driver compat32: fix structure padding for arm, powerpc

Because the 32-bit md_ioctl structure contains 64-bit members, arm
and powerpc add padding to a multiple of 8.  i386 doesn't do this.
The md_ioctl32 definition was correct for amd64/i386 without padding,
but wrong for arm64 and powerpc64.  Make __packed__ conditional on
__amd64__, and test for the expected size on non-amd64.  Note that
mdconfig is used in the ATF test suite.  Note, I verified the
structure size for powerpc, but was unable to test.

Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D41339
Discussed with: jhibbits

(cherry picked from commit 58a46cfd751ac726ddca8544bf73a290b0154a57)

10 months agobhyve: add bootindex option for several devices
Corvin Köhne [Mon, 16 Aug 2021 07:50:15 +0000 (09:50 +0200)]
bhyve: add bootindex option for several devices

The bootindex option creates an entry in the "bootorder" fwcfg file.
This file can be picked up by the guest firmware to determine the
bootorder. Nevertheless, it's not guaranteed that the guest firmware
uses the bootorder. At the moment, our OVMF ignores the bootorder. This
will change in the future.

If guest firmware supports the "bootorder" fwcfg file and no device uses
the bootindex option, the boot order is determined by the firmware
itself. If one or more devices specify a bootindex, the first bootable
device with the lowest bootindex will be booted. It's not garanteed that
devices without a bootindex will be recognized as bootable from the
firmware in that case.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39285

(cherry picked from commit 480bef9481f0c44b19ac4b2adb09f6c3191acd41)

10 months agobhyve: add helper to create a bootorder
Corvin Köhne [Mon, 16 Aug 2021 07:47:53 +0000 (09:47 +0200)]
bhyve: add helper to create a bootorder

Qemu's fwcfg allows to define a bootorder. Therefore, the hypervisor has
to create a fwcfg item named bootorder, which has a newline seperated
list of boot entries. Qemu's OVMF will pick up the bootorder and applies
it.

Add the moment, bhyve's OVMF doesn't support a custom bootorder by
qemu's fwcfg. However, in the future bhyve will gain support for qemu's
OVMF. Additonally, we can port relevant parts from qemu's to bhyve's
OVMF implementation.

Reviewed by: jhb, markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39284

(cherry picked from commit 6632a0a4e3ab68b0e31b612e8aeca14de3fc8159)

10 months agobhyve: pass address of OpRegion to the guest
Corvin Köhne [Wed, 10 May 2023 11:44:28 +0000 (13:44 +0200)]
bhyve: pass address of OpRegion to the guest

Don't allow access to the physical ASLS register. It contains a host
address which is meaningless for the guest. Additionally, it allows the
guest to safely rewrite this register.

This is the last commit required for GVT-d. Nevertheless, it might not
work due to missing firmware support.

MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D26209

(cherry picked from commit 71fb2dcb0023d49fc048e1f7b610ad05bd2efc32)