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
158 stars 19 forks source link

what does Supm and Sspm really mean? #71

Closed ubc-guy closed 1 month ago

ubc-guy commented 3 months ago

This is the text describing Sspm and Supm:

In addition, the pointer masking standard defines two extensions that describe an execution environment but have no bearing on hardware implementations. These extensions are intended to be used in profile specifications. • Sspm: An extension that indicates that there is pointer-masking support available in supervisor mode, with some facility provided in the supervisor execution environment to control pointer masking. • Supm: An extension that indicates that there is pointer-masking support available in user mode, with some facility provided in the application execution environment to control pointer masking. The precise nature of these facilities is left to the respective execution environment.

What does this really mean? Does it mean these tags are names to be used in profiles to indicate that the higher privilege level as implemented pointer masking? That is, does Ssnpm always imply Supm, where there is no visible change to the U-level profile but it is an acknowledgement that the higher S mode is doing something to the addresses?

Perhaps this can be conveyed in simpler language.

SiFiveHolland commented 3 months ago

What does this really mean? Does it mean these tags are names to be used in profiles to indicate that the higher privilege level has implemented pointer masking?

Yes. Supm can imply either Ssnpm or Smnpm, depending on which privilege modes are implemented and/or used on that hart.

That is, does Ssnpm always imply Supm,

No, not if the supervisor software provides no way to enable pointer masking at runtime in the U-mode execution environment.

where there is no visible change to the U-level profile but it is an acknowledgement that the higher S mode is doing something to the addresses?

Supm is certainly a visible change to the U-level profile; it means it is possible to have pointer masking enabled while executing in U-mode.

martinmaas commented 2 months ago

+1 to Samuel's description.

What does this really mean? Does it mean these tags are names to be used in profiles to indicate that the higher privilege level as implemented pointer masking? That is, does Ssnpm always imply Supm, where there is no visible change to the U-level profile but it is an acknowledgement that the higher S mode is doing something to the addresses?

I think this is exactly describing the purpose of these extensions. We can adjust the language if it is currently unclear; are there specific changes that would have made it clearer, in your view?

martinmaas commented 1 month ago

The spec has been updated to provide an additional explanation (654a5c4).