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_PLATFORM_TOPOLOGY.md
| 1 | # GB10 platform topology and discovery cross-check |
| 2 | |
| 3 | This document maps the physical interfaces that reach the GB10 on Machine 1, |
| 4 | and compares them against what the existing AIENOS UEFI discovery path already |
| 5 | assumes. It is a Linux and firmware observation exercise. It does not |
| 6 | initialize the GPU or submit a command. |
| 7 | |
| 8 | Governing: issue [#36](https://github.com/aien-dev/aienux/issues/36), |
| 9 | [GB10_HARDWARE_PROFILE.md](GB10_HARDWARE_PROFILE.md), |
| 10 | [GB10_NATIVE_STATUS.md](GB10_NATIVE_STATUS.md). |
| 11 | |
| 12 | All values below are Linux observed (sysfs and ACPI tables read read-only) on |
| 13 | the current Machine 1 Linux boot. They are not native AIENOS observations. |
| 14 | |
| 15 | ## Observed platform path |
| 16 | |
| 17 | ``` |
| 18 | ACPI MCFG segment 15 |
| 19 | | |
| 20 | v |
| 21 | PCI root bridge 000f:00:00.0 (ACPI PNP0A08:0b) |
| 22 | | |
| 23 | v |
| 24 | GB10 endpoint 000f:01:00.0 (ACPI device, firmware_node |
| 25 | .../PNP0A08:0b/device:1b/device:1c) |
| 26 | ``` |
| 27 | |
| 28 | | Item | Observed value | Source | |
| 29 | | --- | --- | --- | |
| 30 | | ACPI root bridge path | `PNP0A08:0b` | `firmware_node` sysfs, Linux | |
| 31 | | Root bridge function | `000f:00:00.0`, class `0x060400` | sysfs, Linux | |
| 32 | | GB10 endpoint | `000f:01:00.0` | sysfs, Linux | |
| 33 | | Segment / domain | 15 (`0x000f`) | sysfs path, Linux | |
| 34 | | Bus / device / function | 1 / 0 / 0 | sysfs path, Linux | |
| 35 | | Vendor / device | `0x10de` / `0x2e12` | config, Linux | |
| 36 | | Subsystem | `0x10de:0x0000` | config, Linux | |
| 37 | | Class / revision | `0x030000` display controller / `0xa1` | config, Linux | |
| 38 | | Command / status | `0x0407` / `0x0010` | raw config, decoded by this project | |
| 39 | | BAR0 | 64-bit prefetchable memory at `0x24000000`, 64 MiB | `resource`, Linux | |
| 40 | | IOMMU group | 20 (only `000f:01:00.0`) | sysfs, Linux | |
| 41 | | NUMA node | `-1` (not exposed) | sysfs, Linux | |
| 42 | | Kernel driver | `nvidia` | sysfs, Linux | |
| 43 | | Legacy IRQ | 427 | sysfs, Linux | |
| 44 | | MSI-X vectors | 9 (table), 8 exposed in `msi_irqs` | config, sysfs, Linux | |
| 45 | | PCIe link | current 2.5 GT/s x1, max 2.5 GT/s x16 | sysfs and config, Linux | |
| 46 | |
| 47 | ## ACPI MCFG / ECAM |
| 48 | |
| 49 | The MCFG table is 300 bytes and declares 16 PCI segments, each with an ECAM |
| 50 | window and bus range. Segments 0 to 14 use base `0xF300000000` plus a |
| 51 | `0x10000000` stride and cover buses 0 to 15. Segment 15, the GB10 segment, has |
| 52 | ECAM base `0x29000000` and covers buses 0 to 1: |
| 53 | |
| 54 | | Segment | ECAM base | Bus range | |
| 55 | | --- | --- | --- | |
| 56 | | 0 to 10 | `0xF300000000` to `0xF3A0000000` | 0 to 15 | |
| 57 | | 11 to 14 | `0xF3B0000000` to `0xF3E0000000` | 0 to 255 | |
| 58 | | 15 (GB10) | `0x29000000` | 0 to 1 | |
| 59 | |
| 60 | The GB10 is on segment 15 bus 1, inside the declared window. A native AIENOS |
| 61 | ECAM mapper would compute the configuration address as |
| 62 | `ecam_base + (bus - start_bus) * 1 MiB + device * 32 KiB + function * 4 KiB`, |
| 63 | so `000f:01:00.0` maps to `0x29000000 + 0x100000`. |
| 64 | |
| 65 | Provenance: `MCFG` ACPI table, parsed read-only by |
| 66 | `scripts/gb10_profile.sh`; SHA-256 recorded in the evidence JSON. |
| 67 | |
| 68 | ## IORT / SMMUv3 |
| 69 | |
| 70 | The IORT table is present (3904 bytes). The kernel reports an Arm SMMUv3 with |
| 71 | 40-bit output address size, a 2-level stream table covering 25 of 32 stream ID |
| 72 | bits, and a default DMA domain type of Translated (`iommu.passthrough=0`). The |
| 73 | GB10 sits alone in IOMMU group 20, so its stream is isolated from every other |
| 74 | endpoint in the observed group listing. |
| 75 | |
| 76 | Provenance: `IORT` ACPI table presence and size, kernel command line, and the |
| 77 | kernel IOMMU group layout, all Linux observed. The IORT stream-to-SID mapping |
| 78 | for the GB10 is not yet decoded by this project, and is listed as an unknown |
| 79 | below. |
| 80 | |
| 81 | ## Interrupt topology |
| 82 | |
| 83 | The GB10 exposes one legacy interrupt (427) and an enabled MSI-X capability |
| 84 | with a 9-entry vector table at BAR0 offset `0x00b90000` and a PBA at BAR0 |
| 85 | offset `0x00ba0000`, both in BAR0 (BIR 0). MSI is present, 64-bit capable, and |
| 86 | maskable, but disabled; MSI-X is enabled. |
| 87 | |
| 88 | One discrepancy is recorded rather than smoothed over: the MSI-X table size |
| 89 | field reports 9 vectors, and the kernel exposes 8 entries under `msi_irqs` |
| 90 | (429 to 436). The ninth vector's disposition is an unresolved unknown. |
| 91 | |
| 92 | ## NUMA and proximity |
| 93 | |
| 94 | `numa_node` reads `-1` for the GB10. Linux does not expose a NUMA association |
| 95 | for this device. This is recorded as an observed value (`-1`), not converted |
| 96 | into node 0. |
| 97 | |
| 98 | ## What AIENOS must own after ExitBootServices |
| 99 | |
| 100 | To discover, map, isolate, and eventually interrupt-drive this GB10 natively, |
| 101 | AIENOS must own exactly these physical interfaces: |
| 102 | |
| 103 | 1. **ECAM discovery.** The MCFG segment 15 window at `0x29000000` covering |
| 104 | buses 0 to 1, to reach `000f:01:00.0` and its root bridge without firmware |
| 105 | services. |
| 106 | 2. **Configuration access.** Read access to the endpoint header and capability |
| 107 | list, decoded by `aienos-accel` pure functions. |
| 108 | 3. **MMIO mapping authority.** A kernel-owned mapping of the BAR0 64 MiB |
| 109 | region at `0x24000000`, granted through a capability, not ambient physical |
| 110 | memory access. Reading or writing it is outside this characterization phase. |
| 111 | 4. **SMMU / DMA authority.** The stream table entry that maps the GB10's |
| 112 | stream ID to a translation context. AIENOS must program this through the |
| 113 | SMMUv3, bound to a capability, before any DMA. It must not bypass the SMMU. |
| 114 | 5. **Interrupt resource.** The MSI-X table and PBA in BAR0, plus the GIC ITS/MSI |
| 115 | path that delivers the vectors. This is a separate capability from MMIO. |
| 116 | 6. **Firmware objects.** The GB10 firmware image and the GSP transport once a |
| 117 | later milestone authorizes them. |
| 118 | |
| 119 | ## Cross-check against existing AIENOS discovery |
| 120 | |
| 121 | The existing UEFI handoff discovery (`crates/aienos-boot/src/handoff.rs`) and |
| 122 | `aienos-accel` were checked against the observed profile. |
| 123 | |
| 124 | | Existing expectation | Observed on Machine 1 | Status | |
| 125 | | --- | --- | --- | |
| 126 | | Vendor/device `10de:2e12` | `10de:2e12` | matches | |
| 127 | | BDF fast path segment 15 bus 1 device 0 function 0 | `000f:01:00.0` | matches | |
| 128 | | Programmed 64-bit memory BAR0 | 64-bit prefetchable at `0x24000000` | matches | |
| 129 | | PCI memory decoding enabled | command bit 1 set (`0x0407`) | matches | |
| 130 | | BAR0 large enough for PMC offsets 0 and `0x0a00` | BAR0 is 64 MiB | offsets in range | |
| 131 | | Firmware bus range covers the device bus | ECAM segment 15 covers buses 0 to 1 | matches | |
| 132 | |
| 133 | ### Hard-coded assumptions found |
| 134 | |
| 135 | 1. `handoff.rs` compares `vendor_device` against the literal `0x2e12_10de` |
| 136 | rather than the named constants in `aienos-accel`. Behaviourally correct, |
| 137 | but a second source of truth. |
| 138 | 2. `handoff.rs::scan_root` tries segment 15, bus 1, device 0, function 0 first |
| 139 | as a shortcut before scanning firmware bus ranges. The fallback scan makes |
| 140 | this an optimization rather than a hard dependency, but it encodes the |
| 141 | current Machine 1 BDF. |
| 142 | 3. The pre-exit discovery reads only config offsets 0x00, 0x04, 0x10, and 0x14. |
| 143 | It cannot report capability presence, PCIe link state, IOMMU grouping, or |
| 144 | MSI/MSI-X, so the boot report is silent on interrupt and isolation facts. |
| 145 | 4. `Gb10Bar::from_config` requires `physical_base != 0` and a 64-bit memory |
| 146 | BAR0. Both hold, and the rejection reasons are now typed in |
| 147 | `profile::Gb10Bar::from_header`. |
| 148 | |
| 149 | ### Scoped follow-ups, not edits to shared boot files |
| 150 | |
| 151 | These are proposed as separate changes to avoid conflicting with active lanes |
| 152 | on the boot and handoff code: |
| 153 | |
| 154 | - Have `read_candidate` use `NVIDIA_VENDOR_ID` and `GB10_DEVICE_ID` from |
| 155 | `aienos-accel`. |
| 156 | - Replace the inline BAR validation in `probe_gb10` with |
| 157 | `Gb10Bar::from_header`, keeping the same raw values in |
| 158 | `rejected_candidate` so diagnostics are unchanged. |
| 159 | - Extend native discovery to decode the capability list with `pci.rs` and |
| 160 | carry MSI-X presence, table offset, and vector count across handoff, once a |
| 161 | lane owns `handoff.rs`. |
| 162 | |
| 163 | ## Unresolved unknowns |
| 164 | |
| 165 | - The SMMUv3 stream table entry for the GB10 (its stream ID is now decoded: StreamID 0x100 on the SMMUv3 at 0x13000000, see docs/GB10_IORT_DECODE.md). |
| 166 | - The disposition of the ninth MSI-X vector. |
| 167 | - Whether the negotiated PCIe width stays at x1 after link training settles, |
| 168 | and why the current speed reads 2.5 GT/s while the link can go wider. Kernel |
| 169 | boot logged `0.000 Gb/s available PCIe bandwidth, limited by Unknown x0 link` |
| 170 | at `000f:00:00.0`; sysfs later read x1. The negotiated state is dynamic and |
| 171 | is recorded as observed, not derived. |
| 172 | - The PMC register values. They are read only through the UEFI handoff path, |
| 173 | never through Linux in this phase. |