Skip to content

Add cca support#20

Open
roxell wants to merge 3 commits intokernelci:mainfrom
roxell:add-cca
Open

Add cca support#20
roxell wants to merge 3 commits intokernelci:mainfrom
roxell:add-cca

Conversation

@roxell
Copy link
Copy Markdown
Collaborator

@roxell roxell commented Apr 30, 2026

Add --enable-cca to tuxlava. The flag enables Arm CCA / RME on FVP and qemu-arm64.

roxell added 3 commits March 12, 2026 16:13
Add --enable-cca flag for the FVP AEMvA device. It sets the FVP model
parameters needed for Realm Management Extension (RME).

When enabled:
- bp.secure_memory=0 and bp.has_rme=1 to use RME instead of TrustZone
- rme_support_level=2 and speculative execution restrictions on both
  clusters, required by RME
- brbe recording disabled to avoid conflicts with RME trace filtering
- SMMU root registers set for RME

Without this flag the FVP runs with bp.secure_memory=1 as before.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
QEMU SBSA does not support -kernel when pflash firmware is used.
EDK2 needs to load the kernel from a FAT drive instead.

Add --enable-cca for qemu-arm64 that switches to sbsa-ref machine
with RME CPU flags. Add --pflash for SBSA flash images. Create a
FAT boot disk with kernel and startup.nsh for EDK2 UEFI shell.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
The for loop rendering tux_prompt items used Jinja2 whitespace
control ({%- endfor -%}) which stripped the trailing newline.

This caused the test section to be concatenated directly after
the last prompt item, producing invalid YAML like:
  - "buildroot"- test:

Remove the whitespace control on endfor so each prompt gets
its own line and the test section starts on a new line.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Comment thread tuxlava/devices/qemu.py
if enable_trustzone:
self.machine = f"{self.machine},secure=on"

if enable_cca:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two things I can see here, --pflash is required with --enable-cca, we need some validation here. Also what if a user passes --enable-cca, with --enable-trustzone I noticed that CCA will siliently overwrite sbsa-ref. I think same issue with --enable-kvm, these should riase InvalidArguement when combined

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also we check the kernel, but not the pflash. Shouldnt there be pflash validation here?

@bhcopeland
Copy link
Copy Markdown
Member

Can we also include a QEMU CCA template?

Comment thread tuxlava/devices/qemu.py
if enable_trustzone:
self.machine = f"{self.machine},secure=on"

if enable_cca:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also we check the kernel, but not the pflash. Shouldnt there be pflash validation here?

Comment thread tuxlava/devices/qemu.py
fat_img = tmpdir / "boot.img"
with open(fat_img, "wb") as f:
f.truncate(image.stat().st_size + 4 * 1024 * 1024)
subprocess.run(["mformat", "-i", str(fat_img), "::"], check=True)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How to catch these errors when tools not found i.e. it'll fall over with a confusing File Not Found Error

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.

2 participants