]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 months agocap_net: correct capability name from addr2name to name2addr
Mariusz Zaborski [Mon, 23 Oct 2023 21:03:51 +0000 (23:03 +0200)]
cap_net: correct capability name from addr2name to name2addr

Previously, while checking name2addr capabilities, we mistakenly used
the addr2name set. This error could cause a process to inadvertently
reset its limitations.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

(cherry picked from commit afd74c400075d94e01dd3430844bb290834660ef)
(cherry picked from commit 765757c6301fa41c0b59108347c600fbc9020c39)

6 months agofflush: Split a temporary variable in two.
Dag-Erling Smørgrav [Thu, 3 Aug 2023 15:08:03 +0000 (15:08 +0000)]
fflush: Split a temporary variable in two.

It is clearer to avoid reusing temporary variables for different
purposes.

Sponsored by: Klara, Inc.

(cherry picked from commit 1f90b4edffe815aebb35e74b79e10593b31f6b75)
(cherry picked from commit 1e99535be2ea9c0ef8bc57fc885e9c01fa95d2dd)

6 months agoibcore: Introduce enum ib_raw_packet_caps from Linux 4.11
Ka Ho Ng [Sat, 28 Oct 2023 20:57:49 +0000 (16:57 -0400)]
ibcore: Introduce enum ib_raw_packet_caps from Linux 4.11

This enum also exists as enum ibv_raw_packet_caps in libibverbs/verbs.h.

[khng: cherry-picked from Linux
ebaaee253ad3a3c573ab7d3d77e849056bdfa9ea]

Sponsored by: Juniper Networks, Inc.
MFC after: 7 days
Reviewed by: kib, zlei
Differential Revision: https://reviews.freebsd.org/D42177

(cherry picked from commit a69b6af2024fdd501b4bbc674092fb2b6d466364)

6 months agomlx5ib: Fix RSS Toeplitz setup to be aligned with the HW specification
Yishai Hadas [Sat, 28 Oct 2023 20:55:47 +0000 (16:55 -0400)]
mlx5ib: Fix RSS Toeplitz setup to be aligned with the HW specification

The specification for the Toeplitz function doesn't require to set the key
explicitly to be symmetric. In case a symmetric functionality is required
a symmetric key can be simply used.

Wrongly forcing the algorithm to symmetric causes the wrong packet
distribution and a performance degradation.

Link: https://lore.kernel.org/r/20190723065733.4899-7-leon@kernel.org
Fixes: 28d6137008b2 ("IB/mlx5: Add RSS QP support")
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Alex Vainman <alexv@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
[khng: cherry-picked from Linux
b7165bd0d6cbb93732559be6ea8774653b204480]

Sponsored by: Juniper Networks, Inc.
MFC after:      7 days
Reviewed by: kib, zlei
Differential Revision: https://reviews.freebsd.org/D42178

(cherry picked from commit 813d981e1e78daffde4b2a05df35d054fcb4343f)

6 months agomlx5ib: Fix ethertype to be ETH_P_IPV6
Ka Ho Ng [Sat, 28 Oct 2023 20:54:32 +0000 (16:54 -0400)]
mlx5ib: Fix ethertype to be ETH_P_IPV6

Sponsored by: Juniper Networks, Inc.
MFC after: 7 days
Reviewed by: ae, kib, zlei
Differential Revision: https://reviews.freebsd.org/D42184

(cherry picked from commit 3b173281764ba7c02f9de0a67caa1c4eca604413)

6 months agonfsd: Fix a server crash
Rick Macklem [Wed, 18 Oct 2023 02:40:23 +0000 (19:40 -0700)]
nfsd: Fix a server crash

PR#274346 reports a crash which appears to be caused by a NULL default session
being destroyed.  This patch should avoid the crash.

PR: 274346

(cherry picked from commit db7257ef972ed75e33929d39fd791d3699b53c63)

6 months agonfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH
Rick Macklem [Thu, 19 Oct 2023 19:35:35 +0000 (12:35 -0700)]
nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH

When I implemented a test patch using Open Claim_Deleg_Cur_FH
I discovered that the NFSv4.1/4.2 server was broken for this
Open option.  Fortunately it is never used by the FreeBSD
client and never used by other clients unless delegations
are enabled. (The FreeBSD NFSv4 server does not have delegations
enabled by default.)

Claim_Deleg_Cur_FH was broken because the code mistakenly
assumed a stateID argument, which is not the case.
This patch fixes the bug by changing the XDR parser to not
expect a stateID and to fill most of the stateID in from the
clientID. The clientID is the first two elements of the "other"
array for the stateID and is sufficient to identify which
client the delegation is issued to.  Since there is only one
delegation issued to a client per file, this is sufficient to
locate the correct delegation.

If you are running non-FreeBSD NFSv4.1/4.2 mounts against the
FreeBSD server, you need this patch if you have delegations enabled.

PR: 274574

(cherry picked from commit f300335d9aebf2e99862bf783978bd44ede23550)

6 months agonetlink: fix powerpc build.
Alexander V. Chernikov [Tue, 25 Apr 2023 14:59:04 +0000 (14:59 +0000)]
netlink: fix powerpc build.

(cherry picked from commit 9e81e2c4520cdc9b68428a9acc695ad091083ebb)

6 months agolibpfctl: remove unused field from struct pfctl_states
Kristof Provost [Mon, 30 Oct 2023 18:04:12 +0000 (19:04 +0100)]
libpfctl: remove unused field from struct pfctl_states

We never populate this, or use it, so remove it.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 87c5032353106764f324e82541662f448e68f38a)

6 months agolibpfctl: add missing pfctl_status_lcounter() function
Kristof Provost [Mon, 30 Oct 2023 18:02:29 +0000 (19:02 +0100)]
libpfctl: add missing pfctl_status_lcounter() function

We already had accessors for the other types of counters, but not this
one.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 1c824f430a395cdc66e22406e72f20ebd300e47e)

6 months agocam/ata: Postpone removal of two compat sysctls until 15
Zhenlei Huang [Thu, 2 Nov 2023 05:14:40 +0000 (13:14 +0800)]
cam/ata: Postpone removal of two compat sysctls until 15

Prefer UNMAPPEDIO and ROTATING from flags sysctl. See
 1. aeab0812e68c (Add flags sysctl to ada)
 2. cf3ff63e55e4 (Convert unmappedio over to a flag)
 3. 96eb32bf0f5a (Convert rotating to a flag bit)

Reviewed by: imp, ken, #cam
MFC after: immediately (we want this in 14.0)
Differential Revision: https://reviews.freebsd.org/D42402

(cherry picked from commit d24729b2fd66a87c2b925b0c30e46bb0a9d6446a)
(cherry picked from commit fb288d493989d9df4c4f9c8eb3d7e28af61f8302)

6 months agoGiant: Postpone removal of Giant-locked drivers until 15
Zhenlei Huang [Tue, 31 Oct 2023 12:45:14 +0000 (20:45 +0800)]
Giant: Postpone removal of Giant-locked drivers until 15

Reviewed by: imp
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D42401

(cherry picked from commit a8bd34bfc0db38c1c11e9c36b7dd849d607c17a8)
(cherry picked from commit 5019a5acc5b01804e9dccd3796e9e0ea7c82ba90)

6 months agopf: update pf(4) man page to list DIOCGETSTATESV2
Kristof Provost [Mon, 23 Oct 2023 15:11:15 +0000 (17:11 +0200)]
pf: update pf(4) man page to list DIOCGETSTATESV2

The nvlist based state retrieval ioctl has been replaced by an old-style
ioctl for performance reasons. Document that one.

Reported by: Michael Gmelin <grembo@freebsd.org>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42331

(cherry picked from commit 6869f90bf5bbb2f5ae5400e3a435b3680991321d)

6 months agolibpfctl: fix Coverity issues
Kristof Provost [Mon, 23 Oct 2023 11:46:11 +0000 (13:46 +0200)]
libpfctl: fix Coverity issues

 - handle snl_finalize_msg() returning NULL
 - insert the correct data into the states list
 - add missing nvlist_destroy()
 - incorrect order for array bounds

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

(cherry picked from commit 4abc3b482e0d246cd3518622223795c8de102130)

6 months agolibpfctl: fix pfctl_do_ioctl()
Kristof Provost [Mon, 23 Oct 2023 11:43:52 +0000 (13:43 +0200)]
libpfctl: fix pfctl_do_ioctl()

pfctl_do_ioctl() copies the packed request data into the request buffer
and then frees it. However, it's possible for the buffer to be too small
for the reply, causing us to allocate a new buffer. We then copied from
the freed request, and freed it again.

Do not free the request buffer until we're all the way done.

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

(cherry picked from commit 2cffb52514b070e716e700c7f58fdb8cd9b05335)

6 months agonetlink: fix potential llentry lock leak in newneigh handler
R. Christian McDonald [Mon, 23 Oct 2023 11:23:55 +0000 (13:23 +0200)]
netlink: fix potential llentry lock leak in newneigh handler

The netlink newneigh handler has the potential to leak the lock on
llentry objects in the kernel. This patch reconciles several paths
through the newneigh handler that could result in a lock leak.

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

(cherry picked from commit ae2ca32781a90abe987e128ca167ab400a87f369)

6 months agonetlink: allow creation of temporary lle entries.
Alexander V. Chernikov [Tue, 25 Apr 2023 11:08:47 +0000 (11:08 +0000)]
netlink: allow creation of temporary lle entries.

MFC after: 2 weeks

(cherry picked from commit a2728a9a5b8da974e238e6413a980134dbd6297f)

6 months agouser stack randomization: only enable by default for 64bit processes
Konstantin Belousov [Tue, 24 Oct 2023 21:44:06 +0000 (00:44 +0300)]
user stack randomization: only enable by default for 64bit processes

(cherry picked from commit 1798b44fda382c473c9fc7762e162613a39dc23c)

7 months agoisa: Postpone removal of the non-PNP driver until 15
Zhenlei Huang [Sat, 28 Oct 2023 20:31:11 +0000 (04:31 +0800)]
isa: Postpone removal of the non-PNP driver until 15

Reviewed by: imp
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D42387

(cherry picked from commit 98a670cdd6720da4988f902192177fa368b9f9e9)
(cherry picked from commit 699526792d2fac156d72654dba89a4b94c8a4c67)

7 months agopthread_mutexattr(3), _condattr(3): reference libthr(3)
Konstantin Belousov [Mon, 23 Oct 2023 23:03:42 +0000 (02:03 +0300)]
pthread_mutexattr(3), _condattr(3): reference libthr(3)

(cherry picked from commit 4f03a2cae8ae96446064da4e8a533ab24172bdcb)

7 months agopthread_mutexattr_init(3): describe pthread_mutexattr_{set,get}pshared
Konstantin Belousov [Mon, 23 Oct 2023 22:54:54 +0000 (01:54 +0300)]
pthread_mutexattr_init(3): describe pthread_mutexattr_{set,get}pshared

PR: 274678

(cherry picked from commit 2152c4e2db88b9264c6400f2510440465d39c7b8)

7 months agoFix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Fri, 20 Oct 2023 22:14:46 +0000 (15:14 -0700)]
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

Reported-by: Andreas Bock
PR:           274404
(cherry picked from commit 1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2)

7 months agoufs quotas: fix configuring soft quota grace time
Mikel Lechner [Sat, 21 Oct 2023 06:08:38 +0000 (09:08 +0300)]
ufs quotas: fix configuring soft quota grace time

PR: 274552

(cherry picked from commit 2fee3974603bce6f2dc153eb6af459cb4f864ab4)

7 months agobhyve: fix arguments to ioctl(VMIO_SIOCSIFFLAGS)
Gleb Smirnoff [Thu, 26 Oct 2023 09:59:21 +0000 (02:59 -0700)]
bhyve: fix arguments to ioctl(VMIO_SIOCSIFFLAGS)

ioctl(2)'s with integer argument shall pass command argument by value,
not by pointer.  The ioctl(2) manual page is not very clear about that.
See sys/kern/sys_generic.c:sys_ioctl() near IOC_VOID.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D42366
Fixes: fd8b9c73a5a63a7aa438a73951d7a535b4f25d9a

(cherry picked from commit f407a72a506d2630d60d9096c42058f12dff874e)

7 months agopfctl: fix incorrect mask on dynamic address
Kristof Provost [Fri, 6 Oct 2023 12:20:17 +0000 (14:20 +0200)]
pfctl: fix incorrect mask on dynamic address

A PF rule using an IPv4 address followed by an IPv6 address and then a
dynamic address, e.g. "pass from {192.0.2.1 2001:db8::1} to (pppoe0)",
will have an incorrect /32 mask applied to the dynamic address.

MFC after: 3 weeks
Obtained from: OpenBSD
See also: https://ftp.openbsd.org/pub/OpenBSD/patches/5.6/common/007_pfctl.patch.sig
Sponsored by: Rubicon Communications, LLC ("Netgate")
Event: Oslo Hackathon at Modirum

(cherry picked from commit 7ce98cf2f87a22240b66e4c38fd887431a25bf7d)

7 months agomips: add enough glue for membarrier(2)
Konstantin Belousov [Thu, 26 Oct 2023 22:26:46 +0000 (01:26 +0300)]
mips: add enough glue for membarrier(2)

This is direct commit to stable/13.

7 months agolibprocstat: improve conditional for 32-bit compat
Brooks Davis [Thu, 26 Oct 2023 20:38:41 +0000 (21:38 +0100)]
libprocstat: improve conditional for 32-bit compat

Include support for translating 32-bit auxv vectors on non-64-bit
platforms that aren't riscv (which has no 32-bit ABI support and
probably never will).

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42201

(cherry picked from commit 248fe3d3483cb3ec2c78dd31dc02a467060a6577)

7 months agolibprocstat: copy all the 32-bit auxv entries
Brooks Davis [Thu, 26 Oct 2023 20:38:41 +0000 (21:38 +0100)]
libprocstat: copy all the 32-bit auxv entries

Use source struct size not the destination struct size so we copy all
the auxv entries, not just the first half of them.

Fix a style issue on an adjacent line.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42200

(cherry picked from commit 8f06fabe39ac3ebca4ab448a456945008305a23f)

7 months agolibprocstat: make sv_name not static
Brooks Davis [Thu, 26 Oct 2023 20:38:41 +0000 (21:38 +0100)]
libprocstat: make sv_name not static

Making this variable static makes is_elf32_sysctl() and callers thread
unsafe.

Use a less absurd length for sv_name.  The longest name in the system is
"FreeBSD ELF64 V2" which tips the scales at 16+1 bytes.  We'll almost
certainly have other problems if we exceed 32 characters.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42199

(cherry picked from commit 72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140)

7 months agolibprocstat: simplify auxv value conversion
Brooks Davis [Thu, 26 Oct 2023 20:38:41 +0000 (21:38 +0100)]
libprocstat: simplify auxv value conversion

Avoid a weird dance through the union and treat all 32-bit values as
unsigned integers.  This avoids sign extension of flags and userspace
pointers.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42198

(cherry picked from commit 9735cc0e41825bb9e95d16433d381ffe4c190f38)

7 months agolibprocstat: style: space after switch
Brooks Davis [Thu, 26 Oct 2023 20:38:40 +0000 (21:38 +0100)]
libprocstat: style: space after switch

Style demands a space after the switch keyword.

Noticed reviewing code in CheriBSD that propagated the style bug.

Reported by: markj
Sponsored by: DARPA
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D42041

(cherry picked from commit ccac440f7cbb013de41aa3933f3f7be77225c44f)

7 months agoRegen
Konstantin Belousov [Thu, 26 Oct 2023 04:06:56 +0000 (07:06 +0300)]
Regen

7 months agoAdd membarrier(2)
Konstantin Belousov [Thu, 7 Oct 2021 21:10:07 +0000 (00:10 +0300)]
Add membarrier(2)

(cherry picked from commit 4a69fc16a583face922319c476f3e739d9ce9140)

7 months agoAdd cpu_sync_core()
Konstantin Belousov [Thu, 7 Oct 2021 21:57:55 +0000 (00:57 +0300)]
Add cpu_sync_core()

(cherry picked from commit 74ccb8ecf6c115a79f008bc32d4981f1126b63a8)

7 months agoadd pmap_active_cpus()
Konstantin Belousov [Thu, 7 Oct 2021 22:25:54 +0000 (01:25 +0300)]
add pmap_active_cpus()

(cherry picked from commit 8882b7852acf2588d87ccb6d4c6bf7694511fc56)

7 months agomakesyscall: Stop generating $FreeBSD$
Warner Losh [Fri, 9 Jun 2023 13:26:07 +0000 (07:26 -0600)]
makesyscall: Stop generating $FreeBSD$

With 14 coming, we no longer need to generate the $FreeBSD$. We can
likely MFC that to 13 as well.

MFC After: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39879

(cherry picked from commit 61fe63f698148f8d63fe6f366c5e20bc7ad60b87)

7 months agomakesyscalls.lua: Minor fluff removal
Warner Losh [Thu, 20 Apr 2023 22:16:16 +0000 (16:16 -0600)]
makesyscalls.lua: Minor fluff removal

luacheck pointed out two minor issues: line isn't declared as a global,
so declare it local. Also remove an unused parameter.

Suggested by: kevans
Sponsored by: Netflix

(cherry picked from commit c1e987e0624ebf509a6d86099dd47ae6d72a8c03)

7 months agomakesyscalls.lua: Make more luaish
Warner Losh [Thu, 20 Apr 2023 22:15:57 +0000 (16:15 -0600)]
makesyscalls.lua: Make more luaish

x["y"] can be written as x.y, which looks better and is a more typical
lua idiom.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D39709

(cherry picked from commit 1dd350fce0aad85c559b962654f71d1449f21727)

7 months agoacpi_pcib: Rename decoded_bus_range to get_decoded_bus_range
John Baldwin [Fri, 20 Oct 2023 21:53:49 +0000 (14:53 -0700)]
acpi_pcib: Rename decoded_bus_range to get_decoded_bus_range

While here, change the return value to bool.

Discussed by: gibbs

(cherry picked from commit f6c2774fe415f3b79c551b8075c159d6a7d4d0bf)

7 months agox86: Cosmetic cleanups to struct msi_intsrc
John Baldwin [Fri, 20 Oct 2023 21:53:05 +0000 (14:53 -0700)]
x86: Cosmetic cleanups to struct msi_intsrc

- Sort members by size.

- Change msi_msix from a u_int to a bool.

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

(cherry picked from commit bfccb4a429795954cfeca4ba60a07c0e1ec35e07)

7 months agox86 msi: Enable/disable IDT vectors for MSI groups all at once
John Baldwin [Fri, 20 Oct 2023 21:52:38 +0000 (14:52 -0700)]
x86 msi: Enable/disable IDT vectors for MSI groups all at once

Unlike MSI-X, when a device uses multiple MSI interrupts, the entire
group of interrupts are enabled/disabled at once in the relevant PCI
config register.  Currently, the interrupt code enables the IDT vector
for each MSI interrupt when a handler is first registered.  If the PCI
device triggers an MSI interrupt which doesn't yet have a handler,
this can trigger a panic when the Xrsvd ISR executes rather than
treating it as a stray device interrupt.

To fix, enable all the IDT vectors for an MSI group when the first
interrupt handler is configured, and don't disable the IDT vectors
until the last interrupt handler for the group is torn down.

When migrating an MSI group between CPUs, enable/disable the entire
group of IDT vectors if at least one interrupt handler is configured
for the group.

Reported by: jhay
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D42232

(cherry picked from commit 2d4924892144f653a7a7afba27ed1bf536dd7e51)

7 months agoacpi_pcib: Trust decoded bus range from _CRS over _BBN
John Baldwin [Mon, 16 Oct 2023 22:19:07 +0000 (15:19 -0700)]
acpi_pcib: Trust decoded bus range from _CRS over _BBN

Currently if _BBN doesn't match the first bus in the decoded bus range
from _CRS for a Host to PCI bridge, the driver fails to attach as a
defensive measure.

There is now firmware in the field where these do not match, and the
_BBN values are clearly wrong, so rather than failing attach, trust
the range from _CRS over _BBN.

Co-authored-by: Justin Gibbs <gibbs@FreeBSD.org>
Reported by: gibbs
Reviewed by: imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D42231

(cherry picked from commit 22a6678b627b39ceb94f7323be1010e928d92494)

7 months agobhyve: Replace many fprintf(stderr, ...) calls with EPRINTLN
John Baldwin [Mon, 16 Oct 2023 22:17:48 +0000 (15:17 -0700)]
bhyve: Replace many fprintf(stderr, ...) calls with EPRINTLN

EPRINTLN handles newlines appropriately when stdout/stderr have been
reused as the backend for a serial port.

For bhyverun.c itself, the rule this attempts to follow is to use
regular fprintf/perror/warn/err prior to init_pci() (which is when
serial ports are configured) and to switch to EPRINTLN afterwards.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D42182

(cherry picked from commit b0936440b8fcee523c0b26fdbbef7c3b2b5098bf)

7 months agobhyve ahci: Replace WPRINTF with EPRINTLN
John Baldwin [Fri, 13 Oct 2023 19:26:58 +0000 (12:26 -0700)]
bhyve ahci: Replace WPRINTF with EPRINTLN

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

(cherry picked from commit edd2a9b887864d07ac5af480b4b8f35cb76443f6)

7 months agobhyve: Some fwctl simplifications.
John Baldwin [Fri, 13 Oct 2023 19:26:22 +0000 (12:26 -0700)]
bhyve: Some fwctl simplifications.

- Collapse IDENT_SEND/IDENT_WAIT states down to a single state.

- Remove unused 'len' argument to op_data callback.  The value passed
  in (total amount of remaining data to receive) didn't seem very useful
  and no op_data implementations used it.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D41286

(cherry picked from commit f0852344e7abf4d74508185e67a1b98d6cdbd026)

7 months agobhyve: Document the hw.vmm.maxcpu tunable and the current limit on vCPUs
Yuri Pankov [Thu, 12 Oct 2023 19:49:47 +0000 (12:49 -0700)]
bhyve: Document the hw.vmm.maxcpu tunable and the current limit on vCPUs

Reviewed by: corvink (original version)
Co-authored-by: John Baldwin <jhb@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D40074

(cherry picked from commit da202b0fe616e9314739f01493ae310e37a36d8d)

7 months agoamd64: Remove a stale comment from cpu_setregs
John Baldwin [Wed, 11 Oct 2023 21:22:17 +0000 (14:22 -0700)]
amd64: Remove a stale comment from cpu_setregs

Reviewed by: kib, markj, emaste
Differential Revision: https://reviews.freebsd.org/D42134

(cherry picked from commit e839ebfc0dc5851d383ac38740f32e96f7bd5186)

7 months agoriscv: Tidy panic messages for exceptions
John Baldwin [Wed, 11 Oct 2023 21:21:12 +0000 (14:21 -0700)]
riscv: Tidy panic messages for exceptions

- Remove trailing newlines

- Be consistent about the format used to print pointer values

- Print the trap value for access faults (it is the faulting address
  if non-zero) and illegal instructions (it is the first N bytes of
  the decoded instruction if non-zero)

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D41786

(cherry picked from commit ff79f35bdae5742f4e56e1dc18fffc5d9ea98876)

7 months agoTrim various $FreeBSD$
John Baldwin [Tue, 10 Oct 2023 17:34:43 +0000 (10:34 -0700)]
Trim various $FreeBSD$

Approved by: markj (cddl/contrib changes)
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41961

(cherry picked from commit f53355131f65d64e7643d734dbcd4fb2a5de20ed)

7 months agosendmail: Drop $FreeBSD$ from .mc files
John Baldwin [Mon, 25 Sep 2023 14:56:02 +0000 (07:56 -0700)]
sendmail: Drop $FreeBSD$ from .mc files

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

(cherry picked from commit 3aaa7724d68fb001ca3c7e75950edcb617aaeb65)

7 months agoUpdate a few tools to not embed $FreeBSD$ in generated files
John Baldwin [Mon, 25 Sep 2023 14:55:43 +0000 (07:55 -0700)]
Update a few tools to not embed $FreeBSD$ in generated files

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

(cherry picked from commit c4e2333cb2a59e44004d824a1093d9bf1d9fe273)

7 months agopowerpc/generate-hfs.sh: Don't include $FreeBSD$ in prefix to uuencoded image
John Baldwin [Mon, 25 Sep 2023 14:55:18 +0000 (07:55 -0700)]
powerpc/generate-hfs.sh: Don't include $FreeBSD$ in prefix to uuencoded image

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

(cherry picked from commit 5919ab299160e6d330bfd8bacf7bd1c5ad8cabb9)

7 months agoPurge more stray embedded $FreeBSD$ strings
John Baldwin [Mon, 25 Sep 2023 14:54:56 +0000 (07:54 -0700)]
Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

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

(cherry picked from commit eba230afba4932f02a1ca44efc797cf7499a5cb0)

7 months agolpr: Remove now unused fallback definition for __FBSDID
John Baldwin [Mon, 25 Sep 2023 14:50:33 +0000 (07:50 -0700)]
lpr: Remove now unused fallback definition for __FBSDID

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

(cherry picked from commit e4c68414d0854b5e43dfd1b2b0cfbc295702e831)

7 months agoUpdate a couple of tools to not embed __FBSDID in generated files
John Baldwin [Mon, 25 Sep 2023 14:50:11 +0000 (07:50 -0700)]
Update a couple of tools to not embed __FBSDID in generated files

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

(cherry picked from commit 99159b076a278d1feb0e18ae99fd866c90443893)

7 months agoRemove a few more stray __FBSDID uses
John Baldwin [Mon, 25 Sep 2023 14:49:52 +0000 (07:49 -0700)]
Remove a few more stray __FBSDID uses

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

(cherry picked from commit 16837d353cdde87672d08112610e51e4121c4e50)

7 months agovideomode: Regenerate files
John Baldwin [Mon, 25 Sep 2023 14:49:30 +0000 (07:49 -0700)]
videomode: Regenerate files

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

(cherry picked from commit fc3cc652e500bd8e33b4b77449d167f1df073acb)

7 months agovideomode/devlist2h.awk: Don't include $FreeBSD$ in generated files
John Baldwin [Mon, 25 Sep 2023 14:46:53 +0000 (07:46 -0700)]
videomode/devlist2h.awk: Don't include $FreeBSD$ in generated files

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

(cherry picked from commit bd524e2ddb77e1c691f308359ab917414ecb8bed)

7 months agomake_*_driver.sh: Don't include $FreeBSD$ in generated files
John Baldwin [Mon, 25 Sep 2023 14:46:09 +0000 (07:46 -0700)]
make_*_driver.sh: Don't include $FreeBSD$ in generated files

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

(cherry picked from commit 97232e04ca07dffeef629c1628f1cc95f062b41a)

7 months agofactor: Remove an empty #ifdef __FBSDID clause
John Baldwin [Sat, 23 Sep 2023 21:49:11 +0000 (14:49 -0700)]
factor: Remove an empty #ifdef __FBSDID clause

(cherry picked from commit f2f73fa7bd4b24c22ced0ff4566e03115dc9cb5f)

7 months agoifconfig/ifvlan.c: Whitespace fix
John Baldwin [Sat, 23 Sep 2023 20:27:49 +0000 (13:27 -0700)]
ifconfig/ifvlan.c: Whitespace fix

(cherry picked from commit 701468baa415c7d563d1ad28d3133d0a976908e6)

7 months agoRevert "socket tests: Add a regression test for ktrace+recv(MSG_TRUNC)"
Mark Johnston [Tue, 24 Oct 2023 18:03:49 +0000 (14:03 -0400)]
Revert "socket tests: Add a regression test for ktrace+recv(MSG_TRUNC)"

This reverts commit f5a9a849e9034c597c2b0a9014673a44834b9516.

This test will require extra work to port to stable/13.

7 months agoRevert "socket tests: Build fix"
Mark Johnston [Tue, 24 Oct 2023 18:03:23 +0000 (14:03 -0400)]
Revert "socket tests: Build fix"

This reverts commit 1b07f630c11ccf899612a7d02777fe0855e3bb25.

This test will require extra work to port to stable/13.

7 months agosocket tests: Build fix
Mark Johnston [Tue, 17 Oct 2023 14:21:32 +0000 (10:21 -0400)]
socket tests: Build fix

Fixes: d8735eb7acc0 ("socket tests: Add a regression test for ktrace+recv(MSG_TRUNC)")
Reported by: Jenkins

(cherry picked from commit 4bd1e19684945aa1fd3397b58613f5210fda9091)

7 months agobhyve: Use VMIO_SIOCSIFFLAGS instead of SIOCGIFFLAGS
Jan Bramkamp [Mon, 4 Sep 2023 08:38:25 +0000 (10:38 +0200)]
bhyve: Use VMIO_SIOCSIFFLAGS instead of SIOCGIFFLAGS

Creating an IP socket to invoke the SIOCGIFFLAGS ioctl on is the only
thing preventing bhyve from working inside a bhyve jail with IPv4 and
IPv6 disabled restricting the jailed bhyve process to only access the
host network via a tap/vmnet device node.

PR: 273557
Fixes: 56be282bc999 ("bhyve: net_backends, automatically IFF_UP tap devices")
Reviewed by: markj
MFC after: 1 week

(cherry picked from commit fd8b9c73a5a63a7aa438a73951d7a535b4f25d9a)

7 months agouiomove: Add some assertions
Mark Johnston [Mon, 16 Oct 2023 20:12:37 +0000 (16:12 -0400)]
uiomove: Add some assertions

Make sure that we don't try to copy with a negative resid.

Make sure that we don't walk off the end of the iovec array.

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

(cherry picked from commit 8fd0ec53deaad34383d4b344714b74d67105b258)

7 months agosocket tests: Add a regression test for ktrace+recv(MSG_TRUNC)
Mark Johnston [Mon, 16 Oct 2023 22:23:36 +0000 (18:23 -0400)]
socket tests: Add a regression test for ktrace+recv(MSG_TRUNC)

MFC after: 1 week

(cherry picked from commit d8735eb7acc0613fd19f74a49d3bdcb7ed0e9b0e)

7 months agosocket tests: Clean up the MSG_TRUNC regression tests a bit
Mark Johnston [Mon, 16 Oct 2023 21:35:07 +0000 (17:35 -0400)]
socket tests: Clean up the MSG_TRUNC regression tests a bit

- Fix style.
- Move test case-specific code out of the shared function and into the
  individual test cases.
- Remove unneeded setting of SO_REUSEPORT.
- Avoid unnecessary copying.
- Use ATF_REQUIRE* instead of ATF_CHECK*.  The former cause test
  execution to stop after a failed assertion, which is what we want.
- Add a test case for AF_LOCAL/SOCK_SEQPACKET sockets.

MFC after: 1 week

(cherry picked from commit b5e7dbac756afb49c58315c7081737b34a1d2dfd)

7 months agogeom_linux_lvm: Avoid removing from vg_list before inserting
Mark Johnston [Tue, 17 Oct 2023 14:25:38 +0000 (10:25 -0400)]
geom_linux_lvm: Avoid removing from vg_list before inserting

PR: 266693
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 1 week

(cherry picked from commit 56279238b03a0ccef245b22fff7679fe35cffccc)

7 months agondp: fix timestamp display output
R. Christian McDonald [Tue, 17 Oct 2023 16:57:22 +0000 (18:57 +0200)]
ndp: fix timestamp display output

The current xo_format string is incorrect. This restores the display
format prior to libxo-ification work while also explicitly marking
tv_sec and tv_usec as encoded output only.

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

(cherry picked from commit 2bb78b46e02413483409fe73244995524b838b6e)

7 months agox86: Prefer consistent naming for loader tunables
Zhenlei Huang [Tue, 17 Oct 2023 07:05:25 +0000 (15:05 +0800)]
x86: Prefer consistent naming for loader tunables

The following loader tunables do have corresponding sysctl MIBs but
with inconsistent naming. That may be historical reason. Let's prefer
consistent naming for them so that it will be easier to maintain.

 1. hw.dmar.timeout -> hw.iommu.dmar.timeout
 2. hw.lapic_eoi_suppression -> hw.apic.eoi_suppression
 3. hw.lapic_tsc_deadline -> hw.apic.timer_tsc_deadline
 4. hw.x2apic_enable -> hw.apic.x2apic_mode

Those tunables are for field debugging, no need to keep old names for
compatibility.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42248

(cherry picked from commit 12cce5994b92f8235f379d660ccb28da8e69f55b)
(cherry picked from commit 6cd7e3d118f247a8f6bc0f8162a9cb67155b7c76)

7 months agoamd64 pmap: Prefer consistent naming for loader tunable
Zhenlei Huang [Fri, 20 Oct 2023 07:31:44 +0000 (15:31 +0800)]
amd64 pmap: Prefer consistent naming for loader tunable

The sysctl knob 'vm.pmap.allow_2m_x_ept' is loader tunable and have
public document entry in security(7) but is fetched from kernel
environment 'hw.allow_2m_x_ept'. That is inconsistent and obscure.

As there is public security advisory FreeBSD-SA-19:25.mcepsc [1],
people may refer to it and use 'hw.allow_2m_x_ept', let's keep old
name for compatibility.

[1] https://www.freebsd.org/security/advisories/FreeBSD-SA-19:25.mcepsc.asc

Reviewed by: kib
Fixes: c08973d09c95 Workaround for Intel SKL002/SKL012S errata
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42311

(cherry picked from commit 9e7f349ff10691c2e3fb03898dbc942794a47566)
(cherry picked from commit 8784b153a31fc0b3a12449a2f0377eb038e6fb7b)

7 months agovmx: Prefer consistent naming for loader tunables
Zhenlei Huang [Thu, 19 Oct 2023 17:18:25 +0000 (01:18 +0800)]
vmx: Prefer consistent naming for loader tunables

The following loader tunables do have corresponding sysctl MIBs but
with different names. That may be historical reason. Let's prefer
consistent naming for them so that it will be easier to read and
maintain.

 1. hw.vmm.l1d_flush -> hw.vmm.vmx.l1d_flush
 2. hw.vmm.l1d_flush_sw -> hw.vmm.vmx.l1d_flush_sw
 3. hw.vmm.vmx.use_apic_pir -> hw.vmm.vmx.cap.posted_interrupts
 4. hw.vmm.vmx.use_apic_vid -> hw.vmm.vmx.cap.virtual_interrupt_delivery
 5. hw.vmm.vmx.use_tpr_shadowing -> hw.vmm.vmx.cap.tpr_shadowing

Old names are kept for compatibility.

Meanwhile, add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will
report them correctly.

Reviewed by: corvink, jhb, kib, #bhyve
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D42251

(cherry picked from commit f3ff0918ffcdbcb4c39175f3f9be70999edb14e8)
(cherry picked from commit 9e48b627aed346bf5e950134a581218d3097eb7c)

7 months agoautomount(8): when flushing autofs, specify fsid
Konstantin Belousov [Fri, 29 Sep 2023 18:43:42 +0000 (21:43 +0300)]
automount(8): when flushing autofs, specify fsid

PR: 272446

(cherry picked from commit 56c44bd92efa002b2185445878fc98172ae8c66f)

7 months agoautomount: check for mounted-over autofs instances on flush
Andrew Gierth [Mon, 10 Jul 2023 15:09:56 +0000 (16:09 +0100)]
automount: check for mounted-over autofs instances on flush

PR: 272446

(cherry picked from commit 21b8e363c4eb24c0a5659101603cc08a86d87759)

7 months agonmount(MNT_UPDATE): add optional generid fsid parameter
Konstantin Belousov [Fri, 29 Sep 2023 18:42:50 +0000 (21:42 +0300)]
nmount(MNT_UPDATE): add optional generid fsid parameter

(cherry picked from commit 9ef7a491a4236810e50f0a2ee8d52f5c4bb02c64)

7 months agofreebsd-update: create deep BEs by default
Kyle Evans [Thu, 12 Oct 2023 02:51:07 +0000 (21:51 -0500)]
freebsd-update: create deep BEs by default

The -r flag to bectl needs to go away, and we need to just do the right
thing.  In the meantime, we can apply an -r in freebsd-update as a
minimal fix to stop creating partial backups in these (non-default) deep
BE setups.

PR: 267535
(cherry picked from commit 989c5f6da99081b1f2b76ec09e91078e531e1250)

7 months agopmap: Prefer consistent naming for loader tunable
Zhenlei Huang [Thu, 19 Oct 2023 17:00:31 +0000 (01:00 +0800)]
pmap: Prefer consistent naming for loader tunable

The sysctl knob 'vm.pmap.pv_entry_max' becomes a loader tunable since
7ff48af7040f (Allow a specific setting for pv entries) but is fetched
from system environment 'vm.pmap.pv_entries'. That is inconsistent and
obscure.

This reverts 36e1b9702e21 (Correct the tunable name in the message).

PR: 231577
Reviewed by: jhibbits, alc, kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42274

(cherry picked from commit 02320f64209563e35fa371fc5eac94067f688f7f)
(cherry picked from commit e53f8ca323e8e563d4b55883fc3544bea75aab29)

7 months agoveriexec: Correctly export symbols
Zhenlei Huang [Sun, 15 Oct 2023 14:29:18 +0000 (22:29 +0800)]
veriexec: Correctly export symbols

There's no symbol named 'mac_veriexec_get_executable_flags', the right
one should be the function 'mac_veriexec_metadata_get_executable_flags()'.

Reviewed by: stevek
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42133

(cherry picked from commit f34c9c4e3bdc2b8bffae4ac26897e0e847e9f76f)
(cherry picked from commit d8aaf09792338fae07b9618665ea9612b7b92a6e)

7 months agoamd64: Fix two typos of loader tunables
Zhenlei Huang [Thu, 19 Oct 2023 15:23:33 +0000 (23:23 +0800)]
amd64: Fix two typos of loader tunables

To match the sysctl MIBs and document entries in security(7).

Fixes: 2dec2b4a34b4 amd64: flush L1 data cache on syscall return with an error
Fixes: 17edf152e556 Control for Special Register Buffer Data Sampling mitigation

Reviewed by: kib
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D42249

(cherry picked from commit afbb8041a0633c97acb51ac895c9ae3cde4fe540)
(cherry picked from commit 032a0b44541ffb669a4553105c6f6343ab4e3a67)

7 months agokasan.9: Mention the loader tunable 'debug.kasan.disable'
Zhenlei Huang [Fri, 13 Oct 2023 14:42:34 +0000 (22:42 +0800)]
kasan.9: Mention the loader tunable 'debug.kasan.disable'

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

(cherry picked from commit 2df97575088d2efe71d6ee136a677cf50249f96d)
(cherry picked from commit c878532881d639ff50fded05bca37595d8b9d00d)

7 months agoteken: fix style in teken_wcwidth.h
Christos Margiolis [Fri, 13 Oct 2023 05:14:57 +0000 (08:14 +0300)]
teken: fix style in teken_wcwidth.h

Reviewed by: bojan.novkovic_fer.hr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42164

(cherry picked from commit 90367ba750bcbf3f9ac4609c3ec8df4ab95a22af)

7 months agotty/teken: fix UTF8 sequence validation logic
Bojan Novković [Fri, 13 Oct 2023 05:14:36 +0000 (08:14 +0300)]
tty/teken: fix UTF8 sequence validation logic

This patch fixes UTF-8 sequence validation logic in
teken_utf8_bytes_to_codepoint() and fixes fallback behaviour in
ttydisc_rubchar() when an invalid UTF8 sequence is encountered. The code
previously used __bitcount() to extract sequence length information from
the leading byte. However, this assumption breaks for certain code
points that have additional bits set in the first half of the leading
byte (e.g. Cyrillic characters). This lead to incorrect behaviour when
deleting those characters using backspaces. The code now checks the
number of consecutive set bits in the leading byte starting from the
MSB, as per RFC 3629.

Reviewed by: christos
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42147

(cherry picked from commit 2fed1c579c52d63b72fc08ffcc652ba0183f9254)

7 months agoteken: fix up unused func warnings
Mateusz Guzik [Sun, 8 Oct 2023 13:54:11 +0000 (13:54 +0000)]
teken: fix up unused func warnings

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

(cherry picked from commit 4b9aa38ef0e5bedcdd90b6627cc1c215037a1121)

7 months agoteken: use __bitcount() instead of bitcount()
Christos Margiolis [Sat, 7 Oct 2023 21:36:59 +0000 (00:36 +0300)]
teken: use __bitcount() instead of bitcount()

The use of bitcount() triggered a build error because it couldn't be
located. __bitcount() on the other hand is defined in sys/types.h, which
is included in teken/teken.h.

MFC after: 2 weeks

(cherry picked from commit 6d3296f16a06bcaa49918799e683936711dcf9c9)

7 months agotty: fix improper backspace behaviour for UTF8 characters when in canonical mode
Bojan Novković [Sat, 7 Oct 2023 18:00:11 +0000 (21:00 +0300)]
tty: fix improper backspace behaviour for UTF8 characters when in canonical mode

This patch adds additional logic in ttydisc_rubchar() to properly handle
backspace behaviour for UTF-8 characters.

Currently, typing in a backspace after a UTF8 character will delete only
one byte from the byte sequence, leaving garbled output in the tty's
output queue. With this change all of the character's bytes are deleted.
This change is only active when the IUTF8 flag is set (see
19054eb6053189144aa962b2ecc1bf5087758a3e "(s)tty: add support for IUTF8
input flag")

The code uses the teken_wcwidth() function to properly handle character
column widths for different code points, and adds the
teken_utf8_bytes_to_codepoint() function that converts a UTF-8 byte
sequence to a codepoint, as specified in RFC3629.

Reported by:    christos
Reviewed by:    christos, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D42067

(cherry picked from commit 9e589b0938579f3f4d89fa5c051f845bf754184d)

7 months ago(s)tty: add support for IUTF8 input flag
Bojan Novković [Sat, 7 Oct 2023 17:59:57 +0000 (20:59 +0300)]
(s)tty: add support for IUTF8 input flag

This patch adds the necessary kernel and stty code to support setting
the IUTF8 flag for ttys. It is the first of two patches that fix
backspace behaviour for UTF-8 encoded characters when in canonical mode.

Reported by: christos
Reviewed by: christos, imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42066

(cherry picked from commit 128f63cedc14ae21b35f74e11e2fe1a5659c58e8)

7 months agoktrace: Handle uio_resid underflow via MSG_TRUNC
Mark Johnston [Mon, 16 Oct 2023 20:11:55 +0000 (16:11 -0400)]
ktrace: Handle uio_resid underflow via MSG_TRUNC

When recvmsg(2) is used with MSG_TRUNC on an atomic socket type (DGRAM
or SEQPACKET), soreceive_generic() and uipc_peek_dgram() may
intentionally underflow uio_resid so that userspace can find out how
many bytes it should have asked for.

If this happens, and KTR_GENIO is enabled, ktrgenio() will attempt to
copy in beyond the end of the output buffer's iovec.  In general this
will silently cause the ktrace operation to fail since it'll result in
EFAULT from uiomove().  Let's be more careful and make sure not to try
and copy more bytes than we have.

Fixes: be1f485d7d6b ("sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg().")
Reported by: syzbot+30b4bb0c0bc0f53ac198@syzkaller.appspotmail.com
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42099

(cherry picked from commit 761ae1ce798add862d78728cc5ac5240ce7db779)

7 months agoarm64, risvc: warn about ignored kstack_pages for thread0
Konstantin Belousov [Wed, 11 Oct 2023 18:56:28 +0000 (21:56 +0300)]
arm64, risvc: warn about ignored kstack_pages for thread0

(cherry picked from commit 6aa641b71d0dd1b26674f0b6dba086410f643595)

7 months agoarm64: do not disable the kern.kstack_pages tunable on arm64
Konstantin Belousov [Tue, 10 Oct 2023 00:02:06 +0000 (03:02 +0300)]
arm64: do not disable the kern.kstack_pages tunable on arm64

(cherry picked from commit 39cddbd7a07c182c4f121bea5a6effa36862fc63)

7 months agoarm64, riscv: Use KSTACK_PAGES for the thread0 kstack size designator
Konstantin Belousov [Mon, 9 Oct 2023 23:56:37 +0000 (02:56 +0300)]
arm64, riscv: Use KSTACK_PAGES for the thread0 kstack size designator

(cherry picked from commit ac63f7534d0102352bf993ebe2c748ce2ffd432e)

7 months agoarm64 locore.S: fix typos
Konstantin Belousov [Mon, 9 Oct 2023 23:55:45 +0000 (02:55 +0300)]
arm64 locore.S: fix typos

(cherry picked from commit 4095e0bcb9e8fac51eedad89211a5b16af7f55ad)

7 months agoHyper-V: vmbus: check if signaling host is needed in vmbus_rxbr_read
Wei Hu [Fri, 20 Oct 2023 08:58:20 +0000 (08:58 +0000)]
Hyper-V: vmbus: check if signaling host is needed in vmbus_rxbr_read

It is observed that netvsc's send rings could stall on the latest
Azure Boost platforms. This is due to vmbus_rxbr_read() routine
doesn't check if host is waiting for more room to put data, which
leads to host side sleeping forever on this vmbus channel. The
problem was only observed on the latest platform because the host
requests larger buffer ring room to be available, which causes
the issue to happen much more easily.

Fix this by adding check in the vmbus_rxbr_read call and signaling
the host in the callers if check returns positively.

Reported by: NetApp
Tested by: whu
Sponsored by: Microsoft

(cherry picked from commit 49fa9a64372b087cfd66459a20f4ffd25464b6a3)

7 months agoarm64/compat32: Fix handling of 32bits FP registers.
Olivier Houchard [Mon, 16 Oct 2023 20:18:24 +0000 (22:18 +0200)]
arm64/compat32: Fix handling of 32bits FP registers.

We must consider the aarch32 FP registers as 16 128bits registers, and store
that as the first 16 aarch64 FP registers.

PR: 267788

(cherry picked from commit ccd0f34d8585cba727dd17a381309855af655b82)
(cherry picked from commit 0e0a03c792542a2509702378559622efafc86548)

7 months agovm_phys: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:49 +0000 (18:14 +0800)]
vm_phys: Add corresponding sysctl knob for loader tunable

The loader tunable 'vm.numa.disabled' does not have corresponding sysctl
MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also
report it correctly.

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

(cherry picked from commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5)
(cherry picked from commit e26b7e8d02f648623ad343016533487634a16698)

7 months agovm_page: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:49 +0000 (18:14 +0800)]
vm_page: Add corresponding sysctl knob for loader tunable

The loader tunable 'vm.pgcache_zone_max_pcpu' does not have corresponding
sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T`
will also report it correctly.

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

(cherry picked from commit a55fbda874db31b804490567c69502c891b6ff61)
(cherry picked from commit cb5bc8a748dfefc68e3905e8fdf17e0484844383)

7 months agokasan: Add corresponding sysctl knob for loader tunable
Zhenlei Huang [Thu, 12 Oct 2023 10:14:48 +0000 (18:14 +0800)]
kasan: Add corresponding sysctl knob for loader tunable

The loader tunable 'debug.kasan.disabled' does not have corresponding
sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T`
will also report it correctly.

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

(cherry picked from commit db5d0bc868be669ed6588ebeccf8c02e76aabc41)
(cherry picked from commit 6f8ef4d6e44ee27a08c14ab6a892ffccf332bcf7)

7 months agouma.h: Fix a typo in a source code comment
Gordon Bergling [Sun, 15 Oct 2023 12:09:21 +0000 (14:09 +0200)]
uma.h: Fix a typo in a source code comment

- s/setable/settable/

(cherry picked from commit fc9f1d2c6391b1a4b133aab56ace625b72c9ea85)

7 months agoMFC: Remove confDH_PARAMETERS settings in favor of using sendmail's
Gregory Neil Shapiro [Fri, 18 Aug 2023 00:32:56 +0000 (00:32 +0000)]
MFC: Remove confDH_PARAMETERS settings in favor of using sendmail's
built-in default which was added in sendmail 8.15.2 (the config
line predates that 8.15.2 feature).  This also alleviates the need
for admins to create the DH parameters file if they opt to use
Diffie-Hellman.

PR: 248387

(cherry picked from commit 98fd1add676321978db72d77d34ef51ca454c814)

7 months agoptsname.3: accommodate upcoming POSIX Issue 8 ptsname_r
Ed Maste [Fri, 13 Oct 2023 20:25:53 +0000 (16:25 -0400)]
ptsname.3: accommodate upcoming POSIX Issue 8 ptsname_r

POSIX has accepted a proposal[1] to add glibc-compatible ptsname_r.  It
indicates an error by returning the error number, rather than returning
-1 and setting errno.  Update RETURN VALUES in ptsname_r's man page now
to encourage folks to test that the return value != 0 rather than == -1.

[1] https://www.austingroupbugs.net/bug_view_page.php?bug_id=508

Reported by: Collin Funk
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42204

(cherry picked from commit a5ed6a815e38d6c622cd97a6020592ded579cf7a)