]> git.ipfire.org Git - thirdparty/valgrind.git/commit
FreeBSD ioctl: CAMIOCOMMAND with subcommmand XPT_DEV_MATCH
authorPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 1 May 2024 13:17:50 +0000 (15:17 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 1 May 2024 13:17:50 +0000 (15:17 +0200)
commitf4e2f6222457beed382cf6c13b4028672587268a
tree2799d369b3b282992b088e164420ec0c3dc9aa72
parent8a0b3e9f88312e56db69ada5b8579aff877fee72
FreeBSD ioctl: CAMIOCOMMAND with subcommmand XPT_DEV_MATCH

CAM is the FreeBSD disk I/O subsystem (Common Access Method).

I had picked up an implementation of this from bitbucket done
by a FreeBSD dev. It was done a long time ago, around 2013 on
Valgrind 3.8. Mercurial bitbucket is now kickbucket. There
were 2 big problems.

1.  Bit rot. The CAM ioctl is versioned and the version that I
copies was 0x15 whilst the current version is 0x2a, 6 versions
later. That meant that the ioctl wrapper wasn't even getting
called. In addition, as the versioning implies, the data structures
were also out of date.

2. Might also be bit rot but the data structures were copied with
QUEUE_MACRO_DEBUG_TRACE enabled. For that to work the whole
FreeBSD system needs to be built with it turned on. With that
macro turned on in Valgrind the data structures were offset
compared to the kernel, and nothing worked correctly.

There are still a huge number of CAM ioctls unimplemented.
"camcontrol devlist" now works wihtout generating false positives.
coregrind/m_syswrap/syswrap-freebsd.c
include/vki/vki-freebsd.h