commit | 3b38ce9b98e01d10975e97938aa3b6f2ca65467e | [log] [tgz] |
---|---|---|
author | Karl Meakin <karl.meakin@arm.com> | Mon Jan 06 11:52:04 2025 +0000 |
committer | Joao Alves <joao.alves@arm.com> | Thu Jan 30 16:46:55 2025 +0100 |
tree | 4f1ca181b7e81555beab7972996cd43d060fa167 | |
parent | e0b0e325307072e6d3fb44631f3ec8daca47dc64 [diff] |
fix(hftest): recover from UTF-8 errors in logs Strings logged by `dlog` may contain arbitrary bytes, which may not be valid UTF-8. This can cause `hftest` to crash when reading the log files. Change `read_file` to open files with the `backslashreplace` error handler, so that bytes that are invalid UTF-8 will be replaced with backslash escape sequences. Example: ```c HFTEST_LOG("Hello, world \x80"); ``` Before: ``` File "/Users/karmea01/git/work/spm/./test/hftest/hftest.py", line 73, in read_file return f.read() ^^^^^^^^ File "<frozen codecs>", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 2350: invalid start byte ``` After: ``` [1 0] [hftest] hello world \x80 ``` Change-Id: I8d729846d27c94d5f227bbcebb764a2d0a8659de Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Hafnium is the Secure Partition Manager(SPM) reference implementation, following the Arm's Firmware Framework specification.
It leverages Arm's virtualization extensions in the secure world of Arm's A class of devices (feature introduced with Armv8.4 FEAT_SEL2) to allow multiple Trusted OSes or Applications to run concurrently, inside the Trusted Execution Environment, each running as a Secure Partition (SP). Its main goal is to control the system access given to Trusted OSes, and serve as a mediator to the rest of the system.
For example, it limits the memory use, and handles all system calls from Trusted OS. Thus the SPM can enforce spacial isolation, and enforce some level of access control, protecting other critical system resources such as: the secure monitor, the normal world software stack, the SPM itself and other SPs/Trusted Applications. Other important features are: secure interrupt handling, device assignment, inter-partition communication and with the Normal World Software stack, also known as Rich Execution Environment (REE).
The following diagram shows an overview of a typical aarch64-based system, and where Hafnium fits:
Get in touch and keep up-to-date at:
See feature requests and bugs through github.
To find more about Hafnium, view the full documentation. It includes valuable resources such as: Getting Started guide, Threat Model, and other documentation.