Commit graph

147729 commits

Author SHA1 Message Date
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
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
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 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
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
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
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
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
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
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
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
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
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
Kevin Bowling 5253d74e46 e1000: Format em_txrx
No functional changes intended.

Reviewed by:	markj (prior version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30072
2023-06-08 19:06:04 -07:00
Kevin Bowling 034f38cdf8 e1000: Add SPDX tag to em_txrx
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30072
2023-06-08 18:42:20 -07:00
Dmitry Chagin cbbac56091 linux(4): Preserve fpu xsave state across signal delivery on amd64
PR:			270247
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40444
MFC after:		2 weeks
2023-06-09 01:33:26 +03:00
Dmitry Chagin 920184ed6e linux(4): In preparation for xsave refactor fxsave code on amd64
Due to fxsave area is os independent reimplement fxsave handmade code
using copying of a whole area.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40443
MFC after:		2 weeks
2023-06-09 01:32:46 +03:00
Bjoern A. Zeeb a30a0d940d LinuxKPI: add dummy rhashtable implementation
Add a skeleton implementation of rhashtable in order to keep an
upcoming wireless driver compiling.  We'll implement it as soon as
we get there.

MFC after:	10 days
Reviewed by:	emaste (previous version before his suggested changes)
Differential Revision: https://reviews.freebsd.org/D40176
2023-06-08 18:11:11 +00:00
Bjoern A. Zeeb 4cbd427788 LinuxKPI: add devm_ioremap()
Given we do not seem to support ioremap() do not support the "devm"
version either and simply return NULL, which means we do not have
to keep track of the memory to be freed on device free later.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D40173
2023-06-08 18:07:28 +00:00
Bjoern A. Zeeb 17bde9cbc6 LinuxKPI: pci: update struct msi_desc
It seems struct msi_desc is setup differently (or was changed) compared
to how we added it a while ago.  Catch up in order to keep drivers
directly accessing fields compiling.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D40175
2023-06-08 18:04:35 +00:00
Bjoern A. Zeeb 7d7d12ba77 LinuxKPI: pci: add PCI_COMMAND_MEMORY
Add another PCI alias to our native defines for a wireless driver.

MFC after:	10 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D40247
2023-06-08 18:02:33 +00:00
Bjoern A. Zeeb 7c0c69d1a0 LinuxKPI: add struct_group(...)
Add a struct_group() macro needed by a wireless driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D40138
2023-06-08 18:00:57 +00:00
Bjoern A. Zeeb b889315da3 LinuxKPI: add ktime_get_real_ts64()
Add a wrapper for ktime_get_real_ts64() used by a wireless driver.

MFC after:	10 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D40246
2023-06-08 17:58:32 +00:00
Ed Maste f40cd16bfd kern: Move devctl_systems[] out of sys/sys/devctl.h
The amd64-gcc12 build was failing with `error: 'devctl_systems' defined
but not used`.  Just move it to the C file where it's used.

PR:		271903
Sponsored by:	The FreeBSD Foundation
2023-06-08 12:28:04 -04:00
Andrew Turner d057b7aac8 arm64: Malloc the cpu_desc array
We only need this during boot. Allocate the array before starting CPUs
to reduce the memory usage.

Reviewed by:	Zach Leaf <zachary.leaf@arm.com>
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D40433
2023-06-08 17:10:10 +01:00
Andrew Turner 732786a25f arm64: Reduce the direct use of cpu_desc
To help moving to a dynamically allocated cpu_desc array reduce the
places we use it directly and create a pointer that is passed in to
functions that read it.

Reviewed by:	Zach Leaf <zachary.leaf@arm.com>
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D40392
2023-06-08 17:10:10 +01:00
John Baldwin 653738e895 ptrace: Clear TDB_BORN during PT_DETACH.
If a debugger detaches from a process that has a new thread that has
not yet executed, the new thread will raise a SIGTRAP signal to report
it's thread birth event even after the detach.  With the debugger
detached, this results in a SIGTRAP sent to the process and typically
a core dump.  Fix this by clearing TDB_BORN from any new threads
during detach.

Bump __FreeBSD_version for debuggers to notice when the fix is
present.

Reported by:	GDB's testsuite
Reviewed by:	kib, markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D39856
2023-06-07 12:28:36 -07:00
Andrey V. Elsukov 1f16650989 ipmi: add Block Transfer interface support
Reviewed by:	ambrisko
Obtained from:	Yandex LLC
MFC after:	2 weeks
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D40421
2023-06-07 12:30:47 +03:00
Wei Hu 4f8c634de0 arm64 Hyper-V: enable Hyper-V SMP for ARM64
Vmbus_synic_setup() is invoked via vmbus_intrhook -> vmbus_doattach
-> smp_rendezvous. On !EARLY_AP_STARTUP (e.g., aarch64), SMP isn't
functional in intrhooks and smp_rendezvous() will just call
vmbus_synic_setup() on the boot processor. There's nothing that will
initialize the pcpu data on every other AP.

To fix it we need to use SI_SUB_SMP for vmbus_doattach(). With this
patch the vmbus interrupt should work on all arm64 cpus on HyperV.

Reported by:	kevans
Reviewed by:	kevans, whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Obtained from:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D40279
2023-06-07 08:24:13 +00:00
Xin LI 1177a6c8dc gve: Unobfuscate code by using nitems directly for loop.
While there, also make MODULE_PNP_INFO to reflect that the device
description is provided.

Reported-by:	jrtc27
Reviewed-by:	jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D40430
2023-06-06 21:14:30 -07:00
Richard Scheffenegger eb5bfdd065 tcp: Add and update cubic module variable names
Prepare the cubic congestion control module to better align with
the specifications in RFC8312bis.

Rename a few cubic state variables to the variable names found in
the RFC8312bis specification. This makes the code more understandable
for someone reading the RFC and the code. It also makes the variable
naming convention more uniform. Add some variables needed subsequently.

No functional change.

Submitted By:		Bhaskar Pardeshi, VMware Inc.
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D40436
2023-06-06 23:09:28 +02:00
Richard Scheffenegger 43b117f88f tcp: make the maximum number of retransmissions tunable per VNET
Both Windows (TcpMaxDataRetransmissions) and Linux (tcp_retries2)
allow to restrict the maximum number of consecutive timer based
retransmissions. Add that same capability on a per-VNet basis to
FreeBSD.

Reviewed By:		cc, tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D40424
2023-06-06 22:58:54 +02:00
Dmitry Chagin 84617f6fcc linux(4) rt_sendsig: Remove the use of caddr_t
Replace caddr_t by more appropriate char *.

MFC after:		2 weeks
2023-06-06 23:01:39 +03:00
Andrew Turner 62f9bcf2b4 Switch to contigmalloc in the Hyper-V code
In the Hyper-V drivers we need to allocate buffers shared between the
host and guest. This memory has been allocated with bus_dma, however
it doesn't use this correctly, e.g. it is missing calls to
bus_dmamap_sync. Along with this on arm64 we need this memory to be
mapped with the correct memory type that bus_dma may not use.

Switch to contigmalloc to allocate this memory as this will correctly
allocate cacheable memory.

Reviewed by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D40227
2023-06-06 10:50:59 +01:00
Kristof Provost 185c1cddd7 netinet: re-read IP length after PFIL hook
The pfil hook may modify the packet, so before we check its length (to
decide if it needs to be fragmented or not) we should re-read that
length.

This is most likely to happen when pf is reassembling packets. In that
scenario we'd receive the last fragment, which is likely to be a short
packet, pf would reassemble it (likely exceeding the interface MTU) and
then we'd transmit it without fragmenting, because we're comparing the
MTU to the length of the last fragment, not the fully reassembled
packet.

See also:	https://redmine.pfsense.org/issues/14396
Reviewed by:	cy
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D40395
2023-06-06 10:01:03 +02:00
Kristof Provost a9bfd080d0 if_epair: do not transmit packets that exceed the interface MTU
While if_epair has no issues doing this we should drop those packets
anyway, because it improves the fidelity of the automated tests.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D40397
2023-06-06 10:00:48 +02:00