Skip to content

Conversation

@jserv
Copy link
Collaborator

@jserv jserv commented Nov 6, 2025

This restores MMU cache statistics functionality broken by coroutine refactoring. The refactor introduced separate execution paths (SMP mode, single-hart mode, debug mode) but signal handling was only implemented in the SMP path.

Signal handling follows async-signal-safe pattern: handler only sets a volatile sig_atomic_t flag, with stats printing deferred to main loop context. All execution paths now properly clean up resources (pfds, file descriptors) before exit.

Close #113


Summary by cubic

Fixes MMU cache statistics when the emulator is interrupted. Signals are now handled consistently across SMP, single-hart, and debug paths, and stats print once after a clean shutdown.

  • Bug Fixes
    • Use an async-signal-safe handler that only sets a volatile sig_atomic_t flag.
    • Check the flag in SMP, single-hart, and GDB loops; break to allow cleanup.
    • Defer stats printing to the end of main after closing pfds/file descriptors.

Written for commit 11179ad. Summary will update automatically on new commits.

This restores MMU cache statistics functionality broken by coroutine
refactoring. The refactor introduced separate execution paths (SMP mode,
single-hart mode, debug mode) but signal handling was only implemented
in the SMP path.

Signal handling follows async-signal-safe pattern: handler only sets a
volatile sig_atomic_t flag, with stats printing deferred to main loop
context. All execution paths now properly clean up resources (pfds, file
descriptors) before exit.

Close #113
cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv jserv merged commit 55af56c into master Nov 6, 2025
11 checks passed
@jserv jserv deleted the fix-mmu-stats branch November 6, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MMU cache statistics no longer displayed

2 participants