Expand description
§Arm Firmware Framework for Arm A-profile (FF-A) support library
Arm Firmware Framework for Arm A-profile (FF-A) specification
FF-A Memory Management Protocol specification
Library for handling common FF-A related functionality, create and parse interfaces and descriptors defined by FF-A. Starting from FF-A v1.2 the memory management related parts of the specification have been moved to a separate document (link above).
§Design goals
- Keep the code exception level agnostic by default. If exception level specific parts are inevitable, make it optional via a feature flag.
- Keep the code no_std compatible. Use only core by default, make parts using alloc optional via a feature flag.
- The interface towards the library’s users should be ergonomic Rust and following Rust
best-practices where possible.
- Incorrect usage of this library when creating/packing/serializing data structures provided by this library is seen as a programmer error and the library will panic.
- Parsing/unpacking/deserializing data structures provided by this library from a buffer is seen
as runtime “user input data”, and the library should make all necessary checks to validate the
data. In this case the library should never panic, but return rich error types (preferably use
thiserror) so the library user knows what’s wrong.
 
- The FF-A descriptors, packed structs and bit shifting magic should be private for the library,
never exposed to the library user (i.e. ffa_v1_1and later modules).- The implementation of such data structures should strictly follow the FF-A specification.
- Preferably write a doc comment for each such definition that specifies where it comes from in the spec (i.e. Table x.y or chapter x.y.z)
- The data structures should derive the necessary zerocopytraits.
 
§FF-A version handling
The FF-A specification allows different components of a system to use different versions of the
specification. The version used at a specific FF-A instance (i.e. an interface between two FF-A
components) is discovered at runtime, either by parsing FF-A manifests or using FFA_VERSION. An
FF-A component might have to use multiple versions at runtime on its different interfaces, therefore
this library must be able to support this and having a compile time fixed version is not possible.
Because of this, most of the functions to create or parse FF-A messages and data structures require
passing the FF-A version used at the instance where the serialized data was received from or will be
sent to.
§Implemented features
- Supports converting FF-A interface types between Rust types and the FF-A register ABI.
- Memory transaction descriptor handling for FFA_MEM_*interfaces (partial).
- FF-A v1.1+ boot information protocol.
- FF-A partiton information descriptor.
§Future plans
- Implement missing features from FF-A v1.1 and later. Implementing FF-A v1.0 features that are deprecated by v1.1 are low priority for now.
- Increase test coverage.
- Create more detailed documentation to capture which parts of FF-A are currently supported.
§License
The project is MIT and Apache-2.0 dual licensed, see LICENSE-APACHE and LICENSE-MIT.
§Maintainers
arm-ffa is a trustedfirmware.org maintained project. All contributions are ultimately merged by the maintainers listed below.
- Bálint Dobszay balint.dobszay@arm.com balint-dobszay-arm
- Imre Kis imre.kis@arm.com imre-kis-arm
- Sandrine Afsa sandrine.afsa@arm.com sandrine-bailleux-arm
§Contributing
Please follow the directions of the Trusted Firmware Processes
Contributions are handled through review.trustedfirmware.org.
§Arm trademark notice
Arm is a registered trademark of Arm Limited (or its subsidiaries or affiliates).
This project uses some of the Arm product, service or technology trademarks, as listed in the Trademark List, in accordance with the Arm Trademark Use Guidelines.
Subsequent uses of these trademarks throughout this repository do not need to be prefixed with the Arm word trademark.
Copyright The arm-ffa Contributors.
Modules§
- boot_info 
- Implementation of the FF-A Boot information protocol.
- memory_management 
- Implementation of the FF-A Memory Management protocol.
- partition_info 
- Implementation of FF-A partition discovery data structures.
Structs§
- DirectMsg2 Args 
- Arguments for the FFA_MSG_SEND_DIRECT_{REQ,RESP}2interfaces.
- LogChars
- Generic type for storing FFA_CONSOLE_LOGcharacter payload and its length in bytes.
- MsgSend2Flags 
- Flags field of the FFA_MSG_SEND2interface.
- MsgWaitFlags 
- Flags field of the FFA_MSG_WAITinterface.
- NotificationBind Flags 
- Flags field of the FFA_NOTIFICATION_BINDinterface.
- NotificationGetFlags 
- Flags field of the FFA_NOTIFICATION_GETinterface.
- NotificationInfo GetIterator 
- Iterator implementation for parsing the (partition ID, vCPU ID list) pairs of the FFA_SUCCESSof anFFA_NOTIFICATION_INFO_GETcall.
- NotificationSetFlags 
- Flags field of the FFA_NOTIFICATION_SETinterface.
- PartitionInfo GetFlags 
- Flags of the FFA_PARTITION_INFO_GETinterface.
- SuccessArgs Features 
- FFA_FEATURESspecific success argument structure. This type needs further specialization based on ‘FF-A function ID or Feature ID’ field of the preceeding- FFA_FEATURESrequest.
- SuccessArgs IdGet 
- FFA_ID_GETspecific success argument structure.
- SuccessArgs Notification Get 
- FFA_NOTIFICATION_GETspecific success argument structure.
- SuccessArgs Notification Info Get 
- FFA_NOTIFICATION_INFO_GETspecific success argument structure. The- MAX_COUNTparameter depends on the 32-bit or 64-bit packing.
- SuccessArgs SpmId Get 
- FFA_SPM_ID_GETspecific success argument structure.
- TargetInfo 
- Endpoint ID and vCPU ID pair, used by FFA_ERROR,FFA_INTERRUPTandFFA_RUNinterfaces.
- Uuid
- A Universally Unique Identifier (UUID).
- UuidHelper 
- Collection of helper functions for converting between Uuidtype and its representations in various FF-A containers.
- Version
- Version number of the FF-A implementation, .0is the major,.1is minor the version.
Enums§
- ConsoleLogChars 
- Argument for the FFA_CONSOLE_LOGinterface.
- DirectMsgArgs 
- Arguments for the FFA_MSG_SEND_DIRECT_{REQ,RESP}interfaces.
- Error
- Rich error types returned by this module. Should be converted to crate::FfaErrorwhen used with theFFA_ERRORinterface.
- Feature
- Arguments for the FFA_FEATURESinterface.
- FeatureId 
- Feature IDs used by the FFA_FEATURESinterface.
- FfaError
- Error status codes used by the FFA_ERRORinterface.
- FuncId
- Function IDs of the various FF-A interfaces.
- Instance
- An FF-A instance is a valid combination of two FF-A components at an exception level boundary.
- Interface
- FF-A “message types”, the terminology used by the spec is “interfaces”.
- MemAddr
- Memory address argument for FFA_MEM_PERM_{GET,SET}interfaces.
- MemOpBuf 
- Descriptor for a dynamically allocated memory buffer that contains the memory transaction descriptor.
- RxTxAddr 
- RXTX buffer descriptor, used by FFA_RXTX_MAP.
- SecondaryEpRegister Addr 
- Entrypoint address argument for FFA_SECONDARY_EP_REGISTERinterface.
- SuccessArgs 
- Generic arguments of the FFA_SUCCESSinterface. The interpretation of the arguments depends on the interface that initiated the request. The application code has knowledge of the request, so it has to convertSuccessArgsinto/from a specific success args structure that matches the request.
- VersionOut 
- Enum for storing the response of an FFA_VERSION request. It can either contain a Versionor aNOT_SUPPORTEDerror code.
- VmAvailabilityStatus 
- Composite type for capturing success and error return codes for the VM availability messages.
- WarmBoot Type 
- Arguments for the Power Warm Boot FFA_MSG_SEND_DIRECT_REQinterface.
Constants§
- FFA_PAGE_ SIZE_ 4K 
- Constant for 4K page size. On many occasions the FF-A spec defines memory size as count of 4K pages, regardless of the current translation granule.
Type Aliases§
- ConsoleLogChars32 
- Specialized type for 32-bit FFA_CONSOLE_LOGpayload.
- ConsoleLogChars64 
- Specialized type for 64-bit FFA_CONSOLE_LOGpayload.
- SuccessArgs Notification Info Get32 
- FFA_NOTIFICATION_INFO_GET_32specific success argument structure.
- SuccessArgs Notification Info Get64 
- FFA_NOTIFICATION_INFO_GET_64specific success argument structure.