Trusted Execution Environment Startup Method, Apparatus and Equipment
By allocating dedicated memory for trusted execution environments of different security levels in the on-chip system, and combining hardware firewalls and virtualization technology, the problem of insufficient memory security isolation in multi-trusted execution environment scenarios is solved, and multi-domain secure operation is achieved in the integrated architecture of intelligent driving and cockpit.
Patent Information
- Application Number
- CN202611374389.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-17
AI Technical Summary
In multi-trusted execution environment scenarios, existing memory allocation methods suffer from insufficient security isolation, making it difficult to meet the high security requirements of the integrated architecture of intelligent driving and cockpit.
By allocating dedicated first running memory to the first trusted execution environment with a higher security level in the on-chip system, and allocating shared second running memory to multiple second trusted execution environments with lower security levels, physical isolation is achieved using a hardware firewall unit, and logically independent virtual running memory is generated through virtualization technology, and each trusted execution environment is loaded and started respectively.
It achieves hard isolation of high-security-level trusted execution environments and soft isolation of low-security-level trusted execution environments, reducing the risk of permission leakage and fault propagation, and balancing the isolation requirements of services with different security levels with the utilization rate of hardware resources.
Smart Images

Figure CN123116291A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information security technology, specifically to a trusted execution environment startup method, apparatus, and device. Background Technology
[0002] The Rich Execution Environment (REE) and the Trusted Execution Environment (TEE) constitute the layered security architecture of intelligent vehicle devices. The REE is responsible for general functions, while non-secure services in the REE establish a channel connection with the TEE by initiating a request. The TEE then performs sensitive operations and returns the results to complete the collaboration mechanism from REE to TEE.
[0003] In related technologies, a single trusted execution environment is typically constructed through hardware isolation mechanisms. However, in scenarios with multiple trusted execution environments, the memory allocation methods of these technologies suffer from insufficient security isolation. Summary of the Invention
[0004] To address the aforementioned technical issues, this disclosure provides a trusted execution environment startup method, apparatus, and device to resolve the problem of insufficient security isolation in memory allocation methods of related technologies in multi-trusted execution environment scenarios.
[0005] A first aspect of this disclosure provides a method for booting a trusted execution environment for a system-on-a-chip, the system-on-a-chip including a memory and a hardware firewall unit, the method comprising: In response to the on-chip system startup, based on the acquired preset configuration file, a first running memory of the memory is allocated to a first trusted execution environment in a plurality of trusted execution environments, and a second running memory of the shared memory is allocated to a plurality of second trusted execution environments in the plurality of trusted execution environments; wherein, the first running memory and the second running memory are isolated through the firewall unit; Based on the second running memory, independent virtualized running memory is generated for each of the second trusted execution environments; Based on the first running memory, the first trusted execution environment is loaded and started, and based on the multiple virtualized running memory, each of the second trusted execution environments is loaded and started respectively.
[0006] A second aspect of this disclosure provides a trusted execution environment boot device for a system-on-a-chip, the system-on-a-chip including a memory and a hardware firewall unit, comprising: A first processing module is configured to, in response to the startup of the on-chip system, allocate a first running memory of the memory to a first trusted execution environment in the plurality of trusted execution environments based on an acquired preset configuration file, and allocate a second running memory of the shared memory to a plurality of second trusted execution environments in the plurality of trusted execution environments; wherein the first running memory and the second running memory are isolated through the firewall unit; The second processing module is used to generate independent virtualized running memory for each of the second trusted execution environments based on the second running memory; The first startup module is used to load and start the first trusted execution environment based on the first running memory, and to load and start each of the second trusted execution environments based on the multiple virtualized running memory environments respectively.
[0007] A third aspect of this disclosure provides a computer-readable storage medium storing a computer program for executing the Trusted Execution Environment startup method for a system-on-a-chip described in the first aspect above.
[0008] A fourth aspect of this disclosure provides an electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the trusted execution environment startup method for a system-on-a-chip described in the first aspect above.
[0009] A fifth aspect of this disclosure provides a computer program product that, when executed by an instruction processor in the computer program product, performs the trusted execution environment startup method for a system-on-a-chip proposed in the first aspect of this disclosure.
[0010] The technical solution provided in this disclosure, during the on-chip system startup phase, can allocate first running memory for a first trusted execution environment with a higher security level based on a preset configuration file, and allocate shared second running memory for multiple second trusted execution environments with lower security levels. These two types of running memory are physically isolated through a firewall unit. Simultaneously, logically independent virtualized running memory is generated for each second trusted execution environment based on the shared second running memory. The first trusted execution environment is then started based on the first running memory, and each second trusted execution environment is started based on its corresponding virtualized running memory. In other words, in this solution, trusted execution environments with higher security requirements obtain exclusive physical memory resources and are not affected by low-security domain services. Meanwhile, trusted execution environments with lower security requirements do not need to have exclusive physical memory; by sharing the second running memory and using virtualization technology, mutual isolation of the running space can be achieved, thereby reducing the risk of permission leaks and fault propagation caused by multiple domain services sharing memory under a single TEE architecture. Thus, the method in this embodiment achieves hard isolation of high-security-level TEEs through hardware firewall isolation and soft isolation of multiple low-security-level TEEs through virtualized memory, taking into account the isolation requirements of services with different security levels and the utilization rate of hardware resources. This achieves the multi-domain secure operation requirements under the integrated architecture of intelligent driving and cockpit, and thus solves the problem of insufficient security isolation in the memory allocation method of related technologies in the multi-trusted execution environment scenario. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of the software architecture of a system-on-a-chip provided in an exemplary embodiment of this disclosure.
[0012] Figure 2 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in an exemplary embodiment of this disclosure.
[0013] Figure 3 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0014] Figure 4 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0015] Figure 5 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0016] Figure 6 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0017] Figure 7 This is a topology diagram of a device tree file provided in an exemplary embodiment of this disclosure.
[0018] Figure 8 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0019] Figure 9 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0020] Figure 10 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip provided in another exemplary embodiment of this disclosure.
[0021] Figure 11 This is a schematic diagram of the structure of a trusted execution environment startup device for a system-on-a-chip provided in an exemplary embodiment of the present disclosure.
[0022] Figure 12 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation
[0023] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.
[0024] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0025] Application Overview Vehicle driver assistance systems typically employ the ARM TrustZone architecture, which divides hardware resources into two worlds through secure isolation: the Secure World and the Non-Secure World. The Non-Secure World can also be referred to as the Normal World.
[0026] The secure and insecure worlds operate completely independently, sharing hardware resources such as processors, memory, and peripherals. The secure world runs a secure operating system to process sensitive data or perform critical security tasks, such as key management, biometric authentication, and payment protection. The insecure world runs a regular operating system (i.e., a rich operating system, such as Linux or Android) for routine tasks. Access to the insecure world is strictly limited, preventing direct access to the secure world's resources, thus effectively preventing malware or attackers from stealing sensitive information.
[0027] In the ARM TrustZone architecture, the processor achieves isolation between different privilege levels through exception levels (ELs). The ARM TrustZone architecture supports multiple exception levels (ELs), typically including EL0 (user mode), EL1 (operating system mode or kernel mode), EL2 (virtualization mode), and EL3 (security monitoring mode). EL3, as the highest exception level, is responsible for managing the switching between the secure world and the normal world, as well as the scheduling of security resources; a higher number for the exception level indicates a higher level of privilege for the software. Different exception levels can operate in either the secure world or the normal world, depending on the current state of the processor's world.
[0028] Based on the aforementioned hardware isolation, TEE (Trusted Execution Environment) and REE (Rich Execution Environment) constitute a layered security architecture for modern intelligent devices, achieving a balance between functionality and security through ARM TrustZone technology. The TEE operates as a secure zone within the secure world, protecting sensitive data and critical operations; the REE operates in the insecure world, responsible for general functions. Insecure services within the REE establish a channel connection with the TEE by initiating requests, and the TEE executes sensitive operations and returns results. The REE completes subsequent operations, thus establishing a collaborative mechanism from the REE to the TEE.
[0029] With the evolution of automotive electronic and electrical architecture, the functions of Intelligent Driving (ADAS), Intelligent Cockpit (IVI), and Intelligent CLUSTER are gradually being integrated on the same System-on-Chip (SOC) platform. This multi-domain integration trend brings higher computing efficiency and lower hardware costs, but it also places more stringent requirements on the high-reliability execution environment security architecture of in-vehicle systems. Under this integrated architecture, the Intelligent Driving domain needs to meet high-level requirements for functional safety and cybersecurity; the Intelligent Cockpit and Intelligent CLUSTER domains involve diverse services such as infotainment and communication, and also need to have corresponding security protection capabilities.
[0030] Currently, the existing single TEE architecture is insufficient to meet the dual requirements of multi-domain security services and hard isolation, making it difficult to adapt to the future development needs of intelligent driving and cockpit integration. While the ARM V8.4 architecture hardware supports Secure EL2 security virtualization extension technology, which can support hardware-level multi-TEE virtualization, its use cases are limited, and its software has not been fully developed and widely used.
[0031] Exemplary System Figure 1 This is a schematic diagram of the software architecture of a system-on-a-chip provided in an exemplary embodiment of this disclosure. The system-on-a-chip is designed based on ARM v8.4A and above architecture, natively supports ARM TrustZone security extension and Secure-EL2 (S-EL2) security virtualization extension, and has a complete privilege level system and hardware security isolation capabilities.
[0032] In some examples, such as Figure 1As shown, the system is structured from bottom to top as a three-layer architecture: a hardware isolation layer, an EL3 global security management layer, and dual hard-isolated service domains. At the physical level, two completely independent hard-isolated domains are defined by a hardware firewall unit. Hard-isolated domain 1 uses a single-instance hard-isolated TEE architecture to meet high-functionality security requirements, while hard-isolated domain 2 uses an S-EL2 secure virtualization architecture (e.g., Hypervisor) to support the expansion of multiple second trusted execution environment instances. Ultimately, the system simultaneously achieves both strong security hard isolation for the intelligent driving domain and multi-service secure virtualization for the intelligent cockpit domain on the on-chip system. The system privilege levels cover EL3, EL2, and EL1 from top to bottom. Physical hard isolation of CPU, memory, and storage resources is achieved between the two hard-isolated domains through a hardware firewall. Within each domain, TrustZone technology achieves logical security isolation between the non-secure rich execution environment (REE) and the secure trusted execution environment (TEE).
[0033] In this embodiment of the disclosure, multiple trusted execution environments are divided into the following two categories according to security level and isolation method: First trusted execution environment: corresponding to business domains with high functional safety and high information security levels; Multiple second trusted execution environments: corresponding to business domains with general security levels.
[0034] For example, such as Figure 1 As shown, the first trusted execution environment is ADAS TEE OS, which corresponds to the ADAS domain rich operating system; multiple second trusted execution environments may include: IVI TEE OS, Cluster TEE OS, and OTHER TEE OS, etc. IVI TEE OS corresponds to IVI domain rich operating system, Cluster TEE OS corresponds to Cluster domain rich operating system, and OTHER TEE OS corresponds to OTHER domain rich operating system.
[0035] In some embodiments, such as Figure 1 As shown, the EL3 Trusted Execution Environment Management Module (EL3 TEE-MM) runs at the EL3 privilege level. The Hypervisor, running at the non-secure EL2 privilege level, is responsible for the virtualization scheduling of CPU, memory, and peripheral resources on the non-secure side within Hard Isolation Domain 2, creating and managing multiple non-secure virtual machines to achieve isolated operation of multiple service systems in the cockpit, such as IVI, CLUSTER, and OTHER OS. The Trusted Execution Environment Management Module (EL2 TEE-MM), running at the Secure EL2 privilege level and governed by the EL3 TEE-MM, is the core of TEE virtualization management within Hard Isolation Domain 2.
[0036] In some examples, such as Figure 1As shown, the hardware firewall unit provides physical-level resource isolation for the entire system. The hardware firewall unit enables unified configuration of computing resources (Central Processing Unit, CPU), memory resources (Double Data Rate, DDR), and universal flash storage resources (UFS). Configuration permissions are only granted to the highest privilege level of EL3.
[0037] The hardware firewall unit is an on-chip integrated hardware-level access control unit within the SOC, possessing capabilities for master device identification, address range decoding, access permission verification, unauthorized access blocking, and anomaly reporting. The hardware firewall unit can configure access permissions for CPU cores to slave device resources such as memory, storage, and peripheral registers. It supports resource partitioning based on physical address ranges and allows configuration of security / non-security attributes, read / write / execute permissions, and other rules. All rules are enforced by hardware logic, preventing software from bypassing or tampering, thus forming the core hardware foundation for achieving hard isolation.
[0038] Physical CPU resources are divided into two groups by number, belonging to two dedicated hard isolation domains. Each group is further divided into non-secure CPUs and secure CPUs according to TrustZone security state.
[0039] For example, such as Figure 1 As shown, the dedicated CPU group for hard isolation domain 1 is CPU 0-7, which is divided into CPU 0-7 non-secure state and CPU 0-7 secure state, respectively carrying REE services and TEE services within the corresponding domain; the dedicated CPU group for hard isolation domain 2 is CPU 8-15, which is divided into CPU 8-15 non-secure state and CPU 8-15 secure state, respectively carrying REE services and TEE services within the corresponding domain.
[0040] For example, such as Figure 1 As shown, DDR memory resources are divided into four independent memory partitions, each corresponding to a CPU group. The insecure-state memory of hard isolation domain 1 is only accessible to CPUs 0-7 in insecure state and carries operational data from the ADAS domain's REE side; the secure-state memory of hard isolation domain 1 is only accessible to CPUs 0-7 in secure state and carries sensitive operational data and keys for the ADASTEE OS. The insecure-state memory of hard isolation domain 2 is only accessible to CPUs 8-15 in insecure state and carries operational data from virtual machines in the cockpit domain; the secure-state memory of hard isolation domain 2 is only accessible to CPUs 8-15 in secure state and carries sensitive data from the S-EL2 management module and each virtualized TEE instance.
[0041] For example, such as Figure 1As shown, the system is configured with two independent UFS storage controllers, belonging to two hard isolation domains. Each storage controller is further divided into a non-secure storage partition and a secure storage partition. UFS0 belongs to hard isolation domain 1 and contains a non-secure storage partition and a secure storage partition, which respectively store the REE system image and TEE secure image and sensitive persistent data within the domain; UFS1 belongs to hard isolation domain 2 and contains a non-secure storage partition and a secure storage partition, which can respectively store the virtual machine system images and the secure data of each virtualized TEE within the domain.
[0042] Exemplary methods Figure 2 This is a flowchart illustrating a trusted execution environment startup method for a system-on-a-chip (SoC) according to an exemplary embodiment of this disclosure. The SoC includes a memory and a hardware firewall unit. This embodiment can be applied to electronic devices configured with an SoC, such as… Figure 2 As shown, the method may include the following steps: Step 201: In response to the on-chip system startup, based on the acquired preset configuration file, allocate first running memory of the memory for the first trusted execution environment in the multiple trusted execution environments, and allocate second running memory of the shared memory for the multiple second trusted execution environments in the multiple trusted execution environments.
[0043] The first and second running memory are isolated by a firewall unit.
[0044] In some embodiments, the System-on-Chip (SOC) mentioned above refers to a system-on-a-chip integrated circuit. For example, a System-on-Chip can be an automotive intelligent driving chip or other chips equipped with the ARM TrustZone architecture.
[0045] For example, the aforementioned preset configuration file refers to a pre-configured configuration file used to indicate the type, security level, and memory allocation rules of each trusted execution environment in the system. The first trusted execution environment is a trusted execution environment that meets high security level requirements; for example, the first trusted execution environment is a trusted execution environment used to carry core security services in the intelligent driving domain (which can be abbreviated as ADAS TEE). The second trusted execution environment is a trusted execution environment used to carry lower security level requirements in other domains; for example, multiple second trusted execution environments may include a trusted execution environment used to carry intelligent cockpit services and a trusted execution environment used to carry intelligent dashboard services, etc. The aforementioned memory is used to provide independent operating space for different trusted execution environments; for example, the memory can be Dynamic Random Access Memory (DRAM) or Low Power Double Data Rate Synchronous Dynamic Random Access Memory (LPDDR), etc., and this disclosure does not limit this.
[0046] In some examples, the firewall unit is a standalone hardware circuit with hardware-level access isolation capabilities. The firewall unit implements memory access isolation at the hardware level, preventing the first trusted execution environment and the second trusted execution environment from accessing each other's memory space beyond their boundaries. This ensures that the memory of the high-security first trusted execution environment is not illegally accessed by other low-security trusted execution environments, thereby improving the operational security of the first trusted execution environment at the hardware level.
[0047] In some examples, upon power-on startup of the on-chip system, the trusted execution environments (TEEs) are first identified as the first TEE based on their preset security levels recorded in the configuration file. Those with preset security levels higher than a preset threshold are designated as the first TEE, while those with preset security levels lower than or equal to the threshold are designated as the second TEE. Then, based on the memory allocation size corresponding to the first TEE recorded in the configuration file, a corresponding address segment is allocated from the secure memory region of the memory as the first running memory. Finally, a shared second running memory segment is allocated from the remaining space of the secure memory region according to the total preset memory usage of the second TEE. A hardware firewall unit isolates the first and second running memories to ensure the independence of the first running memory corresponding to the first TEE at the hardware level, preventing interference from other TEEs and meeting its high-level security isolation requirements. Multiple second TEEs are isolated using virtualization technology.
[0048] Step 202: Based on the second running memory, generate independent virtualized running memory for each second trusted execution environment.
[0049] In some embodiments, a two-level address translation mechanism based on virtualization technology can be employed to generate independent virtualized running memory for each second trusted execution environment (TEX). Specifically, firstly, a first-level address translation (Stage-1) is enabled within each TEX, converting the virtual addresses of the TEX into intermediate physical addresses (IPAs), ensuring that each TEX has an independent virtual address space starting from address zero. Secondly, a second-level address translation (Stage-2) is enabled, mapping the intermediate physical addresses of the TEX to their corresponding physical sub-regions in the second running memory. The second-level address translation is implemented through a separate Stage-2 page table, ensuring that the intermediate physical addresses of different TEXs are mapped to non-overlapping physical regions in the second running memory, thereby achieving logical isolation. Furthermore, the two-level address translation works in conjunction with a hardware firewall unit; even if the second-level address translation configuration fails, the hardware firewall can still block unauthorized cross-domain access based on the physical address.
[0050] Step 203: Based on the first running memory, load and start the first trusted execution environment, and based on multiple virtualized running memory, load and start each of the second trusted execution environments respectively.
[0051] In some embodiments, the pre-stored image file of the first trusted execution environment is first read and loaded into the allocated first running memory to complete the initialization of the core code and the running environment. Then, the first trusted execution environment is started. The pre-stored image files of each second trusted execution environment are read sequentially and loaded into the physical address space mapped to the virtualized running memory corresponding to the second trusted execution environment in the second running memory to complete the initialization of the running environment of each second trusted execution environment. Finally, each second trusted execution environment is started one by one.
[0052] The technical solution provided in this disclosure, during the on-chip system startup phase, can allocate first running memory for a first trusted execution environment with a higher security level based on a preset configuration file, and allocate shared second running memory for multiple second trusted execution environments with lower security levels. These two types of running memory are physically isolated through a firewall unit. Simultaneously, logically independent virtualized running memory is generated for each second trusted execution environment based on the shared second running memory. The first trusted execution environment is then started based on the first running memory, and each second trusted execution environment is started based on its corresponding virtualized running memory. In other words, in this solution, trusted execution environments with higher security requirements obtain exclusive physical memory resources and are not affected by low-security domain services. Meanwhile, trusted execution environments with lower security requirements do not need to have exclusive physical memory; by sharing the second running memory and using virtualization technology, mutual isolation of the running space can be achieved, thereby reducing the risk of permission leaks and fault propagation caused by multiple domain services sharing memory under a single TEE architecture. Thus, the method in this embodiment achieves hard isolation of high-security-level TEEs through hardware firewall isolation and soft isolation of multiple low-security-level TEEs through virtualized memory, taking into account the isolation requirements of services with different security levels and the utilization rate of hardware resources, thereby realizing the multi-domain safe operation requirements under the integrated architecture of intelligent driving and cockpit.
[0053] like Figure 3 As shown, the system-on-a-chip also includes a first management module running in a security monitoring mode and a second management module running in a secure virtual machine monitoring mode; in the above Figure 2 Based on the illustrated embodiment, step 201 can be implemented by step 2011, and step 202 can be implemented by step 2021: Step 2011: In response to the on-chip system startup, the first management module is initialized, and the first management module allocates first running memory to the first trusted execution environment and allocates shared second running memory to multiple second trusted execution environments according to the preset configuration file.
[0054] In some embodiments, the first management module operates in a security monitoring mode, meaning its privilege level is that of a Trusted Execution Environment Management Module (TEE-MM) running at the highest privilege level EL3 on the ARM architecture (hereinafter referred to as EL3 TEE-MM). The second management module operates in a secure virtual machine monitoring mode, meaning its privilege level is that of a Trusted Execution Environment Management Module running at the second-highest privilege level S-EL2 on the ARM architecture (hereinafter referred to as S-EL2 TEE-MM). Both the first and second management modules exist in a secure environment and belong to different hardware anomaly privilege levels. The first management module has a higher privilege level than the second management module, and can manage the allocation of available resources for the second management module and the first trusted execution environment. The second management module autonomously performs fine-grained resource allocation for each second trusted execution environment within the available resources. It should be noted that the first and second management modules run firmware at different privilege levels.
[0055] For example, upon power-on startup of the on-chip system, the startup process can follow the ARM TrustZone architecture. First, it enters the security monitoring mode (corresponding to the EL3 exception level of the ARM TrustZone architecture, the highest privilege level in the security world). The first management module running in security monitoring mode completes initialization, takes over control of the hardware firewall, loads and parses the preset configuration file pre-stored in the secure storage area, and allocates first running memory in the secure memory area of the memory for the first trusted execution environment (such as ADAS TEE) with a higher security level, based on the security level and memory requirements defined in the preset configuration file. It also allocates shared second running memory for multiple second trusted execution environments (such as IVI / CLUSTER TEE) with lower security levels. The first management module configures access policies through the hardware firewall unit, physically isolating the first and second running memory to ensure the independence of high-security domain resources. Afterwards, the first management module can also pass the management quota of the second running memory to the second management module running in the secure virtual machine monitoring mode (i.e., S-EL2), which then performs fine-grained virtualization memory allocation within the available resources.
[0056] Step 2021: Start the second management module, and through the second management module, use virtualization technology to generate corresponding virtualized running memory for each second trusted execution environment based on the second running memory.
[0057] For example, after the first management module completes the quota allocation and permission transfer of the second running memory, the second management module, running in secure virtual machine monitoring mode (i.e., S-EL2), is started. This second management module generates virtualized running memory for each second trusted execution environment based on the second running memory. Specifically, the second management module pre-divides physical sub-regions corresponding to each second trusted execution environment within the second running memory. For each second trusted execution environment to be started, the second management module allocates an independent virtual address space starting from address zero, then configures an independent Stage-2 page table to map the intermediate physical addresses of the second trusted execution environment to its dedicated physical sub-region, and configures page table access permissions to prohibit the second trusted execution environment from accessing the physical sub-regions of other second trusted execution environments and the first running memory region. After configuration, the address translation mechanism is activated, ensuring that each second trusted execution environment's access to virtual addresses falls into its own dedicated physical sub-region after two levels of address translation, ultimately generating logically independent virtualized running memory.
[0058] Based on the above embodiments, hierarchical control is achieved through management modules with dual privilege levels of EL3 and S-EL2. The first management module with the highest privilege level is used to achieve hardware-level resource isolation, and the second management module with S-EL2 level is used to achieve virtualization multi-instance management, forming a hierarchical security control architecture. This not only achieves the hard isolation strength of the high-security domain, but also improves the deployment flexibility and resource utilization of the general security domain.
[0059] like Figure 4 As shown above, in the above Figure 3 Based on the illustrated embodiments, the embodiments of this disclosure may further include the following steps: Step 204: Based on the preset configuration file, the first management module allocates the first processor group and the first storage space to the first trusted execution environment, and binds the first trusted execution environment and the first security resource.
[0060] The first security resource includes a first processor group, a first storage space, and a first running memory.
[0061] In some examples, based on the processor core resources required by the first trusted execution environment recorded in the preset configuration file, the first management module can allocate a corresponding number and specification of processors from the available processor cores of the on-chip system as a first processor group. Simultaneously, a dedicated storage area of corresponding size can be allocated from the non-volatile storage space of the on-chip system (e.g., embedded flash memory or general-purpose flash memory) as a first storage space. This, together with the previously allocated first running memory, first processor group, and first storage space, constitutes the first security resource. Access permission rules are configured through a hardware firewall, granting access to the first processor group, first storage space, and allocated first running memory only to the first trusted execution environment, prohibiting other trusted execution environments and rich execution environments from initiating unauthorized access to the first security resource, thereby completing the binding between the first trusted execution environment and the first security resource. In this way, hardware isolation of the first trusted execution environment is achieved from multiple dimensions of computing and storage resources, further ensuring the operational security of high-security-level services.
[0062] For example, taking ADAS TEE as the first trusted execution environment. In the vehicle scenario, the first processor group is shared by ADAS TEE and the intelligent driving domain rich operating system (i.e., ADAS OS). That is, the first processor uses the TrustZone security state switching mechanism to run the ADAS TEE in the safe world and the ADAS OS in the normal world in a time-sharing manner. They share the same set of physical CPU cores, but run in different safe worlds, with context isolation implemented by hardware.
[0063] Step 205: Based on the preset configuration file, the first management module allocates a shared second processor group and second storage space to multiple second trusted execution environments, and binds the multiple second trusted execution environments and second security resources.
[0064] The second security resources include a second processor group, a second storage space, and a second running memory.
[0065] In some embodiments, based on the total required processor core resources of multiple second trusted execution environments recorded in a preset configuration file, a first management module can allocate a corresponding number and specification of core groups from the available processor cores of the on-chip system as a second processor group shared by multiple second trusted execution environments. Simultaneously, a shared storage area of corresponding size can be allocated from the non-volatile memory space of the on-chip system as a second storage space. Then, based on the second processor group, the second storage space, and the previously allocated second running memory, a second security resource is constituted. Access permission rules are then configured through a hardware firewall to allow only entities related to the second trusted execution environments to access the second processor group, the second storage space, and the allocated second running memory, while prohibiting access by unauthorized entities outside the second trusted execution environments, thus completing the binding of multiple second trusted execution environments with the second security resource. This shared resource allocation method can not only meet the operational resource requirements of multiple second trusted execution environments but also further save hardware resources, achieving secure operation in conjunction with virtualization isolation. It should be noted that the second security resource is shared by all second trusted execution environments and their corresponding rich operating systems.
[0066] Step 206: Store the binding relationship between the first trusted execution environment and the first security resource, as well as the binding relationships between multiple second trusted execution environments and second security resources, in the hardware firewall unit.
[0067] In some examples, the binding relationship between trusted execution environments and security resources can be represented in the form of a mapping table. This mapping table can be uniformly generated by a first management module running in security monitoring mode: establishing a first mapping table between a first trusted execution environment and a first security resource, and establishing second mapping tables between corresponding dedicated resources (e.g., dedicated processor cores within a second processor group, dedicated physical sub-regions within second running memory, and dedicated storage partitions within second storage space) in multiple second trusted execution environments and second security resources, and storing these first and second mapping tables in the storage area of the hardware firewall unit. The mapping table can be any hardware-readable configuration table format, and this embodiment of the disclosure does not limit this.
[0068] It should be noted that when processing access requests, the hardware firewall unit can index the corresponding mapping table to verify whether the binding relationship between the access source identity and the target resource matches. If the relationship matches, the request is allowed. The first mapping table can only be modified by the first management module, and the second mapping table can only be read by the first management module and authorized second management modules to ensure that the binding relationship is not tampered with.
[0069] Based on the above embodiments, the first management module allocates dedicated computing, storage, and memory resources of corresponding levels to trusted execution environments with different security levels, and the binding relationship is solidified in the hardware firewall unit, realizing multi-dimensional hardware isolation. Combined with the hierarchical management architecture, the security control capability is further strengthened. The security of the high-security-level trusted execution environment is realized from the full resource dimension of computing and storage, while the resource sharing capability of the low-security-level trusted execution environment is still retained, thus balancing the strength of security protection and the utilization rate of hardware resources.
[0070] like Figure 5 As shown, the system-on-a-chip also supports running multiple rich execution environments; each rich execution environment corresponds one-to-one with a trusted execution environment; in the above... Figure 3 Based on the illustrated embodiments, the embodiments of this disclosure may further include the following steps: Step 207: In response to determining that the current business running in the target rich execution environment among multiple rich execution environments needs to call the target trusted execution environment corresponding to the target rich execution environment, a first request instruction carrying the first identity identifier of the target trusted execution environment is generated and sent.
[0071] The first request instruction is used to request a secure routing identifier that routes to the target trusted execution environment. The secure routing identifier is used to switch the current business in the target trusted execution environment to run in the target trusted execution environment.
[0072] In some examples, the system-on-a-chip supports running multiple Rich Execution Environments (REEs), each corresponding one-to-one with a trusted execution environment. These REEs include an ADAS domain rich operating system, an IVI domain rich operating system, an instrument cluster domain rich operating system, and a vehicle networking domain rich operating system. Specifically, the ADAS domain rich operating system corresponds to the first trusted execution environment (ADAS TEE), the IVI domain rich operating system corresponds to the second trusted execution environment (IVI), the instrument cluster domain rich operating system corresponds to the second trusted execution environment (instrument cluster), and the vehicle networking domain rich operating system corresponds to the second trusted execution environment (vehicle networking). Each REE runs in the normal world, handling general business logic. When sensitive operations are required, a secure routing mechanism invokes the security services of the corresponding trusted execution environment. A pre-established binding relationship is established between each REE and its corresponding trusted execution environment, and this binding relationship is stored in a preset configuration file.
[0073] For example, consider a system-on-a-chip (SoC) integrated with an intelligent driving cockpit. Assume the SoC supports two rich execution environments (REXEs) and two trusted execution environments (TEXEs). The REXEs include an intelligent driving REXE corresponding to the intelligent driving domain and an instrument cluster REXE corresponding to the instrument cluster domain. Each REXE corresponds to a TEXE: the intelligent driving REXE corresponds to the intelligent driving domain TEXE, and the instrument cluster REXE corresponds to the instrument cluster TEXE. The intelligent driving domain TEXE has a higher security level and is designated as the first TEXE. The instrument cluster TEXE has a lower security level and is designated as the second TEXE. That is, the target TEXE can be either the first or the second TEXE.
[0074] In some examples, the aforementioned first identity identifier refers to the unique identity identifier of the target trusted execution environment. Each trusted execution environment corresponds to a unique first identity identifier. For example, the first identity identifier can be a universally unique identifier (UUID), a custom unique serial number, etc., and this disclosure does not limit this. Each TEE instance corresponds to a unique first identity identifier, which can be pre-configured in the configuration file. The aforementioned security routing identifier is a multi-level routing identifier composed of multiple node identifiers.
[0075] In some embodiments, each rich execution environment (REE) can independently run insecure services. When a service requires calling a trusted execution environment to complete security-sensitive operations such as signing and encryption, the target REE running the service will match the corresponding target TEE according to the service type, obtain the first identity identifier of the TEE, and generate a first request instruction carrying the first identity identifier. Subsequently, the target REE sends the first request instruction to the permission routing unit in the first management module through a security monitoring call interface to request the security routing identifier corresponding to the target TEE.
[0076] In some examples, the aforementioned security routing identifier refers to a multi-level routing path identifier from the rich execution environment to the target trusted execution environment. It is composed of the identifiers of the management module nodes at each level on the call path and the target trusted execution environment node, and is used to indicate the complete forwarding path of the security request in the multi-level management architecture. This security routing identifier is used to support the establishment of communication connections between the rich execution environment and the target trusted execution environment.
[0077] For example, suppose a cockpit domain of a certain automotive chip corresponds to a cockpit rich execution environment (REXE), and the target trusted execution environment corresponding to this REXE is the cockpit domain trusted execution environment that carries the cockpit identity authentication service. When a user needs to complete a payment operation on the smart cockpit interface, the payment service process running in the cockpit REXE triggers a user identity authentication request. This identity authentication is a security-sensitive operation and requires calling the corresponding target trusted execution environment to complete encryption verification. Therefore, the cockpit REXE, as the target REXE, will generate a first request instruction carrying the first identity identifier of the cockpit domain trusted execution environment.
[0078] Step 208: In response to the first request instruction, the security routing identifier of the target trusted execution environment corresponding to the first identity identifier is determined by the first management module and / or the second management module based on the pre-stored device tree file.
[0079] In some examples, the system pre-generates and stores a device tree file. This device tree file adopts a tree-like topology structure, recording the hierarchical relationship, identification information, resource information, and routing paths between management modules at each level and the trusted execution environment in the form of nodes. If the target trusted execution environment is the first trusted execution environment, the first management module can directly read the device tree file and match the first identity to obtain the corresponding security route identifier. If the target trusted execution environment is the second trusted execution environment, the first management module can forward the request to the second management module, which then reads the device tree file to match and obtain the corresponding security route identifier.
[0080] In some embodiments, the device tree file can be divided into two levels: it may include a first device file and a second device tree file; wherein, the first device tree file is maintained by a first management module and is used to store the device topology at the EL3 level; the second device tree file is maintained by a second management module and is used to store the device topology at the S-EL2 level. The two levels of device tree files together constitute a complete device tree file topology diagram.
[0081] In some examples, the first management module reads a pre-stored first device tree file, traverses the trusted execution environment nodes within its jurisdiction, and compares the unique identifier of each trusted execution environment node with the first identity identifier. If a match is found, the complete path from the root node to the target node is traced back, and all node identifiers in that path are identified as secure route identifiers, which are then returned to the requester. If the first management module does not find a target node matching the first identity identifier, it forwards the request to the lower-level second management module. The second management module then reads its own maintained second device tree file to complete the matching, generates a local sub-path identifier, and sends it back. The first management module then concatenates the upper-level path identifier with the lower-level sub-path identifier to form a complete multi-level route, which is then returned as the secure route identifier. If neither of the two device tree files matches, a query failure result is returned.
[0082] Step 209: Based on the secure routing identifier, establish a communication connection between the target rich execution environment and the target trusted execution environment, and switch the current business in the target rich execution environment to run in the target trusted execution environment.
[0083] In some examples, after the target rich execution environment (REU) obtains the secure routing identifier, it generates a connection establishment request, encapsulates the secure routing identifier and business parameters into a request command, and then sends the request command to the first management module. The first management module parses the request command, matches the corresponding routing path based on the parsed secure routing identifier, and forwards the request command layer by layer according to the routing path, finally delivering it to the target trusted execution environment. After receiving the connection request, the target trusted execution environment can first verify the legality, source identity, and permissions of the connection request. After the connection request passes verification, a secure communication channel is established between the target trusted execution environment and the rich execution environment. After the connection is established, the target rich execution environment switches the sensitive operation part of the current business to run in the target trusted execution environment: business parameters are sent to the target trusted execution environment through the secure channel, the target trusted execution environment calls internal security services to complete sensitive calculations (such as signing, decryption, authentication, etc.), and after processing, returns the result to the target rich execution environment through the secure channel. After receiving the result, the target rich execution environment continues the subsequent business logic, completing a business call.
[0084] Based on the above embodiments, the topology and identification information of the trusted execution environment are stored in a pre-generated device tree file. The target trusted execution environment is quickly located for business calls in rich execution environments based on the device tree index. This solves the problems of complex addressing paths and difficult routing and forwarding of trusted execution environments under a multi-level management architecture, improves the reliability and security of the secure call process, and improves the call addressing efficiency without introducing excessive query latency.
[0085] like Figure 6As shown above, in the above Figure 5 Based on the illustrated embodiment, step 208 above can be implemented through the following steps: Step 2081: In response to the first request instruction, the matching relationship between the first device tree file and the first identity identifier in the device tree file is determined by the first management module.
[0086] For example, the first device tree file can be stored in a secure memory area dedicated to the first management module. Only EL3 privilege level can read and write to the first device tree file, providing the highest level of integrity protection. The first device tree file adopts a tree structure and can record all secure device nodes within the jurisdiction of the first management module. These secure device nodes include the first trusted execution environment node, the second management module node, etc. Each secure device node contains attribute information, which includes at least one of the following: node name, node identifier, UUID, device type, and status identifier. The node identifier is used for fast addressing; the UUID is a unique identifier for each node; the device type identifies whether the secure device node is a TEE OS type, a management module type, or a device group type; and the status identifier identifies the current status of the device, such as available, unavailable, faulty, not started, etc.
[0087] In some embodiments, after receiving the first request instruction, the first management module extracts the first identity identifier from the first request instruction, traverses all child nodes under the root node of the first device tree file, compares the node identifier stored in each node with the first identity identifier one by one, and determines the matching relationship between the first device tree file and the first identity identifier. This matching relationship refers to whether the first device tree file includes a first node identifier corresponding to the first identity identifier. This matching relationship includes two cases: (1) the first device tree file includes a first node identifier corresponding to the first identity identifier; (2) the first device tree file does not include a first node identifier corresponding to the first identity identifier.
[0088] Step 2082: Based on the matching relationship, determine the security routing identifier of the target trusted execution environment from the first device tree file through the first management module.
[0089] In some embodiments, the first identity identifier is used to identify the target trusted execution environment. When the target trusted execution environment is a first trusted execution environment, the first identity identifier is used to identify the first trusted execution environment, that is, the first device tree file includes a first node identifier corresponding to the first identity identifier; when the target trusted execution environment is a second trusted execution environment, the first identity identifier is used to identify the second trusted execution environment, that is, the first device tree file does not include a first node identifier corresponding to the first identity identifier.
[0090] In some embodiments, step 2082 may specifically include: in response to the matching relationship being that the first device tree file includes a first node identifier corresponding to the first identity identifier for indicating a trusted execution environment, obtaining all node identifiers included in the first path from the root node identifier to the first node identifier from the first device tree file; and determining a secure route identifier based on all node identifiers included in the first path.
[0091] For example, the node identifiers of all nodes in the first device tree file can adopt a preset fixed length, and the node identifiers can be randomly generated or fixedly assigned by the first management module. When generating node identifiers, the encoding rules of hierarchical, type-based, and unique within the same level and group must be followed. It should be noted that, in order to avoid addressing conflicts during routing and forwarding by the management module at this level, the uniqueness of node identifiers of different trusted execution environment instances within the same group must be ensured.
[0092] In some embodiments, when the first device tree file includes a first node identifier corresponding to the first identity identifier for indicating a trusted execution environment, the trusted execution environment indicated by the first node identifier is the first trusted execution environment; a first path from the root node identifier to the first node identifier is determined in the first device tree file, and the first path is traversed to extract all node identifiers included in the first path, and then all node identifiers are determined as secure routing identifiers.
[0093] For example, such as Figure 7 The diagram shows the topology of the complete device tree file, which consists of a first device tree file and a second device tree file. The first device tree file is maintained by EL3 TEE-MM (the first management module), with the root node identified as 0xa000. It contains two sub-nodes: a TEE OS device group node, identified as 0xb000, which has one subordinate hard-isolated TEE instance node: ADAS TEE, identified as 0x8001; and a TEE-MM device group node, identified as 0xb001, which has one subordinate lower-level management module (i.e., the second management module) node: EL2 TEE-MM, identified as 0xa000. The second device tree file is maintained by EL2 TEE-MM (second management module), with the root node identifier being 0xa000. The second device tree file includes a TEE OS device group node, with the node identifier being 0xb000. This TEE OS device group node has three virtualized TEE instance nodes: IVI TEE (node identifier 0x8001), Cluster TEE (node identifier 0x8002), and OTHER TEE (node identifier 0x8003). All node identifiers follow the rule of "unique within the same level and group".
[0094] For example, assuming the target trusted execution environment is ADAS TEE, let's take the UUID of ADAS TEE as the primary identifier. Figure 7 As shown, the first management module traverses the first device tree file and matches the first node identifier 0x8001 corresponding to the UUID. It then obtains all node identifiers included in the first path from the root node identifier to the first node identifier in the first device tree file: root node 0xa000 → first type device group node 0xb000 → ADAS TEE node 0x8001; subsequently, all node identifiers included in the above first path are determined as security route identifiers, i.e., the security route identifiers include: 0xa000, 0xb000, and 0x8001.
[0095] In other embodiments, step 2082 may specifically include: in response to the matching relationship that the first device tree file does not include a node identifier corresponding to the first identity identifier for indicating a trusted execution environment, and the first device tree file includes a second node identifier for indicating a subordinate management module of the first management module, forwarding the first request instruction to the second management module indicated by the second node identifier through the first management module; and querying the second device tree file in the device tree file through the second management module to determine the security routing identifier of the target trusted execution environment corresponding to the first identity identifier.
[0096] For example, the node identifiers of all nodes in the second device tree file can adopt a preset fixed length, and the node identifiers can be randomly generated or fixedly assigned by the second management module. When generating node identifiers, the encoding rules of hierarchical, type-based, and unique within the same level and group must be followed. It should be noted that, in order to avoid addressing conflicts during routing and forwarding by the management module at this level, the uniqueness of node identifiers of different trusted execution environment instances within the same group must be ensured.
[0097] In some embodiments, when the first device tree file does not include a node identifier corresponding to the first identity identifier and used to indicate a trusted execution environment, the system queries whether a second node identifier exists in the first device tree file. This second node identifier corresponds to a second management module. If the second node identifier exists, the first management module forwards the first request instruction to the corresponding second management module, which then reads the second device tree file it maintains and performs the matching process. In other words, the second management module queries the second device tree file to determine the security routing identifier of the target trusted execution environment corresponding to the first identity identifier.
[0098] In some embodiments, after receiving the first request instruction, the second management module extracts the first identity identifier from the first request instruction, traverses all child nodes under the root node of the second device tree file, compares the node identifier stored in each node with the first identity identifier one by one, and determines the matching relationship between the second device tree file and the first identity identifier. This matching relationship refers to whether the second device tree file includes a third node identifier corresponding to the first identity identifier. This matching relationship includes two cases: (1) the second device tree file includes a third node identifier corresponding to the first identity identifier; (2) the second device tree file does not include a third node identifier corresponding to the first identity identifier.
[0099] In other embodiments, if the second management module does not find a matching node identifier in the second device tree file, it can send a message back to the first management module that no matching result was found. The first management module will then return a query failure result to the requester and will not establish a corresponding communication connection.
[0100] In some embodiments, the above-mentioned querying of the second device tree file in the device tree file by the second management module to determine the security routing identifier of the target trusted execution environment corresponding to the first identity may specifically include: in response to the second device tree file including a third node identifier corresponding to the first identity for indicating the trusted execution environment, obtaining all node identifiers included in the second path from the root node identifier to the third node identifier from the second device tree file; and determining the security routing identifier based on all node identifiers included in the second path.
[0101] In some embodiments, the second device tree file includes a third node identifier corresponding to the first identity identifier for indicating a trusted execution environment, wherein the trusted execution environment indicated by the third node identifier is the second trusted execution environment; a second path from the root node identifier (i.e., the second node identifier of the second management module node) to the third node identifier is determined in the second device tree file, and the second path is traversed to extract all node identifiers included in the second path, and all node identifiers are returned to the first management module; the path node identifiers from the root node identifier to the second node identifier in the first device tree are obtained through the first management module, and the path node identifiers and all node identifiers included in the second path are determined as secure routing identifiers.
[0102] For example, assuming the target trusted execution environment is IVI TEE, let's take the UUID of IVI TEE as the first identity identifier. Figure 7As shown, the second management module traverses the second device tree file and matches the third node identifier 0x8001 corresponding to the UUID. It then obtains all node identifiers included in the third path from the second node identifier of the second management module to the third node identifier in the second device tree file: the identifier of the second management module 0xa000 → the first type device group node 0xb000 → the third node identifier of IVITEE 0x8001; and through the first management module, it obtains the path node identifiers from the root node identifier to the second node identifier in the first device tree, including: the root node identifier 0xa000 and the node identifier of the TEE-MM device group node 0xb001; subsequently, 0xa000, 0xb001, 0xa001, 0xb000, and 0x8001 are determined as security route identifiers.
[0103] In other examples, in addition to querying the routing identifier of a single TEE, this embodiment also supports querying the complete path list of all TEEs in the system. The specific process is as follows: steps (1) to (5): (1) REE sends the command "Get all TEE paths" to EL3 TEE-MM.
[0104] (2) EL3 TEE-MM traverses all TEE nodes in the first device tree and generates path identifiers for all first TEEs.
[0105] (3) EL3 TEE-MM sends a forwarding command to S-EL2 TEE-MM to “get all TEE paths”.
[0106] (4) S-EL2 TEE-MM traverses all TEE nodes in the second device tree, generates path identifiers for all second TEEs at this level, and returns them to EL3 TEE-MM.
[0107] (5) EL3 TEE-MM summarizes the two-level paths, obtains the complete route identifier, and returns it to REE in a unified manner.
[0108] Through the above mechanism, all available TEE instances in the system can be enumerated on the REE side, enabling dynamic adaptation and discovery of services.
[0109] Based on the above embodiments, the target trusted execution environment is matched by hierarchical retrieval through the hierarchical maintenance of the device tree file. Each management module only needs to maintain the security node information within its own jurisdiction, without storing the full topology data, which reduces the storage overhead of a single management module. At the same time, the hierarchical traversal matching method eliminates the need for full node retrieval, further improving addressing efficiency and making it more suitable for complex trusted execution environment architectures with multiple cores and multiple security domains, facilitating the flexible expansion of newly added trusted execution environment nodes.
[0110] like Figure 8As shown above, in the above Figure 5 Based on the illustrated embodiment, step 209 can be implemented through steps 2091 and 2092, or through steps 2091 and 2093: Step 2091: Generate and send a second request instruction carrying a secure routing identifier in the target rich execution environment.
[0111] The second request instruction is used to request the establishment of a communication connection with the target trusted execution environment.
[0112] In some examples, after the target trusted execution environment obtains the secure routing identifier, a second request instruction can be generated. This second request instruction includes at least the following information: a command to establish a connection, the secure routing identifier, and the identity identifier of the target trusted execution environment (i.e., the first identity identifier). This second request instruction triggers an exception via a security monitoring call instruction, causing the processor to enter the EL3 privilege level and transferring control of the processor to the first management module.
[0113] Step 2092: In response to the target trusted execution environment being the first trusted execution environment, based on the security routing identifier, the second request instruction is forwarded to the first trusted execution environment indicated by the security routing identifier through the first management module, so that the target trusted execution environment and the first trusted execution environment can establish a communication connection.
[0114] In some examples, the first management module parses the security route identifier in the second request instruction, verifies the path's legality, and confirms that the target trusted execution environment corresponding to the security route identifier is the first trusted execution environment under its jurisdiction. It can also verify the identity and permissions of the requesting target rich execution environment, confirming that it has the authority to call the first trusted execution environment. The second request instruction is then sent to the first trusted execution environment through the inter-process communication mechanism of the secure world. The first trusted execution environment receives the second request instruction, verifies its legality, permissions, and session parameters, and upon successful verification, allocates session resources and establishes shared memory mapping, etc., to establish a communication channel. Finally, the connection establishment result is returned to the target rich execution environment along the original path.
[0115] Step 2093: In response to the target trusted execution environment being the second trusted execution environment, the second request instruction is forwarded to the second management module through the first management module, and based on the security routing identifier, the second request instruction is forwarded to the second trusted execution environment indicated by the security routing identifier through the second management module, so that the target trusted execution environment and the second trusted execution environment establish a communication connection.
[0116] In some examples, the first management module parses the security route identifier in the second request instruction, verifies the path's validity, and confirms that the target trusted execution environment corresponding to the security route identifier is the second trusted execution environment under its jurisdiction. After verifying the request permissions and path validity, the second request instruction is forwarded to the second management module. The second management module parses the security route identifier in the second request instruction, locates the second trusted execution environment, and forwards the second request instruction to the second trusted execution environment. After the second trusted execution environment verifies the second request instruction, it allocates session resources, establishes shared memory mapping, etc., to establish a communication channel. Finally, the connection establishment result is returned to the target trusted execution environment along the original path.
[0117] In other embodiments, after the connection is established, the target rich execution environment can switch the sensitive part of the current business to run in the target trusted execution environment: the business request data is encrypted and written to shared memory, and can be interrupted to notify the target trusted execution environment to process it; the target trusted execution environment calls the corresponding internal security service to perform sensitive operations (such as key signing, biometric comparison, secure storage read and write, payment authentication, etc.), and after processing, the result is encrypted and written back to shared memory, and the target rich execution environment is notified to read it; after receiving the result, the target rich execution environment continues to execute the subsequent business logic, completing a complete secure business call.
[0118] Based on the above embodiments, the corresponding forwarding path can be adopted according to the type of trusted execution environment, and the hierarchical management module can be used to realize the step-by-step verification and forwarding of connection requests, which enhances the security of cross-level communication, while reusing existing secure call channels and reducing the complexity of architecture implementation.
[0119] like Figure 9 As shown above, in the above Figure 5 Based on the illustrated embodiments, the embodiments of this disclosure may further include the following steps: Step 210: Register the first trusted execution environment as a first type of device group based on the configuration file of the first trusted execution environment through the first management module, and register the second management module as a second type of device group based on the configuration file of the second management module.
[0120] In some examples, each security component (including the TEE OS and management module) comes with an independent configuration file, which corresponds one-to-one with the component image. The configuration file uses a structured format and may include fields such as component function and responsibility, unique component identifier, resource quota, startup parameters, and version and signature. During system startup, before loading each security component image, the first management module sequentially reads the configuration files of the first trusted execution environment and the second management module. It parses the configuration file to determine that the component type of the first trusted execution environment is "TEE OS type," registers the first trusted execution environment to the first type of device group, creates a corresponding TEE node in the first device tree file, and fills in attributes such as node identifier, type, and status. It then reads the configuration file of the second management module, parses it to determine that the component type is "management module type," registers the second management module to the second type of device group, creates a corresponding management module node in the first device tree file, and fills in the relevant attributes of the second management module.
[0121] Step 211: Generate a first device tree file based on the first group of node identifiers and the connection relationships between the node identifiers in the first group of node identifiers.
[0122] The first group of node identifiers includes the node identifiers of the first management module, the node identifiers of the second management module, the node identifiers of the first type of device group and the second type of device group, as well as the node identifiers of the first trusted execution environment.
[0123] In some embodiments, after all devices at this level have been registered, a complete topology of the first device tree file is constructed through the first management module. Specifically, a root node is created based on the identifier of the first management module; two types of child nodes are created under the root node: a first type of device group node and a second type of device group node, and node identifiers are assigned to these two types of child nodes respectively; the registered first trusted execution environment node is mounted under the first type of device group node, and the registered second management module node is mounted under the second type of device group node. Finally, complete attribute information is filled into all nodes, and parent-child node association pointers are established to form a complete first device tree file.
[0124] Step 212: Through the second management module, based on the configuration files of each second trusted execution environment, register each second trusted execution environment as a first type of device group.
[0125] In some embodiments, after reading the configuration files of each second trusted execution environment through the second management module, the core attribute information such as the component type, unique identifier, and functional permissions of the second trusted execution environment is parsed out. After confirming that the component type of the second trusted execution environment is "TEE OS type", each second trusted execution environment is registered to the first type device group of this level in sequence, and a corresponding TEE node is created in the second device tree. The node identifier, UUID, type, running status, permission scope and other attribute contents of the node are filled in in sequence.
[0126] Step 213: Generate a second device tree file based on the second group of node identifiers and the connection relationships between the node identifiers in the second group of node identifiers.
[0127] The second set of node identifiers includes the node identifiers of the second management module, the node identifiers of each second trusted execution environment, and the node identifiers of the first type of device group; the device tree file includes the first device tree file and the second device tree file.
[0128] In some embodiments, after all second trusted execution environments are registered, the topology of the second device tree file is constructed through the second management module. Specifically, a node identifier is assigned to the second management module and a root node is created; a first type device group node is created under the root node, and a node identifier is assigned to the first type device group node; all registered second trusted execution environment nodes are sequentially mounted under the first type device group node. Finally, the attribute information of all nodes is populated, and parent-child relationships are established to form a complete second device tree file.
[0129] It should be noted that the device tree file topology is formed by combining the first device tree file and the second device tree file mentioned above.
[0130] Based on the above embodiments, a two-level device tree is generated through hierarchical registration, and the topologies of trusted execution environments with different security levels are maintained separately. This achieves both complete topology queryability and isolation between different management domains, effectively reducing the risk of low-security-level management modules accessing high-security-level device information without authorization, and further improving system security. At the same time, the hierarchical registration design also reduces the storage scale and complexity of a single-level device tree, improves the matching efficiency of a single query, and alleviates the query latency problem when the number of devices increases.
[0131] like Figure 10 As shown above, in the above Figure 5 Based on the illustrated embodiments, the embodiments of this disclosure may further include the following steps: Step 214: In response to the target rich execution environment receiving a system shutdown command or a system restart command, generate and send a prohibition command with a third identifier.
[0132] In some embodiments, when the system needs to be shut down, or when a system version update or upgrade is performed, or when a system malfunction triggers a safe restart mechanism, the target trusted execution environment may receive a system shutdown command or a system restart command. In turn, it can generate and send a prohibition command carrying a third identifier to the first management module. The third identifier is used to identify the target object that needs to be stopped. The target object can be the target trusted execution environment or the second management module.
[0133] For example, the third identifier mentioned above is an identifier used to indicate the target trusted execution environment or the second management module. The target trusted execution environment can be a first trusted execution environment or a second trusted execution environment. The prohibition instruction is an instruction used to instruct the target trusted execution environment to stop running, or an instruction used to instruct the second management module to stop running.
[0134] Step 215: In response to the prohibition command, the target object indicated by the third identifier is destroyed through the first management module, or the status of the target object indicated by the third identifier is updated to unavailable.
[0135] The target object is either the target trusted execution environment or the second management module.
[0136] In some examples, the first management module can determine whether to perform a destruction operation or a status update operation on the target object indicated by the third identifier, based on the type of the prohibition instruction. Specifically, if the prohibition instruction is a system shutdown instruction, the first management module performs a destruction operation on the target object. This destruction operation includes: destroying the address space, processor allocation relationship, and storage space binding information corresponding to the target object, completely releasing all security resources it occupies, and also deleting the corresponding binding relationship stored in the hardware firewall unit. If the prohibition instruction is a system restart instruction, the first management module only updates the status of the target object from available to unavailable, without reclaiming or releasing the allocated resources. This facilitates the direct reuse of existing resource allocation when the target object is subsequently restored and enabled, reducing the overhead of reconfiguration and improving the efficiency of restarting.
[0137] In some embodiments, since the first management module runs in EL3, i.e., in security monitoring mode, the first management module has the highest security privileges. When the target object is a first trusted execution environment directly managed by the first management module, the first management module can perform a destruction operation on the first trusted execution environment or update the status of the first trusted execution environment to unavailable. When the target object is a second management module directly managed by the first management module, the first management module can perform a destruction operation on the second management module or update the status of the second management module to unavailable. When the target object is a second trusted execution environment managed by the second management module, the first management module can forward a prohibition instruction to the second management module, which will then perform a destruction operation on the second trusted execution environment or update the status of the target second trusted execution environment to unavailable.
[0138] Based on the above embodiments, in response to the target rich execution environment receiving a system shutdown command or system restart command, a prohibition command with a third identifier can be generated and sent. In response to the prohibition command, the target object indicated by the third identifier can be destroyed through the first management module, or the status of the target object indicated by the third identifier can be updated to unavailable. Because this scheme can promptly clean up or disable the routing configuration and operating status of the corresponding trusted execution environment or management module during the system shutdown or restart process, it can reduce the probability of old routing information conflicts, abnormal statuses, or resource preemption errors occurring during the next system startup. It can also prevent unauthorized access to residual routing information not destroyed during the shutdown and restart process, further improving system security and startup stability under multiple trusted execution environments.
[0139] Exemplary device Figure 11 This is a schematic diagram of a trusted execution environment (TEX) startup device for a system-on-a-chip (SoC) provided as an exemplary embodiment of the present disclosure. The device can be installed in electronic devices such as terminal devices and servers, or on objects such as vehicles, to execute the TEX startup method for a SoC according to any of the above embodiments of the present disclosure.
[0140] like Figure 11As shown, the device 300 includes: a first processing module 301, configured to, in response to the on-chip system startup, allocate a first running memory of the memory to a first trusted execution environment in the plurality of trusted execution environments based on an acquired preset configuration file, and allocate a second running memory of the memory shared by a plurality of second trusted execution environments in the plurality of trusted execution environments; wherein the first running memory and the second running memory are isolated by the firewall unit; a second processing module 302, configured to generate independent virtualized running memory for each of the second trusted execution environments based on the second running memory; and a first startup module 303, configured to load and start the first trusted execution environment based on the first running memory, and load and start each of the second trusted execution environments based on the plurality of virtualized running memory respectively.
[0141] In one possible implementation, the on-chip system further includes a first management module running in a security monitoring mode and a second management module running in a secure virtual machine monitoring mode; the first processing module 301 is specifically used to: initialize the first management module, and allocate the first running memory to the first trusted execution environment according to the preset configuration file through the first management module, and allocate shared second running memory to the plurality of second trusted execution environments; the first startup module 303 is specifically used to: start the second management module, and through the second management module, use virtualization technology to generate corresponding virtualized running memory for each of the second trusted execution environments based on the second running memory.
[0142] In one possible implementation, the device 300 further includes: a third processing module, configured to allocate a first processor group and a first storage space to the first trusted execution environment based on the preset configuration file and through the first management module, and bind the first trusted execution environment and a first security resource; wherein the first security resource includes the first processor group, the first storage space, and the first running memory; a fourth processing module, configured to allocate a shared second processor group and a second storage space to the plurality of second trusted execution environments based on the preset configuration file and through the first management module, and bind the plurality of second trusted execution environments and the second security resource; wherein the second security resource includes the second processor group, the second storage space, and the second running memory; and a first storage module, configured to store the binding relationship between the first trusted execution environment and the first security resource, and the binding relationship between the plurality of second trusted execution environments and the second security resource, respectively, in the hardware firewall unit.
[0143] In one possible implementation, the system-on-a-chip also supports running multiple rich execution environments; wherein the multiple rich execution environments correspond one-to-one with the multiple trusted execution environments; the device 300 further includes: a fourth processing module, configured to, in response to determining that the current service running in the target rich execution environment among the multiple rich execution environments needs to call the target trusted execution environment corresponding to the target rich execution environment, generate and send a first request instruction carrying a first identity identifier of the target trusted execution environment; wherein the first request instruction is used to request to obtain a secure routing identifier routed to the target trusted execution environment, the secure routing identifier being used to switch the current service in the target rich execution environment to run in the target trusted execution environment; a first determining module, configured to, in response to the first request instruction, determine the secure routing identifier of the target trusted execution environment corresponding to the first identity identifier through the first management module and / or the second management module, based on an acquired pre-stored device tree file; and a communication connection module, configured to, based on the secure routing identifier, establish a communication connection between the target rich execution environment and the target trusted execution environment, and switch the current service in the target rich execution environment to run in the target trusted execution environment.
[0144] In one possible implementation, the first determining module is specifically used to: determine the matching relationship between the first device tree file in the device tree file and the first identity identifier through the first management module; and based on the matching relationship, determine the security routing identifier of the target trusted execution environment from the first device tree file through the first management module.
[0145] In one possible implementation, the first determining module is specifically configured to: in response to the matching relationship being that the first device tree file includes a first node identifier corresponding to the first identity identifier for indicating a trusted execution environment, obtain all node identifiers included in the first path from the root node identifier to the first node identifier from the first device tree file; and determine the security route identifier based on all node identifiers included in the first path.
[0146] In one possible implementation, the first determining module is specifically configured to: respond to the matching relationship that the first device tree file does not include a node identifier corresponding to the first identity identifier for indicating a trusted execution environment, and the first device tree file includes a second node identifier for indicating a subordinate management module of the first management module, forward the first request instruction to the second management module indicated by the second node identifier through the first management module; and query the second device tree file in the device tree file through the second management module to determine the security routing identifier of the target trusted execution environment corresponding to the first identity identifier.
[0147] In one possible implementation, the first determining module is specifically configured to: in response to the second device tree file including a third node identifier corresponding to the first identity identifier for indicating a trusted execution environment, obtain all node identifiers included in the second path from the root node identifier to the third node identifier from the second device tree file; and determine the security route identifier based on all node identifiers included in the second path.
[0148] In one possible implementation, the communication connection module is specifically configured to: generate and send a second request instruction carrying the security routing identifier in the target rich execution environment; wherein the second request instruction is used to request the establishment of a communication connection with the target trusted execution environment; in response to the target trusted execution environment being a first trusted execution environment, based on the security routing identifier, forward the second request instruction to the first trusted execution environment indicated by the security routing identifier through the first management module, so that the target rich execution environment establishes a communication connection with the first trusted execution environment; or, in response to the target trusted execution environment being a second trusted execution environment, forward the second request instruction to the second management module through the first management module, and based on the security routing identifier, forward the second request instruction to the second trusted execution environment indicated by the security routing identifier through the second management module, so that the target rich execution environment establishes a communication connection with the second trusted execution environment.
[0149] In one possible implementation, the device 300 further includes: a first registration module, configured to register the first trusted execution environment as a first type of device group based on the configuration file of the first trusted execution environment through the first management module, and to register the second management module as a second type of device group based on the configuration file of the second management module; a first generation module, configured to generate a first device tree file based on a first group of node identifiers and the connection relationships between the node identifiers in the first group of node identifiers; wherein the first group of node identifiers includes the node identifiers of the first management module, the node identifiers of the second management module, the node identifiers of the first type of device group, the node identifiers of the second type of device group, and the node identifiers of the first trusted execution environment; a second registration module, configured to register each second trusted execution environment as the first type of device group through the second management module based on the configuration files of each second trusted execution environment; a second generation module, configured to generate a second device tree file based on a second group of node identifiers and the connection relationships between the node identifiers in the second group of node identifiers; wherein the second group of node identifiers includes the node identifiers of the second management module, the node identifiers of each second trusted execution environment, and the node identifiers of the first type of device group; wherein the device tree file includes the first device tree file and the second device tree file.
[0150] In one possible implementation, the device 300 further includes: a third generation module, configured to generate and send a prohibition instruction with a third identifier in response to the target trusted execution environment receiving a system shutdown instruction or a system restart instruction; and a fifth processing module, configured to, in response to the prohibition instruction, destroy the target object indicated by the third identifier through the first management module, or update the status of the target object indicated by the third identifier to unavailable; wherein the target object is the target trusted execution environment or the second management module.
[0151] The beneficial technical effects corresponding to the exemplary embodiments of this device can be found in the corresponding beneficial technical effects of the exemplary method section above, and will not be repeated here.
[0152] Exemplary electronic devices Figure 12 A structural diagram of an electronic device provided in an embodiment of this disclosure includes at least one processor 111 and a memory 112.
[0153] The processor 111 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.
[0154] The memory 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may execute one or more computer program instructions to implement the trusted execution environment startup method for a system-on-chip and / or other desired functions of the various embodiments of this disclosure described above.
[0155] In one example, the electronic device 11 may also include an input device 113 and an output device 114, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0156] The input device 113 may also include, for example, a keyboard, a mouse, etc.
[0157] The output device 114 can output various information to the outside, including, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0158] Of course, for the sake of simplicity, Figure 12 Only some of the components of the electronic device 11 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 11 may include any other suitable components depending on the specific application.
[0159] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the trusted execution environment startup method for a system-on-a-chip described in the various embodiments of this disclosure in the "Exemplary Methods" section above.
[0160] Computer program products can be written in any combination of one or more programming languages to perform the operations of embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0161] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the trusted execution environment startup method for a system-on-a-chip described in the various embodiments of this disclosure in the "Exemplary Methods" section above.
[0162] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0163] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0164] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
Claims
1. A method for booting a trusted execution environment for a system-on-a-chip, the system-on-a-chip including a memory and a hardware firewall unit, the method comprising: In response to the on-chip system startup, based on the acquired preset configuration file, a first running memory of the memory is allocated to a first trusted execution environment in a plurality of trusted execution environments, and a second running memory of the shared memory is allocated to a plurality of second trusted execution environments in the plurality of trusted execution environments; wherein, the first running memory and the second running memory are isolated through the firewall unit; Based on the second running memory, independent virtualized running memory is generated for each of the second trusted execution environments; Based on the first running memory, the first trusted execution environment is loaded and started, and based on the multiple virtualized running memory, each of the second trusted execution environments is loaded and started respectively.
2. The method of claim 1, wherein, The system-on-a-chip also includes a first management module running in a security monitoring mode and a second management module running in a secure virtual machine monitoring mode. The method of allocating first running memory of the memory to a first trusted execution environment in the plurality of trusted execution environments, and allocating second running memory of the shared memory to a plurality of second trusted execution environments in the plurality of trusted execution environments, based on the acquired preset configuration file, includes: The first management module is initialized, and according to the preset configuration file, the first management module allocates the first running memory to the first trusted execution environment and allocates the shared second running memory to the multiple second trusted execution environments; The step of generating independent virtualized running memory for each of the second trusted execution environments based on the second running memory includes: The second management module is started, and through the second management module, virtualization technology is used to generate corresponding virtualized running memory for each of the second trusted execution environments based on the second running memory.
3. The method according to claim 2, further comprising: Based on the preset configuration file, the first management module allocates a first processor group and a first storage space to the first trusted execution environment, and binds the first trusted execution environment and a first security resource; wherein, the first security resource includes the first processor group, the first storage space, and the first running memory; Based on the preset configuration file, the first management module allocates a shared second processor group and a second storage space to the plurality of second trusted execution environments, and binds the plurality of second trusted execution environments and the second security resource; wherein, the second security resource includes the second processor group, the second storage space, and the second running memory; The binding relationships between the first trusted execution environment and the first security resource, and the binding relationships between the multiple second trusted execution environments and the second security resources are stored in the hardware firewall unit.
4. The method according to claim 2, wherein the on-chip system further supports running multiple rich execution environments; wherein, The plurality of rich execution environments correspond one-to-one with the plurality of trusted execution environments; the method further includes: In response to the determination that the current service running in the target rich execution environment among the plurality of rich execution environments needs to call the target trusted execution environment corresponding to the target rich execution environment, a first request instruction carrying the first identity identifier of the target trusted execution environment is generated and sent; wherein, the first request instruction is used to request to obtain a security routing identifier that routes to the target trusted execution environment, and the security routing identifier is used to switch the current service in the target rich execution environment to run in the target trusted execution environment; In response to the first request instruction, the first management module and / or the second management module determine the security route identifier of the target trusted execution environment corresponding to the first identity identifier based on the acquired pre-stored device tree file; Based on the secure routing identifier, a communication connection is established between the target rich execution environment and the target trusted execution environment, and the current service in the target rich execution environment is switched to run in the target trusted execution environment.
5. The method according to claim 4, wherein, The step of determining the security route identifier of the target trusted execution environment corresponding to the first identity identifier based on the acquired pre-stored device tree file through the first management module and / or the second management module includes: The first management module determines the matching relationship between the first device tree file in the device tree file and the first identity identifier; Based on the matching relationship, the first management module determines the security route identifier of the target trusted execution environment from the first device tree file.
6. The method according to claim 5, wherein, The step of determining the security route identifier of the target trusted execution environment from the first device tree file based on the matching relationship includes: In response to the matching relationship being that the first device tree file includes a first node identifier corresponding to the first identity identifier for indicating a trusted execution environment, all node identifiers included in the first path from the root node identifier to the first node identifier are obtained from the first device tree file. The security route identifier is determined based on the identifiers of all nodes included in the first path.
7. The method according to claim 5, wherein, The step of determining the security route identifier of the target trusted execution environment from the first device tree file based on the matching relationship includes: In response to the matching relationship that the first device tree file does not include a node identifier corresponding to the first identity identifier for indicating a trusted execution environment, and the first device tree file includes a second node identifier for indicating a lower-level management module of the first management module, the first request instruction is forwarded by the first management module to the second management module indicated by the second node identifier; The second management module queries the second device tree file in the device tree file to determine the security route identifier of the target trusted execution environment corresponding to the first identity identifier.
8. The method according to claim 7, wherein, The step of querying the second device tree file in the device tree file through the second management module to determine the security route identifier of the target trusted execution environment corresponding to the first identity identifier includes: In response to the second device tree file including a third node identifier corresponding to the first identity identifier for indicating a trusted execution environment, all node identifiers included in the second path from the root node identifier to the third node identifier are obtained from the second device tree file; The security route identifier is determined based on the identifiers of all nodes included in the second path.
9. The method according to claim 4, wherein, The step of establishing a communication connection between the target rich execution environment and the target trusted execution environment based on the secure routing identifier, and switching the current service in the target rich execution environment to run in the target trusted execution environment, includes: A second request instruction carrying the secure routing identifier is generated and sent in the target trusted execution environment; wherein, the second request instruction is used to request the establishment of a communication connection with the target trusted execution environment; In response to the target trusted execution environment being a first trusted execution environment, based on the secure routing identifier, the second request instruction is forwarded by the first management module to the first trusted execution environment indicated by the secure routing identifier, so that the target trusted execution environment establishes a communication connection with the first trusted execution environment; or, In response to the target trusted execution environment being the second trusted execution environment, the first management module forwards the second request instruction to the second management module, and based on the security routing identifier, the second management module forwards the second request instruction to the second trusted execution environment indicated by the security routing identifier, so that the target trusted execution environment and the second trusted execution environment establish a communication connection.
10. The method according to claim 4, wherein, The method further includes: The first management module registers the first trusted execution environment as a first type of device group based on the configuration file of the first trusted execution environment, and registers the second management module as a second type of device group based on the configuration file of the second management module. A first device tree file is generated based on the first group of node identifiers and the connection relationships between the node identifiers in the first group of node identifiers; wherein, the first group of node identifiers includes the node identifiers of the first management module, the node identifiers of the second management module, the node identifiers of the first type of device group and the node identifiers of the second type of device group, and the node identifiers of the first trusted execution environment; The second management module registers each second trusted execution environment as the first type of device group based on the configuration file of each second trusted execution environment. A second device tree file is generated based on the second group of node identifiers and the connection relationships between the node identifiers in the second group of node identifiers; wherein, the second group of node identifiers includes the node identifiers of the second management module, the node identifiers of each of the second trusted execution environments, and the node identifiers of the first type of device group; The device tree file includes the first device tree file and the second device tree file.
11. The method according to claim 4, further comprising: In response to the target rich execution environment receiving a system shutdown command or a system restart command, a prohibition command with a third identifier is generated and sent. In response to the prohibition instruction, the first management module destroys the target object indicated by the third identifier, or updates the status of the target object indicated by the third identifier to unavailable; wherein, the target object is the target trusted execution environment or the second management module.
12. A trusted execution environment boot device for a system-on-a-chip, the system-on-a-chip including a memory and a hardware firewall unit, comprising: A first processing module is configured to, in response to the startup of the on-chip system, allocate a first running memory of the memory to a first trusted execution environment in the plurality of trusted execution environments based on an acquired preset configuration file, and allocate a second running memory of the shared memory to a plurality of second trusted execution environments in the plurality of trusted execution environments; wherein the first running memory and the second running memory are isolated through the firewall unit; The second processing module is used to generate independent virtualized running memory for each of the second trusted execution environments based on the second running memory; The first startup module is used to load and start the first trusted execution environment based on the first running memory, and to load and start each of the second trusted execution environments based on the multiple virtualized running memory environments respectively.
13. A computer-readable storage medium storing a computer program for executing the Trusted Execution Environment startup method for a system-on-a-chip according to any one of claims 1-11.
14. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the trusted execution environment startup method for a system-on-chip as described in any one of claims 1-11.
