riscv / riscv-j-extension

Working Draft of the RISC-V J Extension Specification
https://jira.riscv.org/browse/RVG-128
Creative Commons Attribution 4.0 International
167 stars 17 forks source link

MXR for store instructions #80

Closed BiwefC closed 3 weeks ago

BiwefC commented 2 months ago

MPRV and SPVP affect pointer masking as well, causing the pointer masking settings of the effective privilege mode to be applied. When MXR is in effect at the effective privilege mode where explicit memory access is performed, pointer masking does not apply.

In pointer-masking v1.0.0-rc2, MXR will effect whether pointer masking is applied or not. But should store instructions is applied with pointer masking be affected by MXR? If so, why should they be affected?

pdonahue-ventana commented 2 months ago

MXR never affects store instructions. It makes executable pages readable, not writable. Pointer masking isn't going to change that.

BiwefC commented 2 months ago

MXR never affects store instructions. It makes executable pages readable, not writable. Pointer masking isn't going to change that.

img_v3_02dp_4e390b0a-6abb-4d30-aa43-cec8a3a7ed0g But in Spike implementation, pmm directly masked by MXR, regardless of the instruction type. Does this means that there is an issue in Spike's implementation?

SiFiveHolland commented 2 months ago

I think the implication is that yes, MXR affects pointer masking for both both loads and stores, but it doesn't really matter because there's no known use case for doing stores with MXR enabled (execute-only pages aren't writable).

Spike is following the spec.

martinmaas commented 2 months ago

I agree with @SiFiveHolland. I think there is nothing in the spec that says it doesn't apply to stores, but it does not matter.