danos/system
Daniel Samson 6a687fbc2b
iommu: AMD-Vi backend behind the vendor-neutral core
The second hardware backend. The IOMMU core, DMA-region capabilities, and
per-device enforcement are unchanged; this adds AMD-Vi (IVRS) as an
alternative to Intel VT-d (DMAR) under the same Backend vtable.

- parseIvrs records the IOMMU control-register base from the first IVHD;
  the platform layer gains iommu_is_amd, and the core picks the backend by
  vendor at init. VT-d and AMD-Vi are mutually exclusive on real hardware.
- iommu-amd.zig: a 2 MiB device table (every DTE zeroed = deny-all until a
  device is claimed), AMD native-format page tables (4 KiB leaves), a
  command buffer (INVALIDATE_DEVTAB_ENTRY / INVALIDATE_IOMMU_PAGES /
  COMPLETION_WAIT) and an event log for faults. The DTE forwards
  interrupts unmapped, so MSI passthrough works exactly as on VT-d.
- The boot log and the iommu self-test are now vendor-aware.

**UNTESTED on real AMD hardware** — danos is developed on Intel, so this
is validated only against QEMU's amd-iommu, and every log line and doc
says so. QEMU quirk handled: its amd-iommu does not observe the
COMPLETION_WAIT store form, but consumes the command ring synchronously on
the tail-register write, so invalidations are already applied by the time
we poll — the backend warns once and proceeds.

Cases: amd-iommu (detection + scratch-domain walker) and
amd-iommu-usb-storage (full storage stack through AMD device-table
translation with per-grant capabilities), both green. 106/106.

This completes the IOVA/IOMMU-enforcement track: per-device DMA domains on
both vendors, with buffers reachable only through delegated capabilities.
2026-07-26 18:31:27 +01:00
..
drivers iommu: DMA-region capabilities — per-grant reachability, protocol flag-day 2026-07-26 18:31:27 +01:00
kernel iommu: AMD-Vi backend behind the vendor-neutral core 2026-07-26 18:31:27 +01:00
services iommu: DMA-region capabilities — per-grant reachability, protocol flag-day 2026-07-26 18:31:27 +01:00
abi.zig iommu: DMA-region capabilities — per-grant reachability, protocol flag-day 2026-07-26 18:31:27 +01:00
boot-handoff.zig reorg: move system/devices into system/kernel/devices 2026-07-22 21:35:30 +01:00
initial-ramdisk.zig boot: survive hand-written sticks — case-fold the /system walk, skip host litter 2026-07-21 18:01:12 +01:00
parameters.zig USB driver stack: xHCI transfers, HID keyboard/mouse, mass storage 2026-07-13 14:11:00 +01:00