Real per-VM log persistence: source attribution + ACL pin (FABRIC-3.md §XXVII)
Wires the previously-unused vm_log_attributed_vm() into LOG-APPEND's kernel primitive so persisted log records carry a trustworthy source (the real attributed VM's registry name, or "HADES" pseudo-source) instead of a caller-supplied, trivially forgeable string. Drops src-addr/src-u from LOG-APPEND's stack signature accordingly. Pins LOG-APPEND via bare ACL-PIN in Artemis's own init.4th, matching BIRTH/CAPSULE-BIRTH's precedent for a privileged word that can't reach the shared, host-portable ACL.4th. Also fixes two console-banner nitpicks: a mis-rendering em dash (U+2014) in the boot banner, and drops "Emergency" from the CLI banner text. Doc corrections to artemis_sig.h/zuse_eligibility_list.h reconciling the three fixed devblock ranges now in play. LOG-FLUSH (the intended normal entry point) and level-aware log eviction remain open, flagged not fixed. Re-verified clean boot to ok> on all 3 architectures after every change. riscv64 showed one new, unrelated virtio_blk write-timeout anomaly during Artemis's early physics self-test (self-recovered, boot unaffected, sector doesn't map to the log region) -- flagged, not investigated. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016UNhH1mhi52i6Qihh7ZV5S
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
61755fde78
commit
2a30212bd3
@@ -56,6 +56,7 @@
|
||||
#include "../include/vm_host.h"
|
||||
#ifdef __STARKERNEL__
|
||||
#include "starkernel/vm/arena.h"
|
||||
#include "starkernel/log_attrib.h" /* vm_log_attributed_vm() */
|
||||
#include "starkernel/console.h" /* g_sk_fault_word */
|
||||
#include "platform_alloc.h" /* sf_free for call_stack */
|
||||
#include "starkernel/vm/stadium_words.h" /* item 4.1: word patrons on the Stadium */
|
||||
@@ -1029,11 +1030,24 @@ void vm_interpret_word(VM* vm, const char* word_str, size_t len)
|
||||
* @param vm Pointer to VM instance
|
||||
* @param input String containing Forth code to interpret
|
||||
*/
|
||||
/* FABRIC-3.md §XXVI follow-on, Step 4 (log_attrib.h): which VM's dictionary
|
||||
* context is currently executing, for log persistence attribution. Save/
|
||||
* restore (not a plain set) so a nested vm_interpret() call -- VM-EXEC
|
||||
* dispatching into a different VM's own dictionary, mid-interpret --
|
||||
* attributes to whichever VM is actually running when it returns to the
|
||||
* outer frame, not silently to the inner one. */
|
||||
static VM *g_log_attrib_vm; /* zero-initialized (BSS) */
|
||||
|
||||
VM *vm_log_attributed_vm(void) { return g_log_attrib_vm; }
|
||||
|
||||
void vm_interpret(VM* vm, const char* input)
|
||||
{
|
||||
if (!vm || !input) return;
|
||||
vm_assert_interpreter_enabled(vm, "vm_interpret");
|
||||
|
||||
VM *prev_attrib_vm = g_log_attrib_vm;
|
||||
g_log_attrib_vm = vm;
|
||||
|
||||
/* Load into input buffer (cap + NUL) */
|
||||
size_t n = 0, cap = INPUT_BUFFER_SIZE ? INPUT_BUFFER_SIZE - 1 : 0;
|
||||
while (n < cap)
|
||||
@@ -1064,6 +1078,8 @@ void vm_interpret(VM* vm, const char* input)
|
||||
vm->heartbeat.check_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
g_log_attrib_vm = prev_attrib_vm;
|
||||
}
|
||||
|
||||
/* ====================== VM memory helpers ======================= */
|
||||
|
||||
Reference in New Issue
Block a user