fix(riscv): enforce execution, CSR, and SMIR constraints - #231
Conversation
Independently validate and consolidate the RISC-V SMIR control-flow, extension-profile, reserved-encoding, and load-to-x0 fixes. Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Independently validate and consolidate IALIGN-sensitive mepc behavior, MISA H/V projection, and reserved mtvec MODE canonicalization. Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
c12b32e to
77ebbc7
Compare
Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Independently validate and consolidate the architectural register list, stack adjustment, direct execution, disassembly, and SMIR expansion behavior. Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
|
@carlosqwqqwq — the independent consolidation is complete at #231 now covers #218, #220, #222, #224, #226, #228, #230, #233, #235, #237, #239, #241, and #244, with the corresponding issues linked for closure on merge. No commits or code were taken from those PRs; the fixes were independently reproduced, reimplemented, and validated, and every rollup commit credits you through the GitHub co-author trailer. The latest addition corrects Zcmp rlist=5 across decode sizing, direct execution, disassembly, and SMIR/JIT, with rlist=6 boundary coverage and independent specification/LLVM oracle checks. Please review the consolidated implementation, especially the architectural fallback frontiers, extension/CSR gates, failed-SC ordering, and Zcmp RV32/RV64 stack-adjustment behavior. |
|
Follow-up validation and independently reimplemented RISC-V fixes now continue in #296. It consolidates the newly reported vector-memory, operand-validation, SRET, and WFI gaps, carries contributor credit, and is ready for review. |
Summary
This independently reimplements, validates, and consolidates the RISC-V fixes proposed in #218, #220, #222, #224, #226, #228, #230, #233, #235, #237, #239, #241, and #244.
No contributor commits were cherry-picked or merged, and no contributor code was copied into this branch. The implementation was derived from the issue reproductions, the repository's current execution paths, and the RISC-V unprivileged/privileged architecture requirements. Carlos is credited as co-author on every rollup commit.
Fixes #217
Fixes #219
Fixes #221
Fixes #223
Fixes #225
Fixes #227
Fixes #229
Fixes #232
Fixes #234
Fixes #236
Fixes #238
Fixes #240
Fixes #243
Changes
funct3valuesmepc,misa, andmtvecinstret; ECALL, EBREAK, and synchronous traps do not retire{ra,s0}in compressed decode sizing, direct execution, disassembly, and SMIR/JIT while preserving the three-register rlist=6 behaviorValidation
Each regression probe reproduced the reported defect against the pre-fix baseline before passing with the independent implementation.
0xb852ascm.push {ra, s0}, -16and0xb856ascm.push {ra, s0}, -32, matching the current RISC-V Zcmp register-list and stack-adjustment tablescargo fmt --all --checkcargo clippy --all-targets --features x86_64-suitecargo build --all-targets --no-default-features --features x86_64-suite,smir-jitIntegration note
This PR is intentionally stacked on #203 so it inherits the already reviewed and green CI/cross/microkernel repairs there. After #203 merges, this PR should be retargeted to
master.#203 independently covers the earlier contributor series #197, #198, #199, #200, #201, #202, #206, #208, #210, #212, #214, and #216. No commits from those PRs are included here either.
@carlosqwqqwq, thank you for reporting these architecture gaps. Please review this consolidation, especially the conservative no-C JALR fallback, extension/CSR profile combinations, compressed overlay handling, native illegal-instruction frontier, failed-SC exception ordering/probe behavior, and the Zcmp rlist=5/rlist=6 boundary and RV32/RV64 stack adjustments.