Add regression test BSP, build scripts, and CI for RV32/RV64#526
Open
akifejaz wants to merge 5 commits into
Open
Add regression test BSP, build scripts, and CI for RV32/RV64#526akifejaz wants to merge 5 commits into
akifejaz wants to merge 5 commits into
Conversation
Signed-off-by: Akif Ejaz <akif.ejaz@10xengineers.ai>
Signed-off-by: Akif Ejaz <akifejaz40@gmail.com>
Signed-off-by: Akif Ejaz <akifejaz40@gmail.com>
fdesbiens
requested changes
May 11, 2026
| int plic_irq_intr(void) | ||
| { | ||
| int ret = -1; | ||
| int irqno = plic_claim(); |
Contributor
There was a problem hiding this comment.
plic_claim() can return any value 0–1023, but callbacks[] only has MAX_CALLBACK_NUM=128 entries. There is no bounds check before callbacks[irqno] is accessed.
// Fix: add bounds check at top of plic_irq_intr()
int irqno = plic_claim();
if (irqno <= 0 || irqno >= MAX_CALLBACK_NUM) {
plic_complete(irqno);
return 0; // spurious or out-of-range, not an error
}Note: checking irqno == 0 also handles the PLIC spurious-interrupt case (irqno=0 means "no interrupt").
|
|
||
| irq_callback callbacks[MAX_CALLBACK_NUM]; | ||
|
|
||
| void plic_irq_enable(int irqno) |
Contributor
There was a problem hiding this comment.
(1 << irqno) is UB when irqno >= 32 (int overflow). The PLIC enable registers are also word-arrays, so only IRQs 0–31 are correctly addressable.
Fix: use (1U << (irqno % 32)) with the correct word offset, or add a guard that asserts/returns if irqno >= 32.
Contributor
|
@akifejaz I reviewed the PR and everything looks good. Please add the two small comments above on the PLIC, and we should be good to go! |
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.
Adds QEMU-virt BSP and regression test infrastructure for RISC-V 32/64-bit ports.
All regression tests passes for RV32/RV64, please see the pipeline status here