]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 months agocp: Remove useless ssize_t cast
Collin Funk [Tue, 13 Feb 2024 02:52:58 +0000 (18:52 -0800)]
cp: Remove useless ssize_t cast

Both wcount and wresid are ssize_t so this cast is not needed. Just
remove it so the code is easier to read.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: emaste, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1116

2 months agoem.4: add interfaces to name section
Alexander Ziaee [Wed, 20 Mar 2024 17:15:51 +0000 (13:15 -0400)]
em.4: add interfaces to name section

Improving first-glance comprehension that this manual page applies to
igb/lem interfaces provided by the em(4) driver.

While here, tag SPDX, link the framework, and shuffle a sentence to fix
linter warning.

Co-authored-by: mhorne
Reviewed by: mhorne
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1134

2 months agoarm64: Add EL1 hardware breakpoint exceptions
Andrew Turner [Tue, 12 Mar 2024 16:50:04 +0000 (16:50 +0000)]
arm64: Add EL1 hardware breakpoint exceptions

Reviewed by: jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44353

2 months agoarm64: Use a switch to decide when to enable debug
Andrew Turner [Tue, 12 Mar 2024 16:47:38 +0000 (16:47 +0000)]
arm64: Use a switch to decide when to enable debug

Use a switch statement to decide which exceptions we need to call
dbg_enable for. This simplifies adding more esceptions to the list in
the future.

Reviewed by: jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44352

2 months agoarm64: Always set the debug control and value regs
Andrew Turner [Tue, 12 Mar 2024 16:34:41 +0000 (16:34 +0000)]
arm64: Always set the debug control and value regs

When listing watchpoints we read the raw registers. To ensure we print
an accurate list always set the watchpoint and breakpoint registers.

Sponsored by: Arm Ltd

Reviewed by: jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44351

2 months agoarm64: Mask non-debug exceptions when single stepping
Andrew Turner [Thu, 14 Mar 2024 14:02:56 +0000 (14:02 +0000)]
arm64: Mask non-debug exceptions when single stepping

When an exception is pending when single stepping we may execute the
handler for that exception rather than the single step handler. This
could cause the scheduler to fire to run a new thread. This will mean
we single step to a new thread causing unexpected results.

Handle this by masking non-debug exceptions. This will cause issues
when stepping over instructions that access the DAIF values so future
work is needed to handle these cases, but for most code this now works
as expected.

Reviewed by: jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44350

2 months agoarm64: Split out a savectx version of vfp_save_state
Andrew Turner [Wed, 3 Jan 2024 17:41:42 +0000 (17:41 +0000)]
arm64: Split out a savectx version of vfp_save_state

Rather than try to detect when vfp_save_state is called by savectx use
a separate function that sets up the pcb as needed.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43304

2 months agolibc/aarch64: Add a non-trivial getcontextx
Andrew Turner [Wed, 6 Mar 2024 12:51:18 +0000 (12:51 +0000)]
libc/aarch64: Add a non-trivial getcontextx

Add support for extra registers to the arm64 getcontextx. As no
registers are defined this just adds the extra register list and an end
context.

Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44255

2 months agolibc/aarch64: Copy the trivial getcontextx
Andrew Turner [Wed, 28 Feb 2024 16:09:17 +0000 (16:09 +0000)]
libc/aarch64: Copy the trivial getcontextx

This will be used as the base of a non-trivial implementation.

Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44254

2 months agoarm64: Support passing more registers to signals
Andrew Turner [Thu, 21 Mar 2024 10:13:16 +0000 (10:13 +0000)]
arm64: Support passing more registers to signals

To support recent extensions to the Arm architecture we may need to
store more or larger registers when sending a signal.

To support this create a list of these extra registers. Userspace that
needs to access a register in the signal handler can then walk the list
to find the correct register struct and read/write its contents.

Reviewed by: kib, markj (earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43302

2 months agowmemchr(3): fix prototypes for wcpcpy() and wcpncpy()
Konstantin Belousov [Thu, 21 Mar 2024 08:38:05 +0000 (10:38 +0200)]
wmemchr(3): fix prototypes for wcpcpy() and wcpncpy()

PR: 277855
Reported by: Paul Floyd <pjfloyd@wanadoo.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 months agolibfdt: Make an internal FDT library available
Mark Johnston [Thu, 21 Mar 2024 04:21:16 +0000 (00:21 -0400)]
libfdt: Make an internal FDT library available

This will be used by bhyve to build a device tree when booting arm64
guests.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40994

2 months agobhyve: Move device model-independent UART code into a separate file
Mark Johnston [Thu, 21 Mar 2024 04:20:37 +0000 (00:20 -0400)]
bhyve: Move device model-independent UART code into a separate file

Currently bhyve implements a ns16550-compatible UART in uart_emul.c.
This file also contains generic code to manage RX FIFOs and to handle
reading from and writing to a TTY.  bhyve instantiates UARTs to
implement COM devices (via pci_lpc.c) and PCI UART devices.

The arm64 port will bring with it a PL011 device model which is used as
the default console (i.e., no COM ports).  To simplify its integration,
add a UART "backend" layer which lets UART device models allocate an RX
FIFO and interact with TTYs without duplicating code.  In particular,
code in uart_backend.* is to be shared among device models, and the
namespace for uart_emul.* is changed to uart_ns16550_*.

This is based on andrew@'s work in
https://github.com/zxombie/freebsd/tree/bhyvearm64 but I've made a
number of changes, particularly with respect to naming and source code
organization.

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40993

2 months agolibsysdecode: fix build after 3d0a736796a9
Kyle Evans [Thu, 21 Mar 2024 03:14:49 +0000 (22:14 -0500)]
libsysdecode: fix build after 3d0a736796a9

TCP_USE_DDP is a kernel-only macro, so we must exclude it in
libsysdecode to avoid breaking the build.

Fixes: 3d0a736796a9 ("tcp: Add a new kernel-only TCP_USE_DDP [...]")

2 months agoTranslate linux_newlstat name argument
John F. Carr [Wed, 20 Mar 2024 22:44:23 +0000 (00:44 +0200)]
Translate linux_newlstat name argument

PR: 277847
MFC after: 1 week

2 months agoMerge commit bbb8a0df7367 from llvm-project (by Shafik Yaghmour):
Dimitry Andric [Wed, 20 Mar 2024 22:39:06 +0000 (23:39 +0100)]
Merge commit bbb8a0df7367 from llvm-project (by Shafik Yaghmour):

  [Clang] Fix ResolveConstructorOverload to not select a conversion function if we are going use copy elision

  ResolveConstructorOverload needs to check properly if we are going to use copy
  elision we can't use a conversion function.

  This fixes:

  https://github.com/llvm/llvm-project/issues/39319
  https://github.com/llvm/llvm-project/issues/60182
  https://github.com/llvm/llvm-project/issues/62157
  https://github.com/llvm/llvm-project/issues/64885
  https://github.com/llvm/llvm-project/issues/65568

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

This should fix 'Assertion failed: (isa<To>(Val) && "cast<Ty>() argument
of incompatible type!")' errors when building devel/boost-libs,
specifically libs/url/src/segments_view.cpp.

Bump __FreeBSD_version so this fix can easily be detected from
devel/boost-all/compiled.mk.

PR: 273335

2 months agocxgbe tom: Handle a race condition when enabling TLS offload
John Baldwin [Wed, 20 Mar 2024 22:30:09 +0000 (15:30 -0700)]
cxgbe tom: Handle a race condition when enabling TLS offload

Use a separate state for when a request to set RX_QUIESCE has been
sent but the resulting TCB reply has not been received.  In
particular, this correctly handles the case where data has been
received and queued in the receive queue before the quiesce request
takes effect.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44435

2 months agoNFS: Request use of TCP_USE_DDP for in-kernel TCP sockets
John Baldwin [Wed, 20 Mar 2024 22:29:51 +0000 (15:29 -0700)]
NFS: Request use of TCP_USE_DDP for in-kernel TCP sockets

Since this is an optimization, ignore failures to enable the option.

For the server side, defer enabling DDP until the first non-NULLPROC
RPC is received.  This allows TLS handling (which uses NULLPROC RPCs)
to enable TLS offload first.

Reviewed by: rmacklem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44002

2 months agocxgbe: Support TCP_USE_DDP on offloaded TOE connections
John Baldwin [Wed, 20 Mar 2024 22:29:28 +0000 (15:29 -0700)]
cxgbe: Support TCP_USE_DDP on offloaded TOE connections

When this socket option is enabled, relatively large contiguous
buffers are allocated and used to receive data from the remote
connection.  When data is received a wrapper M_EXT mbuf is queued to
the socket's receive buffer.  This reduces the length of the linked
list of received mbufs and allows consumers to consume receive data in
larger chunks.

To minimize reprogramming the page pods in the adapter, receive
buffers for a given connection are recycled.  When a buffer has been
fully consumed by the receiver and freed, the buffer is placed on a
per-connection free buffers list.

The size of the receive buffers defaults to 256k and can be set via
the hw.cxgbe.toe.ddp_rcvbuf_len sysctl.  The
hw.cxgbe.toe.ddp_rcvbuf_cache sysctl (defaults to 4) determines the
maximum number of free buffers cached per connection.  Note that this
limit does not apply to "in-flight" receive buffers that are
associated with mbufs in the socket's receive buffer.

Co-authored-by: Navdeep Parhar <np@FreeBSD.org>
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44001

2 months agotcp: Add a new kernel-only TCP_USE_DDP socket option
John Baldwin [Wed, 20 Mar 2024 22:29:02 +0000 (15:29 -0700)]
tcp: Add a new kernel-only TCP_USE_DDP socket option

This socket option can be used by in-kernel consumers (like NFS) to
request a NIC to use optimized receive of large buffers for a
connection.  The current use case is to support DDP by the TOE on
Chelsio NICs.

Reviewed by: rscheff, tuexen, glebius
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44000

2 months agoddp: Clear active DDP buffer members to NULL to pacify an assertion
John Baldwin [Wed, 20 Mar 2024 22:28:43 +0000 (15:28 -0700)]
ddp: Clear active DDP buffer members to NULL to pacify an assertion

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43999

2 months agoarm/GENERIC: Remove TI DTBs
Emmanuel Vadot [Wed, 20 Mar 2024 20:03:01 +0000 (21:03 +0100)]
arm/GENERIC: Remove TI DTBs

We've removed TI support in 3416e102c4e9 ("arm: Remove TI code from GENERIC")
so no need to build the DTBs now.

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 months agoip6_output: Reduce cache misses on pktopts
Andrew Gallatin [Wed, 20 Mar 2024 19:46:01 +0000 (15:46 -0400)]
ip6_output: Reduce cache misses on pktopts

When profiling an IP6 heavy workload, I noticed that we were
getting a lot of cache misses in ip6_output() around
ip6_pktopts. This was happening because the TCP stack passes
inp->in6p_outputopts even if all options are unused. So in the
common case of no options present, pkt_opts is not null, and is
checked repeatedly for different options. Since ip6_pktopts is
large (4 cachelines), and every field is checked, we take 4
cache misses (2 of which tend to be hidden by the adjacent line
prefetcher).

To fix this common case, I introduced a new flag in ip6_pktopts
(ip6po_valid) which tracks which options have been set. In the
common case where nothing is set, this causes just a single
cache miss to load. It also eliminates a test for some options
(if (opt != NULL && opt->val >= const) vs if ((optvalid & flag) !=0 )

To keep the struct the same size in 64-bit kernels, and to keep
the integer values (like ip6po_hlim, ip6po_tclass, etc) on the
same cacheline, I moved them to the top.

As suggested by zlei, the null check in MAKE_EXTHDR() becomes
redundant, and can be removed.

For our web server workload (with the ip6po_tclass option set),
this drops the CPI from 2.9 to 2.4 for ip6_output

Differential Revision: https://reviews.freebsd.org/D44204
Reviewed by: bz, glebius, zlei
No Objection from: melifaro
Sponsored by: Netflix Inc.

2 months agopkgbase: install all libc test files into the tests package
Baptiste Daroussin [Wed, 20 Mar 2024 16:13:56 +0000 (17:13 +0100)]
pkgbase: install all libc test files into the tests package

2 months agopkgbase: make sendmail config files as config
Baptiste Daroussin [Wed, 20 Mar 2024 15:44:35 +0000 (16:44 +0100)]
pkgbase: make sendmail config files as config

2 months agopkgbase: separate /etc/mail/aliases from the sendmail package
Baptiste Daroussin [Wed, 20 Mar 2024 15:39:39 +0000 (16:39 +0100)]
pkgbase: separate /etc/mail/aliases from the sendmail package

move /etc/aliases and /etc/mail/aliases into the runtime package
this file is used by both sendmail and dma.

While here mark this file as a config file so 3way merge is performed

2 months agopkgbase: add a mechanism to be able to force a give ucl include
Baptiste Daroussin [Wed, 20 Mar 2024 08:35:47 +0000 (09:35 +0100)]
pkgbase: add a mechanism to be able to force a give ucl include

This is made in order to be able to find add the post-install scripts
for the kernel, where PKGNAME varies for each KERNCONF but we don't want
to dynamically duplicated the kernel.ucl file.

At the same time we don't want the *-dbg* packages to actually include
those post-install scripts

2 months agobuild: Order kernel-toolchain and buildkernel targets
Mark Johnston [Thu, 25 Jan 2024 17:46:58 +0000 (12:46 -0500)]
build: Order kernel-toolchain and buildkernel targets

MFC after: 1 week

2 months agorc.initdiskless: Disable soft-updates in mdmfs (again)
Jose Luis Duran [Wed, 20 Mar 2024 04:54:18 +0000 (00:54 -0400)]
rc.initdiskless: Disable soft-updates in mdmfs (again)

Re-apply the -S switch to disable soft-updates in memory disks (commit
8b1292ac5219). This might be beneficial when tmpfs(5) is not present in
the kernel, as this can cause mdmfs(8)'s auto keyword to fallback to
using md(4).

PR: 85558
MFC after: 1 week
Reviewed by: imp, emaste, brooks
Differential Revision: https://reviews.freebsd.org/D43242

2 months agosys/syscallsubr.h: align definition of kern_fcntl_freebsd() on 32bit
Konstantin Belousov [Wed, 20 Mar 2024 03:49:01 +0000 (05:49 +0200)]
sys/syscallsubr.h: align definition of kern_fcntl_freebsd() on 32bit

Fixes: d0efabdf15d956e9bc0414356ed798ca3c846e08

2 months agodaemon(8): handle case of waitpid() returning without exited child
Konstantin Belousov [Mon, 18 Mar 2024 08:44:39 +0000 (10:44 +0200)]
daemon(8): handle case of waitpid() returning without exited child

Not checking for either WIFEXITED(status) or zero result results in
never finishing the loop.

PR: 277764
Reviewed by: kevans (previous version)
Discussed with: Daniel Tameling
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44401

2 months agosysent: regen
Brooks Davis [Tue, 19 Mar 2024 22:04:37 +0000 (22:04 +0000)]
sysent: regen

2 months agosyscalls.master: use __acl_type_t
Brooks Davis [Tue, 19 Mar 2024 21:53:50 +0000 (21:53 +0000)]
syscalls.master: use __acl_type_t

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44418

2 months agosys/acl.h: move main typedefs to sys/_types.h
Brooks Davis [Mon, 18 Mar 2024 21:45:42 +0000 (21:45 +0000)]
sys/acl.h: move main typedefs to sys/_types.h

Make __ prefixed versions available without the pollution of sys/acl.h
(and by extension sys/param.h).

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44382

2 months agosyscalls.master: make __sys_fcntl take an intptr_t
Brooks Davis [Tue, 19 Mar 2024 21:52:39 +0000 (21:52 +0000)]
syscalls.master: make __sys_fcntl take an intptr_t

The (optional) third argument of fcntl is sometimes a pointer so change
the type to intptr_t.  Update the libc-internal defintion (actually used
by libthr) to take a fixed intptr_t argument rather than pretending it's
a variadic function.  (That worked because all supported architectures
pass variadic arguments as though the function was declared with those
types.  In CheriBSD that changes because variadic arguments are passed
via a bounded array.)

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44381

2 months agosyscalls.master: struct siginfo -> struct __siginfo
Brooks Davis [Mon, 18 Mar 2024 21:40:07 +0000 (21:40 +0000)]
syscalls.master: struct siginfo -> struct __siginfo

struct siginfo doesn't exist, it's struct __siginfo (and siginfo_t).

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44380

2 months agofreebsd32: struct siginfo32 -> struct __siginfo32
Brooks Davis [Mon, 18 Mar 2024 21:37:39 +0000 (21:37 +0000)]
freebsd32: struct siginfo32 -> struct __siginfo32

In the next commit I will update syscalls.master to use struct __siginfo
(which actually exists) so this update will be needed to make
generated files (from make sysent) align.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44380

2 months agosyscalls.master: align with sigfastblock declaration
Brooks Davis [Tue, 19 Mar 2024 21:51:40 +0000 (21:51 +0000)]
syscalls.master: align with sigfastblock declaration

sigfastblock is declared to take a void * argument in the manpage in
headers so declare it that way and use SAL annotations to say it
interacts with a 32-bit word.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44379

2 months agosyscall.master: fix aio_suspend signature
Brooks Davis [Tue, 19 Mar 2024 21:50:18 +0000 (21:50 +0000)]
syscall.master: fix aio_suspend signature

It takes a `const struct iovec *iovp`.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44378

2 months agosyscalls.master: fix readv and writev iovp decl
Brooks Davis [Tue, 19 Mar 2024 21:50:09 +0000 (21:50 +0000)]
syscalls.master: fix readv and writev iovp decl

Both take const struct iovec * and only read the values.

Reviewed by: olce, kib
Differential Revision: https://reviews.freebsd.org/D44377

2 months agofreebsd32: freebsd32_copyinuio takes const iovp
Brooks Davis [Tue, 19 Mar 2024 21:47:55 +0000 (21:47 +0000)]
freebsd32: freebsd32_copyinuio takes const iovp

We only read the iovp so make it const like in copyinuio.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44376

2 months agoDefine stack_t in sys/_sigaltstack.h
Brooks Davis [Tue, 19 Mar 2024 00:24:37 +0000 (00:24 +0000)]
Define stack_t in sys/_sigaltstack.h

The sigaltstack(2) definition needs this type so make it available
without all of sys/signal.h.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44383

2 months agoarm64: Move curthread setup earlier
Isaac Cilia Attard [Wed, 13 Mar 2024 18:06:19 +0000 (19:06 +0100)]
arm64: Move curthread setup earlier

In 469cfa3c30ee cperciva added TSLOG profiling to link_elf_ireloc.  This
requires curthread to be read when the kernel linker is invoked, but it
hadn't yet been initialized.  On amd64 this was harmless since [gs:0] was
readable; but on arm64 this broke since [x18] was not readable.

Move the curthread (and associated PCPU) setup earlier on arm64 in order
to allow TSLOG to work there.

Fixes: 469cfa3c30ee ("tslog: Annotate some early boot functions")
Differential Revision: https://reviews.freebsd.org/D44317

2 months agoAdd myself (eduardo) to the calendar.
Nuno Teixeira [Tue, 19 Mar 2024 21:21:04 +0000 (21:21 +0000)]
Add myself (eduardo) to the calendar.

Reminded by: mckusick

2 months agocarp: check CARP status in in_localip_fib(), in6_localip_fib()
Gleb Smirnoff [Tue, 19 Mar 2024 18:48:59 +0000 (11:48 -0700)]
carp: check CARP status in in_localip_fib(), in6_localip_fib()

Don't report a BACKUP CARP address as local.  These two functions are used
only by source address validation for input packets, controlled by sysctls
net.inet.ip.source_address_validation and
net.inet6.ip6.source_address_validation.  For this purpose we definitely
want to treat BACKUP addresses as non local.

This change is conservative and doesn't modify compat in_localip() and
in6_localip().  They are used more widely than the FIB-aware versions.
The change would modify the notion of ipfw(4) 'me' keyword.  There might
be other consequences as in_localip() is used by various tunneling
protocols.

PR: 277349

2 months agopf: convert DIOCSETSTATUSIF to netlink
Kristof Provost [Mon, 18 Mar 2024 09:56:25 +0000 (10:56 +0100)]
pf: convert DIOCSETSTATUSIF to netlink

While here also add a basic test case for it.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44368

2 months agopf: fix dummynet + route-to
Kristof Provost [Tue, 12 Mar 2024 12:29:08 +0000 (13:29 +0100)]
pf: fix dummynet + route-to

Ensure that we pick the correct dummynet pipe (i.e. forward vs. reverse
direction) when applying route-to.

We mark the processing as outbound so that dummynet will re-inject in
the correct phase of processing after it's done with the packet, but
that will cause us to pick the wrong pipe number. Reverse them so that
the incorrect decision ends up picking the correct pipe.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44366

2 months agopf: avoid passing through dummynet multiple times
Kristof Provost [Mon, 11 Mar 2024 13:44:17 +0000 (14:44 +0100)]
pf: avoid passing through dummynet multiple times

In some setups we end up with multiple states created for a single
packet, which in turn can mean we run the packet through dummynet
multiple times. That's not expected or intended. Mark each packet when
it goes through dummynet, and do not pass packet through dummynet if
they're marked as having already passed through.

See also: https://redmine.pfsense.org/issues/14854
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44365

2 months agopkgbase: fix packaging of dtb
Baptiste Daroussin [Tue, 19 Mar 2024 14:06:02 +0000 (15:06 +0100)]
pkgbase: fix packaging of dtb

2 months agopkgbase: fix typo preventing packaging kernels
Baptiste Daroussin [Tue, 19 Mar 2024 13:05:12 +0000 (14:05 +0100)]
pkgbase: fix typo preventing packaging kernels

2 months agopkgbase: fix kernel packing after switch ucl rework
Baptiste Daroussin [Tue, 19 Mar 2024 09:00:15 +0000 (10:00 +0100)]
pkgbase: fix kernel packing after switch ucl rework

2 months agopkgbase: rework certctl package to only run rehash on the main package
Baptiste Daroussin [Wed, 31 Jan 2024 12:42:16 +0000 (13:42 +0100)]
pkgbase: rework certctl package to only run rehash on the main package

Rework how ucl manifest are generated leveraging ucl features and flua

now the ucl generation is done via a lua script which uses libucl to
ingest the template and use variables as defined in its command line.

the template will include only if it exist a ucl file named after the
package name which will complement the template or overwrite what was
defined in the template if defined in this specific ucl file

this allows to overwrite license, but add script only to the packages
who actually needs them.

As a results the post install scripts are now only added to the right
package and not also added to the subpackages like -man or -dev

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

2 months agodiff: Improve history section.
Dag-Erling Smørgrav [Tue, 19 Mar 2024 02:59:00 +0000 (03:59 +0100)]
diff: Improve history section.

Reviewed by: gbe
Differential Revision: https://reviews.freebsd.org/D44409

2 months agokldxref: Properly handle reading strings near the end of an ELF file
John Baldwin [Tue, 19 Mar 2024 00:01:23 +0000 (17:01 -0700)]
kldxref: Properly handle reading strings near the end of an ELF file

If a string is at or near the end of an input file and the amount of
remaining data in the file is smaller than the maximum string size,
the pread(2) system call would return a short read which is treated as
an error.  Instead, add a new helper function for reading a string
which permits short reads so long as the data read from the file
contains a terminated string.

Reported by: jrtc27
Reviewed by: jrtc27
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D44419

2 months agoloader.4th dictthreshold too small
Simon J. Gerraty [Mon, 18 Mar 2024 23:16:29 +0000 (16:16 -0700)]
loader.4th dictthreshold too small

The dictthreshold in stand/forth/loader.4th is too small
resulting in full dictionary.

Reviewed by: stevek, imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44414

2 months agouboot/Makefile move BINDIR
Simon J. Gerraty [Mon, 18 Mar 2024 23:14:15 +0000 (16:14 -0700)]
uboot/Makefile move BINDIR

Set BINDIR before we include bsd.init.mk
so we can override it via local.init.mk

Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44413

2 months agonfsd.8: Document ways to minimize Copy operation times
Rick Macklem [Mon, 18 Mar 2024 22:40:41 +0000 (15:40 -0700)]
nfsd.8: Document ways to minimize Copy operation times

For NFSv4.2, a Copy operation can take a long time to complete.
If there is a concurrent ExchangeID or DelegReturn operation
which requires the exclusive lock on all NFSv4 state, this can
result in a stall of the nfsd server.

This patch documents ways to avoid this problem.

This is a content change.

Reviewed by: karels, wollman, pauamma_gundo.com (manpages)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44395

2 months agoadd myself(oh) to the calendar
Oskar Holmlund [Mon, 18 Mar 2024 21:33:03 +0000 (22:33 +0100)]
add myself(oh) to the calendar

Reported by: McKusick
Approved by: Manu (mentor)
Differential Revision: https://reviews.freebsd.org/D44408

2 months agokerneldump: add livedump_start_vnode(9)
Vijeyalakshumi Koteeswaran [Mon, 18 Mar 2024 19:26:29 +0000 (15:26 -0400)]
kerneldump: add livedump_start_vnode(9)

livedump_start_vnode(9) is introduced such that the live minidump on the
system could take a vnode. This interface could be used to extend support
for the existing framework in downstream.

Bump __FreeBSD_version for introducing livedump_start_vnode(9).

Sponsored by: Juniper Networks, Inc.
Reviewed by: khng
Differential Revision: https://reviews.freebsd.org/D43471

2 months agotcp: clear all TCP timers in tcp_timer_stop() when in callout
Gleb Smirnoff [Mon, 18 Mar 2024 20:57:00 +0000 (13:57 -0700)]
tcp: clear all TCP timers in tcp_timer_stop() when in callout

When a TCP callout decides to disable self, e.g. tcp_timer_2msl() calling
tcp_close(), we must also clear all other possible timers.  Otherwise,
upon return, the callout would be scheduled again in tcp_timer_enter().

Revert 57e27ff07aff, which was a temporary partial revert of otherwise
correct 62d47d73b7eb, that exposed the problem being fixed now.  Add an
extra assertion in tcp_timer_enter() to check we aren't arming callout for
a closed connection.

Reviewed by: rscheff

2 months agoAdd myself (rcm) to the calendar.
R. Christian McDonald [Mon, 18 Mar 2024 20:25:43 +0000 (16:25 -0400)]
Add myself (rcm) to the calendar.

Reminded by: mckusick

2 months agorandom(9): bump removal to FreeBSD 15.0
Ed Maste [Mon, 18 Mar 2024 20:02:08 +0000 (16:02 -0400)]
random(9): bump removal to FreeBSD 15.0

It has not yet been removed, and still has some in-tree consumers.

PR: 277655
Sponsored by: The FreeBSD Foundation

2 months agolib{c,sys}: really fix incremental builds
Brooks Davis [Mon, 18 Mar 2024 17:06:41 +0000 (17:06 +0000)]
lib{c,sys}: really fix incremental builds

Reported by: andrew
Fixes: a650ec0e55a9 lib{c,sys}: fix incremental builds

2 months agotcp_rack.4: Update the SEE ALSO section
Gordon Bergling [Mon, 18 Mar 2024 18:25:11 +0000 (19:25 +0100)]
tcp_rack.4: Update the SEE ALSO section

Correct the surname of one of authors of RFC 8985 and add RFC 5681 and
RFC 6937 (PRR: Proportional Rate Reduction for TCP).

Reviewed by: tuexen
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44399

2 months agoktls: catch invalid parameters earlier
Richard Scheffenegger [Mon, 18 Mar 2024 01:55:59 +0000 (02:55 +0100)]
ktls: catch invalid parameters earlier

Move safety checks forward from ktls_session_create() to
ktls_copyin_tls_enable(). Prevents zero mallocs, and excessively
large kernel mallocs.

Reported-by: syzbot+72022fa9163fa958b66c@syzkaller.appspotmail.com
Reported-by: syzbot+8992893e13058ce0670a@syzkaller.appspotmail.com
Sponsored by: NetApp, Inc.
X-NetApp-PR: #79
Reviewed By: tuexen
Differential Revision: https://reviews.freebsd.org/D44364

2 months agoAdd myself (harti) to the calendar.
Hartmut Brandt [Mon, 18 Mar 2024 16:58:03 +0000 (17:58 +0100)]
Add myself (harti) to the calendar.

Reminded by:    mckusick

2 months agoarm64: Return all registers to gdb when able
Andrew Turner [Thu, 14 Mar 2024 17:31:39 +0000 (17:31 +0000)]
arm64: Return all registers to gdb when able

When the kdb thread is the current thread we read the registers from
the trap frame. As this contains all general purpose registers we can
use it to read these in the gdb stub. This allows us to include the
non-callee saved registers, e.g. function arguments.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44360

2 months agouart: Add uart_cpu_acpi_setup to setup the uart
Andrew Turner [Thu, 14 Mar 2024 16:43:28 +0000 (16:43 +0000)]
uart: Add uart_cpu_acpi_setup to setup the uart

In preperation for adding debug port support add a generic function
to setup the uart from ACPI tables.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44358

2 months agouart: Split out initilisation of the acpi devinfo
Andrew Turner [Tue, 12 Mar 2024 18:06:18 +0000 (18:06 +0000)]
uart: Split out initilisation of the acpi devinfo

Split out the common parts of building the uart devinfo from ACPI
tables from the SPCR parser. This will be used when we support the DBG2
table to find the debug uart to be used by the kernel gdb stub.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44357

2 months agoarm64: Rename drop_to_el1 to enter_kernel_el
Andrew Turner [Thu, 15 Feb 2024 14:48:54 +0000 (14:48 +0000)]
arm64: Rename drop_to_el1 to enter_kernel_el

In the future we may not drop to EL1, e.g. when we support FEAT_VHE
where the kernel runs in EL2.

Reviewed by: emaste, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43976

2 months agotcp: remove IS_FASTOPEN() macro
Gleb Smirnoff [Mon, 18 Mar 2024 15:56:17 +0000 (08:56 -0700)]
tcp: remove IS_FASTOPEN() macro

The macro is more obfuscating than helping as it just checks a single flag
of t_flags.  All other t_flags bits are checked without a macro.

A bigger problem was that declaration of the macro in tcp_var.h depended
on a kernel option.  It is a bad practice to create such definitions in
installable headers.

Reviewed by: rscheff, tuexen, kib
Differential Revision: https://reviews.freebsd.org/D44362

2 months agosockets: remove unused KPIs to manipulate sockets
Gleb Smirnoff [Mon, 18 Mar 2024 15:50:30 +0000 (08:50 -0700)]
sockets: remove unused KPIs to manipulate sockets

These KPIs were added in dd0e6c383a9f0 and through 15 years had zero use.
They slightly remind what IfAPI does for struct ifnet.  But IfAPI does
that for the sake of large collection of NIC drivers not being aware of
struct ifnet.  For the sockets it is unclear what could be a large
collection of externally written kernel modules that need extensively use
sockets and not be aware of their internals at the same time. This
isolation of a structure knowledge requires a lot of work, and just
throwing in a few KPIs isn't helpful.

Reviewed by: kib, olce, markj
Differential Revision: https://reviews.freebsd.org/D44311

2 months agoinpcb: remove unused KPIs to manipulate inpcbs
Gleb Smirnoff [Mon, 18 Mar 2024 15:49:39 +0000 (08:49 -0700)]
inpcb: remove unused KPIs to manipulate inpcbs

These KPIs were added in 9d29c635daa69 and through 15 years had zero use.
They slightly remind what IfAPI does for struct ifnet.  But IfAPI does
that for the sake of large collection of NIC drivers not being aware of
struct ifnet.  For the inpcb it is unclear what could be a large
collection of externally written kernel modules that need extensively use
inpcb and not be aware of its internals at the same time. This isolation
of a structure knowledge requires a lot of work, and just throwing in a
few KPIs isn't helpful.

Reviewed by: kib, bz, markj
Differential Revision: https://reviews.freebsd.org/D44310

2 months agossh: remove deprecated client VersionAddendum
Ed Maste [Mon, 18 Mar 2024 14:15:27 +0000 (10:15 -0400)]
ssh: remove deprecated client VersionAddendum

Support for a client VersionAddendum was removed in bffe60ead024, but
the option was retained (as oDeprecated) as a transition aid.
Sufficient time has passed that it can be removed.

Sponsored by: The FreeBSD Foundation

2 months agocalendars: Add myself to the FreeBSD calendar
Gabriel M. Dutra [Sun, 17 Mar 2024 06:36:07 +0000 (03:36 -0300)]
calendars: Add myself to the FreeBSD calendar

Reported by: mckusick
Approved by: dbaio (mentor)
Differential Revision: https://reviews.freebsd.org/D44396

2 months agossh: Update to OpenSSH 9.7p1
Ed Maste [Mon, 18 Mar 2024 14:00:57 +0000 (10:00 -0400)]
ssh: Update to OpenSSH 9.7p1

This release contains mostly bugfixes.

It also makes support for the DSA signature algorithm a compile-time
option, with plans to disable it upstream later this year and remove
support entirely in 2025.

Full release notes at https://www.openssh.com/txt/release-9.7

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

2 months agolibbe: Fix some markup issues.
Dag-Erling Smørgrav [Mon, 18 Mar 2024 13:49:27 +0000 (14:49 +0100)]
libbe: Fix some markup issues.

MFC after: 3 days
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44407

2 months agobectl: Simplify command aliases.
Dag-Erling Smørgrav [Mon, 18 Mar 2024 13:49:23 +0000 (14:49 +0100)]
bectl: Simplify command aliases.

MFC after: 3 days
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44406

2 months agobectl: Use geopt() and drop mention of -?.
Dag-Erling Smørgrav [Mon, 18 Mar 2024 13:49:18 +0000 (14:49 +0100)]
bectl: Use geopt() and drop mention of -?.

MFC after: 3 days
PR: 272260
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44405

2 months agoRename VM_LAST to more appropriate VM_GUEST_LAST
Mateusz Guzik [Mon, 18 Mar 2024 10:48:10 +0000 (10:48 +0000)]
Rename VM_LAST to more appropriate VM_GUEST_LAST

NFC

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

2 months agofreebsd-update: mark "cron" as fetched as "fetch" itself
Michael Osipov [Thu, 14 Mar 2024 16:39:47 +0000 (17:39 +0100)]
freebsd-update: mark "cron" as fetched as "fetch" itself

The change in 33bd05c3187d7b49c80cf1b0132b405c105d0833 was incomplete
because it did not mark "cron" as ISFETCHED=1 although it performs the
same operations as "install", but less output and does not perform a
hard exit. Mark result as such and make "install" know that updates have
been fetched.

PR: 277699
Approved by: jrm (mentor), emaste, cperciva
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44356

2 months agorelease: add basic cloudinit images
Baptiste Daroussin [Fri, 15 Mar 2024 08:43:20 +0000 (09:43 +0100)]
release: add basic cloudinit images

Provide both zfs and ufs images which a 1MB partition reserved for the
config drive wearing a GPT Label "config-drive" to allow consumer to
know where they should push the config drive on the provided image.

2 formats available: qcow2 and raw

This has been tested on OVHCloud baremetal via "bring your own image"
Also tested on openstack

Reviewed by: emaste
Sponsored by: OVHCloud
Differential Revision: https://reviews.freebsd.org/D44369

2 months agolib/msun: Fix tgammal(3) on IEEE 128-bit platforms
Mark Murray [Fri, 1 Mar 2024 15:53:58 +0000 (15:53 +0000)]
lib/msun: Fix tgammal(3) on IEEE 128-bit platforms

Undo the 80-bit "stub" implementation of the 128-bit long double
tgammal(3) function. The latest (as of Feb 2024) version of the
src/contrib/arm-optimised-routines library includes a standalone,
full 128-bit replacement. This needs a small bit of wrapping to
fit it in, but is otherwise a drop-in replacement.

Testing this is hard, as most maths packages blow up as soon as
their 80-bit floating-point capability is exceeded. With 128-bit
tgammal(), this is easy to do, and this is the range that needs to
be checked the most carefully. Using my copy of Maple, I was able
to check that the output was within a few ULP of the correct answer,
right up to the point of 128-bit over- and underflow. Additionally,
the results are no worse, and indeed better than the 80-bit version.

Steve Kargl sent me his libm testing code, which I used to verify
that the excpetions for certain key values were correct. Tested in
this case were +-Inf, +-NaN, +-1 and +-0.

Differential Revision: https://reviews.freebsd.org/D44168
Reviewed by: theraven, andrew, imp

2 months agoAdd myself (michaelo) to the calendar
Michael Osipov [Mon, 18 Mar 2024 09:46:02 +0000 (10:46 +0100)]
Add myself (michaelo) to the calendar

Reminded by: mckusick

2 months agofreebsd-update: Don't provide copiable commands in output
Michael Osipov [Tue, 30 Jan 2024 16:24:45 +0000 (17:24 +0100)]
freebsd-update: Don't provide copiable commands in output

Previously, freebsd-update provided ready-to-go commands for copying and
pasting into the terminal. This causes problems as soon as options are
used and not supplied again by the user, e.g., '-b' or '-d'.
Stop making them copiable and force the user to construct a valid command
line by himself to avoid failures.

PR: 276102
Approved by: jrm (mentor), emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43700

2 months agoAdd myself (jfree) to calendar.freebsd
Jake Freeland [Sun, 17 Mar 2024 22:41:26 +0000 (17:41 -0500)]
Add myself (jfree) to calendar.freebsd

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

2 months agoAdd myself (nc) to the calendar
Neel Chauhan [Sun, 17 Mar 2024 22:34:59 +0000 (15:34 -0700)]
Add myself (nc) to the calendar

Reminded by: mckusick

2 months agoVendor import of OpenSSH 9.7p1
Ed Maste [Sun, 17 Mar 2024 17:47:10 +0000 (13:47 -0400)]
Vendor import of OpenSSH 9.7p1

2 months agoAdd myself (vvd) to the calendar
Vladimir Druzenko [Sun, 17 Mar 2024 15:53:07 +0000 (18:53 +0300)]
Add myself (vvd) to the calendar

Reported by: mckusick
Approved by: mckusick

2 months agoAdd myself (zlei) to the calendar
Zhenlei Huang [Sun, 17 Mar 2024 15:07:53 +0000 (23:07 +0800)]
Add myself (zlei) to the calendar

Reminded by: mckusick

2 months agorelease: remove binutils package data
Ed Maste [Sun, 17 Mar 2024 12:09:31 +0000 (08:09 -0400)]
release: remove binutils package data

GDB was the final GNU binutils component included in the base system,
but was removed in 2020.  Nothing provides a pkgbase binutils package
any longer.

Fixes: 1c0ea326aa6d ("Retire obsolete GDB 6.1.1")
Sponsored by: The FreeBSD Foundation

2 months agoAdd myself (dsl) to the calendar.freebsd
Dmitry Salychev [Sun, 17 Mar 2024 10:09:52 +0000 (11:09 +0100)]
Add myself (dsl) to the calendar.freebsd

2 months agounbound: Vendor import 1.19.3
Cy Schubert [Sun, 17 Mar 2024 00:13:09 +0000 (18:13 -0600)]
unbound: Vendor import 1.19.3

Release notes at
https://www.nlnetlabs.nl/news/2024/Mar/14/unbound-1.19.3-released/

MFC after: 1 week

Merge commit '5a33598e88ad8fbc0affa74dee0a2d8cc4010fbc' into main

2 months agojail: add the -C flag to clean up after a partially removed jail
Jamie Gritton [Sun, 17 Mar 2024 05:11:14 +0000 (22:11 -0700)]
jail: add the -C flag to clean up after a partially removed jail

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

2 months agounbound: Vendor import 1.19.3
Cy Schubert [Sat, 16 Mar 2024 23:58:33 +0000 (17:58 -0600)]
unbound: Vendor import 1.19.3

Release notes at
https://www.nlnetlabs.nl/news/2024/Mar/14/unbound-1.19.3-released/

2 months agokldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
Jessica Clarke [Sat, 16 Mar 2024 01:50:21 +0000 (01:50 +0000)]
kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after: 1 week

2 months agojevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
Jessica Clarke [Sat, 16 Mar 2024 01:50:20 +0000 (01:50 +0000)]
jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after: 1 week

2 months agomandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
Jessica Clarke [Sat, 16 Mar 2024 01:50:20 +0000 (01:50 +0000)]
mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after: 1 week

2 months agonfsd: Add a sysctl to limit NFSv4.2 Copy RPC size
Rick Macklem [Sat, 16 Mar 2024 01:04:37 +0000 (18:04 -0700)]
nfsd: Add a sysctl to limit NFSv4.2 Copy RPC size

NFSv4.2 supports a Copy operation, which avoids file data being
read to the client and then written back to the server, if both
input and output files are on the same NFSv4.2 mount for
copy_file_range(2).

Unfortunately, this Copy operation can take a long time under
certain circumstances.  If this occurs concurrently with a RPC
that requires an exclusive lock on the nfsd such as ExchangeID
done for a new mount, the result can be an nfsd "stall" until
the Copy completes.

This patch adds a sysctl that can be set to limit the size of
a Copy operation or, if set to 0, disable Copy operations.

The use of this sysctl and other ways to avoid Copy operations
taking too long will be documented in the nfsd.4 man page by
a separate commit.

MFC after: 2 weeks

2 months agoAdd another commit to .git-blame-ignore-revs
Brooks Davis [Wed, 13 Mar 2024 19:02:14 +0000 (19:02 +0000)]
Add another commit to .git-blame-ignore-revs