Skip to content

vms-ddc: probe non-virtio (SCSI/NVMe) disks so SHOW DEVICE is faithful on bare metal - #1062

Open
baron-3dl wants to merge 1 commit into
mainfrom
work/vms-ddc-nonvirtio-probe
Open

vms-ddc: probe non-virtio (SCSI/NVMe) disks so SHOW DEVICE is faithful on bare metal#1062
baron-3dl wants to merge 1 commit into
mainfrom
work/vms-ddc-nonvirtio-probe

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

What / Why

vms_devtab_probe_disks() (src/kernel-core/vms_devtab.c) enumerated only
/dev/vd* (virtio-blk). On bare metal / KVM -- OVMX's Rule-9 target -- the
system disk is SATA/SCSI or NVMe, so no disk unit was entered and
SHOW DEVICE VDA0: returned %SYSTEM-W-NOSUCHDEV (the operator's
direct-test finding, vms-ddc / vms-47d).

Three layers, so the fix is real end to end:

  • executive: vms_devtab_probe_disks() now also probes /dev/sd* ->
    SDAn: and /dev/nvmeNn1 -> NVMEn:, entered via the existing
    vms_devtab_add_disk() path. INV-6 preserved exactly as the virtio loop:
    a unit is entered ONLY when exec_blockdev_lookup() actually resolves
    the node -- never a speculative row.
  • kernel config: distro/kernel/ovmx-x86_64.config enables virtio-scsi
    built-in (CONFIG_SCSI/BLK_DEV_SD/SCSI_LOWLEVEL/SCSI_VIRTIO, =y
    -- the initramfs loads no modules). A prior attempt (reverted,
    9102593) used NVMe here, but the minimal from-source config lacks the
    MSI-X plumbing NVMe needs to bring up /dev/nvme0n1 in the guest.
    virtio-scsi reuses the already-enabled virtio transport and presents
    disks as /dev/sd*, exercising the SAME non-virtio probe path reliably
    in a minimal kernel.
  • test harness: run_tests.sh attaches ONE real virtio-scsi disk
    (virtio-scsi-pci + scsi-hd, presenting /dev/sda).

Anti-LARP proof

test_kmod_disk.c asserts, against a REAL vms.ko in QEMU with a real
virtio-scsi disk attached:

  • SDA0: exists in the executive's table (SS$_NORMAL), backing device
    sda
  • SDA0:'s backing dev_t matches /dev/sda's independently
    stat()'d
    major:minor -- the same "no way to fake it" oracle the
    VDA0:..VDA400: checks use
  • SDA100: (a second, absent SCSI unit) reports SS$_NOSUCHDEV (negctl)

Local verification

Kernel module (vms.ko, all TUs including the modified vms_devtab.c)
built cleanly against real kernel headers (make -C /lib/modules/$(uname -r)/build M=... modules, exit 0, no warnings) --
confirms the new probe loops are syntactically/semantically correct. The
full containerized boot + QEMU proof (real virtio-scsi disk -> SDA0:) runs
via the workflow_dispatch CI leg fired alongside this PR.

Refs vms-ddc, vms-47d, vms-050 (oracle-driven UX-fidelity).

Test plan

  • Local vms.ko module build (host kernel headers) -- clean, no warnings
  • CI workflow_dispatch run on this branch -- kmod/acceptance legs (skipped on normal PR triggers) prove the real virtio-scsi disk -> SDA0: enumeration

🤖 Generated with Claude Code

https://claude.ai/code/session_018q4jvj6GCkdbYjRvpy7Vwu

…l on bare metal

vms_devtab_probe_disks() enumerated only /dev/vd* (virtio-blk). On bare
metal / KVM -- OVMX's Rule-9 target -- the system disk is SATA/SCSI or
NVMe, so no disk unit was entered and `SHOW DEVICE VDA0:` returned
%SYSTEM-W-NOSUCHDEV (the operator's direct-test finding, vms-ddc /
vms-47d).

Fix, in three layers:
  - executive: vms_devtab_probe_disks() now also probes /dev/sd* -> SDAn:
    and /dev/nvmeNn1 -> NVMEn:, entered via the existing vms_devtab_add_disk
    path. INV-6 preserved exactly as the virtio loop: a unit is entered ONLY
    when exec_blockdev_lookup() actually resolves the node.
  - kernel: distro/kernel/ovmx-x86_64.config enables virtio-scsi built-in
    (CONFIG_SCSI/BLK_DEV_SD/SCSI_LOWLEVEL/SCSI_VIRTIO, =y -- the initramfs
    loads no modules). A prior attempt used NVMe, but the minimal
    from-source config lacks the MSI-X plumbing NVMe needs to bring up
    /dev/nvme0n1 in the guest; virtio-scsi reuses the already-enabled
    virtio transport and presents disks as /dev/sd*, exercising the same
    non-virtio probe path reliably in a minimal kernel.
  - test: run_tests.sh attaches a REAL virtio-scsi disk (/dev/sda);
    test_kmod_disk.c asserts the executive enters SDA0: backing /dev/sda
    and resolving to the SAME major:minor userspace stat()s independently
    -- the same "no way to fake it" proof the VDA0:..VDA400: checks use --
    plus a negctl that SDA100: (a second, absent unit) reports
    SS$_NOSUCHDEV.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018q4jvj6GCkdbYjRvpy7Vwu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant