snapshot: normalize scc rr0 against the fifos cleared on load - #65
Merged
Conversation
mach-kernel
force-pushed
the
snapshot-restore-2
branch
from
July 30, 2026 13:32
4596747 to
02e7e15
Compare
`channel_from_toml` restored `status` verbatim over cleared FIFOs, leaving `RX_CHAR_AVAILABLE` with no setter and `tx_int_pending` with no way to re-arm.
mach-kernel
force-pushed
the
snapshot-restore-2
branch
from
July 30, 2026 14:09
02e7e15 to
e987bff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
channel_from_tomljust emptied: clearRX_CHAR_AVAILABLE, setTX_BUFFER_EMPTY.tx_int_pendingfromWR1 TX_INT_ENandWR5 TX_ENABLE, matching the TX thread's wait predicate, so a restore cannot latch an interrupt on a disabled transmitter.update_ipso the SCC redrives the IOC line.power_on_devicesclearsmap_statSERIAL (ioc.rs:824) andIoc::load_staterestores it wholesale (ioc.rs:864), both beforescc().load_state(machine.rs:1451/1454).RX_CHAR_AVAILABLEcannot self-heal:read_datareturns 0 without touching the bit over an empty queue, so a guest polling RR0 spins forever.TX_BUFFER_EMPTYis hardening, sinceMachine::stop()drains the FIFO in the 3.7-8.4 ms betweencpu.stop()and the SCC join.Coverage / needs eyes
z85c30tests fail with only thechannel_from_tomlhunk reverted:restore_clears_rx_char_availablerestore_forces_tx_buffer_emptyrestore_rearms_tx_int_pendingrestore_channel_b_tx_int_reaches_rr3_via_arestore_redrives_irq_linetx_int_pendingdirectly becauseget_ipgates on WR1 alone, so neither is observable through RR3:restore_leaves_latch_disarmed_when_tx_int_disabledfails if theWR1conjunct is deletedrestore_leaves_latch_disarmed_when_transmitter_disabledfails if theWR5conjunct is deletedmachine.rs:213installs the CI console there, andread_b_controlreturns 0 for RR3, so B reaches the guest only through A via the sharedip_other.cargo test --release --features lightning,rex-jit,chd: 363 passed, 11 ignored.RX_CHAR_AVAILABLEcase.