Skip to content

PTE permission requirements for CMOs are not clear #2243

@Timmmm

Description

@Timmmm

The privileged spec says:

Attempting to fetch an instruction from a page that does not have execute permissions raises a fetch page-fault exception. Attempting to execute a load or load-reserved instruction whose effective address lies within a page without read permissions raises a load page-fault exception. Attempting to execute a store, store-conditional, or AMO instruction whose effective address lies within a page without write permissions raises a store page-fault exception.

However it says nothing for CMOs. The unprivileged spec says:

A cache-block zero instruction is permitted to access the specified cache block whenever a store instruction is permitted to access the corresponding physical addresses...

and

A cache-block management instruction is permitted to access the specified cache block whenever a load instruction or store instruction is permitted to access the corresponding physical addresses....

But it's very ambiguous whether that applies to PTE checks. As I understand it, the unprivileged spec doesn't really know about the address translation process at all so in theory this can't really be saying anything about PTE checks. Which means the PTE checks for CMOs are not specified.

Presumably we want:

Attempting to fetch an instruction from a page that does not have execute permissions raises a fetch page-fault exception. Attempting to execute a load, load-reserved, or cache-block management instruction whose effective address lies within a page without read permissions raises a load page-fault exception. Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction whose effective address lies within a page without write permissions raises a store page-fault exception.

I think it's ok to only require read for cbo.flush/inval/clean even though it says read or write is required, because write-only PTEs are reserved (similarly to how an AMO only requires write permission).

(I don't know why cbo.inval doesn't require write permission, seeing as it can actually modify the observable memory contents, but there we go.)

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