Hi,
I wonder if there is or there is a plan to develop a dedicated tool that allows a realm developer to calculate Realm Initial Measurements (RIMs) for realms(?)
As you know, the remote attestation mechanism requires a verifier to be provisioned with reference values. In this case, a realm verifier should have access to the initial reference measurement (RIM) of a realm that is intended to be run on a remote Arm CCA platform.
The algorithm that measures the initial state of realms (RIM) is higly sensitive to the content of a realm memory and the order of RMI operations. This means that not only the content of populated realm memory matters but also the implementation of the host components (e.g. kvm, kvmtool/qemu). For example, in the reference implementation of https://gitlab.arm.com/linux-arm/kvmtool-cca, the layout of memory and the content of DTB highly depend on the provided options (DTB is generated in run-time). Unfortunatelly, the content of DTB also depends on the linking order of object files (the order of DTB generation is imposed by __attribute__((constructor)) that is used to register devices). This complicates development of a separate tool for caclulating RIM, as the tool would have to emulate all quirks of the kvmtool.
One of the solution of retrieving Realm Initial Measurements seems to be running the whole firmware/software (e.g. kvmtool/Linux host/TF-RMM) stack on the FVP emulator and gathering the RIM directly from the TF-RMM. This would require a realm developer to have access to the whole firmware/software stack and the emulator of the CCA platform. This might not always be an option.
The other solution would require the implementation of a dedicated tool. For instance, a sensible approach could be to extend the functionality of kvmtool, which can be run on an ordinary Linux machine.
Is Arm going to develop a dedicated tool(-s) for calculating RIMs?
What is the recommended way of retrieving/calculating RIMs for realms?
Kind regards,
Piotr
Hello all,
We have added a GitHub workflow to RMM which allows the former to build
and run the unittests along with their corresponding coverage report
and upload such report in .html format to GitHub.
The workflow is automatically triggered when new pushes are done to the
main branch.
In order to access to the coverage report, you can either
* click on the green check symbol next to the latest commit, from
there to "details" on the "Coverage on unittests for RMM" action on
the pop up window and once in the action page, click on "Summary" on
the left side menu. The report will appear in the "Artifacts"
section as a .zip file with the name "coverage-results" or
* On the TF-RMM repo main page, click on "Actions" and then click on
the "Coverage on unittests for RMM" action corresponding to the
latest commit. You can then access to the report as explained on the
previous bullet.
Please keep in mind that reports older than 90 days will be
automatically deleted.
Thanks,
Javier
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hi All,
Please review the patch-set that adds the functionality in RMM to manage Scalable Matrix Extension (SME) context. If the CPU supports SME and if Realm accesses FPU/SVE functionality then NS SME state is saved to allow Realm to use FPU/SVE register state.
https://review.trustedfirmware.org/q/topic:%22rmm_sme%22+(status:open%20OR%…
Brief summary of changes made in different components:
RMM:
- Introduces SIMD context and exports APIs to the runtime component of RMM to initialize, save, restore, and switch SIMD context.
- Adds SME support in RMM to manage NS SME context. Supports SVE+SME config and SME only config.
- Handles SVE hint bit passed in RMI SMCs
- Handles SME exceptions from Realms
https://review.trustedfirmware.org/q/topic:%22rmm_sme%22+(status:open%20OR%…
TF-A:
- Enables FEAT_SME for RMM
- Passes SMCCCv1.3 SVE hint bit in SMC function ID to RMM
tf-a-tests:
- There are changes in common lib routines for sve, sme so that testcases running in NS-EL2, S-EL1, R-EL1 can use these helper routines.
- Adds helper routines to read, write, compare FPU and SVE Z, P, FFR registers
- Adds SMCCCv1.3 SVE hint bit support in TFTF framework
- Enables SME/SME2 during arch init
- Adds SME helper routines and extends SVE lib routines to support streaming SVE mode.
https://review.trustedfirmware.org/q/topic:%22rmm_sme%22+(status:open%20OR%…
Thanks,
Arun
Hello all,
We currently have a patch under review [1] which will break the existing dependency between 'run-converage' and 'run-unittests' rules in the RMM build system.
This means that once the patch is merged, 'run-coverage' will not build and run RMM unittests. If ran in isolation, it will generate an empty coverage report by default.
This allows to get coverage analysis for especific tests rather than for all the unittests, which makes the process of writting unittests for new modules easier as we can have a picture of the current coverage for such modules without being tainted by the rest of the unittests.
Please note that in order to run coverage analysis on the whole existing set of unittests (as done previously by 'run-coverage') we need to invoke 'run-unittests' before.
The patch, which is currently open for discussion and review, includes instructions on how to run 'run-coverage' to get different types of analysis.
Thanks,
Javier
[1]: https://review.trustedfirmware.org/c/TF-RMM/tf-rmm/+/23039
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hello everyone,
I would like to let you know that there is a first draft of the Threat Model for the TF-RMM ready for review. You can check it out and leave your comments here: https://review.trustedfirmware.org/c/TF-RMM/tf-rmm/+/20477
Best regards,
Javier
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hello,
QEMU 8.1 added support for FEAT_RME. It is experimental, enabled with
'-cpu max,x-rme=on', and requires fixes that will be available in QEMU
8.2. I'm working on adding support to TF-A and TF-RMM.
I just submitted some TF-A patches for review (topic qemu-rme) that enable
the feature for the virt platform, and intend to send the necessary
changes for TF-RMM within a week or so. Without RMM, the Test Realm
Payload is included into the FIP for light testing.
After the TF-A and TF-RMM changes, I'd like to add support for the SBSA
platform as well, which should be a relatively small change once the
common QEMU support is merged.
Thanks,
Jean
---
Building TF-A for QEMU with RME support:
make -j CROSS_COMPILE=aarch64-linux-gnu- PLAT=qemu DEBUG=1
RMM=path/to/rmm/build/Debug/rmm.img ENABLE_RME=1
BL33=path/to/QEMU_EFI.fd QEMU_USE_GIC_DRIVER=QEMU_GICV3
all fip
dd if=tf-a/build/qemu/debug/bl1.bin of=flash.bin bs=4096 conv=notrunc
dd if=tf-a//build/qemu/debug/fip.bin of=flash.bin seek=64 bs=4096 conv=notrunc
Running QEMU, for example:
qemu-system-aarch64 -cpu max,x-rme=on,sme=off -m 3G -smp 8
-M virt,gic-version=3,virtualization=on,secure=on,acpi=off
-bios flash.bin
-kernel linux/arch/arm64/boot/Image
-initrd path/to/initrd
-append console=ttyAMA0
-nographic
...
[ 0.825891] kvm [1]: Using prototype RMM support (version 66.0)
SMC_RMM_FEATURES 0 > RMI_SUCCESS 33403e30
Hi All,
Note you may have received another instance of this note but when I
attempted to send to all TF ML's simultaneously it seemed to fail, so
sending to each one at a time. Sorry about that. :/
We've created a Discord Server for real time chats/sharing. This solution
comes at no cost to the project, is set up with channels for each project,
includes a #general channel, and supports direct 1-1 chats between members,
all with the goal of improving collaboration between trustedfirmware.org
developers.
We encourage all to join! :) Instructions for joining can be found on
the TF.org
FAQ page <https://www.trustedfirmware.org/faq/>.
See you all there and please don't hesitate to reach out if you have any
questions!
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org