Commit Graph

283289 Commits

Author SHA1 Message Date
Vitaliy Gusev
18126b647a
bhyve: use directory file descriptor for checkpoint
This is required to enable capsicum for the snapshot code.

Reviewed by:		corvink
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38858
2023-04-28 09:00:48 +02:00
Konstantin Belousov
cae85a647a efiwake(8): style
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-04-28 06:08:09 +03:00
Johannes Totz
1808b5577d Add efiwake tool
Reviewed by:	kib
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36714
2023-04-28 04:28:51 +03:00
Johannes Totz
3f3ad56520 Expose EFI wake time API
Reviewed by:	kib
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36714
2023-04-28 04:27:55 +03:00
Olivier Certner
6450e7bbad vfs: Fix "emptydir" mount option
Fix vfs_emptydir(). It would consider directories containing directories
with name of the form 'X.' (X being any authorized byte) as empty. Also,
it would cause VOP_READDIR() to return an error on directories
containing enough whiteouts. While here, use a more decently sized
buffer as done elsewhere.

Remove ad-hoc iteration on the directory's content and instead use the
newly exported vn_dir_next_dirent() function (this is what fixes the
second problem mentioned above).

PR:	270988
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39775
2023-04-28 04:27:54 +03:00
Olivier Certner
3d8450db4c vfs: vn_dir_next_dirent(): Simplify interface and harden
Simplify the old interface (one less argument, simpler termination test)
and add documentation about it. Add more sanity checks (mostly under
INVARIANTS, but also in the general case to prevent infinite
loops). Drop the explicit test on minimum directory entry size (without
INVARIANTS).

Deal with the impacts in callers (dirent_exists() and vop_stdvptocnp()).
dirent_exists() has been simplified a bit, preserving the exact same
semantics but for the return code whose meaning has been reversed (0 now
means the entry exists, ENOENT that it doesn't and other values are
genuine errors). While here, suppress gratuitous casts of malloc return
values.

vn_dir_next_dirent() has been tested by a 'make -j4 buildkernel' with a
temporary modification to the VFS cache causing vn_vptocnp() to always
call VOP_VPTOCNP() and finally vop_stdvptocnp() (observed with temporary
debug counters).

Export new _GENERIC_MINDIRSIZ and _GENERIC_MAXDIRSIZ on __BSD_VISIBLE,
and GENERIC_MINDIRSIZ and GENERIC_MAXDIRSIZ on _KERNEL.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39764
2023-04-28 04:27:54 +03:00
Olivier Certner
6bce3f23d0 vfs: Export get_next_dirent() as vn_dir_next_dirent()
Move internal-to-'vfs_default.c' get_next_dirent() to 'vfs_vnops.c' and
export it for use by other parts of the VFS. This is a preparatory
change for using it in vfs_emptydir().

No functional change.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39755
2023-04-28 04:27:54 +03:00
Ed Maste
7f6a000fce CONTRIBUTING: add intro describing the ways we accept contributions
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39854
2023-04-27 19:43:56 -04:00
Simon J. Gerraty
090e9752d7 Additions to targets/pseudo/host-tools
More tools needed to be built for Linux.
These are the ones that "just work".
2023-04-27 14:16:49 -07:00
Simon J. Gerraty
e020aa37b8 jobs.mk report JOB_ARGS log and JOB_LOG_START
At the start of a job include info such as JOB_ARGS the log location
and anything in JOB_LOG_START (eg TARGET_SPEC=${TARGET_SPEC})
2023-04-27 13:40:44 -07:00
Yuri Pankov
08ed87514f tzsetup: appease checkstyle9 2023-04-27 20:29:55 +02:00
Yuri Pankov
cfd0217aa9 tzsetup: adopt zone1970.tab changes
- assumption that single-zone countries do not have description
  is no longer correct; do not try to optimize this case as it's
  only going to make the code more confusing and we now have menus
  with a single zone selection because of this
- remove the single-country continent short cut, it also only serves
  to confuse users as we now have such a continent
- instead add a single-zone contry short cut (see above), now all
  single-zone countries fall here
- use the #@ continent overrides that zone1970.tab introduces (this is
  visible at least fixing Iceland being currently listed under Africa)
- add Arctic Ocean "continent" coming only from the overrides at the
  moment
- update baseline with the changes

Reviewed by:	bapt, philip
Differential Revision:	https://reviews.freebsd.org/D39606
2023-04-27 19:31:48 +02:00
Mark Johnston
ec45f952a2 sockbuf: Add KMSAN checks to sbappend*()
Otherwise KMSAN only detects uninitialized memory when the contents of
the buffer are copied out to userspace or transmitted to a network
interface.  At that point the KMSAN violation will be far removed from
its origin, so let's try to make debugging such problems a bit easier.

Reviewed by:	glebius
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38101
2023-04-27 12:58:56 -04:00
Eugene Grosbein
83fd35b3f3 logger(1): fix timestamps in case of long run
An example:

( echo test; sleep 2; echo test2 ) | logger -h /var/run/log

Before fix, logger assigned same timestamp to both records.

Fixes:		65547fb33d
Reported by:	Vadim Goncharov
MFC after:	1 week
2023-04-27 23:43:16 +07:00
Mark Johnston
7ee4066db1 cap_net tests: Skip tests if there is no connectivity
When testing cap_connect() and name/addr lookup functions, skip tests if
we fail and the error is not ENOTCAPABLE.  This makes the tests amenable
to running in CI without Internet connectivity.

Reviewed by:	oshogbo
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D39242
2023-04-27 09:42:36 -04:00
Guido Falsi
014e03411f bhyve: Add DEBUG_HDA_FILE define to specify location of debug output
Reviewed by:		corvink
Approved by:		corvink
Differential Revision:	https://reviews.freebsd.org/D39826
2023-04-27 15:12:55 +02:00
Guido Falsi
03d3124629 bhyve: Disable bhyve HDA debug by default.
Adapt hda_print_cmd_ctl_data() to not generate compiler warnings
when DEBUG_HDA is off.

Reviewed by:		corvink
Approved by:		corvink
Differential Revision:	https://reviews.freebsd.org/D39826
2023-04-27 15:12:45 +02:00
Kyle Evans
087a2e64ba openzfs: re-enable FPU usage on aarch64
The BLAKE3 generated assembly files have now been updated to avoid
clobbering x18, we can safely re-enable FPU usage on aarch64.
2023-04-26 19:47:14 -05:00
Tino Reichardt
42f0ac5f1b Fix BLAKE3 aarch64 assembly for FreeBSD and macOS
The x18 register isn't useable within FreeBSD kernel space, so we
have to fix the BLAKE3 aarch64 assembly for not using it.

The source files are here: https://github.com/mcmilk/BLAKE3-tests

Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #14728
2023-04-26 19:46:47 -05:00
Cheng Cui
60167184ab
siftr: remove barely used hash generation per record
Reviewers: rscheff, tuexen
Approved by: rscheff, tuexen
Subscribers: imp, melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D39835
2023-04-26 15:57:42 -04:00
Vincenzo Maffione
8c3b8c8386 netmap: pkt-gen: sync with upstream
Keep in sync with the recent upstream changes:

Fix compilation on 32-bit architectures
Update IP length, UDP length/checksum when size changes
Man page fixes

Submitted by:	jlduran@gmail.com
MFC after:	7 days
Differential Revision:	https://reviews.freebsd.org/D39760
2023-04-26 20:32:24 +00:00
John Baldwin
2d7842d0bf arp/ndp: Use valid prototypes for function declarations with no arguments. 2023-04-26 13:18:53 -07:00
Elliott Mitchell
d7e3b05b0d arm: remove passing trapframe to intr_ipi_dispatch()
This was needed before INTRNG was in place and handling the push of
curthread->td_intr_frame.  Since INTRNG now handles this, there is no
longer and need for playing around with the frame inside IPI interrupts.
2023-04-26 20:08:30 +01:00
Elliott Mitchell
c7e5e9dc41 arm: remove interrupt nesting by ipi_preempt()/ipi_hardclock()
This was needed when intr_ipi_dispatch() was called by hardware-specific
IPI interrupt routines which didn't save the trap frame.  Now all ARM
interrupts pass through INTRNG which will have already saved the trap
frame and disabled preemption.

Remove the conditional trapframe/argument passing to the handlers.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D37938
2023-04-26 20:08:30 +01:00
Mateusz Guzik
d09a955a60 zfs: Fix positive ABD size assertion in abd_verify().
This cherry-picks upstream:
commit bba7cbf0a4
Author: Alexander Motin <mav@FreeBSD.org>
Date:   Wed Apr 26 12:20:43 2023 -0400

    Fix positive ABD size assertion in abd_verify().

    Gang ABDs without childred are legal, and they do have zero size.
    For other ABD types zero size doesn't have much sense and likely
    not working correctly now.

    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by:  Alexander Motin <mav@FreeBSD.org>
    Sponsored by:   iXsystems, Inc.
    Closes #14795

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-26 18:00:36 +00:00
Ed Maste
b73183d1a2 ipv6: disable RFC 4620 nodeinfo by default
RFC 4620 is an experimental RFC that can be used to request information
about a host, including:

- the fully-qualified or single-component name
- some set of the Responder's IPv6 unicast addresses
- some set of the Responder's IPv4 unicast addresses

This is not something that should be made available by default.

PR:		257709
Submitted by:	ruben@verweg.com
Reviewed by:	melifaro
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39778
2023-04-26 13:47:59 -04:00
Kyle Evans
ce5a210997 openzfs: arm64: implement kfpu_begin/kfpu_end
This is part one of a fix for booting with ZFS on arm64 using
accelerated checksum implementations.  Checksum benchmarking will
attempt to use the FPU, so we currently panic quickly on boot.  BLAKE3
is still broken, as it clobbers x18 and we promptly discover that fact
as soon as we attempt to fetch curthread in kfpu_end().

Note that _STANDALONE is special-cased here, but ideally we wouldn't be
building the code that uses kfpu_begin()/kfpu_end() at all in the loader
environment.

Discussed with:	imp (a bit)
Differential Revision:	https://reviews.freebsd.org/D39448
2023-04-26 12:24:00 -05:00
Mark Johnston
2c0209a2ca callout: Remove an unneeded MTX_NEW
Reported by:	hselasky
Fixes:		78cfa762eb ("callout: Move per-CPU callout state into the dpcpu region")
2023-04-26 11:15:56 -04:00
Kristof Provost
a81f5112a0 pf: clear PF_TAG_ROUTE_TO for dummynet fast path
Similar to the PF_TAG_DUMMYNET we must also clear the route tag if
dummynet didn't keep the packet. In that case we'd continue immediately
and there'd be no need for the route tag. Keeping it could lead to
unexpected routing of traffic.

See also:	27407a6adc
See also:	https://redmine.pfsense.org/issues/14055
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-26 17:09:47 +02:00
Kristof Provost
9ec48bc31e pfctl: match expand_label_addr() prototype to definition
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-26 17:09:46 +02:00
Mark Johnston
e72f7ed43e buf: Dynamically allocate per-CPU buffer queues
To reduce static bloat.  No functional change intended.

PR:		269572
Reviewed by:	mjg, kib, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39808
2023-04-26 10:09:31 -04:00
Mark Johnston
78cfa762eb callout: Move per-CPU callout state into the dpcpu region
This eliminates some static bloat in amd64 kernels and reduces the
penalty of increasing MAXCPU.  The structures now also maintain NUMA
affinity.  No functional change intended.

PR:		269572
Reviewed by:	mjg, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39807
2023-04-26 10:09:09 -04:00
Mark Johnston
74ac712f72 vmm: Dynamically allocate a couple of per-CPU state save areas
This avoids bloating the BSS when MAXCPU is large.

No functional change intended.

PR:		269572
Reviewed by:	corvink, rew
Tested by:	rew
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39805
2023-04-26 10:08:42 -04:00
Dmitry Chagin
e185d83fc4 linux(4): Use inlined LINUX_KERNVER for tests to improve readability
MFC after:		1 month
2023-04-26 16:57:30 +03:00
Dmitry Chagin
76f8584e49 linux(4): Don't relie on process osreldata when testing features
The ELF note identifyies the operating-system ABI that the executable
was created for. The note data of the Glibc executable contains the
earliest release number of the Linux kernel that supports this ABI.
As of a current 2.37 version of Glibc, it is 3.2.0 for x86, 3.7.0
for Aarch64.
Glibc does not use this release number and the current kernel's
LINUX_VERSION_CODE to detect kernel features, using fallbacks to known
previous way in case of ENOSYS or something else instead.

A dynamically linked Glibc reads the current kernel's LINUX_VERSION_CODE
from the ELF note in the vDSO or fallback to uname syscall if the vDSO
can't be located and parse the release field in struct utsname. Glibc
uses the current kernel's LINUX_VERSION_CODE for "kernel too old" check.

While here use inlined LINUX_KERNVER for tests to improve readability,
as suggested by emaste@.

MFC after:		1 month
2023-04-26 16:56:41 +03:00
Mark Johnston
727fd8a73d irdma: Silence an unused function warning
Reviewed by:	erj
Fixes:	35105900c6 ("irdma(4): Upgrade the driver to 1.1.11-k")
Differential Revision:	https://reviews.freebsd.org/D39719
2023-04-26 09:36:52 -04:00
Toomas Soome
795497bf3d pxeboot: bugs in pxe.h
SEGDESC_t needs to be PACKED
there is no status in t_PXENV_UNDI_MCAST_ADDRESS

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D39799
2023-04-26 16:33:28 +03:00
Alexander V. Chernikov
20b6945c7f netlink: fix IPv6 proxy ndp deletion.
* Move LLT_ADDEDPROXY handling into lltable_link_entry() to
 reduct duplication
* Use standard lltable_delete_addr() for entry deletion
* Add (forgotten) call to llt_post_resolved handler after
 adding the entry via netlink.

MFC after:	2 weeks
2023-04-26 13:26:37 +00:00
Alexander V. Chernikov
52199877a6 arp: report successful deletion via netlink to mimic rtsock. 2023-04-26 13:26:37 +00:00
Andrew Turner
f8c451d291 Add vt_simplefb to the arm64 NOTES file
This will be picked up in the LINT-ACPI and LINT-FDT configs to check
it builds with only one option enabled

Sponsored by:	Arm Ltd
2023-04-26 14:11:36 +01:00
Andrew Turner
80327535cf Mark simplefb as depending on fdt
This file is for a FDT specific device, mark it as such.

Reported by:	Zachary Leaf <zachary.leaf@arm.com>
Sponsored by:	Arm Ltd
2023-04-26 14:11:31 +01:00
Yuri Pankov
989a0e1d81 tzsetup: fix bootstrapping for github CI jobs
Move dump_zonetab() under HAVE_BSDDIALOG as the parsing code
it relies on already is.
2023-04-26 14:29:08 +02:00
Alexander V. Chernikov
a1db1097e6 netlink: fix build without NETLINK in the kernel.
PR:	271066
2023-04-26 11:19:41 +00:00
Yuri Pankov
01007472ea getconf(1): add DEALLOC_PRESENT
Allow getconf to query _PC_DEALLOC_PRESENT pathconf(2) variable
added in 0dc332bff2.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39796
2023-04-26 13:13:36 +02:00
Dag-Erling Smørgrav
6f3c2f41b1 tzcode: Clean up the ctime(3) manual page.
MFC after:	3 weeks
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com
Differential Revision:	https://reviews.freebsd.org/D39714
2023-04-26 11:46:41 +02:00
Dag-Erling Smørgrav
75411d1572 Update tzcode to 2023c.
MFC after:      3 weeks
Sponsored by:   Klara, Inc.
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D39712
2023-04-26 11:46:21 +02:00
Christian McDonald
ef661d4a5b pf: introduce ridentifier and labels to ether rules
Make Ethernet rules more similar to the usual layer 3 rules by also
allowing ridentifier and labels to be set on them.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-26 11:14:41 +02:00
Vitaliy Gusev
0912408a28
vmm: fix HLT loop while vcpu has requested virtual interrupts
This fixes the detection of pending interrupts when pirval is 0 and the
pending bit is set

More information how this situation occurs, can be found here:
c5b5f2d808/sys/amd64/vmm/intel/vmx.c (L4016-L4031)

Reviewed by:		corvink, markj
Fixes:			02cc877968 ("Recognize a pending virtual interrupt while emulating the halt instruction.")
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D39620
2023-04-26 10:38:46 +02:00
Peter Jeremy
b9600db494
prometheus_sysctl_exporter: Replace magic numbers with identifiers.
Identifiers make it clearer what is going on and makes it easier to
find consumers of sysctl functionality.

No functional change.

MFC after:	3 days
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D39797
2023-04-26 18:29:33 +10:00
Corvin Köhne
16f23f7543
bhyve: pass E820 table to guest
E820 table will be used to report valid RAM ranges and reserve special
memory areas like graphics memory for GPU passthrough.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39550
2023-04-26 09:58:37 +02:00