ASELSANMicrokernel
S301 · SOURCE-BOUND GATE EVIDENCE

G8l: user-first-kernel-entry writer-authority audit

Operations --test hedefi → test hedefiyle aynı adlı uygulama/model modülü → kaynak kesiti Bu sayfa yalnız S301 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S301Focused kod testiOperations id exactsource SHA exacttest target exact

operation: g8l-s301-user-first-kernel-entry-writer-authority-audit-partial

uygulama/model · focused test · Operations · 3 exact excerpt

sequence-bound=true · implementation-bound=true
01 · Testin bağlı olduğu uygulama/model kodu

Kapının yürüttüğü gerçek kaynak

tam Rust öğesiL23–L91
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s301_user_first_kernel_entry_writer_authority_audit.rs::S301_WHOLE_SCHEDULER_GUARDED_SITES

pub const S301_WRITER_BOUNDARY_SITES: usize = 1;
pub const S301_WRITER_AUTHORITY_SITES: usize = 0;
pub const S301_DIRECT_SCHEDULER_ACCESS_SITES: usize = S300_DIRECT_SCHEDULER_ACCESS_SITES;
pub const S301_IMMUTABLE_READ_SITES: usize = S300_IMMUTABLE_READ_SITES;
pub const S301_WHOLE_SCHEDULER_GUARDED_SITES: usize = S300_WHOLE_SCHEDULER_GUARDED_SITES;
pub const S301_WHOLE_SCHEDULER_UNROUTED_SITES: usize = S300_WHOLE_SCHEDULER_UNROUTED_SITES;
pub const S301_OPEN_WRITER_SITES: usize = S300_OPEN_WRITER_SITES;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS301SchedulerWriterAuthorityAuditOutcome {
    Idle,
    AwaitingWriterAuthority {
        request_id: u64,
        guarded_sites: usize,
        writer_sites: usize,
    },
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS301SchedulerWriterAuthorityAuditError {
    S300(G8lS300SchedulerWriterAuthorityAuditError),
    S245(G8lS245ExclusionAdmissionRequestError),
    PriorCoverageDrift {
        guarded_sites: usize,
        unrouted_sites: usize,
    },
}

/// Revalidate the prior fail-closed authority boundary without taking
/// admission or constructing a production exclusive wrapper.
pub fn preflight_s301_scheduler_writer_authority(
    caller_cpu: usize,
    request: Option<G8lS245WholeSchedulerExclusionAdmissionRequestView>,
) -> Result<G8lS301SchedulerWriterAuthorityAuditOutcome, G8lS301SchedulerWriterAuthorityAuditError>
{
    match preflight_s300_scheduler_writer_authority(caller_cpu, request)
        .map_err(G8lS301SchedulerWriterAuthorityAuditError::S300)?
    {
        G8lS300SchedulerWriterAuthorityAuditOutcome::Idle => {
            Ok(G8lS301SchedulerWriterAuthorityAuditOutcome::Idle)
        }
        G8lS300SchedulerWriterAuthorityAuditOutcome::AwaitingWriterAuthority {
            request_id,
            guarded_sites,
            writer_sites,
        } if guarded_sites == S301_WHOLE_SCHEDULER_GUARDED_SITES
            && writer_sites == S301_OPEN_WRITER_SITES =>
        {
            Ok(
                G8lS301SchedulerWriterAuthorityAuditOutcome::AwaitingWriterAuthority {
                    request_id,
                    guarded_sites,
                    writer_sites,
                },
            )
        }
        G8lS300SchedulerWriterAuthorityAuditOutcome::AwaitingWriterAuthority {
            guarded_sites,
            writer_sites: _,
            ..
        } => Err(
            G8lS301SchedulerWriterAuthorityAuditError::PriorCoverageDrift {
                guarded_sites,
                unrouted_sites: S301_DIRECT_SCHEDULER_ACCESS_SITES - guarded_sites,
            },
        ),
    }
}
snippet sha256: f8a0799df396file sha256: 66d7ea30e884
02 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam Rust öğesiL139–L160
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s301_user_first_kernel_entry_writer_authority_audit.rs::s301_non_user_current_task_panics_before_address_space_switch

#[test]
fn s301_non_user_current_task_panics_before_address_space_switch() {
    let source = include_str!("../../kernel/src/task/scheduler.rs");
    let boundary = user_first_kernel_entry_boundary(source);
    for required in [
        "if !curr.is_user",
        "panic!(\"[M4.3] user_first_kernel_entry: not a user task\")",
        "maybe_switch_to_task_address_space(curr)",
    ] {
        assert!(
            boundary.contains(required),
            "missing S301 user gate token: {required}"
        );
    }
    let user_gate = boundary.find("if !curr.is_user").unwrap();
    let panic = boundary.find("not a user task").unwrap();
    let address_space = boundary
        .find("maybe_switch_to_task_address_space(curr)")
        .unwrap();
    assert!(user_gate < panic && panic < address_space);
}
snippet sha256: 6479e762fff1file sha256: 40a90582e1ad
03 · Kapı kimlik kaydı

Operations sıra, kimlik ve başlık bağı

tam Operations kaydıL16222–L16278
website/src/lib/operations.ts::g8l-s301-user-first-kernel-entry-writer-authority-audit-partial
  {
    id: "g8l-s301-user-first-kernel-entry-writer-authority-audit-partial",
    date: "2026-08-26",
    sequence: 301,
    status: "passed",
    umbrella_status: "partial",
    title: "G8l: user-first-kernel-entry writer-authority audit",
    summary:
      "S301 focused 15/15 PASS ile user_first_kernel_entry içindeki tek ve scheduler.rs'deki son explicit mutable scheduler aliasını kaynakta doğrular. Current task zorunludur ve user task olmalıdır; no-current ile non-user yolları fail-closed panic eder. Address-space switch, 16-byte stack alignment, 128-byte kernel frame, owned 31-slot GPR snapshot, x16 tabanlı restore, x16/x17 skip, EL0 sysreg/GPR/LR yükleri ve terminal eret/noreturn sırası kilitlenir. Writer authority yalnız model gate'inin exclusive lease'iyle mümkündür; reader lease'i writer'ı açmaz. Production inventory 113 direct / 44 immutable guarded / 69 open writer olarak değişmez ve production exclusive wrapper, provider authority, whole-scheduler exclusion veya scheduler mutation üretilmez.",
    evidence: [
      "S301 focused kaynak/model kapısı iki bağımsız koşuda 15/15 PASS verdi: 130 B / SHA-256 0447f2fe9dc6fdf30815a6962cf23d978425e51bef2acde1efb27e5da13a78b3.",
      "user_first_kernel_entry içindeki tek addr_of_mut!(SCHEDULER) writer boundary'si audit edilir. Missing-current/non-user branch'leri panic eder; maybe_switch_to_task_address_space, 16-byte stack alignment, 128-byte frame, local [u64; 31] snapshot, x16 restore base, x16/x17 skip, SP_EL0/ELR_EL1/SPSR_EL1, x0–x15/x18–x30 ve terminal eret/noreturn sırası kaynakta görünür. Bu scheduler.rs içindeki son explicit mutable scheduler aliasıdır.",
      "Model gate reader membership exclusive writer authority'yi ExclusiveBusy ile bloklar; reader bırakıldıktan sonra non-zero token'lı exclusive lease alınır. Bu host/model evidence'tır.",
      "S300 authority preflight yeniden doğrulanır; pending S245 request korunur ve sonuç AwaitingWriterAuthority { guarded_sites: 44, writer_sites: 69 } olarak döner.",
      "Dört AArch64 profil derlemesi iki koşuda byte-equal exit 0 verdi: QEMU 110646 B / 8bbe65b0, RPi4 149371 B / d5bcfadd, RPi5 412669 B / cfa98980 ve RPi5+SMP 412611 B / e3c2bdd4. Warning header'ları sırasıyla 291, 389, 850 ve 850'dir; zero-warning iddiası değildir.",
      "Birleşik board-rpi5,board-qemu özellikleri iki koşuda beklenen exit 101, 18590 B / ccba43d4, 17 error ve 22 warning header ile fail-closed kaldı; S301 writer boundary'si iki board profilinin birlikte etkinleşmesini açmaz.",
      "S238–S301 dependency matrisi iki koşuda 65 grup / 899/899 PASS; ham loglar byte-equal 8372 B / 2edeace743e323c6c6a2c125a90dff8092e8b0a673f4bd8a9ad03c3546d93bca, süre-normalize özetler byte-equal 8502 B / 1f2b0e76d6ec17360fd795065c5d160b2e4bfbb406c891e85fdce75892d13946. İlk yeniden-toplama komutundaki yanlış S271 target aliası 34 PASS sonrası reddedildi; source/test RED'i değildir. Bu production writer-authority invocation kanıtı değildir.",
      "Ortak make verify-qemu iki koşuda PASS verdi: 116222 B / d3436506 ve 116139 B / 1007fb62; W^X 31/31, S271 GRAPH_ABSENT=YES, RuntimePmm baseline, EL0 x4096, IPC 20/20, tek S142 containment ve SEC5 korunur. Bu ortak smoke S301 production writer invocation kanıtı değildir.",
      "Exact yedi tarihsel G8h assertion adıyla dışlandığında workspace iki koşuda 263 sonuç grubu / 2690 PASS / 7 filtered verdi: ham loglar 61673 B / 32be0690 ve 56f3818c, süre-normalize 25392 B özet byte-equal / SHA-256 6c5523353ac0287a21aa5843aef8da1b70141c135b3f3f2e668a02b859280b73. Filtresiz koşu exit 101, 56895 B / 58893d8d ile frozen S96 exceptions.S identity kapısında RED kaldı; full-workspace GREEN iddia edilmez.",
      "S301 production exclusive wrapper, provider authority, whole-scheduler exclusion, QEMU runtime fixture veya scheduler mutation iddiası eklemez; physical/device operations=0 ve RUNBOOK_EXECUTED_IN_S301=NO.",
    ],
    commands: [
      "cargo test --quiet -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s301_user_first_kernel_entry_writer_authority_audit -- --test-threads=1",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-qemu",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi4",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5,smp",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --features board-rpi5",
      "make verify-qemu",
    ],
    terminalSessions: [
      {
        id: "g8l-s301-user-first-kernel-entry-writer-authority-audit",
        title: "G8l S301 user-first-kernel-entry writer-authority audit",
        commandLines: [
          "cargo test --quiet -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s301_user_first_kernel_entry_writer_authority_audit -- --test-threads=1",
        ],
        outputLines: [
          "test result: ok; S301 focused 1 group / 15 passed; 0 failed",
          "repeat-stable quiet output: 130 B / 0447f2fe9dc6fdf30815a6962cf23d978425e51bef2acde1efb27e5da13a78b3",
          "user-first-kernel-entry writer authority remains model-only: reader blocks exclusive lease; address-space, stack-frame, owned GPR snapshot, x16-based EL0 restore and terminal ERET ordering are source-audited while all 69 production writer sites remain open",
          "dependency: S238–S301 · 65 groups · 899/899 PASS; workspace: 263 groups · 2690 PASS · 7 historical filtered",
        ],
        exitCode: 0,
        outputMode: "selected",
      },
    ],
    terminalSessionsNote:
      "S301 kaynak/model fail-closed authority boundary'sidir; production writer guard/migration, QEMU fixture mutation ve fiziksel/device execution claim edilmez.",
    limitations: [
      "S301 user_first_kernel_entry içindeki tek explicit mutable scheduler aliasını audit ederek scheduler.rs içindeki explicit mutable alias coverage'ını tamamlar; toplam 69 production writer site authority wrapper dışında açık kalır.",
      "Exclusive lease yalnız host/model gate'inde test edilir; production exclusive wrapper, provider authority ve whole-scheduler exclusion açık kalır.",
      "S238–S301 dependency matrisi exact 65 grup / 899/899 PASS'tir; bu production writer authority invocation kanıtı değildir.",
      "Filtresiz workspace frozen S96 identity kapısında RED'dir; workspace umbrella GREEN iddia edilmez.",
      "Supported-profile runtime invocation, Generic SMP ve fiziksel RPi kabulü açık kalır; S301 physical/device operations=0 ve RUNBOOK_EXECUTED_IN_S301=NO.",
    ],
  },
snippet sha256: d1618cc6efe9file sha256: 9726dbf00f84
Focused test komutu
cargo test --quiet -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s301_user_first_kernel_entry_writer_authority_audit -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S301-User-First-Kernel-Entry-Writer-Authority-Audit-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 3050638b71a684d8f8f947a8a6faa237a17fa8db5dc0db04fb207b668b462af9