fix(riscv,x86_64): validate encodings and native replay - #255
Conversation
Centralize the remaining RVV operand and encoding checks across direct and opaque SMIR/JIT execution, reject reserved RV32 shift-immediate bit 25, and cover legal controls through QEMU differentials. Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
|
@carlosqwqqwq, the independently implemented consolidation of #250–#254 is ready for review. Please take a look at the expanded sibling constraints and the direct, SMIR/JIT, and QEMU validation summarized in the description when you have time. |
Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
Preserve every architecturally accepted LLIG guest encoding while emitting the canonical L'L=00 form for hosted helper replay. Co-authored-by: carlos <102978772+carlosqwqqwq@users.noreply.github.com>
|
CI follow-up: the scheduled Full Suite failure on current master was traced to scalar VFIXUPIMM hosted replay preserving the guest LLIG value L'L=11. The ISA accepts all scalar LLIG values, but that replay encoding #UD'd on the allocated AVX-512 host. Commit 7e14c02 keeps guest acceptance intact and canonicalizes only the emitted helper replay to L'L=00, matching the existing scalar replay policy elsewhere in the JIT. Focused exhaustive tests, formatting, and strict Clippy pass locally; the updated GitHub matrix and Full Suite verification are running. |
|
CI update: commit 7e14c02 is green across CI, Cross-build, Microkernel, and the manually dispatched 17-job Full Suite. I also reran the Linux x64 CI job successfully. The available post-fix x64 allocations did not expose AVX-512, so the native VFIXUPIMM differential feature-skipped there; the LLIG guest acceptance and canonical hosted replay bytes are covered by the exhaustive classifier/lowering suite. The PR description now records both the green gates and that hardware-coverage limitation. |
|
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. |
Overview
This is the next independently implemented rollup following merged #203 and #231. It consolidates the architectural reports in #245, #246, #247, #248, and #249 without taking code or commits from the corresponding contributor branches. It also repairs the host-specific AVX-512 replay failure exposed by the rollup's CI audit on current master.
vrgatherei16.vvindex EMUL, alignment, bounds, destination overlap, and mixed-EEW source aliasingvaadd/vasubvector-vector and vector-scalar familiesviota.mnonrestartable and operand-overlap constraints before architectural mutationshamt[5]/instruction bit 25 is set, while retaining the RV64 formsL'L=00, avoiding a processor-specific#UDFixes #245
Fixes #246
Fixes #247
Fixes #248
Fixes #249
Consolidates and supersedes #250, #251, #252, #253, and #254. The RISC-V implementation was derived independently from the issue witnesses and the ISA rules, then validated against QEMU. Carlos is credited as co-author on every rollup commit that incorporates findings originating from these reports.
@carlosqwqqwq, please review the consolidated behavior, expanded sibling coverage, and CI hardening when convenient.
Validation
cargo fmt --all --checkcargo clippy --all-targets --features x86_64-suitecargo clippy --lib --no-default-features --features x86_64-suite,smir-jit -- -D warningscargo build --all-targets --no-default-features --features x86_64-suite,smir-jitqemu-riscv32probe for0x02035293: SIGILL/status 1327e14c02c7e14c02c; its x64 allocation lacked AVX-512, so the native VFIXUPIMM case was feature-skipped while the exhaustive replay encoding tests ranChange-surface audit
Assumption Register
gh pr view 203/gh pr view 231showing a non-merged state would falsify it.exec_vectorcalls the validator before dispatch; the helper executes through the same path and copies state only on success.vmv.x.s,vmv.s.x,vfmv.f.s, andvfmv.s.f; QEMU agrees.vrgatherei16.vv.VFIXUPIMMSS; RISC-V-only changes do not reach that path, and non-AVX-512 hosts skip the native case.L'L=00replay without narrowing guest acceptance.Out-of-scope findings
None that block this rollup.