DragonFlyBSD/src d41d1a0share/man/man4 ahci.4, sys/dev/disk/ahci ahci.c ahci_dragonfly.c

ahci - Properly check and set SATA capabilities and features for ALPM.

- This should now only enable device-initiated and/or host-initiated link
  power-management when it is supported by both controller and disk device.

- Also this now allows for device-initiated power-management to be enabled
  with AHCI controllers that don't support automatic host-initiated
  power-management.

- In addition, this adds support for automatic promotion of "partial" state
  to "slumber" state (i.e. without needing to go through "active" state).

- The kernel console output now explicitly tells when it's enabling DIPM
  (device-initiated power management) and HIPM (host-initiated power
  management) respectively.
DeltaFile
+100-19sys/dev/disk/ahci/ahci.c
+5-8sys/dev/disk/ahci/ahci_dragonfly.c
+9-1share/man/man4/ahci.4
+8-2sys/dev/disk/ahci/atascsi.h
+122-304 files

DragonFlyBSD/src fe14ae5sys/netproto/802_11/wlan ieee80211_ratectl_none.c

wlan - Remove NULL free in fallback "none" ratectl code.

This avoids a kernel panic when detaching a wlan interface that was created
with the "none" ratectl code (i.e. when the wlan_amrr module wasn't loaded).
DeltaFile
+0-1sys/netproto/802_11/wlan/ieee80211_ratectl_none.c
+0-11 files

DragonFlyBSD/src 5f49e87sys/vfs/hammer2 hammer2_chain.c

hammer2 - Add debugging

* Debug situations where the CRC fails.  Print enough information
  for us to poke around and compare the in-kernel buffer against
  the disk buffer.

  All instances to date where hammer2 has detected CRC corruption
  has been due to in-memory corruption, source as yet undetermined.

* Usually hammer2 refuses to operate on the file/directory in
  question until the buffer cache buffer with the in-memory error
  is recycled or the machine is rebooted, avoiding corruption.
  But it is possible that hammer2 might miss an in-memory
  corruption event in some instances (occurring after the CRC
  check, for example).
DeltaFile
+24-3sys/vfs/hammer2/hammer2_chain.c
+24-31 files

DragonFlyBSD/src abe564fsys/kern vfs_bio.c vfs_vm.c, sys/vfs/ext2fs ext2_vnops.c

kernel - Minor Syntax cleanup

* Minor syntax cleanup
DeltaFile
+3-3sys/kern/vfs_bio.c
+4-2sys/vfs/ufs/ffs_vfsops.c
+2-2sys/vfs/ext2fs/ext2_vnops.c
+2-2sys/kern/vfs_vm.c
+2-1sys/vfs/hammer2/hammer2_vnops.c
+2-1sys/vfs/hammer/hammer_ondisk.c
+15-115 files not shown
+25-1511 files

DragonFlyBSD/src c3f20a5sys/kern vfs_subr.c, sys/vfs/nfs nfs_vnops.c

kernel - Handle race in vfsync_bp() and nfs_flush_bp()

* The RB_SCAN callback code on the clean/dirty buffer trees
  must bump b_refs temporarily when issuing a blocking lock
  to prevent the buffer from being ripped out from under the
  call, as the vnode token will be lost during the blocking
  operation.

* vfsync_bp() and vfs_flush_bp() omitted the required refs.

* Code cleanup.
DeltaFile
+13-5sys/kern/vfs_subr.c
+2-0sys/vfs/nfs/nfs_vnops.c
+15-52 files

DragonFlyBSD/src 4748425sys/kern vfs_subr.c

kernel - Fix race in brelvp() and reassignbuf()

* brelvp() can be called with just the buffer (bp) locked.  The
  vnode might not be locked or referenced at the time brelvp()
  is called, or might be locked by some other entity at the time.

* brelvp() obtains the vnode token but this is not sufficient.
  There is a race where, once the bp is removed from the vnode lists,
  the related vnode might be retired out from under brelvp() if the
  vp token is temporarily lost.

  The token can, in fact, be temporarily lost during the syncer list
  manipulation at the end of the routine.  Fix with a vhold()/vdrop()
  around the related code.

* In addition, set bp->b_vp to NULL before the syncer_list manipulation
  instead of after, ensuring that it is NULL'd out while the vnode token
  is still atomically held.  It was theoretically ok before since the
  bp should be locked, but the lost vnode token atomicy was concerning

    [3 lines not shown]
DeltaFile
+23-10sys/kern/vfs_subr.c
+23-101 files

DragonFlyBSD/src ab7d624tools/tools/crypto cryptotest.c cryptokeytest.c

tools: Remove tools/crypto
DeltaFile
+0-622tools/tools/crypto/cryptotest.c
+0-287tools/tools/crypto/cryptokeytest.c
+0-105tools/tools/crypto/cryptostats.c
+0-50tools/tools/crypto/Makefile
+0-45tools/tools/crypto/README
+0-1,1095 files

DragonFlyBSD/src b84e7dc. Makefile_upgrade.inc, sys/config X86_64_GENERIC

crypo: Cleanup from last two patches

Suggested-by: aly
DeltaFile
+9-5sys/crypto/crypto.c
+0-10Makefile_upgrade.inc
+0-1sys/config/X86_64_GENERIC
+9-163 files

DragonFlyBSD/src 056e2ccshare/man/man9 crypto.9, sys/dev/crypto/aesni aesni.c

opencrypto - remove in-kernel crypto(9) framework

The opencrypto crypto(9) API was quite complex (8k LoC), slow and not
used by any other kernel subsystem within DragonFly anymore. It allowed
for chaining various operations, crypto ops and compression, but AFAIK
this was never really used and rather complicated.  For a much simpler,
synchronous API see sys/src/crypto/cryptoapi. For a nice writeup on the
problems of crypto(9) in the context of FreeBSD, please see [1].

The opencrypto API was asynchronous by design. This was good back in the
days when dedicated hardware crypto devices did exist to help offload
the CPU. But the world has now changed towards synchronous CPU
instructions like AESNI. These dedicated CPU instructions are best
called synchronously, which removes the need for book-keeping of
asynchronous requests, often greatly simplifying the caller as well as
the API and "backend" implementation.

Furthermore, those dedicated crypto CPU instructions are not limited to
the kernel, they can be directly used by userland applications as well.

    [15 lines not shown]
DeltaFile
+0-1,651sys/opencrypto/crypto.c
+0-1,433sys/opencrypto/cryptosoft.c
+0-1,099sys/opencrypto/xform.c
+0-672share/man/man9/crypto.9
+0-545sys/opencrypto/castsb.h
+0-516sys/dev/crypto/aesni/aesni.c
+0-5,91635 files not shown
+112-8,04341 files

DragonFlyBSD/src c1ba328. UPDATING, lib/libtcplay crypto-dev.c

cryptodev: remove /dev/crypto pseudo-device

Remove the /dev/crypto pseudo-device. OpenBSD, which invented this API,
did this step back in release 5.7 (2015).

Note that this commit only removes the userland-facing /dev/crypto
device while still keeping the in-kernel crypto(9) API as-is. The plan
is to finally remove crypto(9) in a future commit.

The only applications within DragonFly that ever made use of /dev/crypto
were tcplay(8), cryptsetup(8) and cryptdisks(8) via libtcplay. But this
dependency on /dev/crypto was dropped in commit
ede102cd94449fe52fa9da25631d9f15af6d62ef as of April 21, 2025 in favor
of doing the crypto operations directly in userland without any help
from the kernel via /dev/crypto.

Userland libraries or applications like OpenSSH and OpenSSL do not use
/dev/crypto, mainly for performance reasons (and portability).
DeltaFile
+0-930sys/opencrypto/cryptodev.c
+0-165lib/libtcplay/crypto-dev.c
+0-131share/man/man4/crypto.4
+0-124test/crypto/cryptoapi/crypto-dev.c
+18-0UPDATING
+0-7sys/dev/crypto/cryptodev/Makefile
+18-1,35713 files not shown
+34-1,38219 files

DragonFlyBSD/src fcabea4sys/dev/virtual/virtio/block virtio_blk.c

virtio_blk - Compare old/write-cache setting in vtblk_write_cache_sysctl.
DeltaFile
+5-2sys/dev/virtual/virtio/block/virtio_blk.c
+5-21 files

DragonFlyBSD/src c12552bsys/dev/virtual/virtio/block virtio_blk.c

virtio_blk - Move sysctl setup to the end of attachement.
DeltaFile
+1-2sys/dev/virtual/virtio/block/virtio_blk.c
+1-21 files

DragonFlyBSD/src ae06013sys/dev/disk/mmcsd mmcsd.c, sys/dev/virtual/virtio/block virtio_blk.c

kernel - Do readonly check in .d_open method in mmcsd(4) and virtio_blk(4).

* Makes read-write open fail properly for read-only storage in mmcsd(4) and
  virtio_blk(4), instead of only resulting in transfer errors for the
  disk writes.
DeltaFile
+3-13sys/dev/virtual/virtio/block/virtio_blk.c
+6-8sys/dev/disk/mmcsd/mmcsd.c
+9-212 files

DragonFlyBSD/src 7550650sys/dev/misc/syscons sckmsrndr.c syscons.c

syscons - Add 16bit rendering code for UEFI and KMS driver framebuffers.

This fixes syscons rendering with KMS graphics drivers, when the driver
hands us a 16bit console framebuffer.
DeltaFile
+179-70sys/dev/misc/syscons/sckmsrndr.c
+4-2sys/dev/misc/syscons/syscons.c
+183-722 files

DragonFlyBSD/src d6d89dfsys/dev/virtual/virtio/block virtio_blk.c

virtio_blk - Enable D_KVABIO API.

This should avoid some unnecessary page invalidations.
This driver already was compliant, since it never accesses any of the data
in the bio buffer.
DeltaFile
+5-1sys/dev/virtual/virtio/block/virtio_blk.c
+5-11 files

DragonFlyBSD/src 17f49b3sys/vfs/isofs/cd9660 cd9660_node.c

cd9660 - Fixup typo from fb62a9282b1, to apply *upper* limit to hash table size.
DeltaFile
+1-1sys/vfs/isofs/cd9660/cd9660_node.c
+1-11 files

DragonFlyBSD/src 8ac8573usr.bin/kdump kdump.c kdump.1

kdump - Add -h option to dump data as hex

* Add -h option, dumps data as hex instead of ascii.
DeltaFile
+55-34usr.bin/kdump/kdump.c
+2-0usr.bin/kdump/kdump.1
+57-342 files

DragonFlyBSD/src 0d0182bsys/vfs/hammer2 hammer2_ioctl.c

hammer2 - disable FIOSEEKHOLE

* This function is returning incorrect results and needs more work.
  Disable for now.   Certain portions of the hammer2 btree may not yet
  be synchronized even when the file buffers are synced.  A SEEK_HOLE
  operation just after a file is written but prior to the next full
  filesystem may return incorrect data.  And there are other issues with
  the H2 implementation too.

  So... just disable it for now.

* Fixes make configure; make sequences in dports where grep uses
  SEEK_HOLE to try to locate any large holes in a file.
DeltaFile
+4-0sys/vfs/hammer2/hammer2_ioctl.c
+4-01 files

DragonFlyBSD/src d30f694usr.bin/kdump kdump.c kdump.1

kdump - Add -h option to dump data as hex

* Add -h option, dumps data as hex instead of ascii.
DeltaFile
+55-34usr.bin/kdump/kdump.c
+2-0usr.bin/kdump/kdump.1
+57-342 files

DragonFlyBSD/src 986a428test/crypto/cryptoapi expected_output.md fixtures.csv, test/testcases/crypto/aesxts aes_xts.c

test: import more test cases to cryptapi_test

- Import test cases from test/testcases/crypto/* except for aesctr
  which we do not have support for.

- Dedup fixtures. We are testing symmetric ciphers here, so there is
  no need to keep duplicates of plaintext -> ciphertext and ciphertext
  -> plaintext.

- Always test in both directions: Encrypt plaintext and decrypt
  ciphertext.

- Store ct (ciphertext) in fixtures.csv.
DeltaFile
+0-5,462test/crypto/cryptoapi/expected_output.md
+4,248-365test/crypto/cryptoapi/fixtures.csv
+0-2,334test/testcases/crypto/serpent/serpentecb_vk.txt
+0-2,334test/testcases/crypto/twofish/twofishecb_vk.txt
+0-1,848test/testcases/crypto/aesxts/aes_xts.c
+0-1,566test/testcases/crypto/serpent/serpentecb_vt.txt
+4,248-13,90924 files not shown
+4,586-22,99930 files

DragonFlyBSD/src 9536fb9test/crypto/cryptoapi expected_output.md fixtures.csv

test: Also test CBC variants of cryptoapi
DeltaFile
+1,800-0test/crypto/cryptoapi/expected_output.md
+120-0test/crypto/cryptoapi/fixtures.csv
+12-0test/crypto/cryptoapi/crypto-dev.c
+12-0test/crypto/cryptoapi/crypto-api.c
+1,944-04 files

DragonFlyBSD/src 7e0e24csys/crypto/cryptoapi cryptoapi.c

cryptoapi: Revert inlining of some crypto functions

As this breaks the build due to gcc not able to inline indirect
function calls.
DeltaFile
+4-4sys/crypto/cryptoapi/cryptoapi.c
+4-41 files

DragonFlyBSD/src bd5bbd2test/crypto/cryptoapi cryptoapi_test.c expected_output.md

test: Integrate benchmark into cryptoapi_test util

Print execution times and add "-n REPETITIONS" option.

Take the benchmark results with a grain of salt when comparing the
cryptoapi results against the cryptodev results, as we do not use
the AESNI CPU instruction when crytoapi is used outside the kernel.

While there, parse CLI options using getopt(3) and add a few more
test fixtures.
DeltaFile
+91-21test/crypto/cryptoapi/cryptoapi_test.c
+60-0test/crypto/cryptoapi/expected_output.md
+23-21test/crypto/cryptoapi/crypto-dev.c
+18-13test/crypto/cryptoapi/crypto-api.c
+9-2test/crypto/cryptoapi/Makefile
+4-0test/crypto/cryptoapi/fixtures.csv
+205-576 files

DragonFlyBSD/src 2d6b98csys/crypto/cryptoapi cryptoapi.c

cryptoapi: inline functions and s/blocklen/blocksize/

- Inline a few functions which previously were macros

- Consistently use "blocksize" instead of "blocklen"

- Use uint8_t for alpha instead of int

- Use memset() in proximity of memcpy()

- Non-functional change
DeltaFile
+14-14sys/crypto/cryptoapi/cryptoapi.c
+14-141 files

DragonFlyBSD/src e328994sys/sys param.h

<sys/param.h>: Bump version for libusb(3) update
DeltaFile
+3-1sys/sys/param.h
+3-11 files

DragonFlyBSD/src 5629805lib/libusb libusb10.c libusb.h

libusb: Implement v1.0 libusb_get_version() API

It seems our USB stack was synced from FreeBSD in 2016, so I inherit the
'nano = 2016' version info from FreeBSD.

This function is at least used by 'sysutils/nut' to fill the
'driver.version.usb' metadata in 'usbhid-ups' driver.  The return value
doesn't matter at all.

Obtained-from: FreeBSD (commit 14b896ce80daad378a70a125ca15c2e23cd8d34b)
DeltaFile
+15-0lib/libusb/libusb10.c
+10-0lib/libusb/libusb.h
+5-1lib/libusb/libusb.3
+1-0lib/libusb/Makefile
+31-14 files

DragonFlyBSD/src b7cdd21lib/libusb libusb10.c libusb.3

libusb: Implement v1.0 libusb_get_port_number() API

This function is also used by 'sysutils/nut' to scan the USB devices.
However, nut uses dlopen() to determine the presence of this API and
allows it to be absent.

Obtained-from: FreeBSD (commit 0f2c706643ff211ce1e1eb0cfbc3c05bc67f2311)
DeltaFile
+8-0lib/libusb/libusb10.c
+6-0lib/libusb/libusb.3
+1-0lib/libusb/libusb.h
+1-0lib/libusb/Makefile
+16-04 files

DragonFlyBSD/src fe983b2lib/libusb libusb10.c libusb.3

libusb: Implement v1.0 libusb_set_auto_detach_kernel_driver() API

I noticed this function when I was porting the libusb_get_port_number()
function, so port this as well.

Obtained-from:
FreeBSD (commits 5b40d9601c72fbb04f32437d529dbf51252dc31e
and a3d81a8a8a4f8379b0870238ae417f7986d7d299)
DeltaFile
+25-3lib/libusb/libusb10.c
+11-0lib/libusb/libusb.3
+6-0lib/libusb/libusb20.c
+3-0lib/libusb/libusb20_int.h
+1-0lib/libusb/libusb.h
+1-0lib/libusb/Makefile
+47-36 files

DragonFlyBSD/src a52efb1lib/libusb libusb20.c libusb.h

libusb: Trim trailing whitespace
DeltaFile
+4-4lib/libusb/libusb20.c
+2-2lib/libusb/libusb.h
+6-62 files

DragonFlyBSD/src 9bf50b2sbin/hammer2 cmd_debug.c main.c

hammer2 - Enhance "show" (debugging feature)

Enhance the hammer2 show command to allow a chainspec to be specified
to dump a specific chain.  The output will also print the xxhash64
value for the buffer.
DeltaFile
+29-1sbin/hammer2/cmd_debug.c
+12-6sbin/hammer2/main.c
+8-1sbin/hammer2/hammer2.8
+1-1sbin/hammer2/hammer2.h
+50-94 files