Stage MC-0b2: block subsystem behind g_lock_block (FABRIC-3.10.8 §3.3)

- block_subsystem.c (vendored): every public function's body becomes a
  static *_locked function; bodies call each other only through the
  _locked forms, breaking the internal cycles (relocate, meta relocate,
  migration scan, firsttouch, the meta accessors). Thin public wrappers
  take g_lock_block under __STARKERNEL__; hosted build has no lock and
  still builds clean.
- Lock order: hermes, switch, registry, doe, log, block, console, heap,
  vmm, pmm (Stadium, MC-0d, above block).
- Documented, not coverable by this lock: blk_get_buffer() pointers are
  used after release -- block-buffer ownership across cores is open for
  MC-3.
- Probe (removed): block lock balances on all three ISAs (2,057-2,379
  acquisitions), 0 recursions, 0 held at switch; vblk_io timeouts
  (0/0/4 probe, 0/0/2 acceptance) within the pre-lock riscv64 baseline
  of 0-6.
- Standard sequence on amd64/aarch64/riscv64: hashes and G byte-identical
  to MC-0b, MINT/WIREBIND/USE ok, conservation true, 0 idle growth.
- FABRIC-3.10.8 §3.2 wording fix; lock order noted as checked by
  inspection only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-09-25 18:57:38 -04:00
co-authored by Claude Opus 5.5
parent 5bc7b4dee7
commit 33f4090d6d
16 changed files with 55305 additions and 82 deletions
+4
View File
@@ -52,6 +52,9 @@
* g_lock_registry VM registry list and entries (capsule_birth.c)
* g_lock_doe DoE region (doe_region.c)
* g_lock_log log region (log_region.c)
* g_lock_block block subsystem: device chain, caches, BAM,
* relocation table, and its device I/O
* (block_subsystem.c, MC-0b2)
* g_lock_console console output and line state (console.c)
* g_lock_heap kmalloc heap
* g_lock_vmm page tables (allocates tables from the PMM)
@@ -103,6 +106,7 @@ extern sk_spinlock_t g_lock_switch;
extern sk_spinlock_t g_lock_hermes;
extern sk_spinlock_t g_lock_doe;
extern sk_spinlock_t g_lock_log;
extern sk_spinlock_t g_lock_block;
extern sk_spinlock_t g_lock_console;
extern sk_spinlock_t g_lock_heap;
extern sk_spinlock_t g_lock_pmm;