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

Add tests for SMC Capability #85

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

Furao
Copy link
Contributor

@Furao Furao commented Dec 8, 2022

This new test will make sure that the SMC capability and its associated API call work as expected.

It tests the following:

  1. A correctly configured call works
  2. An SMC call with a function ID that uses a cap with a different badge fails
  3. Minting an SMC cap from an SMC cap with a badge other than 0 fails

I tested this with the following configuration:

../init-build.sh -DPLATFORM=zcu102 -DRELEASE=true -DARM_HYP=TRUE -DKernelAllowSMCCalls=true

I wanted to test on QEMU, but it turned out to be non-trivial to integrate ATF with QEMU for sel4Test. It is doable, but I don't have the bandwidth to support it.

Note: This test assumes you are running ATF in EL3 on an AARCH64 platform. The successful test checks the standard service version and it reports back 0.1 (See https://github.com/ARM-software/arm-trusted-firmware/blob/master/include/services/std_svc.h). Technically this could change in the future and break the test, however the version hasn't changed in the last 9 years since the service was written.

This test requires these PRs:


return sel4test_get_result();
}
DEFINE_TEST(SMC0001, "Test SMC calls", test_smc_calls, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it reasonable to assume that CONFIG_ALLOW_SMC_CALLS will only be enabled on sel4test runs when the test platform also has a compatible ATF running for this test to pass?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It seems reasonable to me)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too. You really need to go looking to add it in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought ARM mandates ATF for Aarch64, or at least strongly encourages it.

Signed-off-by: Robbie VanVossen <[email protected]>
@Furao
Copy link
Contributor Author

Furao commented Aug 29, 2023

CI should probably be updated to include another test configuration on at least the zcu106 to enable KernelAllowSMCCalls.

@kent-mcleod kent-mcleod merged commit 99a462e into seL4:master Aug 30, 2023
18 checks passed
@Furao Furao deleted the smc_cap branch August 30, 2023 13:06
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.

3 participants