aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / docs / GB10_NATIVE_ACCELERATOR_BOUNDARY.md
| 1 | # GB10 native accelerator boundary |
| 2 | |
| 3 | This document freezes the layering a future native GB10 driver must fit into. |
| 4 | It does not design the driver. It defines the boundary so that GPU work can be |
| 5 | built against a capability-bound contract instead of ambient hardware access. |
| 6 | |
| 7 | Governing: issue [#36](https://github.com/aien-dev/aienux/issues/36), |
| 8 | [GB10_HARDWARE_PROFILE.md](GB10_HARDWARE_PROFILE.md), |
| 9 | [GB10_PLATFORM_TOPOLOGY.md](GB10_PLATFORM_TOPOLOGY.md), |
| 10 | [ARCHITECTURE.md](ARCHITECTURE.md). |
| 11 | |
| 12 | ## Frozen layering |
| 13 | |
| 14 | ``` |
| 15 | PCI/ACPI discovery |
| 16 | | |
| 17 | v |
| 18 | device identity/profile |
| 19 | | |
| 20 | v |
| 21 | kernel MMIO mapping authority |
| 22 | | |
| 23 | v |
| 24 | SMMU/DMA authority |
| 25 | | |
| 26 | v |
| 27 | interrupt resource |
| 28 | | |
| 29 | v |
| 30 | GB10 device lifecycle |
| 31 | | |
| 32 | v |
| 33 | GSP transport [FUTURE] |
| 34 | | |
| 35 | v |
| 36 | GPU memory manager [FUTURE] |
| 37 | | |
| 38 | v |
| 39 | channel/queue submit [FUTURE] |
| 40 | | |
| 41 | v |
| 42 | compute execution [FUTURE] |
| 43 | ``` |
| 44 | |
| 45 | The upper six layers are the subject of this characterization phase and the |
| 46 | milestone that follows it. The lower four are marked future and must not be |
| 47 | claimed until each has hardware evidence. |
| 48 | |
| 49 | ## The key contract |
| 50 | |
| 51 | `aienos-accel` must never obtain ambient physical-memory or DMA authority. |
| 52 | |
| 53 | Today `aienos-accel` is pure decoding: it turns byte slices into typed facts |
| 54 | and validates the GB10 contract. That property is permanent. When accelerator |
| 55 | code eventually needs MMIO, interrupts, or DMA, it receives them as explicit |
| 56 | capabilities granted through AEGIS, exactly like every other AIENOS physical |
| 57 | resource. There is to be no global "map physical memory" call, no |
| 58 | `/dev/mem`-style escape, and no untyped physical address that a device driver |
| 59 | can dereference on its own. |
| 60 | |
| 61 | Concretely: |
| 62 | |
| 63 | - Discovery produces a `Gb10Profile`, not a mapped pointer. The profile is |
| 64 | immutable facts. |
| 65 | - Mapping MMIO is a separate, capability-gated kernel service. The discovery |
| 66 | layer cannot map. |
| 67 | - DMA is a separate, capability-gated SMMU service. A device cannot DMA until |
| 68 | AIENOS programs its stream table entry. |
| 69 | - An interrupt line or MSI-X vector is an interrupt capability, distinct from |
| 70 | the MMIO capability that contains the MSI-X table. |
| 71 | |
| 72 | ## Required future capabilities |
| 73 | |
| 74 | These are described conceptually so the eventual implementation has a target. |
| 75 | Only the generic capability substrate, if it already exists, is reused; none of |
| 76 | these accelerator capabilities is implemented in this phase. |
| 77 | |
| 78 | | Capability | Grants | Does not grant | |
| 79 | | --- | --- | --- | |
| 80 | | Accelerator MMIO region | read/write of a bounded BAR window | DMA, interrupts, execution | |
| 81 | | Accelerator interrupt | receive one device interrupt or vector | MMIO, DMA | |
| 82 | | Accelerator DMA domain | participate in an SMMU translation context | MMIO, execution | |
| 83 | | Firmware object | load a named, verified firmware image | MMIO, DMA, execution | |
| 84 | | Compute queue | create and submit a queue | authority over other queues | |
| 85 | |
| 86 | Each is resource-specific and revocable. A compute queue capability without a |
| 87 | DMA domain cannot move data. A DMA domain without an MMIO region cannot be |
| 88 | programmed. Composition is explicit. |
| 89 | |
| 90 | ## Layer responsibilities |
| 91 | |
| 92 | - **PCI/ACPI discovery.** Enumerate firmware-declared ECAM ranges, find the |
| 93 | GB10 by property, decode identity and capabilities. No side effects. This is |
| 94 | implemented in `aienos-accel` (pure) and, later, a native enumerator. |
| 95 | - **device identity/profile.** `Gb10Profile` with provenance. Read only. |
| 96 | - **kernel MMIO mapping authority.** Create a bounded mapping for a granted |
| 97 | accelerator MMIO region. The mapping is the only path to device registers. |
| 98 | - **SMMU/DMA authority.** Program the GB10 stream table entry under a granted |
| 99 | DMA domain. No bypass mode. |
| 100 | - **interrupt resource.** Bind the MSI-X vector or legacy interrupt through the |
| 101 | GIC/ITS to the owner. Distinct capability. |
| 102 | - **GB10 device lifecycle.** Reset, power, and firmware-load state machine |
| 103 | under operator and AEGIS policy. This is the first layer that mutates the |
| 104 | device, and it requires a later milestone. |
| 105 | - **GSP transport (future).** The command/RPC channel to GSP. Requires the |
| 106 | lifecycle layer and the firmware object. |
| 107 | - **GPU memory manager (future).** VRAM allocation and mappings. Requires the |
| 108 | DMA domain. |
| 109 | - **channel/queue submit (future).** Requires the compute queue capability. |
| 110 | - **compute execution (future).** Requires the queue and memory manager. |
| 111 | |
| 112 | ## Safety boundary for this phase |
| 113 | |
| 114 | This characterization phase stops at layer two. It does not initialize the |
| 115 | GPU, communicate with GSP, submit commands, allocate GPU memory, execute |
| 116 | kernels, or perform inference. It does not write PCI configuration space, |
| 117 | change command bits, resize BARs, reset the GPU, perform FLR, rebind the |
| 118 | NVIDIA driver, change power state, write BAR/MMIO registers, access `/dev/mem`, |
| 119 | issue GSP RPC, load alternate firmware, create GPU channels, or map GPU |
| 120 | memory. |
| 121 | |
| 122 | The step from layer two to layer three is the next device-ownership milestone |
| 123 | and needs its own authorization, evidence, and rollback plan. |