Commit graph

2378 commits

Author SHA1 Message Date
Jung-uk Kim
62e841ccce acpica: Import ACPICA 20241212 2025-01-03 17:58:38 -05:00
Jung-uk Kim
1a259ad4ab acpica: Merge ACPICA 20240927 2025-01-03 17:42:12 -05:00
Jung-uk Kim
92f570c32e acpica: Import ACPICA 20240827 2025-01-03 17:41:26 -05:00
Jung-uk Kim
804fe26603 acpica: Import ACPICA 20240321 2025-01-03 17:35:05 -05:00
Emmanuel Vadot
b2d2a78ad8 Import device-tree files from Linux 6.12 2025-01-02 10:12:13 +01:00
Emmanuel Vadot
0e8011faf5 Import device-tree files from Linux 6.11 2025-01-02 10:10:48 +01:00
Emmanuel Vadot
7d0873ebb8 Import device-tree files from Linux 6.10 2025-01-02 10:09:19 +01:00
Emmanuel Vadot
01950c46b8 Import device-tree files from Linux 6.9 2025-01-02 10:06:22 +01:00
Adrian Chadd
cc3b7b7e71 ath_hal_ar9300: implement the TX/RX chainmask override for AR9300 HAL
This commit implements the missing capability set handlers for
setting the transmit and receive chainmasks.  I did this for the
AR5416 and later chips years ago, but not for these.

This is especially useful when you're only hooking up one or two
antennas on a 3 antenna device - or you just want to test it like
that.

It also requires updating the number of supported transmit/receive
streams, so also add them here.

Locally Tested:

* AR9300, STA mode, 1, 2 and 3 stream TX/RX configuration

Differential Revision:	https://reviews.freebsd.org/D48240
2024-12-30 17:35:56 -08:00
Adrian Chadd
18fabd338c ath_hal_ar9300: quick refactor of tx/rx chain handling
Use a temporary variable, make the lines shorter.

Differential Revision:	https://reviews.freebsd.org/D48239
Reviewed by:	emaste
2024-12-30 17:35:37 -08:00
Bjoern A. Zeeb
5d09d10707 iwlwifi: add missing blank, unwrap line
The original commit was missing a space between two words due to
uncareful string line wrapping; let the string run beyond the 80 char
limit in order to also make it grep-able [1].

Reported by:	jrtc27, Chris Torek (chris.torek gmail.com)
Suggested by:	emaste, imp [1]
Sponsored by:	The FreeBSD Foundation
Fixes:		87e140a5c6 avoid (hard) hang on loading module
MFC after:	3 days
X-MFC with:	87e140a5c6
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D48155
2024-12-20 07:09:24 +00:00
Emmanuel Vadot
af0a81b647 iwm: Stop shipping firmware as kernel module
Since we can load raw firmware start shipping them as is.
This also remove the uuencode format that don't add any value and garbage
collect old firmwares version.
For pkgbase users they are now in the FreeBSD-firmware-iwm package.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-12-16 10:44:47 +01:00
Bjoern A. Zeeb
87e140a5c6 iwlwifi: avoid (hard) hang on loading module
For certain users or chipsets (reports were for CNVi devices but
we are not sure if this is limited or specific to them) loading
if_iwlwifi hangs.

The reason for this is that a SYSINIT (module_load_order()) has not
yet run in this case and the Linux driver tries to load the
chipsets-specific module.  On FreeBSD all supported sub-modules are
part of if_iwlwifi so we do not have to load them separately but
calling into kern_kldload via LinuxKPI request_module while loading
the module gives us a hard hang.

iwlwifi calls request_module_nowait() so we can simply skip over this
and continue and the SYSINIT will do the job later if no other
dependencies fail.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
PR:		282789
Tested by:	Ruslan Makhmatkhanov, Pete Wright
Differential Revision: https://reviews.freebsd.org/D47994
2024-12-09 14:45:24 +00:00
Martin Matuska
17aab35a77 zfs: merge openzfs/zfs@e0039c705
Notable upstream pull request merges:
 #16215 44446dccd During pool export flush the ARC asynchronously
 #16301 4b4e346b9 Add ability to scrub from last scrubbed txg
 #16755 0ffa6f346 zdb: show dedup table and log attributes
 #16801 1cd2419ec Fix race in libzfs_run_process_impl
 #16814 a01504b35 Improve speculative prefetcher for block cloning
 #16819 a44eaf169 Optimize RAIDZ expansion
 #16825 e8b333e4d Fix false assertion in dmu_tx_dirty_buf() on cloning
 #16829 6e3c109bc Fix regression in dmu_buf_will_fill()
 #16832 2507db612 zdb_il: use flex array member to access ZIL records
 #16834 0e020bf3e FreeBSD: Remove an incorrect assertion in zfs_getpages()
 #16836 c33a55b0c Allow dsl_deadlist_open() return errors

Obtained from:	OpenZFS
OpenZFS commit:	e0039c7057
2024-12-07 14:55:14 +01:00
John Baldwin
18250ec6c0 Replace calls to bus_generic_attach with bus_attach_children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47675
2024-12-06 17:26:16 -05:00
John Baldwin
723da5d92f Replace calls to bus_generic_probe with bus_identify_children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47674
2024-12-06 17:26:05 -05:00
Martin Matuska
718519f4ef zfs: merge openzfs/zfs@d0a91b9f8
Notable upstream pull request merges:
 #16643 -multiple Change rangelock handling in FreeBSD's zfs_getpages()
 #16697 46c4f2ce0 dsl_dataset: put IO-inducing frees on the pool deadlist
 #16740 -multiple BRT: Rework structures and locks to be per-vdev
 #16743 a60ed3822 L2ARC: Move different stats updates earlier
 #16758 8dc452d90 Fix some nits in zfs_getpages()
 #16759 534688948 Remove hash_elements_max accounting from DBUF and ARC
 #16766 9a81484e3 ZAP: Reduce leaf array and free chunks fragmentation
 #16773 457f8b76e BRT: More optimizations after per-vdev splitting
 #16782 0ca82c568 L2ARC: Stop rebuild before setting spa_final_txg
 #16785 d76d79fd2 zio: Avoid sleeping in the I/O path
 #16791 ae1d11882 BRT: Clear bv_entcount_dirty on destroy
 #16796 b3b0ce64d FreeBSD: Lock vnode in zfs_ioctl()
 #16797 d0a91b9f8 FreeBSD: Reduce copy_file_range() source lock to shared

Obtained from:	OpenZFS
OpenZFS commit:	d0a91b9f88
2024-11-24 10:04:51 +01:00
Martin Matuska
5c65a0a916 zfs: merge openzfs/zfs@1c9a4c8cb
Notable upstream pull request merges:
 #16244 acb6e71ed Added output to `zpool online` and `offline`
 #16684 94a03dd1e Pack dmu_buf_impl_t by 16 bytes
 #16690 6187b1943 On the first vdev open ignore impossible ashift hints
 #16692 673efbbf5 zdb: add extra -T flag to show histograms of BRT refcounts
 #16693 2bf152021 Fix gcc uninitialized warning in FreeBSD zio_crypt.c
 #16694 b16e09619 Reduce dirty records memory usage
 #16701 5945676bc ZFS send should use spill block prefetched from
                  send_reader_thread
 #16734 1c9a4c8cb Fix user properties output for zpool list

Obtained from:	OpenZFS
OpenZFS commit:	1c9a4c8cb4
2024-11-13 13:49:10 +01:00
Bjoern A. Zeeb
52f8e99e7e iwlwifi: script to extract firmware details
When having to find a firmware image with a lower version number
we must only break the inner but not also the outer loop so we
keep looking at any possibly remaining firmware details.

While here also try to find a version from max..1 and not from 1..max.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-11-08 18:09:37 +00:00
Eric Joyner
f9a039060e
ice_ddp: Update to 1.3.41.0
Primarily adds support for E830 devices, unlocking all of their
functionality.

As well, update the README and remove the non-FreeBSD sections
from it.

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

MFC after:	2 days
Sponsored by:	Intel Corporation
2024-10-28 15:55:25 -07:00
Dimitry Andric
b8c3dd46bb Fix gcc unused value warnings in FreeBSD zfs_prop.c
With gcc we are seeing the following -Werror warnings:

  /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:53:33: error: statement with no effect [-Werror=unused-value]
     53 | #define simd_stat_init()        0
        |                                 ^
  /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1092:9: note: in expansion of macro 'simd_stat_init'
   1092 |         simd_stat_init();
        |         ^~~~~~~~~~~~~~
  /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c: In function 'zcommon_fini':
  /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd.h:54:33: error: statement with no effect [-Werror=unused-value]
     54 | #define simd_stat_fini()        0
        |                                 ^
  /workspace/src/sys/contrib/openzfs/module/zcommon/zfs_prop.c:1100:9: note: in expansion of macro 'simd_stat_fini'
   1100 |         simd_stat_fini();
        |         ^~~~~~~~~~~~~~

Both `simd_stat_init()` and `simd_stat_fini()` are defined in the
FreeBSD specific version of `simd.h`:

  #define	simd_stat_init()	0
  #define	simd_stat_fini()	0

These should both be defined as `do {} while (0)` instead, similar to
other macros in this file.

Reviewed by:	mav, tsoome (upstream)
Obtained from:	https://github.com/openzfs/zfs/pull/16693
MFC after:	3 days
Differential Revision:	<https://reviews.freebsd.org/D47297>
2024-10-28 18:34:58 +01:00
Bjoern A. Zeeb
6d67aabd63 rtw89: update Realtek's rtw89 driver.
This adds support for the Realtek 8922AE PCI
wireless network (Wi-Fi 7) adapter.

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation
MFC after:	14 days
2024-10-28 14:42:36 +00:00
Bjoern A. Zeeb
11c53278a8 rtw88: update Realtek's rtw88 driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      14 days
2024-10-28 14:42:32 +00:00
Bjoern A. Zeeb
a4128aad85 iwlwifi: update Intel's iwlwifi/mvm driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:	The FreeBSD Foundation
MFC after:	14 days
2024-10-28 14:42:25 +00:00
Dimitry Andric
3ceba58a75 Fix gcc uninitialized warning in FreeBSD zio_crypt.c
With gcc we are seeing the following -Werror warning:

    In file included from /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h:28,
                     from /workspace/src/sys/contrib/openzfs/include/sys/zfs_context.h:69:
    In function 'zfs_uio_init',
        inlined from 'zio_do_crypt_data' at /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1690:2:
    /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h:102:45: error: 'puio_s.uio_offset' is used uninitialized [-Werror=uninitialized]
      102 |                 zfs_uio_soffset(uio) = uio_s->uio_offset;
          |                                        ~~~~~^~~~~~~~~~~~
    /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c: In function 'zio_do_crypt_data':
    /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1683:20: note: 'puio_s' declared here
     1683 |         struct uio puio_s, cuio_s;
          |                    ^~~~~~
    In function 'zfs_uio_init',
        inlined from 'zio_do_crypt_data' at /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1691:2:
    /workspace/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h:102:45: error: 'cuio_s.uio_offset' is used uninitialized [-Werror=uninitialized]
      102 |                 zfs_uio_soffset(uio) = uio_s->uio_offset;
          |                                        ~~~~~^~~~~~~~~~~~
    /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c: In function 'zio_do_crypt_data':
    /workspace/src/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c:1683:28: note: 'cuio_s' declared here
     1683 |         struct uio puio_s, cuio_s;
          |                            ^~~~~~

Indeed, `zfs_uio_init()` does:

    static __inline void
    zfs_uio_init(zfs_uio_t *uio, struct uio *uio_s)
    {
            memset(uio, 0, sizeof (zfs_uio_t));
            if (uio_s != NULL) {
                    GET_UIO_STRUCT(uio) = uio_s;
                    zfs_uio_soffset(uio) = uio_s->uio_offset;
            }
    }

while the code in `zio_crypt.c` has:

    /*
     * Primary encryption / decryption entrypoint for zio data.
     */
    int
    zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key,
        dmu_object_type_t ot, boolean_t byteswap, uint8_t *salt, uint8_t *iv,
        uint8_t *mac, uint_t datalen, uint8_t *plainbuf, uint8_t *cipherbuf,
        boolean_t *no_crypt)
    {
            int ret;
            boolean_t locked = B_FALSE;
            uint64_t crypt = key->zk_crypt;
            uint_t keydata_len = zio_crypt_table[crypt].ci_keylen;
            uint_t enc_len, auth_len;
            zfs_uio_t puio, cuio;
            struct uio puio_s, cuio_s;
            uint8_t enc_keydata[MASTER_KEY_MAX_LEN];
            crypto_key_t tmp_ckey, *ckey = NULL;
            freebsd_crypt_session_t *tmpl = NULL;
            uint8_t *authbuf = NULL;

            zfs_uio_init(&puio, &puio_s);
            zfs_uio_init(&cuio, &cuio_s);
            memset(GET_UIO_STRUCT(&puio), 0, sizeof (struct uio));
            memset(GET_UIO_STRUCT(&cuio), 0, sizeof (struct uio));

So between the declaration of `puio_s` and `cuio_s`, there is no
initialization of these variables before `zfs_uio_init()` gets called.

Similar to the Linux variant of zio_crypt.c, I think it would be better
to memset the structs `puio_s` and `cuis_s` _before_ calling
`zfs_uio_init()`.

Reviewed by:    tsoome
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D47281
2024-10-25 18:19:25 +02:00
Martin Matuska
87bf66d4a7 zfs: merge openzfs/zfs@b2f6de7b5
Notable upstream pull request merges:
 #16598 b4e4cbeb2 Always validate checksums for Direct I/O reads
 #16603 cefef28e9 vdev_id: multi-lun disks & slot num zero pad
 #16613 ab777f436 Return boolean_t in inline functions of
                  lib/libspl/include/sys/uio.h
 #16616 efeb60b86 FreeBSD: ignore some includes when not building kernel
 #16617 ca0141f32 zpool/zfs: restore -V & --version options
 #16632 7bf525530 zpool/zfs: allow --json wherever -j is allowed
 #16635 7e4be9275 zdb: fix printf format in dump_zap()
 #16640 48dfe3974 Fallback to strerror() when strerror_l() isn't available
 #16650 38a04f0a7 freebsd: Use compiler.h from FreeBSD's base's linuxkpi
 #16664 fba6a9069 zfs_debug: Restore log size limit for userspace
 #16665 fba6a9069 Fix compile-time warnings caused by duplicate struct
                  typedefs
 #16667 b2f6de7b5 zdb: show bp in uberblock dump

Obtained from:	OpenZFS
OpenZFS commit:	b2f6de7b58
2024-10-20 21:26:56 +02:00
Bjoern A. Zeeb
96190b4fef LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details
Add a "zzz_fw_ports_fwget.sh" script to each LinuxKPI based wireless
driver which in essential are all the same and in detail all different.
The scripts have been referenced in fwget(8) sources since d33f5a0afa
but were never committed.

The scripts do the full job compared to `single-line-scripts` I tried to
use before to ease maintainance life.  Some use hacks like calling cpp
and extracting bits from the output to piece them together over multiple
files.  It will be left as an exercise for the future to see if what was
done (a longer while ago) for iwlwifi(4) would be a good idea for some
other drivers too, to have a FreeBSD-specific sysctl to export some of
the accumulated data in an easily processable way.
The scripts are written in the "perl spirit" -- "to get the job done" --
and not to be nice or neat or efficient.  For that we do not need them
often enough or in any critical path.  People are welcome to improve
them if they feel like.
I've used them for two version updates now and even if ports enforce
some other (manual) editing to keep support for multiple branches for
now they worked extremly well.

For the most the scripts extract 2 parts: PCI IDs and firmware name;
then they add "flavor"s to both and put the information together.

That output is then separated into:
- fwget(8) lines of PCI ID to port/package
  wifi-firmware-${name}-kmod-${flavor} mappings and
- distfiles per flavor for the ports.
- For iwlwififw(4) we also generate the tables for the man page
  (and the wiki) and hopefully the .Sh HARDWARE section for iwlwifi.4
  soon too.

Depending on driver various other checks are done, e.g.,
- does the PCI ID have one or more firmware files/flavors associated,
- does the referenced firmware exist in the linux-firmware.git repo,
- are there duplicates,
- find the latest version of the firmware API.

Sponsored by:	The FreeBSD Foundation
Suggested by:	imp (to have automation in D44918)
MFC after:	3 days
2024-10-17 17:26:28 +00:00
Bjoern A. Zeeb
b4c8f251d6 iwlwifi: FreeBSD specific sysctl export update
Update the sysctl export (also adding a mapping function) to also
print (1) for all lines the "flavor" (device_family) name and (2)
also print lines where we only have the trans cfg and not iwl cfg
as with the flavor we can match PCI IDs to firmware package and so
we can have an increased number of matches.
A side effect is that we can also have fwget(8) PCI ID matches for
firmware (flavors) not yet (publicly) existing.  That will allow
us to add them at a later point while a previous release already
supports the chipsets and knows how to get the firmware for them.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-10-17 17:26:24 +00:00
Warner Losh
b487b1f502 openzfs/freebsd: Use compiler.h from FreeBSD's base's linuxkpi
The FreeBSD linux/compiler.h in OpenZFS was copied from a very old
version of FreeBSD's linuxkpi's linux/compiler.h. There's no need for
this duplication. Use FreeBSD's linuxkpi version instead, and provide
zfs_fallthrough to augment it (it's all that's needed). Use #pragma once
to avoid naming issues for guard variables. Since this is a complete
rewrite, use my copyright here (the original code in FreeBSD still
credits everybody).

Remove extra copies of macros that were defined elsewhere, but are now
properly defined in LinuxKPI so are redundant.

This is currently pull request #16650 upstream. Committing now to get
wider testing (make universe works, but historically doesn't catch all
errors).

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D47131
2024-10-15 15:05:49 -06:00
Osama Abboud
f5f8d7c9cd ena: Upgrade ena-com to freebsd v2.8.0
Merge commit '0fd934a2fd12fa74ae409d3de1313e449be5d97e'

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2024-10-15 17:02:26 +00:00
Sia Jee Heng
8056c66557 acpica: Update the SPCR table to version 4
cherry pick 1eeff52124a45d5cd887ba5687bbad0116e4d211 from acpica:

SPCR: Update the SPCR table to version 4

The Microsoft Serial Port Console Redirection (SPCR) specification
revision 1.09 comprises additional fields [1]. The newly added fields
are:
- RISC-V SBI
- Precise Baud Rate
- NamespaceStringLength
- NamespaceStringOffset
- NamespaceString

Additionaly, this code will support up to SPCR revision 1.10, as it
includes only minor wording changes.

[1] https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table

Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
2024-10-11 12:06:33 -06:00
Bjoern A. Zeeb
ce15215bef rtw89: add missing bsddriver.name assignments for two chipsets
On FreeBSDs we locally set bsddriver.name in struct pci_driver to have
the same name for all chipsets.  This helps with, e.g., device
enumeration.  For two chipsets the manual entry was missing.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-10-11 13:40:15 +00:00
Martin Matuska
7a7741af18 zfs: merge openzfs/zfs@b10992582
Notable upstream pull request merges:
 #9416  -multiple zio_compress: introduce max size threshold
 #10018 a10e552b9 Adding Direct IO Support
 #15147 e419a63bf xattr dataset prop: change defaults to sa
 #15454 7e957fde7 send/recv: open up additional stream feature flags
 #15810 0d77e738e Defer resilver only when progress is above a threshold
 #15921 3cf2bfa57 Allocate zap_attribute_t from kmem instead of stack
 #16483 -multiple dmu_objset: replace dnode_hash impl with cityhash4
 #16485 8be2f4c3d zio_resume: log when unsuspending the pool
 #16491 88433e640 sys/types32.h: Remove struct timeval32 from libspl header
 #16496 f245541e2 zfs_file: implement zfs_file_deallocate for FreeBSD 14
 #16511 308f7c2f1 Fix an uninitialized data access
 #16529 29c9e6c32 Fix handling of DNS names with '-' in them for sharenfs
 #16531 ddf5f34f0 Avoid fault diagnosis if multiple vdevs have errors
 #16539 6f50f8e16 zfs_log: add flex array fields to log record structs
 #16546 d40d40913 Evicting too many bytes from MFU metadata
 #16551 3014dcb76 Reduce and handle EAGAIN errors on AIO label reads
 #16554 80645d658 FreeBSD: restore zfs_znode_update_vfs()
 #16565 832f66b21 FreeBSD: Sync taskq_cancel_id() returns with Linux
 #16567 48d1be254 Properly release key in spa_keystore_dsl_key_hold_dd()
 #16569 141368a4b Restrict raidz faulted vdev count
 #16583 c84a37ae9 lua: add flex array field to TString type
 #16584 86737c592 Avoid computing strlen() inside loops
 #16587 d34d4f97a snapdir: add 'disabled' value to make .zfs inaccessible
 #16593 224393a32 feature: large_microzap
 #16597 412105977 Temporarily disable Direct IO by default
 #16605 4ebe674d9 ARC: Cache arc_c value during arc_evict()

Backported pull request merges:
 #16613 ab777f436 Return boolean_t in inline functions of
                  lib/libspl/include/sys/uio.h
 #16616 efeb60b86 FreeBSD: ignore some includes when not building kernel
 #16635 ---TBD--- zdb: fix printf format in dump_zap()

Obtained from:	OpenZFS
OpenZFS commit:	b109925820
OpenZFS tag:	2.3.0-rc1
2024-10-11 08:43:49 +02:00
John Baldwin
59f5f100b7 openzfs: Reduce local diffs
These are all local diffs that have no functional change.

Reviewed by:	mav, emaste
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D46530
2024-10-03 12:07:43 -04:00
Jamie Gritton
ae1a0648b0 jail: unbreak the zfs.mount_snapshot option
The change of its description from integer to boolean didn't actually
change it to a boolean, but only made it impossible to set as either
a boolean or an integer.

Rather than make it work as a boolean parameter should, just revert
to the old (working) integer parameter, and change the documentation
to match.

PR:		274263
Reported by:	andrew.hotlab at hotmail
2024-09-19 12:49:01 -07:00
Bjoern A. Zeeb
7728586800 mt76: add mt7615 to the pile of buildable drivers
Ignoring page_pools with the few needed adjustments and ignoring 7622
mt7615 seems to build as well.  Add it so once we can connect it to
the build people can start testing and debugging.
(The actual work was done on a newer version of the mt76 drivers but
it seems the to-build-changes equally apply here already).

Requested by:	Radu-Cristian Fotescu (freebsd-wireless, 2024-07-31)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-09-13 00:18:02 +00:00
Jessica Clarke
796c6031cd Merge commit 88433e640d from upstream OpenZFS (by Jessica Clarke)
sys/types32.h: Remove struct timeval32 from libspl's header (#16491)

  macOS Sequoia's sys/sockio.h, as included by various bootstrap tools
  whilst building FreeBSD, has started to include net/if.h, which then
  includes sys/_types/_timeval32.h and provide a conflicting definition
  for struct timeval32. Since this type is entirely unused within OpenZFS,
  simply delete the type rather than adding in some kind of OS detection.

  This fixes building FreeBSD on macOS Sequoia (Beta).

  Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
  Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
  Reviewed-by: Alexander Motin <mav@FreeBSD.org>
  Reviewed-by: Tony Hutter <hutter2@llnl.gov>

MFC after:	1 week
2024-09-11 18:01:06 +01:00
Mariusz Zaborski
7f4731ab67 libnv: correct the calculation of the structure's size
Reported by:	Milosz Kaniewski <milosz.kaniewski@gmail.com>
2024-09-11 16:43:43 +02:00
Baptiste Daroussin
001ca4955e zdb: fix build on 32bits 2024-09-10 15:41:26 +02:00
Martin Matuska
e2df9bb441 zfs: merge openzfs/zfs@b10992582
Notable upstream pull request merges:
 #15892 -multiple Fast Dedup: Introduce the FDT on-disk format and feature flag
 #15893 -multiple Fast Dedup: “flat” DDT entry format
 #15895 -multiple Fast Dedup: FDT-log feature
 #16239 6be8bf555 zpool: Provide GUID to zpool-reguid(8) with -g
 #16277 -multiple Fast Dedup: prune unique entries
 #16316 5807de90a Fix null ptr deref when renaming a zvol with snaps and snapdev=visible
 #16343 77a797a38 Enable L2 cache of all (MRU+MFU) metadata but MFU data only
 #16446 83f359245 FreeBSD: fix build without kernel option MAC
 #16449 963e6c9f3 Fix incorrect error report on vdev attach/replace
 #16505 b10992582 spa_prop_get: require caller to supply output nvlist

Obtained from:	OpenZFS
OpenZFS commit:	b109925820
2024-09-09 18:13:02 +02:00
Rob Norris
d59a761834 spa_prop_get: require caller to supply output nvlist
All callers to spa_prop_get() and spa_prop_get_nvlist() supplied their
own preallocated nvlist (except ztest), so we can remove the option to
have them allocate one if none is supplied.

This sidesteps a bug in spa_prop_get(), where the error var wasn't
initialised, which could lead to the provided nvlist being freed at the
end.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
(cherry picked from commit 366d6fecf6bb3c59668b0f3b89f2a610595f3d2f)
2024-09-05 10:27:35 -07:00
Mariusz Zaborski
241a7ddd71 libnv: add tests to verify potential overflow issues
Differential Revision:  https://reviews.freebsd.org/D46131
2024-09-04 13:43:16 +02:00
Mariusz Zaborski
3aaaca1b51 libnv: verify that string is null terminated
During unpacking, we ensure that we do not read beyond the
declared size. However, unpack uses a function that copies
null-terminated strings. Prior to this commit, if the last string
was not null-terminated, it could result in copying data into a
buffer smaller than the allocated size.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45288
Security:       CAP-03
Reported by:    Synacktiv
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46138
2024-09-04 13:42:55 +02:00
Mariusz Zaborski
36fa90dbde libnv: allocate buffer in a safe way
Ensure that the calculation of size of array doesn't
overflow.

Security:	FreeBSD-24:09.libnv
Security:	CVE-2024-45287
Security:	CAP-02
Reported by:	Synacktiv
Reported by:	Taylor R Campbell (NetBSD)
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46131
2024-09-04 13:42:49 +02:00
Zhenlei Huang
778ea7ed5a vchiq(4): Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:34 +08:00
Zhenlei Huang
66c35a6675 krping: Stop checking for failures from malloc(M_WAITOK)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
2024-09-03 18:25:21 +08:00
Warner Losh
ce7fac64ba Revert "nvme: Separate total failures from I/O failures"
All kinds of crazy stuff was mixed into this commit. Revert
it and do it again.

This reverts commit d5507f9e43.

Sponsored by:		Netflix
2024-08-15 21:29:53 -06:00
Warner Losh
d5507f9e43 nvme: Separate total failures from I/O failures
When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
commands on half-failed drives.

Fixes: 9229b3105d (nvme: Fail passthrough commands right away in failed state)
Sponsored by: Netflix
2024-08-15 20:22:18 -06:00
Martin Matuska
29dc934914 zfs: merge openzfs/zfs@d2ccc2155
Notable upstream pull request merges:
 #16431 244ea5c48 Add missing kstats to dataset kstats

Obtained from:	OpenZFS
OpenZFS commit: d2ccc21552
2024-08-15 13:30:31 +02:00
Paul Dagnelie
bd4f2023bb Add missing kstats to dataset kstats
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #16431
(cherry picked from commit 244ea5c488)
2024-08-14 15:42:00 -07:00