Commit graph

286995 commits

Author SHA1 Message Date
Jose Luis Duran
8a30ab5369 atf_python: Set verbosity for commands in a vnet
Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/865
2023-10-13 15:31:30 -04:00
Jose Luis Duran
a1eb150ce2 atf_python: vnet: Use absolute paths within helpers
Usually tests are run in sterile environments; however, there is a
slight chance that the PATH overrides the utilities used for testing.

Pedantically use absolute paths, even inside VNETs, to avoid ambiguity.

Chiefly, jexec -> /usr/sbin/jexec, and ifconfig -> /sbin/ifconfig.

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/865
2023-10-13 15:31:30 -04:00
Jose Luis Duran
7964a28ccf atf_python: Actually implement verbosity for run_cmd
Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/865
2023-10-13 15:31:30 -04:00
Jose Luis Duran
2e620256bd atf_python: Do not attempt to automatically delete lo0
Else `ifconfig lo0 destroy` will throw an:

    ifconfig: SIOCIFDESTROY: Invalid argument

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/865
2023-10-13 15:31:30 -04:00
John Baldwin
edd2a9b887 bhyve ahci: Replace WPRINTF with EPRINTLN
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D42181
2023-10-13 12:26:58 -07:00
John Baldwin
f0852344e7 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
2023-10-13 12:26:22 -07:00
Justin Hibbits
8f31b879ec bpf: Add IfAPI analogue for bpf_peers_present()
An interface's bpf could feasibly not exist, in which case
bpf_peers_present() would panic from a NULL pointer dereference.  Solve
this by adding a new IfAPI that could deal with a NULL bpf, if such
could occur in the network stack.

Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42082
2023-10-13 14:33:31 -04:00
Justin Hibbits
5e444deec0 Revert "bpf: Add IfAPI analogue for bpf_peers_present()"
This reverts commit c81dd8e5fe.

Commit message needs revised.
2023-10-13 14:33:31 -04:00
Mina Galić
74e4a8d208 pmap: add pmap_kextract(9) man page
Add a man page for pmap_kextract(9), with alias to vtophys(9). This man
page is based on pmap_extract(9).

Add it as cross reference in pmap(9), and add comments above the
function implementations.

Co-authored-by:	Graham Perrin <grahamperrin@gmail.com>
Co-authored-by:	mhorne
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/827
2023-10-13 15:27:24 -03:00
Pierre Pronchery
914ab28c59 tzsetup: add support for countries in two continents
This supports countries located across multiple continents, as per the
zone1970.tab file. This only affects Cyprus and Türkiye at the moment.

PR:		236874
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41306
2023-10-13 13:23:59 -04:00
Justin Hibbits
c81dd8e5fe bpf: Add IfAPI analogue for bpf_peers_present()
An interface's bpf could feasibly not exist, in which case
bpf_peers_present() would panic from a NULL pointer dereference.  Solve
this by adding a new IfAPI that includes a NULL check.  Since this API
is used in only a handful of locations, it reduces the the NULL check
scope over inserting the check into bpf_peers_present().

Sponsored by:	Juniper Networks, Inc.
MFC after:	1 week
2023-10-13 13:12:44 -04:00
Pierre Pronchery
60b37735f3 bsdinstall netconfig: avoid duplicate entries in rc.conf
This uses sysrc to write and update configuration variables in the
temporary configuration file for network access, ._rc.conf.net. This
replaces the previous mechanism, which was simply appending new values
as they were updated.

PR:		212396
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42194
2023-10-13 12:45:54 -04:00
Pierre Pronchery
01ab86f7e6 bsdinstall: reset the mirror when restarting
It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when setting up a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts are kept in the environment when
restarting the process; this makes it impossible to run some steps as
expected after the restart.

For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembers the choice made, and will
never prompt for a different one. Rebooting is then the only easy way
out of this situation.

This change only affects the `jail` script for now, as otherwise there
is no way to tell if the value had been specifically set by the user
before starting bsdinstall.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42183
2023-10-13 12:32:38 -04:00
Pierre Pronchery
ac78e3e9c5 bsdinstall: Add "Finish" button to finalconfig
This adds a "Finish" button to the finalconfig step, replacing the
previous first choice, which was to "apply configuration and exit".
The new button is the default action, while the "OK" button is renamed
to "Select".

Also, if an unknown option is chosen, the code flow prompts the user
again instead of exiting.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D42047
2023-10-13 12:23:01 -04:00
Pierre Pronchery
a6d202077d bsdinstall: revisit the finalconfig step
This moves the "finalconfig" step into a dedicated script, where it uses
a loop instead of recursing into itself.

Reviewed by:	bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42046
2023-10-13 12:19:39 -04:00
Zhenlei Huang
7ca90db2f3 kmsan.9: Mention the loader tunable 'debug.kmsan.disable'
Reviewed by:	gbe (manpages), markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42166
2023-10-13 22:42:34 +08:00
Zhenlei Huang
2df9757508 kasan.9: Mention the loader tunable 'debug.kasan.disable'
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42165
2023-10-13 22:42:34 +08:00
Konstantin Belousov
6aa641b71d arm64, risvc: warn about ignored kstack_pages for thread0
Suggested by:	brooks
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42143
2023-10-13 12:26:45 +03:00
Konstantin Belousov
39cddbd7a0 arm64: do not disable the kern.kstack_pages tunable on arm64
Add a comment explaining what is not quite correct with arm64 and riscv.

Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42143
2023-10-13 12:26:45 +03:00
Konstantin Belousov
ac63f7534d arm64, riscv: Use KSTACK_PAGES for the thread0 kstack size designator
instead of kstack_pages. Although it is correct right now to use
kstack_pages on amd64 since the kern.kstack_pages tunable is not
functional on arm64, this is too fragile and wrong on riscv.

Include opt_kstack_pages.h into machdep.c to get the right definition
for KSTACK_PAGES.

Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42143
2023-10-13 12:26:45 +03:00
Konstantin Belousov
4095e0bcb9 arm64 locore.S: fix typos
Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42143
2023-10-13 12:26:44 +03:00
Kristof Provost
81647eb60e pf: implement start/stop calls via netlink
Implement equivalents to DIOCSTART and DIOCSTOP in netlink. Provide a
libpfctl implementation and add a basic test case, mostly to verify that
we still return the same errors as before the conversion

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42145
2023-10-13 09:53:22 +02:00
Martin Matuska
23cf27db2c zfs: merge openzfs/zfs@8a7407012
Notable upstream pull request merges:
 #15368 008baa091 FreeBSD: Reduce divergence from in-tree sources
 #15371 1b310dfb1 DMU: Do not pre-read holes during write
 #15395 8a7407012 Zpool can start allocating from metaslab before
                  TRIMs have completed

Obtained from:	OpenZFS
OpenZFS commit:	8a74070128
2023-10-13 09:45:15 +02:00
Kristof Provost
ab393e9548 netlink: move NETLINK define to opt_global.h
Move the NETLINK define into opt_global.h so we can rely on it being
set correctly, without having to remember to include opt_netlink.h.
This ensures that the NETLINK define is correctly set. If not we
may end up with unloadable modules, due to missing symbols (such as
nlmsg_get_group_writer).

PR:		274306
Reviewed by:	imp, markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42179
2023-10-13 09:23:47 +02:00
Christos Margiolis
90367ba750 teken: fix style in teken_wcwidth.h
Reviewed by:	bojan.novkovic_fer.hr
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D42164
2023-10-13 08:14:57 +03:00
Bojan Novković
2fed1c579c 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
2023-10-13 08:14:36 +03:00
Alfonso S. Siciliano
cdee659f93
sade: Fix F1 help message
Fix F1 message of the disk menu because the button label is "[Modify]".
This is a UI fix, no functional change.
2023-10-13 02:19:45 +02:00
Cy Schubert
6e71235e55 unbound: Import upstream 0ee44ef3 when ENOBUFS is returned
From upstream 0ee44ef3:

- Fix send of udp retries when ENOBUFS is returned. It stops looping
  and also waits for the condition to go away. Reported by Florian
  Obser.

PR:		274352
MFC after:	3 days

Merge commit '292d51198aa319c58f534549851e9c28486abdf4'
2023-10-12 17:04:25 -07:00
Cy Schubert
292d51198a unbound: Import upstream 0ee44ef3 when ENOBUFS is returned
From upstream 0ee44ef3:

- Fix send of udp retries when ENOBUFS is returned. It stops looping
  and also waits for the condition to go away. Reported by Florian
  Obser.
2023-10-12 16:44:55 -07:00
Chuck Tuffli
32557d16e2 bhyve nvme: Add NQN value
Add a NVMe Qualified Name (NQN) to the Controller Data structure using
the "first format" (i.e., "... used by any organization that owns a
domain name" Section 7.9 NVM-Express 1.4c 2021.06.28 Ratified).

This avoids a Linux kernel warning about a missing or invalid NQN.

Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42058
2023-10-12 15:08:05 -07:00
Alfonso S. Siciliano
d287d3282f
libbsddialog: delete formw dependency
libbsddialog >= 0.3 has a built-in form implementation so delete
formw dependency.

Approved by:		bapt (share/mk maintainer)
Differential Revision:	https://reviews.freebsd.org/D42167
2023-10-12 22:44:15 +02:00
Yuri Pankov
da202b0fe6 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
2023-10-12 12:49:47 -07:00
Kajetan Staszkiewicz
4d19eceaef pf: Free pf_rule_items when state is not created
This addresses the issues of pf_rule_times leaking in case of stateless
rules and in case of state creation failures, like hitting the state
limit.

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D42169
2023-10-12 21:18:06 +02:00
Emmanuel Vadot
43cd6bbba0 dwc: re-rewrite barrier part
We need the DMA engine to have everything coherent *before* we
set the OWN bit (the bit that tells the DMA engine that it owns
the descriptor).

Fixes:	487034648805 ("dwc: Rewrite barrier part")

Reported by:	jhb
2023-10-12 20:56:16 +02:00
Emmanuel Vadot
944223076f pkgbase: Put atf_python files in FreeBSD-tests
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-10-12 20:15:03 +02:00
Jason King
8a74070128
Zpool can start allocating from metaslab before TRIMs have completed
When doing a manual TRIM on a zpool, the metaslab being TRIMmed is
potentially re-enabled before all queued TRIM zios for that metaslab
have completed. Since TRIM zios have the lowest priority, it is 
possible to get into a situation where allocations occur from the 
just re-enabled metaslab and cut ahead of queued TRIMs to the same 
metaslab.  If the ranges overlap, this will cause corruption.

We were able to trigger this pretty consistently with a small single 
top-level vdev zpool (i.e. small number of metaslabs) with heavy 
parallel write activity while performing a manual TRIM against a 
somewhat 'slow' device (so TRIMs took a bit of time to complete). 
With the patch, we've not been able to recreate it since. It was on 
illumos, but inspection of the OpenZFS trim code looks like the 
relevant pieces are largely unchanged and so it appears it would be 
vulnerable to the same issue.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jason King <jking@racktopsystems.com>
Illumos-issue: https://www.illumos.org/issues/15939
Closes #15395
2023-10-12 11:01:54 -07:00
Andrew Gallatin
be91b4797e acpi_ged: Handle events directly
Handle ged interrupts directly from the interrupt handler,
while the interrupt source is masked, so as to conform
with the acpi spec, and avoid spurious interrupts and
lockups on boot.

When an acpi ged interrupt is encountered, the spec requires
the os (as stated in 5.6.4: General Purpose Event Handling)
to leave the interrupt source masked until it runs the
EOI handler.  This is not a good fit for our method of
queuing the work (including the EOI ack of the interrupt),
via the AcpiOsExecute() taskqueue mechanism.

Note this fixes a bug where an arm64 server could lock up if
it encountered a ged interrupt at boot.  The lockup was
due to running on a single core (due to arm64 not using
EARLY_AP_STARTUP), and due to that core encountering a
new interrupt each time the interrupt handler unmasked
the interrupt source, and having the EOI queued on a taskqueue
which never got a chance to run. This is also possible
on any platform when using just a single processor.
The symptom of this is a lockup at boot, with:
"AcpiOsExecute: failed to enqueue task, consider
increasing the debug.acpi.max_tasks tunable" scrolling
on console.

Similarly, spurious interrupts would occur when running
with multiple cores, because it was likely that the
interrupt would fire again immediately, before the
ged task could be run, and before an EOI could be sent
to lower the interrupt line.  I would typically see
3-5 copies of every ged event due to this issue.

This adds a tunable, debug.acpi.ged_defer, which can be
set to 1 to restore the old behavior.  This was done
because acpi is a complex system, and it may be
theoretically possible something the ged handler does
may sleep (though I cannot easily find anthing by inspection).

MFC after: 1 month
Reviewed by: andrew, jhb, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42158
2023-10-12 11:27:44 -04:00
Ceri Davies
261cda20e1 UPDATING: fix typo 2023-10-12 13:00:56 +01:00
Zhenlei Huang
c415cfc8be 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
2023-10-12 18:14:49 +08:00
Zhenlei Huang
a55fbda874 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
2023-10-12 18:14:49 +08:00
Zhenlei Huang
1d2b743784 kmsan: Add corresponding sysctl knob for loader tunable
The loader tunable 'debug.kmsan.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
2023-10-12 18:14:49 +08:00
Zhenlei Huang
db5d0bc868 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
2023-10-12 18:14:48 +08:00
Zhenlei Huang
51dc362d1a boottrace: Add corresponding sysctl knob for loader tunable
The loader tunable 'kern.boottrace.table_size' 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
2023-10-12 18:14:48 +08:00
Emmanuel Vadot
257405d707 xilinx: reset: Remove debug printfs
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-10-12 09:32:59 +02:00
Mateusz Guzik
37544d9768 vfs: convert recycles_count and recycles_free_count to mere u_long
Only vnlru ever updates them.

This also removes recycles_count updates from hand-rolled debug vnode
recycling via sysctl.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-10-12 07:00:15 +00:00
Mateusz Guzik
a92fc3122d vfs: count recycles by vnlru and by vn_alloc separately
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-10-12 06:50:07 +00:00
Kyle Evans
989c5f6da9 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
2023-10-11 21:54:03 -05:00
Brian Behlendorf
fd51286227
spec: define _bashcompletiondir if undefined
Always define _bashcompletiondir in the spec file to a reasonable value
when it is undefined.  Required for `rpmbuild --rebuild <srpm>`.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15396
2023-10-11 16:56:32 -07:00
Alexander Motin
1b310dfb1d
DMU: Do not pre-read holes during write
dmu_tx_check_ioerr() pre-reads blocks that are going to be dirtied
as part of transaction to both prefetch them and check for errors.
But it makes no sense to do it for holes, since there are no disk
reads to prefetch and there can be no errors.  On the other side
those blocks are anonymous, and they are freed immediately by the
dbuf_rele() without even being put into dbuf cache, so we just
burn CPU time on decompression and overheads and get absolutely
no result at the end.

Use of dbuf_hold_impl() with fail_sparse parameter allows to skip
the extra work, and on my tests with sequential 8KB writes to empty
ZVOL with 32KB blocks shows throughput increase from 1.7 to 2GB/s.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15371
2023-10-11 16:37:21 -07:00
Mateusz Guzik
bb679b0c49 vfs: count calls to uma_reclaim in vnlru 2023-10-11 22:49:34 +00:00