Commit Graph

275599 Commits

Author SHA1 Message Date
Hans Petter Selasky
527762b2f7 mlx4: Fix a memory leak bug.
In function mlx4_opreq_action(), pointer "mailbox" is not released,
when mlx4_cmd_box() return and error, causing a memory leak bug.
Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can
free this pointer.

Linux commit:
febfd9d3c7f74063e8e630b15413ca91b567f963

PR:		264056
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-19 10:13:06 +02:00
Hans Petter Selasky
ad7741ff69 ibcore: Fix possible memory leak in ib_mad_post_receive_mads()
If ib_dma_mapping_error() returns non-zero value,
ib_mad_post_receive_mads() will jump out of loops and return -ENOMEM
without freeing mad_priv. Fix this memory-leak problem by freeing
mad_priv in this case.

Linux commit:
a17f4bed811c60712d8131883cdba11a105d0161

PR:		264057
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-05-19 10:13:06 +02:00
Martin Matuska
716fd348e0 zfs: merge openzfs/zfs@c0cf6ed67
Notable upstream pull request merges:
  #10662 zvol_wait: Ignore locked zvols
  #12789 Improve log spacemap load time
  #12812 Improved zpool status output, list all affected datasets
  #13277 FreeBSD: Use NDFREE_PNBUF if available
  #13302 Make zfs_max_recordsize default to 16M
  #13311 Fix error handling in FreeBSD's get/putpages VOPs
  #13345 FreeBSD: Fix translation from ABD to physical pages
  #13373 zfs: holds: dequadratify
  #13375 Corrected edge case in uncompressed ARC->L2ARC handling
  #13388 Improve mg_aliquot math
  #13405 Reduce dbuf_find() lock contention
  #13406 FreeBSD: use zero_region instead of allocating a dedicated page

Obtained from:	OpenZFS
OpenZFS commit:	c0cf6ed679
2022-05-19 00:55:59 +02:00
Dimitry Andric
4e2d3f26bd Remove accidentally committed diff file
I accidentally added the upstream diff file from the llvm commit I
merged in 1a0329799c. Clean it out.

Noticed by:	markj
Fixes:		1a0329799c
MFC after:	2 weeks
2022-05-18 21:45:40 +02:00
Ed Maste
ec3c01ae72 makefs: sort cd9660 sysid entries in man page
"efi" was added at the end of the sysid list rather than in alpha
order.  Move it as a diff reduction against NetBSD.
2022-05-18 15:42:12 -04:00
Dimitry Andric
1a0329799c Apply llvm fix for "Invalid PPC CTR loop!" error on powerpcspe
Merge commit d9d15af7873f from llvm git (Qiu Chaofan):

  [PowerPC] Treat llvm.fmuladd intrinsic as using CTR

  This fixes bug 55463, similar to D78668. This is a temporary fix since
  we will switch to post-isel CTR loop determination in the future.

  Reviewed By: dim, shchenz

  Differential Revision: https://reviews.llvm.org/D125746

MFC after:	2 weeks
2022-05-18 20:29:02 +02:00
Ed Maste
f70de61e56 loader.efi: add cross-reference to loader(8)
The loader.efi man page describes UEFI-specific loader details, but not
general loader information.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-05-18 10:33:20 -04:00
Ruslan Bukin
41ce5498f8 Add OFW support to arm64's IOMMU framework.
This is needed to support non-PCI devices like memory-mapped
display controllers.
Split-out some initialization code from iommu_ctx_alloc() into
iommu_ctx_init() method so we could pass controller's MD-data
obtained from DTS to the driver prior to a CTX initialization.

Tested on Morello SoC.

Sponsored by:	UKRI
2022-05-18 14:11:23 +01:00
Ruslan Bukin
182a69328d Fix stream table entry (STE) initialization and removal.
For PCI devices we have entire L1 descriptor for every session ID (SID),
but for non-PCI (e.g. Display Processing Unit DPU), a single L1
descriptor serves multiple SIDs.
So prevent re-initialization of L1 descriptor if already initialized.
Don't free entire L1 descriptor on every STE removal.

Sponsored by:	UKRI
2022-05-18 13:42:37 +01:00
Michael Gmelin
ed87ff4e95 hidraw: Return string lengths for certain ioctls
Make HIDIOCGRAWPHYS, HIDIOCGRAWNAME, and HIDIOCGRAWUNIQ return
the length of the copied out string (including the trailing NUL
character), so they behave like their Linux hidraw counterparts.

Reviewed by:	wulf
Differential Revision:	https://reviews.freebsd.org/D35233
2022-05-18 12:12:19 +02:00
Warner Losh
f8f1e9cd1c bsd-family-tree: FreeBSD 13.1
Now that 13.1 has been announced, add today's date UTC as the release
date.

MFC After: 3 days
2022-05-17 18:02:42 -06:00
John Baldwin
12b37f8f9c cxgbe: Deactivate upper layer drivers (like TOE) during detach.
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D35237
2022-05-17 16:33:49 -07:00
Bjoern A. Zeeb
892b1874ac net80211: remove (optional) RSN from preobereq
802.11i-2004 did not specify that RSN can be added to the probereq,
only to the proberesp (and others) yet it was added in what seems was
b032f27c36 (multi-BSS support).
802.11-2020 does not list the IE either for probereq so remove it.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Okayed by:	adrian
Differential Revision: https://reviews.freebsd.org/D34893
2022-05-17 22:33:10 +00:00
Olivier Cochard
c678572e76 Prevent running sigwait tests in parallel
test_sig_discard_ign_* could not run at the same time.

Approved by:	dchagin
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D35236
2022-05-17 23:33:39 +02:00
Coleman Kane
c0cf6ed679
Fix compiler warnings about zero-length arrays in inline bitops
The compiler appears to be expanding the unused NULL pointer into a
zero-length array via the inline bitops code. When -Werror=array-bounds
is used, this causes a build failure. Recommended solution is allocate
temporary structures, fill with zeros (to avoid uninitialized data use
warnings), and pass the pointer to those to the inline calls.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #13463 
Closes #13465
2022-05-17 13:07:39 -07:00
Piotr Kubaj
f5024381ac powerpc: enable supported sanitizers on powerpc64*
1. Merge LLVM's 315d792130258a9b7250494be8d002ebb427b08f, adding support
for FreeBSD/powerpc64*.
2. Add sanitizer list to lib/libclang_rt/Makefile, taken from the list of
libraries that llvm-devel port builds.
3. powerpc64le supports the same sanitizers that powerpc64, but powerpc64le
also supports xray* sanitizers.
4. lib/libclang_rt/xray/Makefile hardcodes amd64-specific files, so that needs
to be conditionalized.
5. Sanitizers are not enabled for powerpc, because powerpc supports only
builtins and profile.

Reviewed by:	dim
Differential Revision: https://reviews.freebsd.org/D35228
Relnotes:	yes
MFC after:	3 days
2022-05-17 21:46:53 +02:00
Christian Weisgerber
9bf4983f54 truss: add ppoll(2) argument decoding
PR:		264029
Approved by:	emaste
MFC after:	3 days
2022-05-17 20:23:25 +02:00
Gleb Smirnoff
6890b58814 sockbuf: improve sbcreatecontrol()
o Constify memory pointer.  Make length unsigned.
o Make it never fail with M_WAITOK and assert that length is sane.
2022-05-17 10:10:42 -07:00
Gleb Smirnoff
b46667c63e sockbuf: merge two versions of sbcreatecontrol() into one
No functional change.
2022-05-17 10:10:42 -07:00
Gleb Smirnoff
eac7f0798b unix: garbage collect unp_dispose_mbuf() for brevity 2022-05-17 10:10:41 -07:00
Gleb Smirnoff
2e5bf7c49f unix: fix mbuf leak on close of socket with data
Fixes:	1f32cef471
2022-05-17 10:10:41 -07:00
Kristof Provost
386b1a033c pf: allocate krule->timestamp in pf_krule_alloc()
There are three calls which can allocate a new rule. DIOCADDRULE,
DIOCADDRULENV and DIOCCHANGERULE. The first two call pf_ioctl_addrule(),
but DIOCCHANGERULE does not. As a result rules created through
DIOCCHANGERULE do not have the timestamp per-cpu memory allocated, and
we panic when the rule is exported with pf_krule_to_nvrule().

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-05-17 15:55:08 +02:00
Vladimir Kondratyev
71fe907dfb LinuxKPI: Switch irq_work implementation back to standard taskqueue
from fast one as dmabuf does not run callbacks from critical sections
since drm-kmod 5.7.
Consumers which requires fair irq_work like drm-kmod 5.4 must #define
LKPI_IRQ_WORK_USE_FAST_TQ somewhere in source file before linux/irq_work.h
inclusion to enable old behavior.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35052
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
bec4576e4c LinuxKPI: Do not use forward declaration for struct llist_node
in linux/irq_work.h as irq_work structure contains full version of
llist_node rather than reference to it.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35052
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
fa30bff5da LinuxKPI: IRQ work add TASKQUEUE_FAIL_IF_PENDING flag to taskqueue_enqueue
call to match Linux.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35052
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
b6f87b78b5 LinuxKPI: Implement kthread_worker related functions
Kthread worker is a single thread workqueue which can be used in cases
where specific kthread association is necessary, for example, when it
should have RT priority or be assigned to certain cgroup.

This change implements Linux v4.9 interface which mostly hides kthread
internals from users thus allowing to use ordinary taskqueue(9) KPI.
As kthread worker prohibits enqueueing of already pending or canceling
tasks some minimal changes to taskqueue(9) were done.
taskqueue_enqueue_flags() was added to taskqueue KPI which accepts extra
flags parameter. It contains one or more of the following flags:

TASKQUEUE_FAIL_IF_PENDING - taskqueue_enqueue_flags() fails if the task
    is already scheduled to execution. EEXIST is returned and the
    ta_pending counter value remains unchanged.
TASKQUEUE_FAIL_IF_CANCELING - taskqueue_enqueue_flags() fails if the
    task is in the canceling state and ECANCELED is returned.

Required by:	drm-kmod 5.10

MFC after:	1 week
Reviewed by:	hselasky, Pau Amma (docs)
Differential Revision:	https://reviews.freebsd.org/D35051
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
0093bc3cd1 LinuxKPI: Implement sched_set_fifo(_low) functions
Required by:	drm-kmod

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D35050
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
1ebd7aeeca LinuxKPI: Add some pollution required by drm-kmod to linux/sched.h
MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D35050
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
6bcd132222 LinuxKPI: Add cpu_latency_qos_request_active stub to linux/pm_qos.h
Required by:	drm-kmod 5.10

MFC after:	1 week
Reviewers:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D35049
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
41559beb00 LinuxKPI: Fix typo in cond_resched_lock
Lock must be released rather than acquired around mi_switch call.

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D35048
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
29d5f0c148 LinuxKPI: Convert lkpi-shrinker lock to sx.
This fixes "might_sleep() with the following non-sleepable locks held:
exclusive sleep mutex lkpi-shrinker" warnings.

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D35047
2022-05-17 15:10:20 +03:00
Vladimir Kondratyev
f49cddbda6 LinuxKPI: Allow lkpi_iic driver to be a child of drm device.
i915kms exposes "AUX #/port #" I2C adapters as drm children

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D35046
2022-05-17 15:10:19 +03:00
Kevin Bowling
9b88ecd674 igc: Increase rx_buffer_size local variable to 32b
Apply 6987c47569 to igc. This is not
expected to have any benefit on current parts with current observed PBA
sizes but will avoid surprises if they are increased in future chips.

Approved by:	grehan
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35217
2022-05-16 20:15:34 -07:00
Gleb Smirnoff
aa9f97af93 tests/unix_dgram: account for size of sender address in the filling cycle
This fixes test failure with large net.local.dgram.recvspace values.
2022-05-16 19:08:21 -07:00
наб
276b08cb00 linux: libzutil: zfs_strip_path: only strip known prefixes
This mirrors FreeBSD:
  # zpool create -o cachefile= testpsko media/testpsko
  # zpool create -o cachefile= testpsko2 $PWD/testpsko2
  $ ./zpool list -v
  NAME                                              SIZE  ALLOC   FREE
  filling                                          25.5T  6.85T  18.6T
    mirror-0                                       3.64T   500G  3.15T
      ata-HGST_HUS726T4TALE6L4_V6K2L4RR                -      -      -
      ata-HGST_HUS726T4TALE6L4_V6K2MHYR                -      -      -
    raidz1-1                                       21.8T  6.36T  15.5T
      ata-HGST_HUS728T8TALE6L4_VDKT237K                -      -      -
      ata-HGST_HUS728T8TALE6L4_VDGY075D                -      -      -
      ata-HGST_HUS728T8TALE6L4_VDKVRRJK                -      -      -
  cache                                                -      -      -
    nvme0n1p4                                      63.0G  12.8G  50.2G
  tarta-boot                                        240M  50.0M   190M
    mirror-0                                        240M  50.0M   190M
      tarta-boot                                       -      -      -
      tarta-boot-nvme                                  -      -      -
  tarta-zoot                                       55.5G  6.96G  48.5G
    mirror-0                                       55.5G  6.96G  48.5G
      tarta-zoot                                       -      -      -
      tarta-zoot-nvme                                  -      -      -
  testpsko                                         39.5G   744K  39.5G
    media/testpsko1                                39.5G   744K  39.5G
  testpsko2                                        39.5G   130K  39.5G
    /home/nabijaczleweli/store/code/zfs/testpsko2  39.5G   130K  39.5G

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13413
Closes #9771
2022-05-16 15:56:57 -07:00
наб
5ac80603bd libzfs: constify zfs_strip_partition(), zfs_strip_path()
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13413
2022-05-16 15:56:53 -07:00
наб
ca3b105cd9 libzfs: pool: zpool_vdev_name: use libzfs_envvar_is_set
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13413
2022-05-16 15:56:48 -07:00
наб
e9072c76f8 zpool: max_width: monomorphise subtype iteration
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13413
2022-05-16 15:56:27 -07:00
Alan Somers
ecdc04d006 makefs: fix calculation of file sizes
When a new FS image is created we need to calculate how much space each
file is going to consume.
Fix two bugs in that logic:

1) Count the space needed for indirect blocks for large files.
1) Normally the trailing data of a file is written to a block of frag
   size, 4 kB by default.

However for files that use indirect blocks a full block is allocated,
32kB by default.  Take that into account.

Adjust size calculations to match what is done in ffs_mkfs routine:

* Depending on the UFS version the superblock is stored at a different
  offset. Take that into account.
* Add the cylinder group block size.
* All of the above has to be aligned to the block size.

Finally, Remove "ncg" variable. It's always 1 and it was used to
multiply stuff.

PR:		229929
Reviewed by:	mckusick
MFC after:	2 weeks
Sponsored by:	Semihalf
Submitted by:	Kornel Dulęba <mindal@semihalf.com>
Differential Revision:	https://reviews.freebsd.org/D35131
Differential Revision:	https://reviews.freebsd.org/D35132
2022-05-16 16:32:10 -06:00
Piotr Kubaj
c1e0431c22 riscv: also enable includes, stats and stats_client in libclang_rt
Reviewed by:	dim (earlier version)
Differential Revision: https://reviews.freebsd.org/D34735
MFC after:	3 days
2022-05-16 23:56:21 +02:00
Dmitry Chagin
3020bfe1b8 linux(4): Fix arm64 syscalls.master layout
MFC after:		2 weeks
2022-05-16 22:53:38 +03:00
Dmitry Chagin
41068268ec libsysdecode: Fix decoding of SCHED_ flags
Use sys/sched.h where SCHED_ flags are defined.

Reviewed by:		emaste
Differential revision:	https://reviews.freebsd.org/D35208
MFC after:		2 weeks
2022-05-16 21:57:48 +03:00
Bjoern A. Zeeb
88a15f72cf iwlwifi: import two fixes from linux v5.18-rc7
Import two changes from torvalds/linux.git at tag: v5.18-rc7:
b20bdd9cc9740ac1f2138adab25ddd51245c67be
    iwlwifi: mvm: Don't fail if PPAG isn't supported
7635a1ad8d92dcc8247b53f949e37795154b5b6f
    iwlwifi: iwl-dbg: Use del_timer_sync() before freeing

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-16 18:07:36 +00:00
Bjoern A. Zeeb
275172b519 iwlwifi: update firmware
Update to the latest iwlwifi firmware based on
 linux-firmware at b19cbdca78ab2adfd210c91be15a22568e8b8cae
 (tag: 20220509)
and update firmware module Makefiles accordingly.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-16 16:18:14 +00:00
Bjoern A. Zeeb
fac1f59384 iwlwifi: update driver from iwlwifi-next
Import code update from iwlwifi-next
 at e89600ebeeb14d18c0b062837a84196f72542830.

This amongst other things removes the deprecated BCAST_FILTERING option,
which we had disabled before due to firmware issues.
Also prepares us for the next firmware update.

The "enable_ini" module option has become an integer with a
sysctl proc equivalent handler.  Disable the module parameter changing
for the moment until we'll have working LinuxKPI support or implement
it as SYSCTL_PROC in FreeBSD directly.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-16 15:54:57 +00:00
Bjoern A. Zeeb
05d6f4d696 LinuxKPI: 802.11 add rfkill_soft_blocked()
Add rfkill_soft_blocked() to the list of things to implement in
preparation for an iwlwifi update.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-16 15:38:31 +00:00
Kevin Bowling
48a1a6be19 igc: Fix typo in PCI ID define usage
Reported by:	jenkins
Fixes:	bf0aa72f1f igc: Update PCI IDs
MFC after:	3 days
2022-05-15 16:17:49 -07:00
Kevin Bowling
bf0aa72f1f igc: Update PCI IDs
I226-K PCI ID got clarified by intel. Add a new I226 ID while here.

Approved by:	grehan
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35218
2022-05-15 15:09:58 -07:00
Kirk McKusick
187d7e9821 Reduce code nesting in readsuper().
No functional change.
2022-05-15 15:02:24 -07:00
Michael Tuexen
edc5b6ea88 sctp: use sb_avail() when accessing sb_acc for reading
This is a cleanup to simplify a patch for PR 260116.

PR:		260116
MFC after:	3 days
2022-05-14 12:38:43 +02:00