Skip to content

PMP: difference between load and store behaviour for size > XLEN #2396

@Wren6991

Description

@Wren6991

The PMP section says:

On some implementations, misaligned loads, stores, and instruction
fetches may also be decomposed into multiple accesses, some of which may
succeed before an access-fault exception occurs. In particular, a
portion of a misaligned store that passes the PMP check may become
visible, even if another portion fails the PMP check. The same behavior
may manifest for stores wider than XLEN bits (e.g., the FSD instruction
in RV32D), even when the store address is naturally aligned.

Stores with width greater than XLEN are allowed to tear against PMP checks. I didn't realise until I re-read this today that there is no such allowance for loads with width greater than XLEN.

Given loads are used for memory-mapped IO, the lack of tearing on loads is an observable aspect of the core's behaviour. This seems to make it illegal to implement Zilsd with a 32-bit data bus if you allow ld to IO regions and you have a PMP grain G = 0. (Or at least, illegal to implement ld as lw + lw).

I'm hoping this is an oversight given Zilsd was specifically modified in places to make it easier to implement on 32-bit-native RV32 implementations, and the Zilsd spec explicitly gives permission for 32-bit tearing in a few places. Could somebody please clarify?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions