Commit Graph

280929 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
822fa7ae1e cp: Add tests involving sparse files.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38290
2023-02-02 15:45:55 +01:00
Dag-Erling Smørgrav
606d0e4a9a libc: Add tests for strchrnul(3).
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D38286
2023-02-02 15:45:45 +01:00
Stefan Eßer
f7e5465cb5 Revert "sys/kbio.h: support Unicode key codes in vt keymap files"
It has been pointed out, that this change causes ABI breakage for
[GP]IO_DEADKEYMAP. I'll create a review on phabricator.

Since the 8 bit limit on keycodes causes issues for certain keymaps,
a fix should be committed in time to allow a MFC to 13.2.

This reverts commit 1e0853ee84.

Reported by: 	    Jessica Clarke
2023-02-02 09:05:43 +01:00
Corvin Köhne
55f1ca209d
atrtc: expose power loss as sysctl
Exposing the a power loss of the rtc as an sysctl makes it easier to
detect an empty cmos battery.

Reviewed by:		manu
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38325
2023-02-02 08:25:08 +01:00
Rick Macklem
99187c3a44 prison_check_nfsd: Add check for enforce_statfs != 0
Since mountd(8) will not be able to do exports
when running in a vnet prison if enforce_statfs is
set to 0, add a check for this to prison_check_nfsd().

Reviewed by:	jamie, markj
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D38189
2023-02-01 16:02:20 -08:00
Konstantin Belousov
25c862ae50 libthr pshared: correct a bug in allocation
When __thr_pshared_offpage() is called for allocation, it must not use
the cached offpage for the key.  Instead, the cached offpage must be
unmapped and removed from the cache, if any.

It is legitimate for the user code to unmap the shared lock object without
destroying it, and then mapping something over the freed VA to carry
another shared lock.  In this case the cached offpage must be un-cached.

PR:	269277
Reported by:	rau8344@gmail.com
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38345
2023-02-02 00:59:27 +02:00
Konstantin Belousov
3cf37d1251 libthr: add pshared_destroy() helper
Rewviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38345
2023-02-02 00:59:27 +02:00
Konstantin Belousov
83a49712af kstack_contains(): account for struct pcb on stack
for arm64, arm, powerpc, and riscv

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38320
2023-02-02 00:59:27 +02:00
Konstantin Belousov
3f08bd5653 i386 trap_check_kstack(): use kstack_contains()
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38320
2023-02-02 00:59:27 +02:00
Konstantin Belousov
7c567fcc56 i386 kstack_contains(): account for pcb/fpu save area
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38320
2023-02-02 00:59:26 +02:00
Konstantin Belousov
2555f175b3 Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.h
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38320
2023-02-02 00:59:26 +02:00
John Baldwin
6cc52efa13 arm_smcc_1_2_*: Don't trash SP and X19 if no return value structure.
Jumping direct to ret was not restoring the saved value of x19 and was
also not adjusting sp to discard the two saved registers.

Reviewed by:	andrew
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37922
2023-02-01 13:54:09 -08:00
Gleb Smirnoff
a0102dee34 sockets: in sousrsend() pass down the error to aio(4)
This somewhat undermines the initial goal of sousrsend() to have all
the special error handling for a write on a socket in a single place.
The aio(4) needs to see EWOULDBLOCK to re-schedule the job.  Because
aio(4) handles return from soreceive() and sousrsend() with the same
code, we can't check for (error == 0 && done < job_nbytes).  Keeping
this exclusion for aio(4) seems a lesser evil.

Fixes:	7a2c93b86e
2023-02-01 13:03:10 -08:00
Dmitry Chagin
575e48f1c4 linux(4): Deduplicate MI futex structures.
MFC after:	1 week
2023-02-01 21:57:04 +03:00
Gleb Smirnoff
fd53298799 unix: add myself to the copyright notice
for the new implementation of PF_UNIX/SOCK_DGRAM
2023-02-01 09:39:28 -08:00
Gleb Smirnoff
5ebea466dc inpcb: add myself to the copyright notice
for the SMR synchronization in late 2021 and following cleanups
2023-02-01 09:39:25 -08:00
Wei Hu
c75ae52216 arm64: Hyper-V: vPCI: Fix typo and some indentations
Fix a typo and some indentation errors in the previous commits.

Reported by:	jrtc27
Fixes:	db247798c5 ("arm64: Hyper-V: vPCI: SPI MSI mapping for gic v3 acpi in arm64")
Fixes:	6e5b082cab ("arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4")
Sponsored by:	Microsoft
2023-02-01 17:34:19 +00:00
Warner Losh
f051d72314 hyperv: Build and install where supported
Remove the hard-coded dependency on HYPERV being only x86. Instead, 100%
rely on MK_HYPERV. It's always right (since it's marked BROKEN (so set
to "no") on architectures we don't support).

Sponsored by:		Netflix
Reviewed by:		bz
Differential Revision:	https://reviews.freebsd.org/D38306
2023-02-01 10:21:57 -07:00
Wei Hu
ea11861e43 arm64: Hyper-V: vPCI: Enabling v-PCI in FreeBSD in ARM64 Hyper-V
This patch does remaining enablement in hyperv vpci driver to work
on arm64 Hyper-V. For that it required to use PCI protocol 1.4 and
corresponding different PCI message handling. Also new MSI allocation,
MSI-X mapping, release.

This is the last patch of total three patches to enalbe Hyper-V vPCI
support in arm64.

Reviewed by:	whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Obtained from:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D37958
2023-02-01 16:59:27 +00:00
Stefan Eßer
1e0853ee84 sys/kbio.h: support Unicode key codes in vt keymap files
Some keyboard definitions return Unicode characters that cannot be
represented in the 8 bits provided by an u_char.

Extend then width of the keycode entries to 16 bits to allow for all
keycodes currently defined in share/vt/keymaps/*,kbd.

Reported by:	   yuri@aetern.org
MFC after:	   3 days
2023-02-01 17:24:18 +01:00
Krzysztof Zdziarski
c0a4a7bb94 qat: Fixed Coverity reported issue
This patch provides fixes for following Coverity issues:
CID 1504073
CID 1504075
CID 1504076
CID 1504077

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>

Fixes:		a977168c48 ("qat: Add Intel® 4xxx Series platform support")
Reviewed by:	markj
Sponsored by:   Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38339
2023-02-01 11:02:08 -05:00
Wei Hu
6e5b082cab arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4
This is enabling the PCI protocol 1.4 and corresponding structures
in order to support arm64 Hyper-V.

This is the 2nd of the three patches to enable Hyper-V vPCI support
in arm64.

Reviewed by:	whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Obtained from:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D37780
2023-02-01 16:00:10 +00:00
Wei Hu
db247798c5 arm64: Hyper-V: vPCI: SPI MSI mapping for gic v3 acpi in arm64
Microsoft Azure Hyper-V uses SPI to map MSI in ARM64, instead of
using LPI IDS. To enable that we need to have gic registered with
ACPI_MSI_XREF and gic acpi to map SPI for MSI.

This is the 1st of the three patchs to enable Hyper-V vPCI support
in arm64.

Reviewed by:	andrew, emaste, whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Obtained from:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D37763
2023-02-01 15:40:08 +00:00
Dmitry Chagin
5c32146723 amd64: Eliminate write only cpu_fxsr.
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D38289
MFC after:		1 week
2023-02-01 18:17:06 +03:00
Mateusz Piotrowski
197947e0a3 ifconfig.8: Improve readability of vlanproto's description
Sponsored by:	Klara Inc.
MFC after:	1 week
2023-02-01 16:06:45 +01:00
Corvin Köhne
892feec221
vmm: avoid spurious rendezvous
A vcpu only checks if a rendezvous is in progress or not to decide if it
should handle a rendezvous. This could lead to spurios rendezvous where
a vcpu tries a handle a rendezvous it isn't part of. This situation is
properly handled by vm_handle_rendezvous but it could potentially
degrade the performance. Avoid that by an early check if the vcpu is
part of the rendezvous or not.

At the moment, rendezvous are only used to spin up application
processors and to send ioapic interrupts. Spinning up application
processors is done in the guest boot phase by sending INIT SIPI
sequences to single vcpus. This is known to cause spurious rendezvous
and only occurs in the boot phase. Sending ioapic interrupts is rare
because modern guest will use msi and the rendezvous is always send to
all vcpus.

Reviewed by:		jhb
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37390
2023-02-01 12:36:36 +01:00
Gregory Neil Shapiro
17c8213559 Note upgrade to sendmail 8.17.1 2023-02-01 02:23:02 +00:00
Gregory Neil Shapiro
38c2f8fe62 Note upgrade to sendmail 8.17.1 2023-02-01 02:22:39 +00:00
Bjoern A. Zeeb
b0ddb44fd4 LinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues()
Fix indentation in lkpi_wake_tx_queues().
No functional changes.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 23:12:30 +00:00
Bjoern A. Zeeb
3dd980267f LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT
Add code (currently disabled by #ifdef) for HT and VHT to
lkpi_scan_ies_add().  Switch to a local variable for ic given
the new code also needs the value.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-31 23:00:28 +00:00
Jean-Sébastien Pédron
a83b3ec719
linuxkpi: list_sort()'s callback now takes list arguments
This change breaks the API of `list_sort()`. `LINUXKPI_VERSION >= 51300`
is used to keep the header compatible with both versions of the
prototype.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38082
2023-01-31 23:36:33 +01:00
Eric Joyner
5354596764
vtd: Increase DRHD_MAX_UNITS
Observed on a couple Ice Lake-SP platforms (Intel Coyote Pass, Dell
R750), there are more than 8 DRHD sections enumerated in the DMAR ACPI
section.  Since the previous limit was 8, this resulted in some of these
not being parsed by vtd when the iommu is initialized; in this case when
PCI devices are being passthru'd to a bhyve VM.

This omission later causes a kernel panic later in initialization when
devices could not be found in a valid DRHD scope because the DHRD
containing the device's scope was not added to vtd.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

PR:		268486
Sponsored by:	Intel Corporation
Reviewed by:	rew@, corvink@
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D38285
2023-01-31 13:57:42 -08:00
Justin Hibbits
dc57ec3ca0 Mechanically convert ffec(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37836
2023-01-31 16:26:36 -05:00
Justin Hibbits
13f2ef1637 Mechanically convert mwl(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37840
2023-01-31 16:26:35 -05:00
Justin Hibbits
9f012efb63 Mechanically convert gem(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37809
2023-01-31 16:26:35 -05:00
Justin Hibbits
3df047e3f3 Mechanically convert ps3 if_glc(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37792
2023-01-31 16:26:35 -05:00
Justin Hibbits
44e65355a3 Mechanically convert if_cas(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37793
2023-01-31 16:26:34 -05:00
Justin Hibbits
98fe10c8fc Mechanically convert mge(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37833
2023-01-31 16:26:34 -05:00
Justin Hibbits
b7459fb0ad Mechanically convert genet(4) to IfAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37832
2023-01-31 16:26:34 -05:00
Justin Hibbits
ad06fc3283 re(4): Fix whitespace from IfAPI conversion
Fixes:		4519a073c3
Sponsored by:	Juniper Networks, Inc.
2023-01-31 16:26:33 -05:00
Justin Hibbits
74c592c047 etherswitch: Clean up whitespace after IfAPI conversion
Sponsored by:	Juniper Networks, Inc.
Fixes:		2e6a8c1ae
2023-01-31 16:26:33 -05:00
Justin Hibbits
34d5a6a3dc Last change for mgb(4) needed for IfAPI conversion
Sponsored by:	Juniper Networks, Inc.
2023-01-31 16:26:33 -05:00
Justin Hibbits
087f0d352a Mechanically convert bge(4) to DrvAPI
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37842
2023-01-31 15:02:18 -05:00
Justin Hibbits
56c1eafe50 IfAPI: Finish conversion of bnxt(4) to IfAPI.
Sponsored by:	Juniper Networks, Inc.
2023-01-31 15:02:18 -05:00
Justin Hibbits
4519a073c3 Mechanically convert if_re(4) to DrvAPI
Reviewed By:	kevlo
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37790
2023-01-31 15:02:18 -05:00
Justin Hibbits
d79539e6f2 IfAPI: Add if_altq_is_enabled() interface.
Summary:
The only user of the ALTQ_IS_ENABLED() in a driver checks against the
ifnet queue.  Abstract that all out and present the interface to check
if ALTQ is enabled on the interface.

Sponsored by:	Juniper Networks, Inc.
Reviewed By:	glebius
Differential Revision: https://reviews.freebsd.org/D38204
2023-01-31 15:02:17 -05:00
Justin Hibbits
31cfaf191b IfAPI: Add l2com accessor for firewire.
Summary:
Firewire is the only device driver that accesses the l2com member, all
other accesses are handled within the netstack itself.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38203
2023-01-31 15:02:17 -05:00
Justin Hibbits
0d2684e15e IfAPI: Add some more accessors
Summary:
* if_setreassignfn for wireguard.
* if_getinputfn() and if_getstartfn() for various drivers.  Use the
  function descriptor typedefs for these and the setters.
* vlantrunk accessor.  This is used by VLAN_CAPABILITIES() used by
  several drivers, as well as directly by mxge(4).
* if_pcp member accessor, used by cxgbe.
* accessors for netmap adapter.

Sponsored by:	Juniper Networks, Inc.
Reviewed By:	glebius
Differential Revision: https://reviews.freebsd.org/D38202
2023-01-31 15:02:17 -05:00
Justin Hibbits
9507d03bfe IfAPI: Use the ifnet APIs in kern_poll()
The only API used is if_name().

Sponsored by:	Juniper Networks, Inc.
2023-01-31 15:02:16 -05:00
Justin Hibbits
c255d1a401 IfAPI: Add if_llsoftc member accessors for TOEDEV
Summary:
Keep TOEDEV() macro for backwards compatibility, and add a SETTOEDEV()
macro to complement with the new accessors.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	glebius
Differential Revision: https://reviews.freebsd.org/D38199
2023-01-31 15:02:16 -05:00