Skip to content

Add an automated test for PSCI CPU_SUSPEND#34

Open
m4tx wants to merge 1 commit intomainfrom
psci_test
Open

Add an automated test for PSCI CPU_SUSPEND#34
m4tx wants to merge 1 commit intomainfrom
psci_test

Conversation

@m4tx
Copy link
Copy Markdown
Collaborator

@m4tx m4tx commented Apr 3, 2026

This adds another integration test that primarily tests whether the PSCI CPU_SUSPEND call works correctly. This is somewhat tricky to do under QEMU, as neither its default firmware nor Trusted Firmware-A supports suspending CPUs.

Therefore, the test script downloads and builds both Trusted Firmware-A and Rusted Firmware-A, and then runs the payload. To avoid pulling a bootloader on top of it, a qemu_bl33 platform config has been added so that ritm can now run as the bl33 payload in QEMU.

Because TF-A/RF-A seem to leave EL1 system registers in non-reset state (just like any other firmware could), this also adds some code to reset the registers necessary to boot the test payload or the Linux kernel.

@m4tx m4tx requested review from qperret2 and qwandor April 3, 2026 09:35
Comment on lines +81 to +86
old_handover = 'EntryPointInfo {\n pc: 0x6000_0000,\n args: Default::default(),\n }'
new_handover = 'EntryPointInfo {\n pc: 0x6000_0000,\n args: [0x4000_0000, 0, 0, 0, 0, 0, 0, 0],\n }'
if old_handover in content:
content = content.replace(old_handover, new_handover)
with open(rfa_platform_file, "w") as f:
f.write(content)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not very happy about this. @qwandor do you have any better idea on how to pass the DT from RF-A to RITM?

One option would be to hardcode the address in RITM itself, but it doesn't sound much nicer than patching RF-A...

This adds another integration test that primarily tests whether the PSCI
CPU_SUSPEND call works correctly. This is somewhat tricky to do under
QEMU, as neither its default firmware nor Trusted Firmware-A supports
suspending CPUs.

Therefore, the test script downloads and builds both Trusted Firmware-A
and Rusted Firmware-A, and then runs the payload. To avoid pulling a
bootloader on top of it, a qemu_bl33 platform config has been added so
that ritm can now run as the bl33 payload in QEMU.

Because TF-A/RF-A seem to leave EL1 system registers in non-reset state
(just like any other firmware could), this also adds some code to reset
the registers necessary to boot the test payload or the Linux kernel.
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.

1 participant