Skip to content

Support badged SMC caps to restrict SMC function IDs - #589

Open
midnightveil wants to merge 5 commits into
seL4:mainfrom
au-ts:julia/badged-smc
Open

Support badged SMC caps to restrict SMC function IDs#589
midnightveil wants to merge 5 commits into
seL4:mainfrom
au-ts:julia/badged-smc

Conversation

@midnightveil

@midnightveil midnightveil commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

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 cap which has no allowlisting, instead allowing everything. This is always (in my opinion) a bad design.

<system>
    <protection_domain name="arm_smc" priority="1">
        <program_image path="arm_smc.elf" />

        <cspace>
            <!-- An (ARM) SMC capability that permits SMC calls to 0x84000000 (PSCI_VERSION) -->
            <cap_smc slot="1" function_id="0x84000000" />
        </cspace>
    </protection_domain>
</system>

Review commit-by-commit.

@midnightveil midnightveil linked an issue Aug 10, 2026 that may be closed by this pull request
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>
@midnightveil
midnightveil marked this pull request as ready for review August 11, 2026 02:53
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

Successfully merging this pull request may close these issues.

Add ARM SMC forwarding granularity

1 participant