Commit Graph

284350 Commits

Author SHA1 Message Date
Alexander V. Chernikov
85e0016a97 ifconfig: remove global 'name' variable.
Consistenly use newly-added 'ctx->ifname' as the name of the current
target interface.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40438
MFC after:	2 weeks
2023-06-13 06:22:41 +00:00
Alexander V. Chernikov
c6f0602f23 ifconfig: pass if_ctx instead of socket to the tunnel handlers.
This is a pre-requisite for the global 'name' variable removal.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40432
MFC after:	2 weeks
2023-06-13 06:20:00 +00:00
Alexander V. Chernikov
4106282ec4 ifconfig: remove global 'printifname' variable.
This variable was used to print the created interface name in the
atexit(3) handler. The interface name was calculated in the
ifclonecreate() by matching old & new names.

This change alter the implementation the following way:
1) the function responsible for the interface creation (ifcreate_ioctl)
 updates all necessary state internally. This removes the need for the
 name manipulation hack in wlan_create().
2) As atexit(3) handler does not accept any parameters, explicitly store
 the name to print in the ifname_to_print variable read by the atexit(3)
 handler.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40431
MFC after:	2 weeks
2023-06-13 06:18:10 +00:00
Alexander V. Chernikov
c6885dbda7 ifconfig: eliminate global 'verbose' and 'printkey' variables
Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40427
MFC after:	2 weeks
2023-06-13 06:16:14 +00:00
Alexander V. Chernikov
74b4261161 ifconfig: add if_ctx argument to the generic and ifclone callbacks.
This is the continuation of the ifconfig cleanup work. This change is
a pre-requsite for the next changes removing some of the global variables.
It will also help in implementing functionality via Netlink instead of ioctl.
No functional changes intended.
* vxlan_cb() was removed as it contained no code
* ioctl_ifcreate() was renamed to ifcreate_ioctl() to follow the other
netlink/ioctl function naming. Netlink and ioctl provide _different_
interfaces and it's not possible to have a unified interface object
that can be filled by either netlink or ioctl implementations. With that
in mind, I'm leaning more to the function_<nl|ioctl> postfix pattern,
than doing ioctl_ or netlink_ prefix.

Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D40426
MFC after:	2 weeks
2023-06-13 06:10:56 +00:00
Yan Ka, Chiu
ab4d1b73cb route(8): teach route to attach to jails
Add -j <jail> flag to route(8) to allow route to perform actions in
a Jail.

Differential Revision: https://reviews.freebsd.org/D40377
MFC after:	2 weeks
2023-06-13 06:06:27 +00:00
Alexander V. Chernikov
0eb0d23335 ktest: make ktest work with Netlink loaded as a module.
MFC after:	2 weeks
2023-06-13 06:04:14 +00:00
Xin LI
08300d8494 expand_number: Tighten check of unit.
The current code silently ignores characters after the unit as long
the unit themselves were recognized. This commit makes expand_number(3)
to fail with EINVAL if buf did not terminate after the unit character.

Historically, the function accepts and ignores "B" as a SI unit, this
behavior is preserved and e.g. KB, MB are still accepted as aliases of
K and M, document this behavior in the manual page.

While I am there, also write a few test cases to validate the behavior.

Reviewed-by:	emaste
MFC-after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40482
2023-06-12 21:08:32 -07:00
Warner Losh
bdc81eeda0 nvme: Switch to nda by default
We already run nda by default on all the !x86 architectures. Switch the
default to nda. nda created nvd compatibility links by default, so this
should be a nop. If this causes problems for your application, set
hw.nvme.use_nvd=1 in your loader.conf.

Sponsored by:		Netflix
2023-06-12 21:41:06 -06:00
Mitchell Horne
0449bc249b mac(9): update SEE ALSO
Rather than maintaining an incomplete list of MAC modules references,
just reference mac(4), where such a list can be found.

Reviewed by:	Mina Galić <freebsd@igalic.co>
Reviewed by:	Pau Amma <pauamma@gundo.com>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40485
2023-06-12 17:31:09 -03:00
Mitchell Horne
e2cb720101 mac(4): update the references to MAC modules
Add entries for mac_ntpd(4) and mac_priority(4) to the table of MAC
modules.

Drop the entry for mac_none(4) from the list, but retain the
cross-reference in SEE ALSO. This module has no functional impact and is
of minimal interest to users. Add a new cross-reference to the similar
mac_stub(4), limited to SEE ALSO for the same reasoning.

Reviewed by:	Pau Amma <pauamma@gundo.com>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40483
2023-06-12 17:31:09 -03:00
Alan Cox
34eeabff5a amd64/arm64 pmap: Stop requiring the accessed bit for superpage promotion
Stop requiring all of the PTEs to have the accessed bit set for superpage
promotion to occur.  Given that change, add support for promotion to
pmap_enter_quick(), which does not set the accessed bit in the PTE that
it creates.

Since the final mapping within a superpage-aligned and sized region of a
memory-mapped file is typically created by a call to pmap_enter_quick(),
we now achieve promotions in circumstances where they did not occur
before, for example, the X server's read-only mapping of libLLVM-15.so.

See also https://www.usenix.org/system/files/atc20-zhu-weixi_0.pdf

Reviewed by:	kib, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D40478
2023-06-12 13:40:57 -05:00
Ed Maste
1dd6f95bb9 wg(4): add Matt Macy back to AUTHORS section
Matt did the initial in-kernel FreeBSD driver port.  The driver would
not exist without that work and some of it remains, even if the driver
was largely rewritten and reworked before being added back to the tree.

Authors remain in alphabetical order by surname.

Sponsored by:	The FreeBSD Foundation
2023-06-12 14:36:34 -04:00
Mark Johnston
280826817f qatfw: Don't build if WITH_SOURCELESS_UCODE is defined 2023-06-12 13:47:51 -04:00
Krzysztof Zdziarski
266b0663c5 qat: Add Intel® 4xxx Series VF driver support
Overview:
Intel(R) QuickAssist Technology (Intel(R) QAT) provides hardware
acceleration for offloading security, authentication and compression
services from the CPU, thus significantly increasing the performance and
efficiency of standard platform solutions.

This commit introduces:
- Intel® 4xxx Series VF driver support.
- Device configurability via sysctls.
- UIO support for Intel® 4xxx Series devices.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Karol Grzadziel <karolx.grzadziel@intel.com>

Sponsored by:	Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39850
2023-06-12 13:44:01 -04:00
Mark Johnston
694f18d353 qat: Stop building on i386
The driver isn't tested on i386, so don't spend effort compiling it.
2023-06-12 13:44:01 -04:00
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