Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smepmp extension chapter needs a rewrite to make it normative #1818

Open
radimkrcmar opened this issue Jan 21, 2025 · 7 comments
Open

Smepmp extension chapter needs a rewrite to make it normative #1818

radimkrcmar opened this issue Jan 21, 2025 · 7 comments

Comments

@radimkrcmar
Copy link
Contributor

The text that made it into this repository is not a specification, but a proposal, and needs a thorough rewrite.

To list some issues:

6.2. Proposal

The reset value of mseccfg is implementation-specific, otherwise if backwards compatibility is a requirement it should reset to zero on hard reset.

6.4. Rationale

A lot of the Smepmp chapter should be straight deleted.

@aswaterman
Copy link
Member

Yes, overall, the effort to merge all the specs together has been structural rather than semantic. Each spec's authors should be working with @wmat to close that gap.

@gfavor
Copy link
Collaborator

gfavor commented Jan 21, 2025 via email

@kasanovic
Copy link
Collaborator

This comment can be applied to many sections of the manual.

That said, we should also be keeping an archive of the proposals which often include rationale that helps explain design details, and which are useful for later development. But I agree this should be normally not in the reference manual, except where it helps clarify the specification itself.

@radimkrcmar
Copy link
Contributor Author

Rationale in the spec is welcome, as long as it is actually rationale and is clearly marked as non-normative.

If you look at Rationale section, it has sentences

Since a CSR for security and / or global PMP behavior settings is not available with the current
spec, we needed to define a new one. [...]

that only made sense while the proposal was outside the manual.

Smepmp has issues in normative text as well. A lot of definitions around mseccfg are outdated, because the CSR is already defined and used outside of this extension. For example, the sentence I already quoted

The reset value of mseccfg is implementation-specific, otherwise if backwards compatibility is a requirement it should reset to zero on hard reset.

is barely readable even with the usual amount of goodwill needed for the manual. (The manual should say if the value is implementation specific or reset to zero. Based on the reset section, I think it is neither.)

@Timmmm
Copy link
Contributor

Timmmm commented Feb 25, 2025

Some other bits that need to be reworked:

However, there are no such mechanisms available on Machine mode in the current (v1.11) Privileged Spec. ...

Machine Security Configuration (mseccfg) is a new RW Machine mode CSR

All mseccfg fields defined on this proposal are WARL

The reset value of mseccfg is implementation-specific, otherwise if backwards compatibility is a requirement it should reset to zero on hard reset.

(The previous two should be moved to where mseccfg is defined.)

On mseccfg we introduce a field

(There are a few more "we introduce a field"s.)

Adding a rule

(Not related to it being a proposal, but "Adding a rule" is an odd way to say "Configuring a PMP entry".)

Visual representation of the proposal

It is expected that BootROM

(Probably should be "the firmware" or similar.)

Since a CSR for security and / or global PMP behavior settings is not available with the current spec, we needed to define a new one. This new CSR will allow us to ....


Also

Machine-Mode Allowlist Policy (mseccfg.MMWP)

Based on the acronym I think this is supposed to be Machine-Mode Whitelist Policy? If you think the whitelist is racist then how about Machine-Mode Waiver Policy? I think that's probably a better name anyway.

I actually really like the Rationale section. It would be nice if more of the spec had that.

@Timmmm
Copy link
Contributor

Timmmm commented Feb 26, 2025

The "visual representation" (which is great btw), uses "Machine-Mode Whitelist Policy".

@mickflemm
Copy link

Updated both the text and the image, let me know if that works:
#1879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants