Commit graph

284334 commits

Author SHA1 Message Date
Mark Johnston 9c0467929a geli tests: Add a regression test for PR 271766
This test case catches both of the bugs reported there.

PR:		271766
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40469
2023-06-12 12:52:24 -04:00
Mark Johnston 9f7fdd8c1a crypto: Advance the correct pointer in crypto_cursor_copydata()
PR:		271766
Reported by:	Michael Laß <bevan@bi-co.net>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40468
2023-06-12 12:52:24 -04:00
Mark Johnston 718d4a1d56 opencrypto: Handle end-of-cursor conditions in crypto_cursor_segment()
Some consumers, e.g., swcr_encdec(), may call crypto_cursor_segment()
after having advanced the cursor to the end of the buffer.  In this case
I believe the right behaviour is to return NULL and a length of 0.

When this occurs with a CRYPTO_BUF_VMPAGE buffer, the cc_vmpage pointer
will point past the end of the page pointer array, so
crypto_cursor_segment() ends up dereferencing a random pointer before
the function returns a length of 0.  The uio-backed cursor has
a similar problem.

Address this by keeping track of the residual buffer length and
returning immediately once the length is zero.

PR:		271766
Reported by:	Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40428
2023-06-12 12:52:24 -04:00
Johannes Totz e74dd9577f hwpstate_amd: calculate power if P-state info comes from MSR
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D40140
2023-06-12 12:52:24 -04:00
Warner Losh 2c0cd59345 checkstyle9.pl: Add check for bad email
Add check for bad email. And remove check for qemu that doesn't matter.

Sponsored by:		Netflix
2023-06-12 10:08:17 -06:00
VexedUXR 6f6213ec90 Add comments for memory size
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/753
2023-06-12 08:57:20 -06:00
Dmitriy Alexandrov 6016aedba1 uipc_syscalls: removed unnecessary check in accept1() function
Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/773
2023-06-12 08:49:13 -06:00
VexedUXR a8c1c0b727 Add boot1.efi to CLEANFILES
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/775
2023-06-12 08:41:22 -06:00
Tom Hukins c9a1abe79b mount_nullfs(8): refer to nullfs(5)
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/772
2023-06-12 08:35:36 -06:00
Mina Galić 3ed646d89a fix qcom_cpu_kpssv2 compile on ASUS_AC1300
Complete afdb42987c by changing the return type from boolean_t to bool
for the definition for qcom_cpu_kpssv2_regulator_start.

PR: 271932
Fixes: afdb42987c
Pull Request: https://github.com/freebsd/freebsd-src/pull/776
2023-06-12 08:30:15 -06:00
Corvin Köhne dece4f2d87
bhyve: register TPM device as ACPI device
The TPM device is an ACPI device with some custom ACPI tables.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40453
2023-06-12 13:04:37 +02:00
Corvin Köhne d5edf13d01
bhyve: add basic TPM device
Add an empty TPM device struct which will be used for TPM emulation in
subsequent commits.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40452
2023-06-12 13:04:35 +02:00
Corvin Köhne 4e46ab0ebe
bhyve: allow adding FwCfg items to ACPI tables
A TPM has an event log. Therefore, qemu adds a FwCfg item and adds it to
an ACPI table. We like to use the same OVMF driver as qemu, so we should
do the same. This commit adds the ability to basl to do it.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40451
2023-06-12 13:04:26 +02:00
John Baldwin bb17701050
bhyve: Remove vestigial support for setting max vCPUs.
The kernel part of the hypervisor is not going to support per-VM maxcpu
limits. The topology is only used to control the values returned by
CPUID leaves for which max vCPUs is not relevant.

Reviewed by:		corvink, markj
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D37176
2023-06-12 12:49:49 +02:00
Andrew Turner 178747a158 Add more arm64 special register values
These will be used to simplify the kernel special register handling.

Sponsored by:	Arm Ltd
2023-06-12 09:31:14 +01:00
R. Christian McDonald bb5d6d14d8 wpa: Enable receiving priority tagged (VID 0) frames
Certain internet service providers transmit vlan 0 priority tagged
EAPOL frames from the ONT towards the residential gateway. VID 0
should be ignored, and the frame processed according to the priority
set in the 802.1P bits and the encapsulated EtherType (i.e. EAPOL).

The pcap filter utilized by l2_packet is inadquate for this use case.

Here we modify the pcap filter to accept both unencapsulated and
encapsulated (with VLAN 0) EAPOL EtherTypes. This preserves the
original filter behavior while also matching on encapsulated EAPOL.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Reviewed by:	cy
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D40442
2023-06-11 16:26:04 -07:00
Dmitry Chagin 4864590568 Revert "linux(4): The futex_wait operation should restart."
This reverts commit 5eec19c8eb due to its
wrong. Linux interrupts futex syscall on signal and return EINTR.
2023-06-11 12:47:27 +03:00
Bjoern A. Zeeb 51117ed116 LinuxKPI: 802.11: correct HE_MAC_CAP3 values
While we had assigned dummy values so far to HE, correct the HW_MAC_CAP3
values to avoid compile time errors of drivers when shifting values out
of range.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-06-10 23:06:14 +00:00
Bjoern A. Zeeb bee50f894b LinuxKPI: qcom: update QMI and MHI
Minor updates to QMI and MHI (mostly making arguments const)
in order to facilitate porting the next generation athk driver.

MFC after:	10 days
2023-06-10 23:06:04 +00:00
Bjoern A. Zeeb ab55b58b5c LinuxKPI: add dummy of.h
Given https://reviews.freebsd.org/D34318 was abandoned add an empty
of.h dummy header file to at least avoid #include errors and avoid
covering those #include with CONFIG_OF.

MFC after:	10 days
2023-06-10 23:05:49 +00:00
Bjoern A. Zeeb a5ae63edd5 LinuxKPI: 802.11: initialize txq
In 5a9a0d7803 we omitted the initialization
of the per-hw txq settings.  Fix this.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Fixes:		5a9a0d7803
2023-06-10 23:05:15 +00:00
Bjoern A. Zeeb 3206587a20 LinuxKPI: 802.11: improve scan handling
Under certain circumstances a hw_scan may be downgraded to a software
scan.  Handle these situations better and make sure we free resources
in all cases once. [1]

Also leave a note about scanning all bands (or we would have to switch
bands manually).

In both cases hardware doing and driver saying seem not entirely
consistent for all and all firmware.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reported by:	imp [1]
2023-06-10 23:04:40 +00:00
Martin Matuska 4e8d558c9d zfs: merge openzfs/zfs@feff9dfed
Notable upstream pull request merges:
  #14833 Update compatibility.d files
  #14841 ZIL: Reduce scope of per-dataset zl_issuer_lock
  #14863 zil: Add some more statistics
  #14866 btree: Implement faster binary search algorithm
  #14894 Fix inconsistent definition of zfs_scrub_error_blocks_per_txg
  #14892 Fix concurrent resilvers initiated at same time
  #14903 Fix NULL pointer dereference when doing concurrent 'send' operations
  #14910 ZIL: Allow to replay blocks of any size
  #14939 Fix the L2ARC write size calculating logic
  #14934 Introduce zfs_refcount_(add|remove)_few()
  #14946 Improve l2arc reporting in arc_summary
  #14953 Finally drop long disabled vdev cache
  #14954 Fix the L2ARC write size calculating logic (2)
  #14955 Use list_remove_head() where possible
  #14959 ZIL: Fix race introduced by f63811f072

Obtained from:	OpenZFS
OpenZFS commit:	feff9dfed3
2023-06-10 19:31:17 +02:00
Graham Perrin 5ca7f02946 hier(7): typo (critial)
https://bugs.freebsd.org/261349

PR:                      261349
Reported by:             Mike Karels <mike@karels.net>
Fixes: 6469f9c595 hier(7): improvement, modernisation
2023-06-10 14:08:35 +01:00
Graham Perrin 6469f9c595 hier(7): improvement, modernisation
Consistent use of lowercase, spacing between sections, etc.

Cease mentioning floppy disks.

De-list /usr/share/misc/fonts/, which has been ??? (without a
description) for twenty-seven years.

Change zpool to pool. (zpool is a command.)

Uppercase PPP for Point-to-Point Protocol.

A few other changes to wording, including avoidance of the phrase
pre-fab.

Update the descriptions of:

* /tmp/
* /usr/share/misc/
* /var/preserve/
* /var/tmp/
* /var/tmp/vi.recover/.

Refer to vi(1) instead of ex(1).

https://bugs.freebsd.org/261349

PR:                      261349
Reviewed by:             mhorne
Approved by:             mhorne
Pull request:            https://github.com/freebsd/freebsd-src/pull/763
2023-06-10 09:41:35 +01:00
David E. O'Brien 2a3493b93b Correct man page URI formatting.
Don't format URL's embedding a ',' where one doesn't exist; so that
one may copy-n-paste the displayed URL into a browser.
2023-06-09 20:49:51 -07:00
Konstantin Belousov a254f67102 rtld: fix typo in comment
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-06-10 04:35:14 +03:00
Ed Maste 5ad6c907f9 Cirrus-CI: add a manually triggered aarch64-gcc12 task
Sponsored by:	The FreeBSD Foundation
2023-06-09 20:49:31 -04:00
George Amanakis feff9dfed3
Fix the L2ARC write size calculating logic (2)
While commit bcd5321 adjusts the write size based on the size of the log
block, this happens after comparing the unadjusted write size to the
evicted (target) size.

In this case l2ad_hand will exceed l2ad_evict and violate an assertion
at the end of l2arc_write_buffers().

Fix this by adding the max log block size to the allocated size of the
buffer to be committed before comparing the result to the target
size.

Also reset the l2arc_trim_ahead ZFS module variable when the adjusted
write size exceeds the size of the L2ARC device.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14936
Closes #14954
2023-06-09 17:05:47 -07:00
Warner Losh 17dce737e3 mvs: Eliminate unused variable.
ccim is unused. Just remove it.

PR: 271920
Sponsored by:		Netflix
2023-06-09 17:21:40 -06:00
John Baldwin 553022aba5 ipf: Remove no-longer-needed NO_WARRAY_BOUNDS. 2023-06-09 15:35:32 -07:00
Bjoern A. Zeeb 2e07e885d6 LinuxKPI: implement timer_{delete,shutdown}_sync()
Implement timer_{delete,shutdown}_sync(), which do not seem to require
anything additional to the already existing del_timer_sync().

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D40124
2023-06-09 22:25:33 +00:00
Richard Scheffenegger 8e7c2e14cf netstat: display c and C flags properly
Restructure c and C flag checks for string length to
work properly. Quickly bypass for non TCP protos too.

Reviewed By:		tuexen
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D40480
2023-06-09 23:58:00 +02:00
Dmitriy Alexandrov af9ce4e9bb kern_ntptime: Fix undefined behavior of the shift operator
L_LINT macro is used with negative numbers [i.e.
L_LINT(time_freq, -MAXFREQ)], it could cause undefined
behavior. It should be similar to the L_RSHIFT(v, n) macro.

MFC after:	2 weeks
Reviewed by:	cy
Pull Request:	https://github.com/freebsd/freebsd-src/pull/769
Signed-off-by: Dmitriy Alexandrov <d06alexandrov@gmail.com>
2023-06-09 14:04:54 -07:00
Brad Smith 2c01176a28 msun: Correct FreeBSD version in sincos() man page
The sincos() man page notes the function was added to msun in FreeBSD
9.0 which must have been an oversight in the review as it was commited
to 12.0 and then backported to the 11 branch.

So I have provided a diff to correct this to the first FreeBSD version
it did ship with which was 11.2.

Reviewed by:	dim, imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D40308
2023-06-09 22:04:43 +02:00
Alexander Motin 70ea484e3e
Finally drop long disabled vdev cache.
It was a vdev level read cache, designed to aggregate many small
reads by speculatively issuing bigger reads instead and caching
the result.  But since it has almost no idea about what is going
on with exception of ZIO_FLAG_DONT_CACHE flag set by higher layers,
it was found to make more harm than good, for which reason it was
disabled for the past 12 years.  These days we have much better
instruments to enlarge the I/Os, such as speculative and prescient
prefetches, I/O scheduler, I/O aggregation etc.

Besides just the dead code removal this removes one extra mutex
lock/unlock per write inside vdev_cache_write(), not otherwise
disabled and trying to do some work.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14953
2023-06-09 12:40:55 -07:00
Brian Behlendorf 6db4ed51d6
ZTS: Skip checkpoint_discard_busy
Until the ASSERT which is occasionally hit while running
checkpoint_discard_busy is resolved skip this test case.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #12053
Closes #14952
2023-06-09 11:10:01 -07:00
Alexander Motin 90ccfd426d
Improve l2arc reporting in arc_summary.
- Do not report L2ARC as FAULTED in presence of in-flight writes.
- Report read and write I/Os, bytes and errors.
- Remove few numbers not important to average user.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #12304 
Closes #14946
2023-06-09 10:14:05 -07:00
Alexander Motin b3ad3f48d9
Use list_remove_head() where possible.
... instead of list_head() + list_remove().  On FreeBSD the list
functions are not inlined, so in addition to more compact code
this also saves another function call.

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 #14955
2023-06-09 10:12:52 -07:00
Alexander Motin 55b1842f92
ZIL: Fix race introduced by f63811f072.
We are not allowed to access lwb after setting LWB_STATE_FLUSH_DONE
state and dropping zl_lock, since it may be freed by zil_sync().
To free itxs and waiters after dropping the lock we need to move
lwb_itxs and lwb_waiters lists elements to local storage.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14957
Closes #14959
2023-06-09 10:08:05 -07:00
Andrew Turner 072a4ba82a Update the Arm Optimized Routine library to v23.01
Sponsored by:   Arm Ltd
2023-06-09 17:56:02 +01:00
Andrew Turner 1dd169af71 Add more arm64 ID registers to the user_regs array
This is a mapping from ID register value to offset in struct cpu_desc.
These registers may be needed with future architecture revisions either
by userspace or by bhyve.

Sponsored by:	Arm Ltd
2023-06-09 17:55:19 +01:00
Ed Maste 6024564cd4 Cirrus-CI: split main script into separate world + kernel
It appears that Cirrus-CI has a 100MB limit for log output, and we
exceed that (!) with the amd64-gcc12 build.  Separate world and kernel
build tasks in an attempt to stay below the limit.

This also has the benefit of showing world and kernel build status
separately in the Cirrus-CI UI.

PR:		271903
Sponsored by:	The FreeBSD Foundation
2023-06-09 11:07:24 -04:00
Baptiste Daroussin 92d817ad6b nlsysevent: remove useless CFLAGS 2023-06-09 17:04:10 +02:00
Stephen J. Kiernan 7bb4d1302c veriexec: Do not save error from file info in fingerprint status
We do not want or need to propagate the error from fetching file info
when determining the file status. It could cause open(2) and similar
calls to fail when trying to access devices.

Obtained from:	Juniper Networks, Inc.
2023-06-09 10:49:59 -04:00
Randall Stewart e022f2b013 tcp: Rack fixes and misc updates
So over the past few weeks we have found several bugs and updated hybrid pacing to have
more data in the low-level logging. We have also moved more of the BBlogs to "verbose" mode
so that we don't generate a lot of the debug data unless you put verbose/debug on.
There were a couple of notable bugs, one being the incorrect passing of percentage
for reduction to timely and the other the incorrect use of 20% timely Beta instead of
80%. This also expands a simply idea to be able to pace a cwnd (fillcw) as an alternate
pacing mechanism combining that with timely reduction/increase.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D40391
2023-06-09 10:27:08 -04:00
Warner Losh 9121945d70 Regenerate sysent stuff after $FreeBSD$ removal
Sponsored by:		Netflix
2023-06-09 07:28:27 -06:00
Warner Losh 61fe63f698 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
2023-06-09 07:26:24 -06:00
Joseph Mingrone a75d93a74d
tcpdump: Do not hard code HAVE_LIBCRYPTO in config.h
Reviewed by:	emaste
Fixes:		ee67461e56 (tpcdump: Update to 4.99.4)
Sponsored by:	The FreeBSD Foundation
2023-06-09 09:16:11 -03:00
Konstantin Belousov e9a38ed2fa rtld: fix allocate_module_tls() variant I fallback to static allocation
Submitted by:	Joerg Sonnenberger
Fixes:	91880e07f605edb90339685bc934699a4344de3bESC
MFC after:	1 week
2023-06-09 15:13:46 +03:00