Commit Graph

267157 Commits

Author SHA1 Message Date
Ed Maste
7cc6e39cb6 Do not build libatf-c++ when WITHOUT_CXX
libatf-c++ requires C++ support.

From jrtc27: bit slightly odd this isn't gated by MK_TESTS (which itself
depends on MK_CXX), but this makes sense given the current behaviour.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32732

(cherry picked from commit 6ce99625ca)
2021-11-29 10:10:53 -05:00
Ed Maste
8bb7b159b5 src.opts.mk: Add WITHOUT_CXX dependencies
OFED, OPENMP, and PMC depend on C++ support.  Force them off when
building WITHOUT_CXX.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32730

(cherry picked from commit 0e1c864898)
2021-11-29 10:10:53 -05:00
Ed Maste
8f02234dbd Don't build sanitizer runtimes under WITHOUT_CXX
In the past we built the sanitizer runtimes when building Clang
(and using Clang as the compiler) but 7676b388ad changed this to
be conditional only on using Clang, to make the runtimes available
for external Clang.

They fail to build when WITHOUT_CXX is set though, so add MK_CXX
as part of the condition.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Fixes:		7676b388ad ("Always build the sanitizer runtimes...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32731

(cherry picked from commit ad09e2c8cf)
2021-11-29 10:10:53 -05:00
Kristof Provost
9bb3c824f5 net tests: basic if_gif(4) test case
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32836

(cherry picked from commit 6e0755b37b)
2021-11-29 15:44:40 +01:00
Kristof Provost
60c3b9a78a if_gif: fix vnet shutdown panic
If an if_gif exists and has an address assigned inside a vnet when the
vnet is shut down we failed to clean up the address, leading to a panic
when we ip_destroy() and the V_in_ifaddrhashtbl is not empty.

This happens because of the VNET_SYS(UN)INIT order, which means we
destroy the if_gif interface before the addresses can be purged (and
if_detach() does not remove addresses, it assumes this will be done by
the stack teardown code).

Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup
operations happen in the correct order.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32835

(cherry picked from commit 8ca6c11a7c)
2021-11-29 15:44:39 +01:00
Mark Johnston
d364adc09c Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block
The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either.  Unbreak buildworld when WITHOUT_ZFS is set.

Reported by:	bz
Fixes:		9e9c651cac ("cddl: fix missing ZFS library dependencies")

(cherry picked from commit 7b3642da21)
2021-11-29 09:27:49 -05:00
Greg V
4022f3eec4 cddl: fix missing ZFS library dependencies
In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by:	freqlabs, markj

(cherry picked from commit 9e9c651cac)
2021-11-29 09:26:35 -05:00
Mark Johnston
e0cee46f58 amd64: Initialize kernel_pmap's active CPU set to all_cpus
This is in preference to simply filling the cpuset, and allows the
conditional in pmap_invalidate_cpu_mask() to be elided.

Also export pmap_invalidate_cpu_mask() outside of pmap.c for use in a
subsequent commit.

Suggested by:	kib
Reviewed by:	alc, kib
Tested by:	pho
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 71e6e9da22)
2021-11-29 09:17:08 -05:00
Mark Johnston
1556ae1356 vm_page: Remove vm_page_sbusy() and vm_page_xbusy()
They are unused today and cannot be safely used in the face of unlocked
lookup, in which pages may be busied without the object lock held.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib

(cherry picked from commit a2665158d0)
2021-11-29 09:11:37 -05:00
Mark Johnston
cb081566cf vm_page: Consolidate page busy sleep mechanisms
- Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take
  a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix
  up callers.
- Modify vm_page_busy_sleep() to return a status indicating whether the
  object lock was dropped, and fix up callers.
- Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep()
  instead.
- Remove vm_page_sleep_if_(x)busy().

No functional change intended.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib

(cherry picked from commit 87b646630c)
2021-11-29 09:11:29 -05:00
Mark Johnston
fdd27db348 vm: Add a mode to vm_object_page_remove() which skips invalid pages
This will be used to break a deadlock in ZFS between the per-mountpoint
teardown lock and page busy locks.  In particular, when purging data
from the page cache during dataset rollback, we want to avoid blocking
on the busy state of invalid pages since the busying thread may be
blocked on the teardown lock in zfs_getpages().

Add a helper, vn_pages_remove_valid(), for use by filesystems.  Bump
__FreeBSD_version so that the OpenZFS port can make use of the new
helper.

PR:		258208
Reviewed by:	avg, kib, sef
Tested by:	pho (part of a larger patch)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d28af1abf0)
2021-11-29 09:09:28 -05:00
Justin Hibbits
2949655427 Fix segment size in compressing core dumps
A core segment is bounded in size only by memory size.  On 64-bit
architectures this means a segment can be much larger than 4GB.
However, compress_chunk() takes only a u_int, clamping segment size to
4GB-1, resulting in a truncated core.  Everything else, including the
compressor internally, uses size_t, so use size_t at the boundary here.

This dates back to the original refactor back in 2015 (r279801 /
aa14e9b7).

PR:		260006
Sponsored by:	Juniper Networks, Inc.

(cherry picked from commit 63cb9308a7)
2021-11-29 09:08:11 -05:00
N.J. Mann
141f0db23e pchtherm: Let the driver be compiled into the kernel
PR:		259776

(cherry picked from commit a11983366e)
2021-11-29 09:04:16 -05:00
Rick Macklem
b61ed46880 nfsstat: Add output for counts of new RPCs to the "-E" option
Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

(cherry picked from commit 75c666197c)
2021-11-28 15:58:03 -08:00
Mateusz Piotrowski
2b890871f7 style.Makefile.5: Do not require $FreeBSD$ SCM IDs
It's no longer required to have those SCM IDs at the start of makefiles.

MFC after:	3 days

(cherry picked from commit 1ac5586c6d)
2021-11-28 17:45:08 +01:00
Mateusz Piotrowski
98ddcae346 os-release.5: Fix quoting of dots
Dots needs to escaped with \& to be places inside Ql quotes.

MFC after:	3 days

(cherry picked from commit ee7485bef5)
2021-11-28 17:42:37 +01:00
Gordon Bergling
654f47cfc0 ffs_softdep: Fix a typo in a source code comment
- s/conditonally/conditionally/

(cherry picked from commit bebff61587)
2021-11-28 12:43:32 +01:00
Gordon Bergling
18e627e9c7 ppbus(4): Fix a typo in source code comment
- s/quering/querying/

Obtained from:	NetBSD

(cherry picked from commit 975e2e3f84)
2021-11-28 12:43:11 +01:00
Gordon Bergling
43c4228c97 lpr(1): Fix a typo in a source code comment
-s /debuging/debugging/

(cherry picked from commit 840d72371b)
2021-11-28 12:42:53 +01:00
Gordon Bergling
7125ea0f15 firewire(4): Fix a typo in a source code comment
- s/unavailabe/unavailable/

(cherry picked from commit 3e5ddef0fd)
2021-11-28 12:42:33 +01:00
Gordon Bergling
f9236943e1 ixl(4): Fix a typo in a sysctl description
(cherry picked from commit d7125850f0)
2021-11-28 12:42:14 +01:00
Gordon Bergling
197f36e000 iscsi(4): Fix a typo in a source code comment
- s/conditon/condition/

(cherry picked from commit 5e21882bb4)
2021-11-28 12:41:52 +01:00
Gordon Bergling
c8f21cc79f sched_ule(4): Fix two typo in source code comments
- s/conditons/conditions/
- s/unconditonally/unconditionally/

(cherry picked from commit 15b5c347f1)
2021-11-28 12:41:11 +01:00
Gordon Bergling
03490cedbc TWL: Fix a typo in a source code comment
- s/maxium/maximum/

(cherry picked from commit 8b11850f9d)
2021-11-28 12:40:29 +01:00
Ed Maste
2104a80649 mkimg: zero entry in vhdx_write_metadata
Otherwise _reserved might contain uninitialized data.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 036af1053a)
2021-11-27 19:29:30 -05:00
Ed Maste
ee2e925603 Fix coredump_phnum test with ASLR enabled
coredump_phnum intends to generate a core file with many PT_LOAD
segments.  Previously it called mmap() in a loop with alternating
protections, relying on each mapping following the previous, to produce
a core file with many page-sized PT_LOAD segments.  With ASLR on we no
longer have this property of each mmap() following the previous.

Instead, perform a single allocation, and then use mprotect() to set
alternating pages to PROT_READ.

PR:		259970
Reported by:	lwhsu, mw
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33070

(cherry picked from commit 8ec4c5dae3)
2021-11-27 19:27:03 -05:00
Ed Maste
374f859ec0 ng_h4: add deprecation notice
It is already gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-27 19:26:38 -05:00
Andriy Gapon
f537b30564 icee: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 01e3492337)
2021-11-27 10:47:25 +02:00
Andriy Gapon
83f68b84c2 ds1307: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 27645265c4)
2021-11-27 10:44:16 +02:00
Andriy Gapon
a9f6a79b2d sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes
(cherry picked from commit e17b58ecbc)
2021-11-27 10:32:36 +02:00
Rick Macklem
0aa59ac827 pNFS: Add nfsstats counters for number of Layouts
For pNFS, Layouts are issued by the server to indicate
where a file's data resides on the DS(s).  This patch
adds counters for how many layouts are allocated to
the nfsstatsv1 structure, using two reserved fields.

(cherry picked from commit ce9676de86)
2021-11-26 18:20:16 -08:00
Alfredo Dal'Ava Junior
c41d129485 ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)
On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer
address was removed from device tree for security purposes (value is set
to zero to avoid leaking the address).

This patch works around the problem by taking framebuffer base address
from the "ranges" property of a parent node.

Reviewed by:	luporl, jhibbits (on IRC)
MFC after:	2 weeks
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D30626

(cherry picked from commit b042d10cdc)
2021-11-26 20:50:55 -03:00
Kristof Provost
9aa63a8d13 libpfct: be consistent with u_int vs. uint
Always use uint64_t over u_int64_t, for the sake of consistency.

No functional change.

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

(cherry picked from commit 7bb3c927f7)
2021-11-26 04:42:04 +01:00
Kristof Provost
029aed9281 lagg: fix unused-but-set-variable
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 3142d4f622)
2021-11-26 04:40:56 +01:00
Kristof Provost
07b8f5dca1 pf tests: basic test for ridentifier
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32751

(cherry picked from commit 508161111d)
2021-11-26 04:39:33 +01:00
Kristof Provost
cfe9b890d5 pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of
the pflog header.
The intent behind this is to allow users to correlate rules across
updates (remember that pf rules continue to exist and match existing
states, even if they're removed from the active ruleset) and pflog.

Obtained from:	pfSense
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32750

(cherry picked from commit 76c5eecc34)
2021-11-26 04:39:05 +01:00
Ed Maste
c433c96d86 Update deprecation version for drivers removed in main
Removal of the amr, esp, iir, mly and twa drivers was planned before
FreeBSD 13, but did not happen before the branch.  Update the
depreciation notices to indicate that they are gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-25 11:54:12 -05:00
Ed Maste
ab3f1b678d cloudabi: add deprecation notice in stable branches
It has been removed from main before 14.0.

Sponsored by:	The FreeBSD Foundation
2021-11-25 11:54:11 -05:00
Guangyuan Yang
3218666bd0 bridge(4): Use American spelling of "behavior"
Fixes:		8406182dbe
Reported by:	Pau Amma <pauamma@gundo.com>

(cherry picked from commit 28ba36c65d)
2021-11-25 00:01:16 -05:00
Konstantin Belousov
b0f2ca4348 kmod_syms.awk: fix removal of the export list from the symbol table
(cherry picked from commit 0d7a6199b6)
2021-11-25 03:09:21 +02:00
Konstantin Belousov
83271c68c4 Fix some modules to export more used symbols
(cherry picked from commit 5bb3134a8c)
2021-11-25 03:09:21 +02:00
Rick Macklem
f4e3699069 UPDATING: Add an entry for commit 6e8e261f0d
This is a direct commit.
2021-11-24 16:47:03 -08:00
Rick Macklem
0c8684ae20 param.h: Bump __FreeBSD_version to 1300522
Commit 6e8e261f0d changed the internal KAPI between the NFS modules.
Bump __FreeBSD_version to 1300522.

This is a direct commit.
2021-11-24 16:39:52 -08:00
Rick Macklem
6e8e261f0d nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts
If a pNFS server's DS runs out of disk space, it replies
NFSERR_NOSPC to the client doing writing.  For the Linux
client, it then sends a LayoutError RPC to the MDS server to
tell it about the error.  This patch adds the same to the
FreeBSD NFSv4.2 pNFS client, to maintain Linux compatible
behaviour, particlularily for non-FreeBSD pNFS servers.

(cherry picked from commit 44744f7538)
2021-11-24 16:32:09 -08:00
Rick Macklem
354988ca3f nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError
If a pNFS server's DS runs out of disk space, it replies
NFSERR_NOSPC to the client doing writing.  For the Linux
client, it then sends a LayoutError RPC to the MDS server to
tell it about the error and keeps retrying, doing repeated
LayoutGets to the MDS and Write RPCs to the DS.  The Linux client is
"stuck" until disk space on the DS is free'd up unless
a subsequent LayoutGet request is sent a NFSERR_NOSPC
reply.
The looping problem still occurs for NFSv4.1 mounts, but no
fix for this is known at this time.

This patch changes the pNFS MDS server to reply to LayoutGet
operations with NFSERR_NOSPC once a LayoutError reports the
problem, until the DS has available space.  This keeps the Linux
NFSv4.2 from looping.

Found during recent testing because of issues w.r.t. a DS
being out of space found during a recent IEFT NFSv4 working
group testing event.

(cherry picked from commit f8dc06303b)
2021-11-24 14:35:03 -08:00
Rick Macklem
3f539826e1 nfsd: Fix f_bavail and f_ffree for NFSv4 when negative
Since the NFS Space_available and Files_available are unsigned,
the NFSv3 server sets them to 0 when negative, so that they
do not appear to be large positive values for non-FreeBSD clients.
This patch fixes the NFSv4 server to do the same.

Found during a recent IEFT NFSv4 working group testing event.

(cherry picked from commit d70ca5b00e)
2021-11-24 14:31:55 -08:00
Ka Ho Ng
35f26bdf59 iser: Remove redundant linuxkpi MODULE_DEPEND
Since ibcore depends on linuxkpi, there is no need to pull in the
linuxkpi dependency in iser.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	trasz
Differential Revision:	https://reviews.freebsd.org/D32977

(cherry picked from commit f7523c8a19)
2021-11-24 15:17:26 -05:00
Kristof Provost
094b79ea73 pf tests: route_to:icmp_nat_head requires scapy
Document the requirement so the test is skipped if scapy is not
installed.

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

(cherry picked from commit 11703705c2)
2021-11-24 17:45:51 +01:00
Kristof Provost
576d71e383 riscv: add COMPAT_FREEBSD12 option
Turn on compat option for older FreeBSD versions (i.e. 12). We do not
enable the compat options for 11 or older because riscv was never
supported in those versions.

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

(cherry picked from commit 23e1961e78)
2021-11-24 17:45:51 +01:00
Zhenlei Huang
eaab06d53d devfs.rules: Correctly unhide pf in vnet jails
Revision 9e9be081d8 introduced a new devfs rule devfsrules_jail_vnet. It
includes rule devfsrules_jail which include other rules. Unfortunately
devfs could not recursively parse the action include and thus
devfsrules_jail_vnet will expose all nodes.

PR:		255660
Reviewed by:	kp
Obtained from:	Gijs Peskens <gijs@peskens.net>
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D32814

(cherry picked from commit 7acd322ebe)
2021-11-24 17:45:51 +01:00