aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_block.txt
diff options
context:
space:
mode:
authorfellair <tesladead43@gmail.com>2025-06-12 20:39:14 +0300
committerAleksandr Nogikh <nogikh@google.com>2025-06-16 16:52:54 +0000
commitcfebc8873b2f707ef8ed0bb2d8abb0280fede23a (patch)
tree78e81303e6483d12f2aa1078462703710a1e49a8 /sys/linux/dev_block.txt
parentb07d761310f45ec82aafa352739e190d12ab58a0 (diff)
sys/linux: update descriptions in dev_block.txt
A few things done here: - Add new block device ioctls (and structs) related to encryption, added in 1ebd4a3c095c ("blk-crypto: add ioctls to create and prepare hardware-wrapped keys"): BLKCRYPTOIMPORTKEY BLKCRYPTOGENERATEKEY BLKCRYPTOPREPAREKEY Deviate slightly from original keys-related structs to ensure that ioctl syscalls have preallocated buffers to work with, not merely pointers that go nowhere. - Add and update new/missing syscalls related to zoned block devices: BLKGETZONESZ BLKGETNRZONES BLKOPENZONE BLKCLOSEZONE BLKFINISHZONE - Add a few other missing syscalls, such as BLKRASET. - Fix some syscalls' directions (mostly, to 'inout').
Diffstat (limited to 'sys/linux/dev_block.txt')
-rw-r--r--sys/linux/dev_block.txt46
1 files changed, 43 insertions, 3 deletions
diff --git a/sys/linux/dev_block.txt b/sys/linux/dev_block.txt
index 3d445c216..536367d02 100644
--- a/sys/linux/dev_block.txt
+++ b/sys/linux/dev_block.txt
@@ -7,6 +7,7 @@ include <uapi/linux/blkzoned.h>
include <uapi/linux/pr.h>
include <uapi/linux/hdreg.h>
include <uapi/linux/blkpg.h>
+include <linux/blk-crypto.h>
resource fd_block_trace[fd]
resource fd_block[fd_block_trace]
@@ -16,7 +17,7 @@ openat$rnullb(fd const[AT_FDCWD], file ptr[in, string["/dev/rnullb0"]], flags fl
openat$md(fd const[AT_FDCWD], file ptr[in, string["/dev/md0"]], flags flags[open_flags], mode const[0]) fd_block
openat$pmem0(fd const[AT_FDCWD], file ptr[in, string["/dev/pmem0"]], flags flags[open_flags], mode const[0]) fd_block
-ioctl$BLKTRACESETUP(fd fd_block_trace, cmd const[BLKTRACESETUP], arg ptr[in, blk_user_trace_setup])
+ioctl$BLKTRACESETUP(fd fd_block_trace, cmd const[BLKTRACESETUP], arg ptr[inout, blk_user_trace_setup])
ioctl$BLKTRACESTART(fd fd_block_trace, cmd const[BLKTRACESTART], arg const[0])
ioctl$BLKTRACESTOP(fd fd_block_trace, cmd const[BLKTRACESTOP], arg const[0])
ioctl$BLKTRACETEARDOWN(fd fd_block_trace, cmd const[BLKTRACETEARDOWN], arg const[0])
@@ -25,18 +26,20 @@ ioctl$BLKFLSBUF(fd fd_block, cmd const[BLKFLSBUF], arg ptr[in, intptr])
ioctl$BLKROSET(fd fd_block, cmd const[BLKROSET], arg ptr[in, intptr])
ioctl$BLKDISCARD(fd fd_block, cmd const[BLKDISCARD], arg ptr[in, intptr])
ioctl$BLKSECDISCARD(fd fd_block, cmd const[BLKSECDISCARD], arg ptr[in, intptr])
+ioctl$BLKDISCARDZEROES(fd fd_block, cmd const[BLKDISCARDZEROES], arg ptr[out, intptr])
ioctl$BLKZEROOUT(fd fd_block, cmd const[BLKZEROOUT], arg ptr[in, blk_zone_range])
-ioctl$BLKREPORTZONE(fd fd_block, cmd const[BLKREPORTZONE], arg ptr[in, blk_zone_report])
-ioctl$BLKRESETZONE(fd fd_block, cmd const[BLKRESETZONE], arg ptr[in, blk_zone_range])
ioctl$BLKRAGET(fd fd_block, cmd const[BLKRAGET], arg ptr[out, intptr])
+ioctl$BLKFRAGET(fd fd_block, cmd const[BLKFRAGET], arg ptr[out, intptr])
ioctl$BLKROGET(fd fd_block, cmd const[BLKROGET], arg ptr[out, intptr])
ioctl$BLKBSZGET(fd fd_block, cmd const[BLKBSZGET], arg ptr[out, intptr])
+ioctl$BLKSSZGET(fd fd_block, cmd const[BLKSSZGET], arg ptr[out, intptr])
ioctl$BLKPBSZGET(fd fd_block, cmd const[BLKPBSZGET], arg ptr[out, intptr])
ioctl$BLKIOMIN(fd fd_block, cmd const[BLKIOMIN], arg ptr[out, intptr])
ioctl$BLKIOOPT(fd fd_block, cmd const[BLKIOOPT], arg ptr[out, intptr])
ioctl$BLKALIGNOFF(fd fd_block, cmd const[BLKALIGNOFF], arg ptr[out, intptr])
ioctl$BLKSECTGET(fd fd_block, cmd const[BLKSECTGET], arg ptr[out, intptr])
ioctl$BLKROTATIONAL(fd fd_block, cmd const[BLKROTATIONAL], arg ptr[out, intptr])
+ioctl$BLKRASET(fd fd_block, cmd const[BLKRASET], arg ptr[in, intptr])
ioctl$BLKFRASET(fd fd_block, cmd const[BLKFRASET], arg ptr[in, intptr])
ioctl$BLKBSZSET(fd fd_block, cmd const[BLKBSZSET], arg ptr[in, intptr])
ioctl$BLKPG(fd fd_block, cmd const[BLKPG], arg ptr[in, blkpg_ioctl_arg])
@@ -45,6 +48,21 @@ ioctl$BLKGETSIZE(fd fd_block, cmd const[BLKGETSIZE], arg ptr[out, intptr])
ioctl$BLKGETSIZE64(fd fd_block, cmd const[BLKGETSIZE64], arg ptr[out, int64])
ioctl$BLKGETDISKSEQ(fd fd_block, cmd const[BLKGETDISKSEQ], arg ptr[out, int64])
+# TODO: To properly explore zones-related ioctls, figure out how to setup zoned devices.
+ioctl$BLKREPORTZONE(fd fd_block, cmd const[BLKREPORTZONE], arg ptr[inout, blk_zone_report])
+ioctl$BLKRESETZONE(fd fd_block, cmd const[BLKRESETZONE], arg ptr[in, blk_zone_range])
+ioctl$BLKOPENZONE(fd fd_block, cmd const[BLKOPENZONE], arg ptr[in, blk_zone_range])
+ioctl$BLKCLOSEZONE(fd fd_block, cmd const[BLKCLOSEZONE], arg ptr[in, blk_zone_range])
+ioctl$BLKFINISHZONE(fd fd_block, cmd const[BLKFINISHZONE], arg ptr[in, blk_zone_range])
+ioctl$BLKGETZONESZ(fd fd_block, cmd const[BLKGETZONESZ], arg ptr[in, int32])
+ioctl$BLKGETNRZONES(fd fd_block, cmd const[BLKGETNRZONES], arg ptr[in, int32])
+
+# TODO: These calls may fail early on current kernel testing setups due to
+# uninitialized blk_crypto_profile involved in related device drivers.
+ioctl$BLKCRYPTOIMPORTKEY(fd fd_block, cmd const[BLKCRYPTOIMPORTKEY], arg ptr[inout, blk_crypto_import_key_arg])
+ioctl$BLKCRYPTOGENERATEKEY(fd fd_block, cmd const[BLKCRYPTOGENERATEKEY], arg ptr[inout, blk_crypto_generate_key_arg])
+ioctl$BLKCRYPTOPREPAREKEY(fd fd_block, cmd const[BLKCRYPTOPREPAREKEY], arg ptr[inout, blk_crypto_prepare_key_arg])
+
ioctl$HDIO_GETGEO(fd fd_block, cmd const[HDIO_GETGEO], arg ptr[out, hd_geometry])
ioctl$IOC_PR_REGISTER(fd fd_block, cmd const[IOC_PR_REGISTER], arg ptr[in, pr_registration])
@@ -113,6 +131,28 @@ blk_user_trace_setup {
pid pid
}
+blk_crypto_import_key_arg {
+ raw_key_ptr ptr[in, array[int8, 16:BLK_CRYPTO_MAX_RAW_KEY_SIZE]]
+ raw_key_size len[raw_key_ptr, int64]
+ lt_key_ptr ptr[out, array[int8, 1:BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]]
+ lt_key_size len[lt_key_ptr, int64]
+ reserved array[const[0, int64], 4]
+}
+
+blk_crypto_generate_key_arg {
+ lt_key_ptr ptr[out, array[int8, 1:BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]]
+ lt_key_size len[lt_key_ptr, int64]
+ reserved array[const[0, int64], 4]
+}
+
+blk_crypto_prepare_key_arg {
+ lt_key_ptr ptr[in, array[int8, 1:BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]]
+ lt_key_size len[lt_key_ptr, int64]
+ eph_key_ptr ptr[out, array[int8, 1:BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE]]
+ eph_key_size len[eph_key_ptr, int64]
+ reserved array[const[0, int64], 4]
+}
+
pr_registration {
old_key int64
new_key int64