lowRISC / lowRISC/ibex

Store instructions fetched from non-executable memory update data_we_o, data_addr_o, and data_wdata_o

Open
#2,278 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:Bug
Dominant language
SystemVerilog
Stars
2.1k
Forks
810
Avg merge
5d 23h
Merged PRs (30d)
9

Description

Observed Behavior

When a store instruction is read from a section of memory marked by the PMP as non-executable, data_we_o, data_addr_o, and data_wdata_o are still updated as though the instruction is valid. Additionally, no output alert or fault signals are raised, though the appropriate CSRs are updated.
Image
Image

Expected Behavior

Instructions deemed invalid by the PMP should be entirely gated and have no artifacts. Additionally, I would expect an alert_minor_o to be raised, though I may be wrong about that.

Steps to reproduce the issue

I've created a repository with the test bench I used to verify the issue.
To trigger this issue in your own environment:

  1. Configure the PMP to have areas that should not be executable.
  2. Store memory write instructions in that non-executable area.
  3. Branch to the non-executable area.
  4. Observe the error.

Regarding parameters, I observed this issue with BranchTargetALU enabled and disabled, with WritebackStage enabled and disabled, with ICache enabled, with BranchPredictor enabled and disabled, and with SecureIbex disabled. All other parameters (excluding PMP configuration) were left at their default values.

My Environment

EDA tool and version:

Xilinx Vivado 2024.1

Operating system:

Windows 11

Version of the Ibex source code:

Commit SHA: 125445f692d5dc91892a7852112ad3633f44969f. No changes to source code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction testbench, ibex_invalid_store_tb.sv, and configure PMP to branch into a non-executable area containing store instructions. Trace the resulting data_we_o, data_addr_o, data_wdata_o, alert, and fault signals; done means invalid instructions produce no store-interface artifacts and the expected fault behavior is covered.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.