Resolve issues IRQ handling, IPC, and fpage - #168
Merged
Merged
Conversation
IRQ handling: - Add memory clobbers to cpsid/cpsie to prevent reordering - Fix irq_number() operand order (was reading garbage) - Add isb after msr control for pipeline synchronization - Restore r4-r11 in schedule_in_irq() when no context switch - Make __irq_saved_regs volatile to prevent optimization issues - Use explicit unrolled copy in __irq_save to prevent loop issues IPC: - Add MR bounds check in INACTIVE non-start path (security) - Return error for send to T_INACTIVE without timeout (prevents hang) - Return error for send to non-existent thread Fpage management: - Fix split_fpage() bounds validation (<= base, >= end) - Add NULL checks for as/fpage parameters - Fix shift UB: use ((memptr_t)1 << shift) throughout - Add overflow check for end = base + size - Add free_fpage_chain() helper for proper cleanup - Fix partial allocation leaks in assign_fpages_ext() - Add cycle guard in unmap_fpage() with CONFIG_MAX_FPAGES limit Memory/Thread subsystem: - Add error handling for assign_fpages_ext() failures - Add panic on KIP fpage creation failure - Check map_fpage() return values in map_area()
The CI was incorrectly passing when tests failed. Now it properly
detects "FAILED" in test output and fails the build.
Check order:
1. Crash detection (MEMFAULT/HardFault/panic) - immediate failure
2. Test failure detection ("FAILED") - immediate failure
3. Boot success verification (KDB/kernel messages)
4. Test pass count reporting
This will correctly fail CI on the "From parameter (local)" test
failure until C2.2 (L4_ExchangeRegisters unimplemented) is fixed.
The kernel's IPC returns the sender's global thread ID in the 'from' parameter. The test was comparing against L4_LocalIdOf() which depends on the unimplemented L4_ExchangeRegisters syscall, causing it to always return 0. Fix: Compare directly with the global ID (ipc_t2) since that's what the kernel actually returns. This resolves the CI failure where "From parameter (local)" was failing with "Returned Id 0 != 0".
ktimer_enable() only updated ktimer_delta and ktimer_time if the timer was not already enabled. This caused a bug when scheduling an earlier event: it calls ktimer_enable(ticks) to "reset timer", but if ktimer_enabled was already 1, the new delta was ignored. Always update ktimer_delta and reset ktimer_time regardless of current enabled state. This ensures proper timer rescheduling when inserting events before the current queue head.
Print "L4/Pistachio test suite complete" after all tests finish. This allows CI to detect successful test completion and exit early, rather than waiting for the full timeout while pingpong runs forever. Update CI workflow to: - Exit successfully when "test suite complete" is detected - Fail explicitly if tests started but didn't complete (timeout)
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.
IRQ handling:
__irq_saved_regsvolatile to prevent optimization issuesIPC:
Fpage management:
Memory/Thread subsystem: