danos/system/kernel
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
..
architecture/x86_64 docs: full docs-vs-code audit — fix every stale claim across 40 docs 2026-07-22 09:09:53 +01:00
acpi.zig iommu: AMD-Vi backend behind the vendor-neutral core 2026-07-26 18:31:27 +01:00
console.zig console: page-wrap instead of scrolling — never read the framebuffer 2026-07-21 19:22:59 +01:00
device-model.zig kernel: flatten the device/discovery code, merge power into acpi, rename fdt 2026-07-22 21:49:20 +01:00
devices-broker.zig iommu: enable Intel VT-d translation with per-claim device confinement 2026-07-26 18:31:27 +01:00
fdt.zig kernel: flatten the device/discovery code, merge power into acpi, rename fdt 2026-07-22 21:49:20 +01:00
font.psf Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
heap.zig docs: audit all 'what's next' sections against the code; fix stale comments 2026-07-22 02:23:51 +01:00
iommu-amd.zig iommu: AMD-Vi backend behind the vendor-neutral core 2026-07-26 18:31:27 +01:00
iommu-intel.zig iommu: enable Intel VT-d translation with per-claim device confinement 2026-07-26 18:31:27 +01:00
iommu.zig iommu: AMD-Vi backend behind the vendor-neutral core 2026-07-26 18:31:27 +01:00
ipc-synchronous.zig iommu: DMA-region capabilities — per-grant reachability, protocol flag-day 2026-07-26 18:31:27 +01:00
ipc.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
irq.zig M15: interrupts for PCI devices (ECAM config space + MSI) 2026-07-10 19:59:09 +01:00
kernel.zig iommu: enable Intel VT-d translation with per-claim device confinement 2026-07-26 18:31:27 +01:00
log-ring.zig reorg: move test fixtures to test/system/services (source + boot volume) 2026-07-23 00:11:07 +01:00
log.zig kernel: the boot transcript on screen, every line timestamped 2026-07-21 19:09:34 +01:00
platform.zig kernel: flatten the device/discovery code, merge power into acpi, rename fdt 2026-07-22 21:49:20 +01:00
pmm.zig M14b: DMA memory (dma_alloc / dma_free) 2026-07-10 19:43:59 +01:00
process.zig iommu: DMA-region capabilities — per-grant reachability, protocol flag-day 2026-07-26 18:31:27 +01:00
scheduler.zig iommu: DMA-region capabilities — per-grant reachability, protocol flag-day 2026-07-26 18:31:27 +01:00
sync.zig kernel: contain a fatal fault — name the task, release the BKL before halt 2026-07-14 09:05:10 +01:00
tests.zig iommu: AMD-Vi backend behind the vendor-neutral core 2026-07-26 18:31:27 +01:00
vfs.zig reorg: move test fixtures to test/system/services (source + boot volume) 2026-07-23 00:11:07 +01:00
wall-clock.zig kernel: tagged log ring — per-line pid/name/level records, klog_status 2026-07-21 15:30:28 +01:00