ASELSANMicrokernel
S341 · SOURCE-BOUND GATE EVIDENCE

S341 · ASID-retirement production writer guard integration

production acquire → S247 guard modülü → Operations-bound focused test Bu sayfa yalnız S341 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S341Production writer guardOperations id exactsource SHA exacttest target exact

operation: g8l-s341-asid-retirement-writer-guard-integration-partial

production · S247 guard · focused test · Operations · 4 exact excerpt

sequence-bound=true · implementation-bound=true
01 · Test edilen uygulama/model kodu

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

tam Rust öğesiL5741–L5797
kernel/src/task/scheduler.rs::retire_current_asid_after_kernel_switch

/// Leave the current user address space and record the completing ASID TLBI.
/// The ASID lease intentionally remains in the dead task until the later-stack
/// reaper has dropped its root and every owned intermediate table.
unsafe fn retire_current_asid_after_kernel_switch() {
    #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
    let s341_irq_guard = crate::arch::aarch64::IrqGuard::new();
    #[cfg(feature = "board-rpi5")]
    let s257_scheduler_read_access = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s256_asid_transition_read_access_guard_expansion::acquire_s257_production_scheduler_read_access()
        .unwrap_or_else(|error| {
            panic!(
                "S257 retiring-task ASID scheduler read access failed closed: {:?}",
                error
            )
        });
    let asid = (&*core::ptr::addr_of!(SCHEDULER))
        .current_task
        .as_ref()
        .map_or(0, |task| task.asid);
    #[cfg(feature = "board-rpi5")]
    drop(s257_scheduler_read_access);

    // Install the kernel root with ASID 0 first, then perform
    // DSB ISHST -> TLBI ASIDE1IS -> DSB ISH -> ISB for the retired user ASID.
    switch_to_kernel_address_space();

    #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
    let s341_writer_access = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s341_asid_retirement_writer_guard_integration::acquire_s341_production_scheduler_writer_access()
        .unwrap_or_else(|error| {
            panic!(
                "S341 ASID-retirement scheduler writer guard failed closed: {:?}",
                error
            )
        });
    if let Some(task) = (&mut *core::ptr::addr_of_mut!(SCHEDULER))
        .current_task
        .as_mut()
    {
        if task.asid != asid {
            crate::kprintln!(
                "[K1-ASID] quiescence witness mismatch expected={} current={}; retaining resources",
                asid,
                task.asid
            );
            #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
            drop(s341_writer_access);
            #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
            drop(s341_irq_guard);
            return;
        }
        task.address_space_quiesced = true;
    }
    #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
    drop(s341_writer_access);
    #[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
    drop(s341_irq_guard);
}
snippet sha256: 6ff54dfa0c06file sha256: 838dd474448c
02 · Ortak exclusion üyeliği

S247 production writer guard

tam Rust öğesiL159–L171
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s341_asid_retirement_writer_guard_integration.rs::acquire_s341_production_scheduler_writer_access

#[cfg(all(target_arch = "aarch64", target_os = "none", feature = "board-rpi5"))]
pub fn acquire_s341_production_scheduler_writer_access(
) -> Result<G8lS341ProductionSchedulerWriterAccess, G8lS247WholeSchedulerAccessError> {
    let caller_cpu =
        crate::percpu::try_current_cpu_id().ok_or(G8lS247WholeSchedulerAccessError::InvalidCpu)?;
    if caller_cpu != crate::g8l_runtime_contract::CPU0 {
        return Err(G8lS247WholeSchedulerAccessError::InvalidCpu);
    }
    let access = crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s246_whole_scheduler_read_access_guard::S247_PRODUCTION_WHOLE_SCHEDULER_ACCESS_GATE
        .try_acquire_exclusive_for_valid_cpu(caller_cpu)?;
    Ok(G8lS341ProductionSchedulerWriterAccess { _access: access })
}
snippet sha256: 6256b3fa15abfile sha256: 8e6999c7e766
03 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam Rust öğesiL221–L236
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s341_asid_retirement_writer_guard_integration.rs::target_function_contains_one_mutable_alias_and_one_s341_guard

#[test]
fn target_function_contains_one_mutable_alias_and_one_s341_guard() {
    let target = retire_asid_boundary();
    assert_eq!(target.matches("addr_of_mut!(SCHEDULER)").count(), 1);
    assert_eq!(
        target
            .matches("acquire_s341_production_scheduler_writer_access()")
            .count(),
        1
    );
    assert_eq!(
        target.matches("task.address_space_quiesced = true").count(),
        1
    );
}
snippet sha256: 7b298a6e3ff9file sha256: 18554fdd2147
04 · Kapı kimlik kaydı

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

tam Operations kaydıL13821–L13899
website/src/lib/operations.ts::g8l-s341-asid-retirement-writer-guard-integration-partial
  {
    id: "g8l-s341-asid-retirement-writer-guard-integration-partial",
    date: "2026-08-27",
    sequence: 341,
    status: "passed",
    umbrella_status: "partial",
    title: "S341 · ASID-retirement production writer guard integration",
    summary:
      "S341, retire_current_asid_after_kernel_switch içindeki tek mutable SCHEDULER quiescence-publication sınırını S340 ve 44 production reader'ın kullandığı aynı S247 state word'e bağlar. Tarihsel S257 reader retiring task ASID'sini owned scalar'a kopyalayıp düşer; kernel TTBR0 install ve ASID TLBI tamamlandıktan sonra local IRQ guard ile CPU0-only S341 writer alınır. Writer yalnız current-task ASID eşleşmesini, mismatch diagnostic'ini ve address_space_quiesced=true commit'ini kapsar; hem mismatch hem başarı yolunda writer IRQ restore'dan önce bırakılır. Guarded writer 14/69, açık writer 55 ve provider authority 0'dır. Production kaynakta üç direct callsite vardır fakat supported-profile S341 runtime observation=0'dır; downstream terminate_current_task_due_to_fatal_error writer'ı S342 için ayrı açık kalır.",
    evidence: [
      "Focused ASID-retirement writer-integration kapısı 31/31 PASS verdi. Önceki S340 30/30, tarihsel S257 current-to-kernel-ASID read 11/11, task-lifecycle source 5/5, deferred current-runtime-OOM 5/5 ve lower-EL fault recovery 7/7 regresyonları ayrıca geçti.",
      "Aynı S247 state word üzerinde CPU0-only writer membership, non-CPU0 pre-commit rejection, reader→writer ve writer→reader exclusion, exact-once success/error release ve S340→S341 token monotonluğu doğrulandı.",
      "Production kaynak sırası S257 reader acquire → retiring ASID owned copy → reader drop → switch_to_kernel_address_space ile kernel TTBR0 install ve ASID TLBI → IRQ guard → acquire_s341 writer → tek mutable alias → exact ASID match/mismatch diagnostic → address_space_quiesced=true → writer drop → IRQ restore olarak kilitlendi.",
      "S341 writer sınırı S257 reader'ı, MMU/TTBR0/TLBI etkilerini, task teardown'u veya sonraki writer'ı kapsamaz. Mismatch yolu tarihsel diagnostic'i korur ve hem writer'ı hem IRQ guard'ı dönüşten önce explicit bırakır; başarı yolu aynı release sırasını kullanır.",
      "task/scheduler.rs içindeki üç production retire_current_asid_after_kernel_switch çağrı noktası kaynakta sayıldı. Bu source-wiring envanteridir; QEMU/RPi supported-profile invocation veya cihaz gözlemi değildir.",
      "Fresh izole AArch64 profilleri 4/4 exit 0 verdi: board-qemu 111647 B / d84243cf…daff / 293 warning header; board-rpi4 150372 B / 4b9688d9…6996 / 391; board-rpi5 529266 B / 3114b7ea…2177 / 1174; board-rpi5+smp check 529052 B / e0a5fcb9…9a55 / 1174. Zero-warning iddiası yoktur.",
      "S238–S341 dependency matrisi iki bağımsız seri koşuda 105 grup / 1636/1636 PASS verdi; 13814 B normalize özetler aynı 4e338134…860a SHA-256 ile byte-eşittir.",
      "Exact yedi tarihsel assertion adı dışlanıp --test-threads=1 kabulü kullanıldığında workspace 303 sonuç grubu / 3465 PASS / 0 fail / 7 filtered verdi; 67048 B log 9ee35a8e…ead9'dur.",
      "Filtresiz workspace exit 101 ile yalnız frozen S96 wiring_does_not_mutate_timer_gic_boot_or_expand_runtime_scope source-identity reddinde durdu; 62270 B log e018ecdb…600'dür ve global workspace GREEN iddia edilmez.",
      "make verify-qemu ortak regresyonu 116447 B / 5dd34e5b…7088 ile strict ELF W^X 31/31, S130–S154, IPC 20/20, scheduler SEC5 ve kernel fault marker 0 PASS verdi. Bu S341 ASID-retirement writer invocation kanıtı değildir.",
      "Website 530/530 test ile PASS; lint, boş çıktılı TypeScript kontrolü ve 23/23 static route ayrıca geçti. İlk Cloudflare Pages production/main S341 içerik yayını ae9503c2 ile tamamlandı; çıktı 193 statik dosyadır.",
      "Cache-busted custom-domain /operations/ ve /timeline/ rotaları HTTP 200 döndü ve dağıtım sonrası yerel out ile byte-exact eşleşti. Operations 10495024 B / 1425fc4a…9582, Timeline 2699827 B / 7303ce80…cee2'dir. Immutable https://ae9503c2.aselsan-microkernel.pages.dev erişimi bu doğrulama ortamından 10 saniyede curl exit 28 / HTTP 000 verdi; custom-domain PASS'i bu sonucu gizlemez.",
      "Timeline'da 180 ayrı data-gate-policy kartı vardır; S341, S340, S339, S338, S337, S325, S324 ve S323 tam birer kez bulunur. S341 policy 3734 karakter, S324–S341 minimum yoğunluğu 1055 karakterdir ve birleşik gate-policy kutusu yoktur.",
      "S245 request ve S244 admission dokunulmadan kalır; production provider authority=0, whole-scheduler exclusion=false ve toplam 55 production writer açık kalır.",
      "Fiziksel/device işlem yapılmadı: physical/device operations=0 ve RUNBOOK_EXECUTED_IN_S341=NO.",
    ],
    commands: [
      "cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s341_asid_retirement_writer_guard_integration -- --nocapture",
      "cargo build -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5",
      "cargo check -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5,smp",
      "cargo test --workspace --quiet -- --test-threads=1 [seven exact historical --skip filters]",
      "make verify-qemu",
      "npm run deploy",
    ],
    terminalSessions: [
      {
        id: "g8l-s341-asid-retirement-writer-guard-integration",
        title: "G8l S341 ASID-retirement writer guard integration",
        commandLines: [
          "cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s341_asid_retirement_writer_guard_integration -- --nocapture",
        ],
        outputLines: [
          "test result: ok; S341 focused 1 group / 31 passed; 0 failed",
          "shared S247 gate: 44 guarded readers + 14/69 guarded writers; 55 writers open",
          "S257 copy/drop < kernel TTBR0/TLBI < IRQ < S341 writer < ASID match < quiesced=true < writer drop < IRQ restore",
          "production source callsites=3; supported-profile runtime observations=0",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "g8l-s341-operations-timeline-production-publication",
        title: "S341 Operations/Timeline production publication",
        commandLines: [
          "npm run deploy",
          "curl --cache-busted https://aselsan.kerege.net/{operations,timeline}/ and compare with local out",
        ],
        outputLines: [
          "website 530/530; lint PASS; TypeScript PASS; static routes 23/23; files=193",
          "Cloudflare Pages production/main initial content deployment: ae9503c2 · https://ae9503c2.aselsan-microkernel.pages.dev",
          "custom-domain operations HTTP 200 · 10495024 B · SHA-256 1425fc4ab889b65d5c2b4701d2735b002e710c189e1e538e8f0b25120fb39582 · byte-exact PASS",
          "custom-domain timeline HTTP 200 · 2699827 B · SHA-256 7303ce80bcf339b599eaf86a3942e853cf40f32dcd459a65006f6cad0e8ecee2 · byte-exact PASS",
          "timeline cards=180; S341/S340/S339/S338/S337/S325/S324/S323 exact-once; S341 policy=3734 chars; S324-S341 minimum=1055 chars",
          "immutable deployment URL probe: curl exit 28 after 10 s · HTTP 000; custom-domain evidence remains authoritative",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
    ],
    terminalSessionsNote:
      "S341 on dördüncü production writer'ın kaynak entegrasyonudur. Üç source callsite bulunur, fakat supported-profile runtime/cihaz gözlemi yoktur; global exclusion ya da provider authority oluşmadı.",
    limitations: [
      "55 production writer aynı shared gate dışında kaldığı için whole-scheduler exclusion ve provider authority açık kalır.",
      "Üç production source callsite wiring kanıtıdır; supported-profile S341 invocation/observation kanıtı yoktur.",
      "Downstream terminate_current_task_due_to_fatal_error writer entegrasyonu S342 için açık bırakılmıştır.",
      "Default-parallel PTY determinism S331'den açık taşınır; kayıtlı seri kabul matrisi kullanılır.",
      "Transient-contention liveness/soak, Generic SMP ve fiziksel RPi kabulü açık kalır.",
    ],
  },
snippet sha256: 8952b7e369dcfile sha256: 9726dbf00f84
Focused test komutu
cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s341_asid_retirement_writer_guard_integration -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S341-ASID-Retirement-Writer-Guard-Integration-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 91d38c7b6222f0b4c117be786454853543da55a160e543d9b951057cc20dcc06