fix(riscv): reject masked viota.m writing v0 - #253
Closed
carlosqwqqwq wants to merge 1 commit into
Closed
Conversation
Member
|
Thank you for reporting #248 and proposing a fix. This is now independently consolidated in #255, including masked vd=v0, destination/source overlap, and the nonzero-vstart rule, with transactional direct and SMIR/JIT coverage plus QEMU controls. To keep review and CI focused on one rollup, I am closing this PR in favor of #255. You are credited as co-author on the rollup commit. |
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.
fix(riscv): reject masked viota.m writing v0
Closes #248
Summary
The masked form of the vector iota instruction reads its predicate from
v0, and the RISC-V V extension requires that a maskedviota.mdestination cannot overlap the mask register (riscv-v-spec, "Vector Iota Instruction" and Section 5.3). The affectedOp::Viotabranch only trapped on a non-zerovstart, so the maskedvd == v0encoding such asviota.m v0, v2, v0.twas executed and clobbered the mask. QEMU raises SIGILL for these encodings at decode time viatrans_viota_m/require_vm.The fix rejects any masked
viota.mwhose destination isv0, before thevstartcheck, matching QEMU's check order.Validation
cargo test --lib: the targeted viota tests pass, and the full library test suite passes with no regressions.No new upstream test files are added; this is a source-only change.