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

GitHub aien-dev/aienux#14 (code only)

closed derived 89b608e2a0ad9c01 #14

Imported from GitHub aien-dev/aienux#14 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base a22b1d81b71d4c81e9519e3a341f126c0af8082f · Head 5f21d9958722047a58a9193b10191bea96dea554

Apply it

git checkout -b patch-89b608e2a0ad9c01 a22b1d81b71d4c81e9519e3a341f126c0af8082f
curl -fsSL https://interplane.io/drakestapleton/aienux/patches/89b608e2a0ad9c01.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/aienux
14
5f21d9958722047a58a9193b10191bea96dea554
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":14,"url":"https://github.com/aien-dev/aienux/pull/14","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:35:49Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/crates/aienos-boot/src/handoff.rs b/crates/aienos-boot/src/handoff.rs
index b39b769b..b278a382 100644
--- a/crates/aienos-boot/src/handoff.rs
+++ b/crates/aienos-boot/src/handoff.rs
@@ -14,6 +14,7 @@
 //!   /boot/efi/EFI/AIENOS/BOOTREPORT.TXT
 //!   /sys/firmware/efi/efivars/AienosBootReport-a1e05b0e-7c3d-4f51-9b6a-2d8e4c1f0a37
 
+use aienos_kernel::acpi;
 use aienos_kernel::arch::aarch64::{
     counter_frequency_hz, counter_ticks, EarlyUart, SPARK_16550_UART_BASE,
 };
@@ -28,6 +29,7 @@ use uefi::proto::media::file::{File, FileAttribute, FileMode};
 use uefi::proto::pci::root_bridge::PciRootBridgeIo;
 use uefi::proto::pci::PciIoAddress;
 use uefi::runtime::{ResetType, VariableAttributes, VariableVendor};
+use uefi::table::cfg::ConfigTableEntry;
 use uefi::{cstr16, guid};
 
 const REPORT_VENDOR: VariableVendor = VariableVendor(guid!("a1e05b0e-7c3d-4f51-9b6a-2d8e4c1f0a37"));
@@ -97,6 +99,50 @@ fn discover_gb10() -> Option<aienos_accel::Gb10Identity> {
     None
 }
 
+/// Reads a firmware ACPI table whose header is at `addr`.
+///
+/// # Safety
+/// `addr` must be zero or point to a mapped ACPI table left by firmware.
+unsafe fn table_at<'a>(addr: usize) -> Option<&'a [u8]> {
+    if addr == 0 {
+        return None;
+    }
+    let header = unsafe { core::slice::from_raw_parts(addr as *const u8, acpi::SDT_HEADER_LEN) };
+    let len = acpi::sdt_length(header)?;
+    if !(acpi::SDT_HEADER_LEN..=1 << 20).contains(&len) {
+        return None;
+    }
+    Some(unsafe { core::slice::from_raw_parts(addr as *const u8, len) })
+}
+
+/// Core inventory from the firmware MADT (RSDP, then XSDT, then "APIC").
+fn discover_cpu_topology() -> Option<acpi::CpuTopology> {
+    let rsdp = uefi::system::with_config_table(|entries| {
+        entries
+            .iter()
+            .find(|e| e.guid == ConfigTableEntry::ACPI2_GUID)
+            .map(|e| e.address as usize)
+    })?;
+    // SAFETY: firmware published this ACPI 2.0 RSDP, which is 36 bytes long.
+    let rsdp = unsafe { core::slice::from_raw_parts(rsdp as *const u8, 36) };
+    if &rsdp[..8] != b"RSD PTR " {
+        return None;
+    }
+    let xsdt_addr = u64::from_le_bytes(rsdp[24..32].try_into().ok()?) as usize;
+    // SAFETY: the RSDP points at the XSDT; its checksum is validated below.
+    let xsdt = acpi::checked_table(unsafe { table_at(xsdt_addr) }?, b"XSDT").ok()?;
+    for addr in acpi::xsdt_entries(xsdt) {
+        // SAFETY: XSDT entries point at firmware ACPI tables.
+        let Some(table) = (unsafe { table_at(addr as usize) }) else {
+            continue;
+        };
+        if &table[..4] == b"APIC" {
+            return acpi::madt_cpu_topology(table).ok();
+        }
+    }
+    None
+}
+
 /// Geometry of the display mode the firmware already configured.
 fn discover_framebuffer() -> Option<FramebufferInfo> {
     let handle = uefi::boot::get_handle_for_protocol::<GraphicsOutput>().ok()?;
@@ -168,6 +214,8 @@ fn main() -> Status {
     let frequency_hz = counter_frequency_hz();
     let gb10 = discover_gb10();
     let framebuffer = discover_framebuffer();
+    let cpu = discover_cpu_topology();
+    let boot_midr = aienos_kernel::arch::aarch64::midr_el1();
 
     let mut pre = ReportBuf::<1024>::new();
     let _ = writeln!(pre, "AIENOS pre-exit report");
@@ -188,6 +236,26 @@ fn main() -> Status {
             let _ = writeln!(pre, "gb10: unavailable");
         }
     }
+    match cpu {
+        Some(t) => {
+            let _ = writeln!(pre, "cpu_cores: {}", t.cores);
+            for (class, count) in t.classes() {
+                let _ = writeln!(pre, "cpu_efficiency_class_{class}: {count}");
+            }
+            if t.unknown_class > 0 {
+                let _ = writeln!(pre, "cpu_efficiency_class_unknown: {}", t.unknown_class);
+            }
+        }
+        None => {
+            let _ = writeln!(pre, "cpu_topology: unavailable");
+        }
+    }
+    let _ = writeln!(
+        pre,
+        "boot_cpu_midr: {:#x} (part {:#05x})",
+        boot_midr,
+        aienos_kernel::arch::aarch64::midr_part(boot_midr)
+    );
     match framebuffer {
         Some(f) => {
             let _ = writeln!(
@@ -238,6 +306,7 @@ fn main() -> Status {
         largest_region,
         Some(timing),
         gb10,
+        cpu,
     );
 
     // 1. Screen: the display mode firmware set up, written directly.
diff --git a/crates/aienos-kernel/src/acpi.rs b/crates/aienos-kernel/src/acpi.rs
new file mode 100644
index 00000000..286f8f9b
--- /dev/null
+++ b/crates/aienos-kernel/src/acpi.rs
@@ -0,0 +1,235 @@
+//! Minimal ACPI table parsing for early CPU topology.
+//!
+//! Pure functions over byte slices so they are testable on the host; the boot
+//! image copies no memory and only hands the firmware's tables in as slices.
+//!
+//! The MADT lists one GIC CPU interface (GICC) entry per core. Since ACPI 6.0
+//! each entry carries a Processor Power Efficiency Class; lower numbers are more
+//! power-efficient. On heterogeneous parts such as the GB10 (Cortex-A725 and
+//! Cortex-X925) this is how firmware tells the OS which cores are which,
+//! without starting the secondary cores.
+
+pub const SDT_HEADER_LEN: usize = 36;
+const MADT_ENTRIES_OFFSET: usize = 44;
+const GICC_TYPE: u8 = 0x0B;
+const GICC_FLAGS: usize = 12;
+const GICC_MPIDR: usize = 68;
+const GICC_EFFICIENCY_CLASS: usize = 76;
+/// GICC entries shorter than this predate the efficiency class field.
+const GICC_LEN_WITH_CLASS: usize = 77;
+const GICC_ENABLED: u32 = 1;
+const GICC_ONLINE_CAPABLE: u32 = 1 << 3;
+
+/// Distinct efficiency classes tracked; real parts have two or three.
+pub const MAX_CLASSES: usize = 8;
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum AcpiError {
+    Truncated,
+    BadSignature,
+    BadChecksum,
+    BadEntry,
+}
+
+fn u32_at(b: &[u8], at: usize) -> Option<u32> {
+    Some(u32::from_le_bytes(b.get(at..at + 4)?.try_into().ok()?))
+}
+
+fn u64_at(b: &[u8], at: usize) -> Option<u64> {
+    Some(u64::from_le_bytes(b.get(at..at + 8)?.try_into().ok()?))
+}
+
+/// Length field of a system description table header.
+pub fn sdt_length(header: &[u8]) -> Option<usize> {
+    u32_at(header, 4).map(|l| l as usize)
+}
+
+/// Validates signature, declared length and checksum; returns the table.
+pub fn checked_table<'a>(bytes: &'a [u8], signature: &[u8; 4]) -> Result<&'a [u8], AcpiError> {
+    let len = sdt_length(bytes).ok_or(AcpiError::Truncated)?;
+    if len < SDT_HEADER_LEN || len > bytes.len() {
+        return Err(AcpiError::Truncated);
+    }
+    let table = &bytes[..len];
+    if &table[..4] != signature {
+        return Err(AcpiError::BadSignature);
+    }
+    if table.iter().fold(0u8, |sum, b| sum.wrapping_add(*b)) != 0 {
+        return Err(AcpiError::BadChecksum);
+    }
+    Ok(table)
+}
+
+/// Physical addresses listed in an XSDT.
+pub fn xsdt_entries(xsdt: &[u8]) -> impl Iterator<Item = u64> + '_ {
+    xsdt.get(SDT_HEADER_LEN..)
+        .unwrap_or(&[])
+        .as_chunks::<8>()
+        .0
+        .iter()
+        .map(|c| u64::from_le_bytes(*c))
+}
+
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
+pub struct CpuTopology {
+    /// Enabled or online-capable cores listed in the MADT.
+    pub cores: u32,
+    /// `(efficiency_class, core_count)`, sorted by class; unused slots are zero.
+    pub classes: [(u8, u32); MAX_CLASSES],
+    pub distinct_classes: usize,
+    /// Cores whose GICC entry is too old to carry an efficiency class.
+    pub unknown_class: u32,
+    /// Affinity (MPIDR) of the first listed core, for cross-checking the boot core.
+    pub first_mpidr: Option<u64>,
+}
+
+impl CpuTopology {
+    fn add(&mut self, class: u8) {
+        if let Some(slot) = self.classes[..self.distinct_classes]
+            .iter_mut()
+            .find(|(c, _)| *c == class)
+        {
+            slot.1 += 1;
+        } else if self.distinct_classes < MAX_CLASSES {
+            self.classes[self.distinct_classes] = (class, 1);
+            self.distinct_classes += 1;
+            self.classes[..self.distinct_classes].sort_unstable_by_key(|(c, _)| *c);
+        } else {
+            self.unknown_class += 1;
+        }
+    }
+
+    pub fn classes(&self) -> &[(u8, u32)] {
+        &self.classes[..self.distinct_classes]
+    }
+}
+
+/// Summarises the cores in a validated MADT ("APIC") table.
+pub fn madt_cpu_topology(madt: &[u8]) -> Result<CpuTopology, AcpiError> {
+    let madt = checked_table(madt, b"APIC")?;
+    let mut topo = CpuTopology::default();
+    let mut at = MADT_ENTRIES_OFFSET;
+    while at < madt.len() {
+        let kind = madt[at];
+        let len = *madt.get(at + 1).ok_or(AcpiError::Truncated)? as usize;
+        if len < 2 || at + len > madt.len() {
+            return Err(AcpiError::BadEntry);
+        }
+        let entry = &madt[at..at + len];
+        if kind == GICC_TYPE {
+            let flags = u32_at(entry, GICC_FLAGS).ok_or(AcpiError::BadEntry)?;
+            if flags & (GICC_ENABLED | GICC_ONLINE_CAPABLE) != 0 {
+                topo.cores += 1;
+                if topo.first_mpidr.is_none() {
+                    topo.first_mpidr = u64_at(entry, GICC_MPIDR);
+                }
+                if len >= GICC_LEN_WITH_CLASS {
+                    topo.add(entry[GICC_EFFICIENCY_CLASS]);
+                } else {
+                    topo.unknown_class += 1;
+                }
+            }
+        }
+        at += len;
+    }
+    Ok(topo)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::vec::Vec;
+
+    fn gicc(mpidr: u64, flags: u32, class: u8, len: usize) -> Vec<u8> {
+        let mut e = std::vec![0u8; len];
+        e[0] = GICC_TYPE;
+        e[1] = len as u8;
+        e[GICC_FLAGS..GICC_FLAGS + 4].copy_from_slice(&flags.to_le_bytes());
+        e[GICC_MPIDR..GICC_MPIDR + 8].copy_from_slice(&mpidr.to_le_bytes());
+        if len > GICC_EFFICIENCY_CLASS {
+            e[GICC_EFFICIENCY_CLASS] = class;
+        }
+        e
+    }
+
+    fn madt(entries: &[Vec<u8>]) -> Vec<u8> {
+        let mut t = std::vec![0u8; MADT_ENTRIES_OFFSET];
+        t[..4].copy_from_slice(b"APIC");
+        // A non-GICC entry (GIC distributor) that must be skipped.
+        let mut gicd = std::vec![0u8; 24];
+        gicd[0] = 0x0C;
+        gicd[1] = 24;
+        t.extend_from_slice(&gicd);
+        for e in entries {
+            t.extend_from_slice(e);
+        }
+        let len = t.len() as u32;
+        t[4..8].copy_from_slice(&len.to_le_bytes());
+        let sum = t.iter().fold(0u8, |s, b| s.wrapping_add(*b));
+        t[9] = 0u8.wrapping_sub(sum);
+        t
+    }
+
+    #[test]
+    fn counts_gb10_style_heterogeneous_cores_by_efficiency_class() {
+        // Ten efficient cores (class 0) then ten performance cores (class 1).
+        let entries: Vec<Vec<u8>> = (0..20u64)
+            .map(|i| gicc(0x8100_0000 + (i << 8), GICC_ENABLED, u8::from(i >= 10), 82))
+            .collect();
+        let topo = madt_cpu_topology(&madt(&entries)).unwrap();
+        assert_eq!(topo.cores, 20);
+        assert_eq!(topo.classes(), &[(0, 10), (1, 10)]);
+        assert_eq!(topo.unknown_class, 0);
+        assert_eq!(topo.first_mpidr, Some(0x8100_0000));
+    }
+
+    #[test]
+    fn skips_disabled_cores_and_counts_old_entries_as_unknown() {
+        let entries = [
+            gicc(0, GICC_ENABLED, 0, 80),
+            gicc(1, 0, 1, 80),                   // disabled, not online capable
+            gicc(2, GICC_ONLINE_CAPABLE, 1, 80), // hot-pluggable, counted
+            gicc(3, GICC_ENABLED, 0, 76),        // ACPI 5.x entry, no class byte
+        ];
+        let topo = madt_cpu_topology(&madt(&entries)).unwrap();
+        assert_eq!(topo.cores, 3);
+        assert_eq!(topo.classes(), &[(0, 1), (1, 1)]);
+        assert_eq!(topo.unknown_class, 1);
+    }
+
+    #[test]
+    fn rejects_bad_checksum_signature_and_lengths() {
+        let good = madt(&[gicc(0, GICC_ENABLED, 0, 80)]);
+        let mut bad_sum = good.clone();
+        bad_sum[MADT_ENTRIES_OFFSET + 30] ^= 1;
+        assert_eq!(madt_cpu_topology(&bad_sum), Err(AcpiError::BadChecksum));
+
+        let mut wrong_sig = good.clone();
+        wrong_sig[0] = b'X';
+        wrong_sig[9] = wrong_sig[9].wrapping_sub(b'X' - b'A');
+        assert_eq!(madt_cpu_topology(&wrong_sig), Err(AcpiError::BadSignature));
+
+        assert_eq!(
+            madt_cpu_topology(&good[..good.len() - 1]),
+            Err(AcpiError::Truncated)
+        );
+
+        let mut zero_len = madt(&[]);
+        zero_len.extend_from_slice(&[GICC_TYPE, 0]);
+        let len = zero_len.len() as u32;
+        zero_len[4..8].copy_from_slice(&len.to_le_bytes());
+        zero_len[9] = 0;
+        let sum = zero_len.iter().fold(0u8, |s, b| s.wrapping_add(*b));
+        zero_len[9] = 0u8.wrapping_sub(sum);
+        assert_eq!(madt_cpu_topology(&zero_len), Err(AcpiError::BadEntry));
+    }
+
+    #[test]
+    fn reads_xsdt_entry_addresses() {
+        let mut xsdt = std::vec![0u8; SDT_HEADER_LEN];
+        xsdt.extend_from_slice(&0x1234_5678u64.to_le_bytes());
+        xsdt.extend_from_slice(&0x9abc_def0u64.to_le_bytes());
+        let addrs: Vec<u64> = xsdt_entries(&xsdt).collect();
+        assert_eq!(addrs, [0x1234_5678, 0x9abc_def0]);
+    }
+}
diff --git a/crates/aienos-kernel/src/arch/aarch64.rs b/crates/aienos-kernel/src/arch/aarch64.rs
index 34427e2d..f66104aa 100644
--- a/crates/aienos-kernel/src/arch/aarch64.rs
+++ b/crates/aienos-kernel/src/arch/aarch64.rs
@@ -74,6 +74,29 @@ pub fn counter_ticks() -> u64 {
     }
 }
 
+/// Main ID register of the executing core. Bits 15:4 are the part number
+/// (0xd87 Cortex-A725, 0xd85 Cortex-X925 on the GB10).
+#[inline(always)]
+pub fn midr_el1() -> u64 {
+    #[cfg(target_arch = "aarch64")]
+    {
+        let midr: u64;
+        unsafe {
+            core::arch::asm!("mrs {0}, midr_el1", out(reg) midr, options(nomem, nostack, preserves_flags));
+        }
+        midr
+    }
+    #[cfg(not(target_arch = "aarch64"))]
+    {
+        0
+    }
+}
+
+/// Part number field of a MIDR value.
+pub const fn midr_part(midr: u64) -> u16 {
+    ((midr >> 4) & 0xfff) as u16
+}
+
 /// Read the frequency of the architectural virtual counter.
 #[inline(always)]
 pub fn counter_frequency_hz() -> u64 {
diff --git a/crates/aienos-kernel/src/boot.rs b/crates/aienos-kernel/src/boot.rs
index 864a7386..91a60fd8 100644
--- a/crates/aienos-kernel/src/boot.rs
+++ b/crates/aienos-kernel/src/boot.rs
@@ -2,8 +2,10 @@
 //!
 //! Provides the bare-metal entry path, early serial banner, and BootReceipt.
 
+use crate::acpi::CpuTopology;
 use crate::arch::aarch64::{
-    counter_ticks, current_el, disable_interrupts, dsb, halt, isb, EarlyUart, SPARK_16550_UART_BASE,
+    counter_ticks, current_el, disable_interrupts, dsb, halt, isb, midr_el1, midr_part, EarlyUart,
+    SPARK_16550_UART_BASE,
 };
 use crate::mem::{BitmapFrameAllocator, PhysAddr, PAGE_SIZE};
 use crate::report::ReportBuf;
@@ -139,6 +141,10 @@ pub struct BootFacts {
     pub timing: Option<BootTiming>,
     pub kernel_entry_ticks: u64,
     pub gb10: Option<aienos_accel::Gb10Identity>,
+    /// Core inventory from the firmware MADT, if it was found and valid.
+    pub cpu: Option<CpuTopology>,
+    /// MIDR of the core running the boot path.
+    pub boot_midr: u64,
     pub exception_level: u8,
 }
 
@@ -163,6 +169,26 @@ pub fn write_boot_report(out: &mut impl Write, facts: &BootFacts) -> bool {
             let _ = writeln!(out, "gb10: unavailable");
         }
     }
+    match facts.cpu {
+        Some(t) => {
+            let _ = writeln!(out, "cpu_cores: {}", t.cores);
+            for (class, count) in t.classes() {
+                let _ = writeln!(out, "cpu_efficiency_class_{class}: {count}");
+            }
+            if t.unknown_class > 0 {
+                let _ = writeln!(out, "cpu_efficiency_class_unknown: {}", t.unknown_class);
+            }
+        }
+        None => {
+            let _ = writeln!(out, "cpu_topology: unavailable");
+        }
+    }
+    let _ = writeln!(
+        out,
+        "boot_cpu_midr: {:#x} (part {:#05x})",
+        facts.boot_midr,
+        midr_part(facts.boot_midr)
+    );
     let Some((managed_frames, first_frame)) = facts.allocator else {
         let _ = writeln!(out, "allocator: unavailable; boot halted");
         return false;
@@ -193,6 +219,7 @@ pub fn early_kernel_enter(
     memory_region: Option<BootMemoryRegion>,
     boot_timing: Option<BootTiming>,
     gb10: Option<aienos_accel::Gb10Identity>,
+    cpu: Option<CpuTopology>,
 ) -> (BootReport, bool) {
     let kernel_entry_ticks = counter_ticks();
     disable_interrupts();
@@ -206,6 +233,8 @@ pub fn early_kernel_enter(
         timing: boot_timing,
         kernel_entry_ticks,
         gb10,
+        cpu,
+        boot_midr: midr_el1(),
         exception_level: current_el(),
     };
     let mut report = BootReport::new();
@@ -221,7 +250,13 @@ pub fn early_kernel_init_with_gpu(
     boot_timing: Option<BootTiming>,
     gb10: Option<aienos_accel::Gb10Identity>,
 ) -> ! {
-    let (report, ok) = early_kernel_enter(conventional_memory_kb, memory_region, boot_timing, gb10);
+    let (report, ok) = early_kernel_enter(
+        conventional_memory_kb,
+        memory_region,
+        boot_timing,
+        gb10,
+        None,
+    );
     let uart = EarlyUart::new(SPARK_16550_UART_BASE);
     uart.write_str("\n");
     uart.write_str(report.as_str());
@@ -280,6 +315,23 @@ mod tests {
             }),
             kernel_entry_ticks: 3_000,
             gb10: Some(gb10),
+            cpu: Some(crate::acpi::CpuTopology {
+                cores: 20,
+                classes: [
+                    (0, 10),
+                    (1, 10),
+                    (0, 0),
+                    (0, 0),
+                    (0, 0),
+                    (0, 0),
+                    (0, 0),
+                    (0, 0),
+                ],
+                distinct_classes: 2,
+                unknown_class: 0,
+                first_mpidr: Some(0x8100_0000),
+            }),
+            boot_midr: 0x410f_d870,
             exception_level: 2,
         };
         let mut report = BootReport::new();
@@ -289,6 +341,10 @@ mod tests {
             "gb10_segment: 15",
             "gb10_bar0_phys: 0x650000000",
             "gb10_pmc_boot_0: 0x1b0000a1",
+            "cpu_cores: 20",
+            "cpu_efficiency_class_0: 10",
+            "cpu_efficiency_class_1: 10",
+            "boot_cpu_midr: 0x410fd870 (part 0xd87)",
             "allocator_reserved_frame_phys: 0x10000000",
             "uefi_entry_to_handoff_ms: 1",
             "handoff_to_kernel_entry_ms: 2",
diff --git a/crates/aienos-kernel/src/lib.rs b/crates/aienos-kernel/src/lib.rs
index d3efa865..3baac6ab 100644
--- a/crates/aienos-kernel/src/lib.rs
+++ b/crates/aienos-kernel/src/lib.rs
@@ -8,6 +8,7 @@
 
 #![cfg_attr(not(feature = "std"), no_std)]
 
+pub mod acpi;
 pub mod arch;
 pub mod boot;
 pub mod crypto;
diff --git a/docs/MILESTONES.md b/docs/MILESTONES.md
index eab941e5..a99c89c1 100644
--- a/docs/MILESTONES.md
+++ b/docs/MILESTONES.md
@@ -22,6 +22,56 @@
 
 ---
 
+## 0. Current Critical Path (revised 2026-09-24)
+
+The phases in section 1 remain the destination. This is the gate order being
+executed now, adopted from the reviewed roadmap. The first vision is proven
+only at M8. Status words: **done** = verified on this repository's evidence;
+**built** = code merged and host-verified, never run on hardware; **pending**
+= not started or blocked.
+
+| Gate | Scope | Status | Evidence / blocker |
+|---|---|---|---|
+| **M0** Close Config A | Clean reference snapshot | done | PR #12: schema 3.0.0 bundle, all repositories clean |
+| | Benchmark evidence | done | CPU baseline: Llama-3.2-1B Q4_K_M on 20 Arm cores, 256-token samples, mean decode 54.2 tokens/s |
+| | Verified recovery and rollback | pending | Needs the attended one-time boot ([procedure](NATIVE_BOOT_ONE_TIME.md)) |
+| **M1** UEFI/QEMU substrate | Automated emulator boot proof | pending | No `qemu-system-aarch64` or AArch64 UEFI firmware on the host; UEFI images are format-checked only |
+| **M2A** Spark firmware handoff | Memory map into early allocator | built | PR #10 |
+| | GB10 PCI identity, BAR0, PMC_BOOT registers | built | PR #11 |
+| | CPU topology from the ACPI MADT (efficiency classes) and boot-core MIDR | built | Parser tested on constructed tables; Linux shows boot cpu0 is a Cortex-A725 |
+| | Broader ACPI device discovery | pending | |
+| **M2B** Human bring-up console | GOP framebuffer text after firmware exit | built | PR #13 |
+| | UART at `0x16A00000` (bounded, Spark only) | built | PR #13; external reachability unknown |
+| | USB keyboard (xHCI + HID) | pending | |
+| **M2C** Hardware test automation | Exclusive Machine 1 key and ledger records in `aien-proof` | built | aien-sovereign-core PR #126: `aien-proof hold --resource machine-1 -- CMD` |
+| | Power/reset control, HDMI capture, USB input emulation | pending | Needs hardware chosen by the operator |
+| **M3** Kernel isolation | MMU, exceptions, interrupts, timer, scheduler, IPC/capabilities | pending | Scheduler consumes M2A CPU topology |
+| **M4** Storage and recovery | | pending | Host crates exist (`recovery`, `store`) |
+| **M5** Encryption and identity | | pending | |
+| **M6** Minimal wired networking | DHCP/static IP, ARP/NDP, IP, UDP/TCP, secure control transport | pending | Before the self-maintaining agent; Wi-Fi and Bluetooth later |
+| **M7** AIEN runtime and native CPU inference | | pending | Compare against the M0 CPU baseline |
+| **M8** Cortex and persistent agent | | pending | Host crates exist (`cortex`, `agent-state`) |
+
+**Current blocker for M2 on hardware:** Secure Boot is enabled on Machine 1
+(observed 2026-09-24), so firmware refuses the unsigned handoff image. Changing
+it is escalation trigger 1 and is the operator's decision.
+
+**Accelerator lane:** device characterization (PCI identity, BAR layout,
+firmware interfaces, register discovery) is allowed now. Command submission,
+GSP interaction, GPU memory management and GPU inference stay a separate,
+non-blocking program (see [GB10_NATIVE_STATUS.md](GB10_NATIVE_STATUS.md)).
+
+**Open operator decisions on the M2 bring-up path:**
+- The handoff image writes its report to the `AienosBootReport` firmware
+  variable after `ExitBootServices`, as a one-time bring-up diagnostic.
+  AIENOS does not depend on it, but it uses a firmware runtime storage service
+  after handoff (escalation trigger 11) and needs operator sign-off.
+- `scripts/stage_one_time_boot.sh --apply` sets `BootNext` and adds a boot
+  entry outside BootOrder. It runs only when the operator invokes it
+  (Phase 2 escalation trigger on NVRAM boot variables).
+
+---
+
 ## 1. Master Phased Execution Framework
 
 The AIENOS master execution sequence progresses across eight distinct phases. The order expresses architectural dependency, not administrative bureaucracy. Each phase establishes sovereign deliverables, enforceable invariants, objective acceptance tests, and explicit escalation triggers.
diff --git a/docs/NATIVE_BOOT_ONE_TIME.md b/docs/NATIVE_BOOT_ONE_TIME.md
index f7a550d2..9e0de1e2 100644
--- a/docs/NATIVE_BOOT_ONE_TIME.md
+++ b/docs/NATIVE_BOOT_ONE_TIME.md
@@ -34,18 +34,27 @@ The image does not touch the Linux installation, its partitions, or BootOrder.
 
 ```bash
 bash scripts/stage_one_time_boot.sh            # dry run: prints the plan
-bash scripts/stage_one_time_boot.sh --apply    # needs sudo; sets BootNext only
+sudo -v                                        # cache sudo; hold gives the command no stdin
+aien-proof hold --resource machine-1 --job stage-native-boot -- \
+    bash scripts/stage_one_time_boot.sh --apply # sets BootNext only
 sudo reboot
 ```
 
+`aien-proof hold` (aien-sovereign-core) lets only one agent own Machine 1 at a
+time and records each attempt, with its full output, as an `audit` event in the
+shared ledger.
+
 Expect: the firmware logo, the AIENOS pre-exit report, then a dark screen with
 `AIENOS NATIVE BOOT REPORT` and a countdown. After the reset, Linux boots
 normally. Then:
 
 ```bash
-bash scripts/collect_boot_report.sh
+aien-proof hold --resource machine-1 --job collect-native-boot -- \
+    bash scripts/collect_boot_report.sh
 ```
 
+The ledger entry then carries the booted image digest and both reports.
+
 `NATIVE_BOOT_OK` means the kernel ran and its report survived the reset.
 
 ## If something goes wrong
diff --git a/scripts/collect_boot_report.sh b/scripts/collect_boot_report.sh
index 924c8f28..873fbea5 100755
--- a/scripts/collect_boot_report.sh
+++ b/scripts/collect_boot_report.sh
@@ -6,6 +6,14 @@ set -euo pipefail
 
 report_file="/boot/efi/EFI/AIENOS/BOOTREPORT.TXT"
 report_var="/sys/firmware/efi/efivars/AienosBootReport-a1e05b0e-7c3d-4f51-9b6a-2d8e4c1f0a37"
+image="/boot/efi/EFI/AIENOS/aienos-handoff.efi"
+
+echo "== staged image"
+if [[ -r "${image}" ]]; then
+    echo "sha256: $(sha256sum "${image}" | cut -d" " -f1)"
+else
+    echo "missing: ${image}"
+fi
 
 echo "== pre-exit report (${report_file})"
 if [[ -r "${report_file}" ]]; then