]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 months agoRemove $FreeBSD$: two-line lua tag
Warner Losh [Wed, 16 Aug 2023 17:55:30 +0000 (11:55 -0600)]
Remove $FreeBSD$: two-line lua tag

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

10 months agosys: Remove $FreeBSD$: two-line lua tag
Warner Losh [Wed, 16 Aug 2023 17:55:27 +0000 (11:55 -0600)]
sys: Remove $FreeBSD$: two-line lua tag

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

10 months agoRemove $FreeBSD$: one-line catalog
Warner Losh [Wed, 16 Aug 2023 17:55:26 +0000 (11:55 -0600)]
Remove $FreeBSD$: one-line catalog

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

10 months agosys: Remove $FreeBSD$: one-line catalog
Warner Losh [Wed, 16 Aug 2023 17:55:22 +0000 (11:55 -0600)]
sys: Remove $FreeBSD$: one-line catalog

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

10 months agoRemove $FreeBSD$: one-line bare tag
Warner Losh [Wed, 16 Aug 2023 17:55:20 +0000 (11:55 -0600)]
Remove $FreeBSD$: one-line bare tag

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

10 months agosys: Remove $FreeBSD$: one-line bare tag
Warner Losh [Wed, 16 Aug 2023 17:55:17 +0000 (11:55 -0600)]
sys: Remove $FreeBSD$: one-line bare tag

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

10 months agoRemove $FreeBSD$: one-line nroff pattern
Warner Losh [Wed, 16 Aug 2023 17:55:15 +0000 (11:55 -0600)]
Remove $FreeBSD$: one-line nroff pattern

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

10 months agoRemove $FreeBSD$: two-line nroff pattern
Warner Losh [Wed, 16 Aug 2023 17:55:10 +0000 (11:55 -0600)]
Remove $FreeBSD$: two-line nroff pattern

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

10 months agosys: Remove $FreeBSD$: two-line nroff pattern
Warner Losh [Wed, 16 Aug 2023 17:55:06 +0000 (11:55 -0600)]
sys: Remove $FreeBSD$: two-line nroff pattern

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

10 months agoRemove $FreeBSD$: one-line sh pattern
Warner Losh [Wed, 16 Aug 2023 17:55:03 +0000 (11:55 -0600)]
Remove $FreeBSD$: one-line sh pattern

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

10 months agosys: Remove $FreeBSD$: one-line sh pattern
Warner Losh [Wed, 16 Aug 2023 17:54:58 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: one-line sh pattern

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

10 months agoRemove $FreeBSD$: one-line .S pattern
Warner Losh [Wed, 16 Aug 2023 17:54:57 +0000 (11:54 -0600)]
Remove $FreeBSD$: one-line .S pattern

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

10 months agosys: Remove $FreeBSD$: one-line .S pattern
Warner Losh [Wed, 16 Aug 2023 17:54:54 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: one-line .S pattern

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

10 months agoRemove $FreeBSD$: alt one-line .c pattern
Warner Losh [Wed, 16 Aug 2023 17:54:53 +0000 (11:54 -0600)]
Remove $FreeBSD$: alt one-line .c pattern

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

10 months agoRemove $FreeBSD$: alt two-line .c pattern
Warner Losh [Wed, 16 Aug 2023 17:54:48 +0000 (11:54 -0600)]
Remove $FreeBSD$: alt two-line .c pattern

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

10 months agoRemove $FreeBSD$: one-line .c pattern
Warner Losh [Wed, 16 Aug 2023 17:54:42 +0000 (11:54 -0600)]
Remove $FreeBSD$: one-line .c pattern

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

10 months agosys: Remove $FreeBSD$: one-line .c pattern
Warner Losh [Wed, 16 Aug 2023 17:54:36 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: one-line .c pattern

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

10 months agoRemove $FreeBSD$: two-line .c pattern
Warner Losh [Wed, 16 Aug 2023 17:54:34 +0000 (11:54 -0600)]
Remove $FreeBSD$: two-line .c pattern

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

10 months agosys: Remove $FreeBSD$: two-line .c pattern
Warner Losh [Wed, 16 Aug 2023 17:54:30 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: two-line .c pattern

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

10 months agoRemove $FreeBSD$: one-line .c comment pattern
Warner Losh [Wed, 16 Aug 2023 17:54:29 +0000 (11:54 -0600)]
Remove $FreeBSD$: one-line .c comment pattern

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

10 months agosys: Remove $FreeBSD$: one-line .c comment pattern
Warner Losh [Wed, 16 Aug 2023 17:54:24 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: one-line .c comment pattern

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

10 months agoRemove $FreeBSD$: one-line .h pattern
Warner Losh [Wed, 16 Aug 2023 17:54:23 +0000 (11:54 -0600)]
Remove $FreeBSD$: one-line .h pattern

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

10 months agosys: Remove $FreeBSD$: one-line .h pattern
Warner Losh [Wed, 16 Aug 2023 17:54:18 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: one-line .h pattern

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

10 months agoRemove $FreeBSD$: two-line .h pattern
Warner Losh [Wed, 16 Aug 2023 17:54:16 +0000 (11:54 -0600)]
Remove $FreeBSD$: two-line .h pattern

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

10 months agosys: Remove $FreeBSD$: two-line .h pattern
Warner Losh [Wed, 16 Aug 2023 17:54:11 +0000 (11:54 -0600)]
sys: Remove $FreeBSD$: two-line .h pattern

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

10 months agoRemove $FreeBSD$: one-line m4 tag
Warner Losh [Wed, 16 Aug 2023 17:54:09 +0000 (11:54 -0600)]
Remove $FreeBSD$: one-line m4 tag

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

10 months agosys: Remove $FreeBSD$: sound driver version
Warner Losh [Wed, 16 Aug 2023 17:53:59 +0000 (11:53 -0600)]
sys: Remove $FreeBSD$: sound driver version

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

10 months agoFix incremental builds after GoogleTest update
Dimitry Andric [Tue, 15 Aug 2023 21:14:26 +0000 (23:14 +0200)]
Fix incremental builds after GoogleTest update

At the moment, several Makefiles under tests/ do not correctly generate
.depend files, which can lead to link errors when doing incremental
(e.g. WITHOUT_CLEAN) builds:

  ld: error: undefined symbol: testing::internal::g_linked_ptr_mutex
  >>> referenced by gtest-port.h:2137 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2137)
  >>>               mockfs.o:(testing::internal::linked_ptr_internal::depart())
  >>> referenced by gtest-port.h:2139 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2139)
  >>>               mockfs.o:(testing::internal::linked_ptr_internal::depart())
  >>> referenced by gtest-port.h:2139 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/private/gtest/internal/gtest-port.h:2139)
  >>>               mockfs.o:(testing::internal::linked_ptr_internal::depart())
  >>> referenced 3 more times

For the time being, put in a depend-cleanup.sh workaround for this.

Reported by: des
Reviewed by: emaste
Fixes: 28f6c2f29280
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D41476

10 months agoRELNOTES: Note the deprecation of 32-bit platforms for 15.0.
John Baldwin [Wed, 16 Aug 2023 16:49:17 +0000 (09:49 -0700)]
RELNOTES: Note the deprecation of 32-bit platforms for 15.0.

This draws a line in the sand of removing support for 32-bit worlds
and kernels aside from COMPAT_FREEBSD32 and lib32 support.  The
project may choose to alter this approach when 15.0 is released by
extending some level of 32-bit support in 15.0 or later.

In particular, at present there is a fair bit of interest in retaining
armv7 support in 15.0 at least.

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

10 months agosys: Add a deprecation warning for 32-bit kernels.
John Baldwin [Wed, 16 Aug 2023 16:48:51 +0000 (09:48 -0700)]
sys: Add a deprecation warning for 32-bit kernels.

Per recent discussions on arch@ and at the BSDCan developer summit, we
are considering removing support for 32-bit platforms (in some form)
for 15.0 (at the earliest).  A final decision on what will ship in
15.0 will be made closer to the release of 15.0.  However, we should
communicate the potential deprecation in 14.0 to provide notice to
users.

This commit adds a warning during boot on 32-bit kernels that they are
deprecated and may be removed in 15.0.  More details will be included
in a followup commit to RELNOTES.

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

10 months agocxgbe(4): Update firmwares to 1.27.4.0
Navdeep Parhar [Wed, 16 Aug 2023 12:42:00 +0000 (05:42 -0700)]
cxgbe(4): Update firmwares to 1.27.4.0

This is the list of changes since last release, taken from the release
notes of Chelsio Unified Wire 3.18.0.1.

Version : 1.27.4.0
Date    : 07/05/2023
=======================================
Fixes
-----

BASE:
- Handle 40G to 100G cable change.
- Avoid unnecessary i2c read.
=======================================

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications
MFC after: 1 week

10 months agolocal.dirdeps.mk ensure tools/build is built if needed
Simon J. Gerraty [Wed, 16 Aug 2023 15:31:11 +0000 (08:31 -0700)]
local.dirdeps.mk ensure tools/build is built if needed

If MK_host_egacy is yes, we need it built, make sure that happens.

Reviewed by: stevek

10 months agonetstat(1): fix manpage date
Doug Rabson [Wed, 16 Aug 2023 14:13:31 +0000 (15:13 +0100)]
netstat(1): fix manpage date

MFC after: 1 week

10 months agonetstat(1): teach netstat to attach to jails
Doug Rabson [Mon, 14 Aug 2023 08:01:28 +0000 (09:01 +0100)]
netstat(1): teach netstat to attach to jails

Add -j <jail> flag to netstat(1) to allow access to network information
from a jail.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41446

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

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

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

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

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

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

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

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

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

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

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

10 months agodevmatch: introduce quiet command line option
Bjoern A. Zeeb [Sun, 13 Aug 2023 21:33:48 +0000 (21:33 +0000)]
devmatch: introduce quiet command line option

In setups without hints whatsoever one can get a long list of
"Can't read linker hints file" error messages during boot.
Add a -q/--quiet option which would suppress the noise and leave
space for more essential information.

While here switch to a pre-defined exit code from sysexits.

MFC after: 4 weeks
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41443

10 months agoboot0: add a note about BIOS-supported serial rates
Ed Maste [Tue, 15 Aug 2023 22:42:22 +0000 (18:42 -0400)]
boot0: add a note about BIOS-supported serial rates

We plan to increase the default serial rate to 115200 (see review
D36295) but early boot components that use BIOS interfaces do not
support higher rates.  Add a note to that effect.

Reported by: imp
Sponsored by: The FreeBSD Foundation

10 months agoe1000: Fix off by one ipcse
Kevin Bowling [Tue, 15 Aug 2023 21:37:43 +0000 (14:37 -0700)]
e1000: Fix off by one ipcse

This has been off by one in the FreeBSD drivers as far back as I've
looked.  Emperically HW and SW emulations I have available don't seem to
mind.  Noticed while debugging other issues.

MFC after: 3 days

10 months agollvm: fix armv[67] after 0bc26e325450
Warner Losh [Tue, 15 Aug 2023 19:08:39 +0000 (13:08 -0600)]
llvm: fix armv[67] after 0bc26e325450

During the life-cycle of the patch that landed as 0bc26e325450, the
variable names changed and I missed that in the rebase. Use the proper
TARGET_TRIPLE_ABI.

Fixes: 0bc26e325450
Sponsored by: Netflix

10 months agonvme.h: Fix a comment typo in admin opcode enum
John Baldwin [Tue, 15 Aug 2023 18:05:30 +0000 (11:05 -0700)]
nvme.h: Fix a comment typo in admin opcode enum

Sponsored by: Chelsio Communications

10 months agossh: Remove note about memory leak now resolved upstream
Ed Maste [Tue, 15 Aug 2023 15:54:09 +0000 (11:54 -0400)]
ssh: Remove note about memory leak now resolved upstream

OpenSSH 9.4p1 (updated in commit 535af610a4fd) includes the memory leak
fix that we originally applied in 69c72a57af84 ("sftp: avoid leaking
path arg in calls to make_absolute_pwd_glob.").

Sponsored by: The FreeBSD Foundation

10 months agodrm2: remove unused Alpha and MIPS #defines
Ed Maste [Tue, 18 Oct 2022 14:27:32 +0000 (10:27 -0400)]
drm2: remove unused Alpha and MIPS #defines

10 months agoetdump: warn only once for non El Torito bootable ISO images
Ed Maste [Sat, 22 Apr 2023 00:36:28 +0000 (20:36 -0400)]
etdump: warn only once for non El Torito bootable ISO images

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

10 months agox86: include CPU ID in "Invalid CPU ID" panic
Ed Maste [Fri, 4 Aug 2023 18:56:15 +0000 (14:56 -0400)]
x86: include CPU ID in "Invalid CPU ID" panic

Sponsored by: The FreeBSD Foundation

10 months agossh: correct VersionAddendum date
Ed Maste [Tue, 15 Aug 2023 13:29:06 +0000 (09:29 -0400)]
ssh: correct VersionAddendum date

Reported by: Herbert J. Skuhra <herbert@gojira.at>
Fixes: 535af610a4fd ("ssh: Update to OpenSSH 9.4p1")
Sponsored by: The FreeBSD Foundation

10 months agoarm64: increase MAXCPU to 1024, following amd64
Ed Maste [Thu, 3 Aug 2023 21:47:06 +0000 (17:47 -0400)]
arm64: increase MAXCPU to 1024, following amd64

As in commit 9051987e40c5 for amd64, support up to 1024 CPU cores.
arm64 hardware with more than 256 CPU cores is currently available and
will become increasingly common over FreeBSD 14's lifetime.

PR: 269572
Reviewed by: andrew
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41319

10 months agoarm64: Add a driver for the Arm PL031 RTC
Andrew Turner [Tue, 1 Aug 2023 15:21:21 +0000 (16:21 +0100)]
arm64: Add a driver for the Arm PL031 RTC

It is a simple RTC found in some Arm SoCs, e.g. the Arm Juno.

Reviewed by: manu
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41267

10 months agoofw_firmware: Return BUS_PROBE_GENERIC instead of 0
Emmanuel Vadot [Tue, 15 Aug 2023 05:59:09 +0000 (07:59 +0200)]
ofw_firmware: Return BUS_PROBE_GENERIC instead of 0

While here make it only probe if the node is directly under the root
one. If it's not it's likely a device node named 'firmware' and not the
firmware group we're interested in.

Suggested by: jhb
Sponsored by: Beckhoff Automation GmbH & Co. KG

10 months agoe1000: disable TSO on lem(4) and em(4)
Kevin Bowling [Tue, 15 Aug 2023 00:25:39 +0000 (17:25 -0700)]
e1000: disable TSO on lem(4) and em(4)

Disable TSO on lem(4) and em(4) until a ring stall can be debugged.

I am not able to reproduce the issue on lem(4) but disabling there in
abundance of caution in case the issue is not specific to em(4).

Reported by: grog

10 months agonvme: use mtx_padaalign instead of mtx + alignment attribute
Warner Losh [Mon, 14 Aug 2023 22:31:37 +0000 (16:31 -0600)]
nvme: use mtx_padaalign instead of mtx + alignment attribute

nvme driver predates, it seems, mtx_padalign. Modernize.

Sponsored by: Netflix

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

10 months agox86: move EARLY_AP_STARTUP into DEFAULTS
Ed Maste [Mon, 7 Aug 2023 21:49:57 +0000 (17:49 -0400)]
x86: move EARLY_AP_STARTUP into DEFAULTS

EARLY_AP_STARTUP was introduced in 2016 (commit fdce57a04219) with note:

    As a transition aid, the new behavior is moved under a new
    kernel option (EARLY_AP_STARTUP). This will allow the option
    to be turned off if need be during initial testing. I hope to
    enable this on x86 by default in a followup commit ...

It was enabled by default, but became effectively mandatory (on x86)
some time later.  Move it to DEFAULTS to avoid an unbootable system if
the option is left out of a custom kernel configuration file.

Reported by: wollman
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41352

10 months agosockets: on accept(2) don't copy all of so_options to new socket
Gleb Smirnoff [Mon, 14 Aug 2023 19:56:07 +0000 (12:56 -0700)]
sockets: on accept(2) don't copy all of so_options to new socket

As uncovered by e3ba0d6adde3 we are copying lots of irrelevant options
from the listener to an accepted socket, even those that aren't relevant
to a non-listener, e.g. SO_REUSE*, SO_ACCEPTFILTER.  Stop doing that
and provide a fixed opt-in list for options to be inherited.  Ideally
we shall not inherit anything at all.  For compatibility inherit a set
of options that are meaningful for a non-listening socket of a protocol
that can listen(2).

Differential Revision: https://reviews.freebsd.org/D41412
Fixes: e3ba0d6adde3c694f46a30b3b67eba43a7099395

10 months agoRELNOTES: Trim spurious blank line.
John Baldwin [Mon, 14 Aug 2023 19:02:29 +0000 (12:02 -0700)]
RELNOTES: Trim spurious blank line.

10 months agovm: Allow MAP_32BIT for all architectures
Dmitry Chagin [Mon, 14 Aug 2023 17:20:20 +0000 (20:20 +0300)]
vm: Allow MAP_32BIT for all architectures

Reviewed by: alc, kib, markj
Differential revision: https://reviews.freebsd.org/D41435

10 months agovm: MAP_32BIT_MAX_ADDR defined in sys/mman.h
Dmitry Chagin [Mon, 14 Aug 2023 17:18:30 +0000 (20:18 +0300)]
vm: MAP_32BIT_MAX_ADDR defined in sys/mman.h

Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D41434

10 months agoofed: fix roce gid insertion for vlan interfaces
Bartosz Sobczak [Mon, 14 Aug 2023 15:49:26 +0000 (08:49 -0700)]
ofed: fix roce gid insertion for vlan interfaces

When attempting to use vlan interface the correct GID
wasn't created due to incorrect ifp validation.

The problem was introduced in
3e142e07675b ('ofed: Mechanically convert to IfAPI)

Signed-off-by: Bartosz Sobczak bartosz.sobczak@intel.com
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
PR: 273043
Sponsored by: Intel Corporation
Reviewed by: jhibbits@, erj@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41426

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

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

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

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

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

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

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

10 months agosctp: cleanup
Michael Tuexen [Mon, 14 Aug 2023 10:27:39 +0000 (12:27 +0200)]
sctp: cleanup

Do not put a variable in the stcb for passing it to a function.
Just use a parameter of the function. No functional change intended.

MFC after: 1 week

10 months agobhyve: add Qemu PPI emulation for TPM devices
Corvin Köhne [Mon, 29 Aug 2022 10:10:47 +0000 (12:10 +0200)]
bhyve: add Qemu PPI emulation for TPM devices

Windows requires a physical presence interface to recognize the TPM
device. Qemu's OVMF has an implementation for the PPI which can be
reused. Using the Qemu PPI makes it very easy because we don't have to
implement new PPI functionality into our OVMF. The Qemu implementation
is already there.

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

10 months agosctp: add an assert
Michael Tuexen [Sun, 13 Aug 2023 20:47:43 +0000 (22:47 +0200)]
sctp: add an assert

This enforces a condition mentioned in a comment.

MFC after: 1 week

10 months agosctp: use consistent names for locking macros
Michael Tuexen [Sun, 13 Aug 2023 20:32:54 +0000 (22:32 +0200)]
sctp: use consistent names for locking macros

While there, add also a macro for an assert. Will be used shortly.
No functional change intended.

MFC after: 1 week

10 months agoixgbe: define IXGBE_LE32_TO_CPUS
Kevin Bowling [Mon, 14 Aug 2023 01:47:09 +0000 (18:47 -0700)]
ixgbe: define IXGBE_LE32_TO_CPUS

Richard Lowe notes in PR 170267 IXGBE_LE32_TO_CPUS was previously
directly defined as le32dec() which is a pure function but the shared
code is expecting an in place conversion.

In SVN r282289 its assignment was removed altogether.

There was some deliberation in the PR on what to define this as, we
just need to do the update in place which is easy enough.

The uintptr_t casts in the shared code were from a DPDK sync and are
unwanted with our new ixgbe_osdep.h implementation.

PR: 170267
Reported by: Richard Lowe <richlowe@richlowe.net>
MFC after: 1 week

10 months agoofw_firmware: Only match if there is no compatible
Emmanuel Vadot [Sun, 13 Aug 2023 06:28:13 +0000 (08:28 +0200)]
ofw_firmware: Only match if there is no compatible

If there is a compatible string it likely means that the firmware needs
a dedicated driver (like on RPI*).

PR: 273087
Tested-by: Mark Millard <marklmi26-fbsd@yahoo.com>
Sponsored by: Beckhoff Automation GmbH & Co. KG
Fixes: fdfd3a90b6ce ("ofw: Add a ofw_firmware driver")

10 months agostress2: Added a 'fsck_ffs -B' regression test
Peter Holm [Sun, 13 Aug 2023 09:09:39 +0000 (11:09 +0200)]
stress2: Added a 'fsck_ffs -B' regression test

10 months agogdtoa: Regenerate configuration headers for 32-bit arm.
Michal Meloun [Sun, 13 Aug 2023 05:51:56 +0000 (07:51 +0200)]
gdtoa: Regenerate configuration headers for 32-bit arm.

These configuration headers were only guessed, but unfortunately not exactly
correctly. Therefore, re-generate them on real HW.

Generated on CA15, verified on CA9, CA7(with VFP lite) and on 32-bit ARMv9.

PR: 272229
Reported by: Robert Clausecker <fuz@FreeBSD.org>
MFC after: 2 weeks

10 months agoMFV: less v643.
Xin LI [Sun, 13 Aug 2023 07:13:31 +0000 (00:13 -0700)]
MFV: less v643.

MFC after: 2 weeks

10 months agoVendor import of less v643.
Xin LI [Sun, 13 Aug 2023 07:06:29 +0000 (00:06 -0700)]
Vendor import of less v643.

10 months agovis(3): need <stdint.h> for SIZE_MAX
Kyle Evans [Sun, 13 Aug 2023 05:28:12 +0000 (00:28 -0500)]
vis(3): need <stdint.h> for SIZE_MAX

10 months agoMerge commit 'acb089b983171667467adc66f56a723b609ed22e' into kbsd/vis
Kyle Evans [Sun, 13 Aug 2023 05:23:02 +0000 (00:23 -0500)]
Merge commit 'acb089b983171667467adc66f56a723b609ed22e' into kbsd/vis

Highlights:
- Some style fixes
- Bumped mbbuf in istrsenvisx() to MB_LEN_MAX to avoid VLAs
- mbslength cannot go negative, so make it unsigned
- Further bounds checking & fix an additional overrun, with dlen == 0
- Avoid duplicate call to wcslen(start)

10 months agoVendor import of NetBSD's (un)vis(3) at 2023-08-13
Kyle Evans [Sun, 13 Aug 2023 05:16:33 +0000 (00:16 -0500)]
Vendor import of NetBSD's (un)vis(3) at 2023-08-13

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

On 64bit, there is a 4-byte hole in struct vdso_timekeep32 after
tk_current, if the structure is not packed.  This is due to the MD
th_x86_pvc_last_systime being 64bit.

Change amd64 VDSO_TIMEHANDS_MD32 to not use uint64_t, replace it with
pair of uint32_t, as it is done for all other members.

PR: 273085
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

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

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

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.

A UFS/FFS snapshot file is identified with the SF_SNAPSHOT
flag to identify it as a snapshot. This flag needs to be
set before setting some of its block pointers to the special
values BLK_SNAP and BLK_NOCOPY. If the snapshot creation fails
and we call VOP_REMOVE(), the SF_SNAPSHOT flag will let the
remove routine know that the special block pointer values need
to be rolled back before attempting deletion of the file.

Also ensure that an fsck is required after setting superblock
values in the ffs_checkcgintegrity() routine.

Reported-by: Peter Holm
Tested-by: Peter Holm
MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
10 months agovlan: Respect IFCAP_LRO mask
Kevin Bowling [Sat, 12 Aug 2023 16:31:22 +0000 (09:31 -0700)]
vlan: Respect IFCAP_LRO mask

vlan_capabilities(), used by the IFCAP ioctl, was not respecting the
IFCAP_LRO bit if it was masked by the requestor.

This prevented if_bridge(4) from automasking LRO with a message like:
bridge0: can't disable some capabilities on em3.11: 0x400

This also prevented manually disabling LRO from any vlan interface.

PR: 254596
Reported by: Paul Vixie <paul@redbarn.org>
MFC after: 1 week

10 months agoRevert "if_vlan: do not enable LRO for bridge interaces"
Kristof Provost [Sat, 12 Aug 2023 13:56:21 +0000 (15:56 +0200)]
Revert "if_vlan: do not enable LRO for bridge interaces"

This reverts commit 5f11a33ceeb385477cb22d9ad5941061c5a26be9.

As requested by Kevin Bowling. He explains:

> The subtle bug was that vlan_capabilities() in if_vlan was not obeying
> the requested mask from its IFCAP ioctl.

11 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
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41281

11 months agovm: Fix address hints of 0 with MAP_32BIT
Alan Cox [Thu, 3 Aug 2023 07:07:14 +0000 (02:07 -0500)]
vm: Fix address hints of 0 with MAP_32BIT

Also, rename min_addr to default_addr, which better reflects what it
represents.  The min_addr is not a minimum address in the same way that
max_addr is actually a maximum address that can be allocated.  For
example, a non-zero hint can be less than min_addr and be allocated.

Reported by: dchagin
Reviewed by: dchagin, kib, markj
Fixes: d8e6f4946cec0 "vm: Fix anonymous memory clustering under ASLR"
Differential Revision: https://reviews.freebsd.org/D41397

11 months agolinuxolator: implement Linux' PROT_GROWSDOWN
Konstantin Belousov [Sat, 29 Jul 2023 21:00:51 +0000 (00:00 +0300)]
linuxolator: implement Linux' PROT_GROWSDOWN

From the Linux man page for mprotect(2):
   PROT_GROWSDOWN
       Apply  the  protection  mode  down to the beginning of a mapping
       that grows downward (which should be a stack segment or a
       segment mapped with the MAP_GROWSDOWN flag set).

Reported by: dchagin
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41099

11 months agovm_map_protect(): add VM_MAP_PROTECT_GROWSDOWN flag
Konstantin Belousov [Fri, 28 Jul 2023 00:40:53 +0000 (03:40 +0300)]
vm_map_protect(): add VM_MAP_PROTECT_GROWSDOWN flag

which requests to propagate lowest stack segment protection to the grow gap.
This seems to be required for Linux emulation.

Reported by: dchagin
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41099

11 months agovm_map_growstack(): restore stack gap data if gap entry was removed
Konstantin Belousov [Tue, 25 Jul 2023 18:52:15 +0000 (21:52 +0300)]
vm_map_growstack(): restore stack gap data if gap entry was removed

and then restored.

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

11 months agovm_map: do not allow to merge stack gap entries
Konstantin Belousov [Tue, 25 Jul 2023 18:48:57 +0000 (21:48 +0300)]
vm_map: do not allow to merge stack gap entries

At least, offset handling is wrong for them.

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

11 months agovm_map_protect(): handle stack protection stored in the stack guard
Konstantin Belousov [Tue, 25 Jul 2023 13:32:28 +0000 (16:32 +0300)]
vm_map_protect(): handle stack protection stored in the stack guard

mprotect(2) on the stack region needs to adjust guard stored protection,
so that e.g. enable executing on stack worked properly on stack growth.

Reported by: dchagin
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41099

11 months agovm_map_protect(): move guard handling at the last phase into an empty dedicated helper
Konstantin Belousov [Fri, 28 Jul 2023 00:14:07 +0000 (03:14 +0300)]
vm_map_protect(): move guard handling at the last phase into an empty dedicated helper

Restructure the first phase slightly, to facilitate further changes.

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