Skip to content

arch-riscv: Fix segfault in masked vector strided loads#3162

Open
amatabsc wants to merge 1 commit into
gem5:developfrom
amatabsc:fix-vector-stride-load-missing-vm-src-reg
Open

arch-riscv: Fix segfault in masked vector strided loads#3162
amatabsc wants to merge 1 commit into
gem5:developfrom
amatabsc:fix-vector-stride-load-missing-vm-src-reg

Conversation

@amatabsc
Copy link
Copy Markdown
Contributor

VlElementMicroConstructor did not register v0 as a source operand when vm=0, despite execute() calling getRegOperand(this, _numSrcRegs-1) to read the mask. This out-of-bounds access caused a segfault.
Affected instructions: vlse8.v, vlse16.v, vlse32.v, vlse64.v and all vlsseg* variants when used with a mask (vm=0).
Fix is one line: add SET_VM_SRC() at the end of the constructor, matching the pattern already used in VlSegMicroConstructor and VleMicroConstructor.

Copy link
Copy Markdown
Contributor

@saul44203 saul44203 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-riscv The RISC-V ISA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants