interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / GB10_IORT_DECODE.md

282 lines · 17691 bytes Raw Blame History Source

GB10 IORT decode: stream id, SMMU node, reserved regions (aienos#286, cut B5)

Report only. Host only. Read-only. No kernel code was changed, no hardware register was touched, no QEMU run was made. Base commit of aienos read: be514b5 (main). Firmware table read on the Spark on 2026-10-10 (/sys/firmware/acpi/tables/IORT, 3904 bytes, sha256 5e0096a2be83ce2025c5c6395455c6814c16e01ff433791e8057c245f4939cb1).

Tags: [SOURCE file:line] read in the named file or table. [INFERRED] reasoned from sources, not directly shown. [UNKNOWN] nothing read answers it. Paths without a repo prefix are in aienos. actbl2.h is /usr/src/linux-headers-6.11.0-1014-nvidia/include/acpi/actbl2.h on the Spark (ACPICA layout of the IORT, ARM DEN 0049). linux iort.c is drivers/acpi/arm64/iort.c at torvalds/linux master, fetched 2026-10-10.

1. Short answer

2. Method

  1. Read the layout first: actbl2.h structs acpi_iort_node (:470), acpi_iort_id_mapping (:492), acpi_iort_root_complex (:549), acpi_iort_smmu_v3 (:603), acpi_iort_rmr and acpi_iort_rmr_desc (:640-651), and the id-range rule from linux iort.c:361 (rid_in > map->input_base + map->id_count means ranges are inclusive; id_count is the number of ids minus one). Both recorded with docs-read.
  2. Dumped the table (root read of /sys/firmware/acpi/tables/IORT) and decoded it with scripts/iort_decode.rs (Rust, standard library only, reads a file, touches no hardware). scripts/gb10_iort_decode.sh does both steps.
  3. Ground check against Linux (section 5) before trusting the decode.

3. What the table contains

68 nodes, revision 6, OEM MEDTEK. [SOURCE IORT header]

NodeOffsetWhatMappings
ITS group 00x30ITS id 0none (terminal)
SMMUv3 A0x48base 0x13800000, flags 0x1 (COHACC override), event/pri/gerr/sync GSIV 342/347/340/341stream 0x10000..=0x110000 to ITS group, DeviceID = stream + 0x200000
SMMUv3 B0xa0base 0x13000000, flags 0x1, GSIV 366/371/364/365stream 0x0..=0x10000 to ITS group, DeviceID = stream
SMMUv3 C0xf8base 0x14900000, flags 0x1, GSIV 397/0/395/396none (no MSI path)
Named USB0..USB5, UBF0..UBF30x150..0x36cplatform USB controllerssingle stream 0x0..0x9 on SMMUv3 A
Root complex seg 0..140x3a8..0x6f0ATS 0, 40-bit, coherentrid 0x0..=0xffff to SMMUv3 A, stream base 0x10000 * (seg + 1)
Root complex seg 150x72cATS 1, 40-bit, coherentrid 0x0..=0xffff to SMMUv3 B, stream = rid
Named HDA00x768audiosingle stream 0x500 on SMMUv3 B
Named ROT0/1, DSP1..3, CNT0, ASD0, I2C0..6, SPI0/2/3, PMU0, DMA00x7a4..0xbdcplatform peripheralssingle streams on SMMUv3 C
RMR0xc18flags 0x10: remap NOT permitted, unprivileged, attributes Normal NC; 3 ranges (section 1)stream 0x0..=0x100 on SMMUv3 B
PMCG x170xc98..0xf18performance monitor pages per SMMUnone

[SOURCE IORT decode, full listing reproduced by scripts/gb10_iort_decode.sh]

4. Resolution walk for the GB10

segment 15, rid 0x0100
  root complex @0x72c  map in 0x0..=0xffff out 0x0  -> SMMUv3 B @0xa0   StreamID 0x100
  SMMUv3 B   @0xa0   map in 0x0..=0x10000 out 0x0 -> ITS group @0x30  DeviceID 0x100

The PCIe root port of that segment (000f:00:00.0, rid 0x0000) is StreamID 0x0 on the same SMMU. [INFERRED from the same mapping]

5. Ground checks (Linux on the same machine, read-only)

CheckDecode saysLinux saysResult
GB10 SMMUSMMUv3 B, base 0x13000000/sys/bus/pci/devices/000f:01:00.0/iommu -> smmu3.0x0000000013000000match
Negative control: segments 0 to 9 devices (8 functions)SMMUv3 A, base 0x13800000every /sys/bus/pci/devices/000[0-9]:*/iommu -> smmu3.0x0000000013800000match
Number of SMMUs3/sys/class/iommu: 0x13000000, 0x13800000, 0x14900000match
RMR covers the GB10 streamyes (0x0..=0x100 inclusive)group 20 reserved_regions: a1600000-b97fffff direct, 280000000-302ffffff direct (= RMR ranges 2, 1+0 merged)match
MSI doorbellITS group 0group 20 reserved_regions: 8000000-80fffff msiconsistent

The inclusive id-range rule is what makes the RMR cover the GB10: with an exclusive reading the RMR would stop at 0xff and Linux would not list those regions for group 20. [SOURCE linux iort.c:361; sysfs above]

6. What this means for aienos

FactWhere in the kernelConsequence
Parser kept only the first SMMUv3 node (until cut B7a, section 9: now every node, smmus[])native/kernel/core/acpi.cuntil B7a SMMUv3 A was the only SMMU aienos could bring up; B is now brought up by its first confined stream
Root-complex mappings whose output is another SMMU are skipped (rd32(e + 12) != s.node_off)native/kernel/core/acpi.c:386-387segment 15 has no mapping in g.iort; ck_iort_stream_id(15, 0x100) returns -1
ck_dma_confine returned CK_SMMU_NOSTREAM (B5), CK_SMMU_OTHER (B6); since B7a it routes to SMMUv3 Bnative/kernel/core/smmu_svc.cfail closed throughout: never granted unconfined; a GB10 window now needs a caller (B7b)
Only the named-component path knows the "other SMMU" case (CK_SMMU_OTHER)native/kernel/core/smmu_svc.c:162-167; native/kernel/include/ck.h:116the PCI path reports NOSTREAM where OTHER is the truth; a report-only mismatch, not a safety hole
Range test rel > m->id_countnative/kernel/core/acpi.c:430inclusive, agrees with Linux; no change needed
STE_N 4096native/kernel/core/smmu_svc.c:14StreamID 0x100 fits
Window leaf is Normal Non-cacheablenative/kernel/core/smmu_svc.c:16-19same attribute the RMR demands (Normal NC), so the RMR ranges could be expressed as windows [INFERRED]
One window plus the stream's RMR ranges per stream (B7a)native/kernel/core/smmu_svc.c map_reservedthe three RMR ranges are identity-mapped beside the window in one stage-1 table

Gaps a future cut would have to close before any GB10 DMA (design facts, not a plan):

  1. Bring up SMMUv3 B (base 0x13000000) in addition to or instead of A: own stream table, command and event queues, GSIVs 366/371/364/365.
  2. Select the SMMU per root complex, not "the first node"; ck_iort_parse would have to carry several SMMU nodes or be called per node.
  3. Honour the RMR for StreamID 0x100: identity windows for the three ranges with Normal NC, or the GPU's firmware traffic into them faults. [INFERRED; what the ranges hold is UNKNOWN]
  4. Keep DMA addresses under 40 bits for segment 15 (address limit 40).
  5. MSI: DeviceID 0x100 at ITS 0 if interrupts are ever used instead of polling.

7. Unknowns

8. Cut B6 (done, QEMU/host only)

ck_iort_parse now remembers every SMMUv3 node and the root-complex mappings that target one other than the first (struct ck_iort_other, ck_iort_other_stream), and ck_dma_confine returns CK_SMMU_OTHER with that SMMU and stream named (len 0, never granted) instead of CK_SMMU_NOSTREAM. Host checks: test_smmu Spark-shape case (segment 15 rid 0x100 -> stream 0x100 on 0x13000000), iort-mutants with the new CK_IORT_MUTANT_OTHER_BLIND killed, and ck_acpi_scan --iort on the real table printing the segment 15 mapping as not driven. The second SMMU is still not brought up; that is a later cut with its own approval.

9. Cut B7a (done, QEMU/host only): several SMMUs, RMR honoured

Approval: aienos#286 (comment of 2026-10-10). Hardware boot is cut B7b and needs a machine window; nothing here was run on the Spark's SMMUs.

What changed:

Behaviour on the Spark that this cut does NOT change: USB0..USB5 and UBF0..UBF3 (the xHCI path) sit on SMMUv3 A (section 3), so the keyboard and recovery flows still touch only the first SMMU. SMMUv3 B is brought up only when a caller confines a segment 15 requester (the GB10) or HDA0; no such caller exists yet (that is cut B7b, with its own approval and a machine window).

Checks (host, QEMU): test_smmu Spark-shape case with the RMR node (route(15, 0x100) -> instance 1, base 0x13000000, stream 0x100, one RMR with three ranges; 0x101 has none; route(4, 0x100) -> instance 0 stream 0x50100; malformed RMR nodes refused), iort-mutants with three new killed mutants (CK_IORT_MUTANT_RMR_BLIND: RMR nodes ignored; CK_IORT_MUTANT_RMR_EXCLUSIVE: stream range read as exclusive, dropping stream 0x100; CK_IORT_MUTANT_ROUTE_FIRST: every requester routed to the first SMMU), sanitizer build, the freestanding build, the QEMU gates (one SMMU on QEMU virt: behaviour unchanged), and ck_acpi_scan --iort on the real table printing the three instances, the segment 15 route to instance 1 and the RMR node.

Still unknown after this cut: everything in section 7, plus whether SMMUv3 B comes up with this driver's geometry (IDR0/IDR1 read only at B7b).

10. Cut B7b preparation (done, QEMU/host only): the probe image

Approval: Drake's ruling of 2026-10-10 (aien-architecture#190, item 5): B7b preparation is authorized, not an unattended boot. The boot itself needs a first operator-confirmed, two-hour attended window after the recovery media, rollback, trust and preflight checks pass. Nothing in this cut ran on the Spark's SMMUs.

What changed:

What the B7b window would show on the Spark (expected from sections 3 and 9 and ck_acpi_scan --iort on this machine's table, not observed):

b7b_probe: start segment=15 rid=0x100 window_bytes=4096 no_dma=yes
b7b_probe: route instance=1 base=0x13000000 stream=0x100 rmr_nodes=1 (smmus=3)
smmu: instance 1 up base=0x13000000
smmu: stream 0x100 on 0x13000000: 3 firmware-reserved range(s) identity-mapped beside the window
b7b_probe: confined stream=0x100 smmu_base=0x13000000 iova=0x... len=0x1000
b7b_probe: instance=1 idr0=0x........ idr1=0x........ st_level=. sidsize=..
b7b_probe: unconfine rc=0 (ok); stream 0x100 aborts again
AIENOS_B7B_PROBE: CONFINED_AND_RELEASED

Any other summary is a finding, not a retry: REFUSED names the reason (nostream: the route differs from section 3; failed: bring-up or an RMR attribute was refused), FAIL means the unconfine failed or no live instance matched the confined base.

Still open before the window (not done in this cut):