Support badged SMC caps to restrict SMC function IDs - #589
Conversation
4fb3591 to
c7191ec
Compare
This is useful as we are going to add SMC caps and they don't reference PD name/ID, so we need to distinguish them. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
Needed for new SMC badge changes. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
Useful for debugging. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
The "smc=true" attribute on a PD would provide an unbadged SMC capability that allows a component to invoke any function exposed by the ARM Secure Monitor. Use our extra capabilities / cap mappings feature to support this. This leaves the "smc=true" still enabled and useable. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
Use instead <cap_sc> feature instead for allow-listed function IDs. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
c7191ec to
3ea486d
Compare
|
The current way of doing SMC is by setting an attribute The proposed way is using the recently added cap export mechanism and letting users call I agree that this is a better API, as it is more generic and avoids the Microkit wrapper function. However, the I would not disallow |
Note: this contains a breaking change by removing the SMC attribute.
This should be fine, as the 3.0.0 release is planned to be breaking anyway.
This change could be reverted; it is left as a separate commit to make that easy.
The other design choice here was that we do not permit "function_id=0", or some other way to make
badge = 0 <=> unbadged smc capwhich has no allowlisting, instead allowing everything. This is always (in my opinion) a bad design.Review commit-by-commit.