Method and equipment for executing FPGA (Field Programmable Gate Array) task in confidential computing architecture

By introducing the transmission task module and FPGA protection module into the Arm confidential computing architecture, using the root monitor to create stub tasks in the non-secure world and creating real tasks in the domain world, the problem of FPGA task execution security in the Arm CCA architecture is solved , achieving the compatibility and security of FPGA confidential computing.

CN118779100AActive Publication Date: 2024-10-15SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410819705.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-15
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The existing Arm confidential computing architecture is difficult to provide effective confidential computing protection on FPGA, resulting in security challenges in FPGA task execution and cannot be directly compatible with Arm CCA system design.

Method used

By introducing the transmission task module and FPGA protection module, the root monitor is used to create stub tasks without real data in the non-secure world, and real tasks are created in the domain world. The granular protection table is used to provide an isolated execution environment, making the FPGA based on The transfer descriptor reads confidential data through DMA transfer to perform tasks.

Benefits of technology

It implements FPGA confidential computing in the Arm confidential computing architecture, provides a secure execution environment, avoids direct data access of FPGA tasks in the non-secure world, and enhances data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779100A_ABST
    Figure CN118779100A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and equipment for executing an FPGA task in a confidential computing architecture. The method comprises the following steps: firstly, configuring a pile data structure of an FPGA task in a non-secure world section of a memory by FPGA software of a non-secure world; then, a root monitor in the root world configures a real data structure corresponding to the stub data structure in a first section, corresponding to the first domain, in the memory, and the real data structure comprises a domain cache region and a transmission descriptor; the domain cache region is used for storing confidential data to be processed; the transmission descriptor is used for describing data to be subjected to DMA transmission. Next, the root monitor sets a first GPT table for the CPU and a second GPT table for the FPGA, such that in the first GPT table, the FPGA memory map MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment. Therefore, the root monitor interacts with the FPGA through the FPGA MMIO, so that the FPGA reads the confidential data through DMA transmission based on the transmission descriptor, and the FPGA task is executed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to a confidential computing framework, and more particularly, to a method and apparatus for executing FPGA tasks in a confidential computing framework. Background Art

[0002] With the development of computing technology in various industries and the increase in cloud and end users, people store a large amount of data in various computer devices. As the industry develops, people's attention to the security of equipment and data is also increasing. In order to ensure the security of equipment and data, various architecture manufacturers have also proposed their own solutions, such as ARM's TrustZone technology, AMD's Secure Virtual Machine Encryption Technology (SEV), Intel's Software Guard Extension (SGX) technology, and so on. These solutions provide users with a secure trusted execution environment for confidentially storing and processing data, protecting it from untrusted kernels and traditional applications. Taking Arm's TrustZone technology as an example, it regards the operating environment of traditional kernels and applications as a non-secure world, creates an isolated secure world, and defines a security layer with the highest authority for world switching. The non-secure world will not be able to directly access the secure world, and needs to be verified by the firmware of the security layer to access specific resources.

[0003] Although the ARM confidential computing architecture effectively ensures the data security of users, it still has some shortcomings, one of which is that it cannot provide support for confidential computing on dedicated accelerators such as FPGAs. This makes the use of FPGAs for task acceleration under this technical framework a great security challenge, and there is a need for improvement. Summary of the invention

[0004] One or more embodiments of this specification describe a method and device for executing FPGA tasks in a confidential computing architecture, which can provide a confidential computing environment for the execution of FPGA tasks and support FPGA confidential computing based on the hardware characteristics of the existing confidential computing architecture.

[0005] According to a first aspect, a method for executing an FPGA task in a confidential computing architecture is provided, wherein the confidential computing architecture includes a secure world, a domain world, a non-secure world, and a root world; the method includes:

[0006] The FPGA software in the non-secure world configures the stub data structure of the FPGA task in the non-secure world section of the memory according to the data requirement information of the FPGA, including the data buffer area;

[0007] The root monitor in the root world configures a real data structure corresponding to the stub data structure in a first section corresponding to the first domain in the memory, including a domain buffer corresponding to the data buffer and a transfer descriptor; the domain buffer is used to store confidential data to be processed; the transfer descriptor is used to describe data to be transferred by direct memory access (DMA);

[0008] The root monitor sets a granular protection table GPT, which includes a first GPT table for the CPU and a second GPT table for the FPGA, so that in the first GPT table, the FPGA memory mapping MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment;

[0009] The root monitor interacts with the FPGA through the FPGA MMIO, so that the FPGA reads the confidential data through DMA transmission based on the transmission descriptor and executes the FPGA task.

[0010] According to a second aspect, a root monitor in a confidential computing architecture is provided, the confidential computing architecture comprising a secure world, a domain world, a non-secure world and a root world; the root monitor is located in the root world and comprises a transmission task module and an FPGA protection module, wherein:

[0011] The transmission task module is configured to configure the pile data structure of the FPGA task in the non-secure world section of the memory in response to the FPGA software of the non-secure world according to the data demand information of the FPGA, and configure the real data structure corresponding to the pile data structure in the first section of the memory corresponding to the first domain, wherein the pile data structure includes a data buffer area; the real data structure includes a domain buffer area corresponding to the data buffer area, and a transmission descriptor; the domain buffer area is used to store confidential data to be processed; the transmission descriptor is used to describe data to be transmitted by direct memory access DMA;

[0012] The FPGA protection module is configured to set a granularity protection table GPT, including a first GPT table for the CPU and a second GPT table for the FPGA, so that in the first GPT table, the FPGA memory mapping MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment; interact with the FPGA through the FPGA MMIO, so that the FPGA reads the confidential data through DMA transmission based on the transfer descriptor and executes the FPGA task.

[0013] According to a third aspect, a computing device is provided, comprising a memory and several processors, wherein the computing device forms a confidential computing architecture, wherein the confidential computing architecture comprises a secure world, a domain world, a non-secure world and a root world; the root world comprises a root monitor as described in the second aspect.

[0014] In the solution provided in the embodiments of this specification, FPGA confidential computing compatible with the Arm confidential computing architecture CCA is implemented through transmission tasks. According to the transmission task mechanism, a stub task that does not contain real data is created by the FPGA software in the non-secure world, and the stub task is scheduled and managed like a regular process. After the stub task is submitted, the root monitor creates a data structure of a real FPGA task containing real data in the domain world segment, including a domain cache area for storing confidential data, and a transmission descriptor for describing data to be DMA-transferred. The root monitor also provides an isolated execution environment for the real FPGA task through the setting of the GPT table. As a result, the FPGA reads confidential data through DMA transmission based on the transmission descriptor and executes the FPGA task. In this way, FPGA confidential computing is implemented in the Arm confidential computing architecture CCA. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0016] Figure 1 A schematic diagram showing the Arm confidential computing architecture;

[0017] Figure 2 Shows the access control of each world to the physical address space in the confidential computing architecture;

[0018] Figure 3 A schematic diagram showing running an FPGA task in a confidential computing architecture according to one embodiment;

[0019] Figure 4 A method for executing FPGA tasks in a confidential computing architecture according to one embodiment is shown;

[0020] Figure 5 A schematic diagram showing a plurality of transmission descriptors according to one embodiment;

[0021] Figure 6 Shown in an example scenario is a GPT table maintained by a root monitor. DETAILED DESCRIPTION

[0022] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0023] To ensure data security, ARM provides TrustZone technology, in which the operating environment of the traditional kernel and application is regarded as a non-secure world (Normal World), an isolated secure world (Secure World) is created outside of it, and a security layer with the highest authority is defined for world switching.

[0024] Specifically, in the Armv8-A architecture, the CPU core divides exceptions into four levels based on privilege division, EL0 to EL3, where EL0 represents the application level, EL1 is used for the system kernel (kernal), EL2 represents the virtual machine manager (hypervisor), and EL3 represents the security layer monitor. These four levels can also be used to represent the permission level of the operating environment. In the TrustZone trusted zone technology, the CPU security state is divided into a non-secure (Normal) state and a secure state. EL0 and EL1 can run in any state. For example, an untrusted operating system OS (untrusted OS) can be executed in EL1 in the non-secure world, and a trusted OS can be executed in EL1 in the secure world. EL2 can be used in a secure state. EL3 is the security layer monitor, which always exists in the secure world and is used to execute the switching of the security state.

[0025] Under this architecture, the non-secure world cannot directly access the secure world and needs to be verified by the security layer monitor to access specific resources. Sensitive or confidential data and high-privilege software applications run in the secure world, thus providing a trusted execution environment TEE for these confidential data.

[0026] Based on the above TrustZone infrastructure, ARM recently released the improved Arm confidential computing architecture CCA (Confident ia l Compute Architecture itecture). The Arm confidential computing architecture is part of the Armv9-A architecture. It introduces the domain management extension based on the original TrustZone architecture. In addition to the non-secure world and secure world that already exist in the trusted zone technology, this extension introduces the domain world and the root world. In order to support the isolation of different worlds, the CCA architecture provides the Realm Management Extension RME (Realm Management Extension) component at the hardware layer to expand the isolation mode.

[0027] Figure 1 Figure 1 shows a schematic diagram of the Arm confidential computing architecture. Figure 1As shown in the figure, in the Arm confidential computing organization CCA, the operating environment is divided into four worlds: secure world, non-secure world (Normal), domain world and root world. The root world monitor with the highest authority runs in the root world and is responsible for the isolation and communication between worlds. The domain world is used to provide a protected virtual machine confidential computing environment called confidential domain for virtual machines. The domain management monitor RMM runs in the domain world and is responsible for managing the execution of domain virtual machines and the interaction with the non-secure world. Users can put virtual machines into the confidential domain as domain virtual machines to isolate illegal access from external software. Specifically, users can create virtual machines through the virtual machine manager in the non-secure world, and transfer them to the domain world through the domain management monitor RMM to become domain virtual machines. The domain management monitor RMM will be responsible for the inspection and protection related to the security of the confidential domain. Domain virtual machines are isolated from each other using virtualization technology, and the domain management monitor will be responsible for managing the accessible address space of virtual machines in different domains. Domain virtual machines do not need to trust the non-secure world and the secure world, but only need to trust the domain management monitor and the root world monitor.

[0028] Correspondingly, the Arm confidential computing architecture CCA also divides the physical address space PAS (Phys ica l addressspaces) of the memory into four worlds. Figure 2 The figure shows the access control of the physical address space by the security status of each world in the confidential computing architecture. Figure 2 As shown, the root world has the highest access rights and can access the address spaces of all four worlds. The non-secure world has the lowest access rights and can only access the address spaces of the non-secure world. The secure world and the domain world can access the address spaces of the non-secure world and their own worlds.

[0029] In the Arm confidential computing architecture, address space access control of different worlds is achieved by constructing a granular protection table GPT (Granu le Protection Table le) and performing a granular protection check GPC (Granu le Protection Check) based on the GPT table. Specifically, the confidential computing architecture CCA maintains a granular protection table GPT in memory, which records the security status of each segment of physical memory in fine granularity. Typically, the granularity of the record is in units of memory pages (4KB segments). In this way, the security status and access rights of each memory page are recorded in the GPT table. When the allocation of memory pages migrates and changes in different worlds, the entries in the GPT can be dynamically updated.

[0030] When the processor accesses the memory, the aforementioned RME component in the hardware layer performs a granular protection check GPC. During the check, the security status of the current CPU is obtained, and the security status of the memory page requested to be accessed is obtained by reading the GPT table, and a check is made to see if the two match. If the GPC check fails (for example, if the host OS of the non-secure world requests to access the memory of the domain world), a granular protection exception signal is issued, thereby denying the memory access and ensuring isolation between the worlds. Through the above isolation mechanism, the Arm confidential computing architecture further provides an isolated confidential computing environment for the domain virtual machines of the domain world.

[0031] On the other hand, many tasks hope to be accelerated by dedicated accelerators, among which FPGA is a hardware used to accelerate task execution. FPGA (Field Programmable Gate Array) is a programmable hardware circuit structure that can build circuit logic and execute specific computing instructions through languages ​​such as Veri log. FPGA has demonstrated its acceleration performance in the fields of neural network acceleration computing and industrial control, and has gradually attracted the attention of cloud providers to expand its application.

[0032] However, the existing Arm computing framework has difficulty in providing effective confidentiality protection for FPGA computing tasks. This is partly because the Arm computing framework treats FPGAs as ordinary, untrusted peripherals. Although FPGAs have their own proprietary on-chip memory, they still need to interact with host memory. During the interaction, FPGAs need to access host memory together with the CPU and many untrusted peripherals, making them vulnerable to attacks. On the other hand, according to the workflow of most current ARM devices, FPGA task execution and scheduling are managed by FPGA software (such as FPGA drivers and related programming software libraries). However, this FPGA software is in a non-secure world and is vulnerable to attacks.

[0033] Specifically, FPGA software is used to manage the computing environment of FPGA and interact with FPGA hardware. In the normal process, in order to prepare the execution environment, FPGA software allocates physical memory according to task requirements, loads the data to be processed into the host memory, and uses FPGA memory mapping MMIO to enable FPGA hardware to access the data in the host memory via direct memory access DMA to execute FPGA tasks.

[0034] Assume that a strong adversary controls the entire software stack of the non-secure world and the secure world, including FPGA software, untrusted OS, hypervisor, and software at the same level in the secure world. The adversary wants to spy on or even tamper with the confidential data of the FPGA task, including the input data, intermediate data, or execution results of the task. Then, the adversary may access the host memory, read the confidential data stored therein, or control the peripherals capable of DMA to read the above memory data, thereby launching an attack.

[0035] At present, some confidentiality protection schemes have been designed for GPU accelerators. However, due to differences in hardware design, the workflows of GPU and FPGA accelerators are different, so it is impossible to directly migrate confidential computing schemes for GPU to FPGA-accelerated systems. In a recent study on Arm CCA, a confidential accelerated computing system compatible with GPU and FPGA was proposed. Although the system ensures the security of FPGA computing, it does not conform well to the system design of Arm CCA: it relies on a relatively large accelerator software stack to manage accelerated computing, which greatly increases the trusted computing base of confidential virtual machines and requires a lot of changes to the FPGA software stack. In addition, some researchers also use non-Arm security hardware or traditional Arm security hardware (such as StrongBox system, which relies on Arm TrustZone; Cronus system, which relies on Arm secure virtualization, etc.) to build confidential accelerated computing systems. However, such systems are not directly compatible with the system design based on Arm CCA, and traditional Arm security hardware is no longer fully trusted in Arm CCA, resulting in reduced system security. In addition, some researchers have proposed building defense mechanisms inside FPGA accelerators, such as building encryption engines and remote authentication modules inside FPGAs. However, such designs require modifying the accelerator hardware, resulting in reduced hardware compatibility.

[0036] Therefore, overall, for the Arm CCA architecture, how to provide confidential computing protection for the task execution of FPGA accelerators remains a challenge.

[0037] In view of this, a solution is proposed in the embodiments of this specification, which provides security protection for FPGA computing tasks based on the hardware characteristics of the Arm confidential computing architecture CCA without affecting the original functional design of the Arm CCA architecture, thereby supporting confidential computing on the FPGA.

[0038] Figure 3 A schematic diagram illustrating running FPGA tasks in a confidential computing architecture according to one embodiment. Figure 3The system architecture shown complies with the Arm confidential computing architecture CCA, in which a host runs in the non-secure world, and the host includes FPGA drivers (such as XDMA) and other peripheral drivers. The virtual machine manager hypervisor creates several confidential computing "domains" and manages and schedules them. In the domain world newly introduced by the confidential computing architecture CCA, the domain management monitor RMM is deployed to achieve memory isolation of different "domains". The root world deploys a root monitor with the highest authority to manage isolation and switching between worlds, and provide security authentication mechanisms such as key management and remote verification. The root monitor can be implemented in the form of secure firmware.

[0039] In the above CCA architecture, the domain management monitor RMM and the root world of the domain world are considered to be fully trusted. This is because the memory and code required by these components are very small, so the exposed attack surface is small and not easily vulnerable. In addition, other components are considered untrusted, including the software of the secure world.

[0040] In the scheme of the embodiments of this specification, in order to realize FPGA confidential computing, several additional components are introduced into the root monitor of the root world: a transmission task module, an FPGA protection module and a domain security module. Among them, the transmission task module is used to create a real task in the domain memory for the transmission task that does not contain real data created for the FPGA in the non-secure memory; the FPGA protection module is used to protect the FPGA operating environment from attacks, and the domain security module is used to build the domain, transmit confidential data and authenticate FPGA hardware. In addition, in the scheme of this embodiment, the FPGA software (including FPGA driver and related function libraries) still runs on the host side of the non-secure world, but a small amount of modification is required to assist in completing the transmission task.

[0041] The purpose of the transfer task is to make the FPGA workflow compatible with the mechanism introduced by the Arm confidential computing architecture. The core idea is to allow the FPGA software on the host to create and manage FPGA tasks (also called stub tasks) corresponding to the domain in the non-secure world, including allocating memory, creating buffers, scheduling and submitting tasks, etc. These stub tasks, such as Figure 3The FPGA task 1 corresponding to domain 1 and the FPGA task 2 corresponding to domain 2 have data structures similar to those of ordinary FPGA tasks, for example, they contain the required data buffers, but the data buffers of these stub tasks do not contain the real data to be processed, and at most provide descriptions of these data buffers. Correspondingly, the data structure of the corresponding real FPGA task is constructed in the corresponding domain. The FPGA software can submit these stub tasks as usual. What is different from the norm is that when it is submitted, the root monitor located in the root world replaces the stub tasks with the real FPGA tasks in the corresponding domain. The real FPGA task has a data structure similar to that of the stub task, but it is filled with real confidential data to be processed. In addition, according to the execution characteristics of the FPGA, in the corresponding domain, the data descriptors required for the FPGA to perform direct memory access DMA are created and maintained ( Figure 3 Thus, under the control of the root monitor, the FPGA reads the confidential data stored in the domain according to the transfer descriptor in the corresponding domain and executes the operation logic in the FPGA. In this process, the corresponding GPT table is provided by the FPGA protection module to ensure the isolation of the execution environment. Therefore, the solution of this embodiment allows the non-secure world to schedule and manage FPGA tasks from different domains without accessing the real confidential data, which is in line with the concept of the Arm confidential computing architecture.

[0042] The following describes the process of scheduling and executing FPGA computing tasks and providing a confidential isolation environment for them through the task transmission mechanism in conjunction with a single FPGA task.

[0043] Figure 4 A method for executing FPGA tasks in a confidential computing architecture according to one embodiment is shown; it can be understood that Figure 4 The method in Figure 3 The confidential computing architecture shown is implemented.

[0044] First, in the initialization or preparation phase, the user can apply for a domain for an FPGA and pass the real data that needs to be processed by the FPGA task into it through an encrypted channel. Here, the domain can be created by Figure 3The domain security module shown is performed. Specifically, the domain security module can create a virtual machine through hypervisor according to the user's request, and deploy it to the domain world as a confidential domain by interacting with the domain management monitor RMM. For the convenience of description (and to distinguish it from other specific domains when necessary), the domain applied for by the user is referred to as the first domain below. After creating the first domain, the user can negotiate a key with the first domain to establish a secure channel. Specifically, the user can exchange keys with the first domain through the DH (Diffie-Hellman) protocol, the DH protocol based on elliptic curves, or various other protocols, thereby negotiating an encryption key. Therefore, based on the negotiated key, the two can establish a secure encryption channel. Through this secure encryption channel, the first domain can receive confidential data transmitted by the user and store it in the domain world.

[0045] Unlike GPUs that use task codes to indicate computing logic, the execution logic of FPGAs has been solidified in the hardware circuit by the designer through programming. In other words, after the design is completed, the FPGA has a fixed execution logic. Usually, the designed FPGA has a corresponding description file, which records the functional logic of the FPGA, the exposed interfaces, the input / output data corresponding to the interfaces, etc. Through this description file, the data requirement information of the FPGA task can be determined.

[0046] In one embodiment, after the above-mentioned first domain is created, the description file corresponding to the FPGA is recorded in the first domain. When the FPGA task needs to be executed, the first domain can provide data requirement information to the FPGA software in the host side of the non-secure world according to the description file, including target transmission data, data length, data type, etc. In order to prevent the FPGA software from being tampered with after being attacked, in one embodiment, the first domain also provides signature information, that is, the data requirement information is signed and the signature is attached to the data requirement information. In other embodiments, the FPGA software can also obtain the data requirement information of the FPGA task by other means, such as provided by the user to the FPGA software, or read the above-mentioned description file at a specified storage location according to the user's instructions to obtain the data requirement information.

[0047] According to the above initialization phase, the first domain obtains the confidential data / real data provided by the user and stores it in the protected domain world. The host obtains the data requirement information of the FPGA task and stores it in the unprotected area corresponding to the non-secure world.

[0048] On this basis, the FPGA software in the host side of the non-secure world can create a transmission task based on the data demand information. As mentioned above, the FPGA software mainly includes FPGA driver software, such as the XDMA driver using Xilinx, and some related function libraries, such as the user layer runtime function library. The FPGA software has been modified to create a stub task in the non-secure world based on the transmission task mechanism.

[0049] Specifically, Figure 4 As shown in step S41, the FPGA software of the non-secure world configures the stub data structure of the FPGA task in the non-secure world section of the memory according to the data requirement information of the FPGA, including the data cache area.

[0050] Specifically, the FPGA software can create a transmission task and configure the stub data structure accordingly. As mentioned above, the data requirement information indicates the data information required by the FPGA task to process data, including the number, size, and fill data of the data buffer. Based on such data requirement information, the FPGA software can allocate corresponding memory space in the non-secure world segment of the memory, and create several stub data buffers that meet the requirements of the data requirement information.

[0051] In some embodiments, the data requirement information may require the creation of multiple data buffers, for example, one of which is used to store input data and another is used to store execution results. Optionally, sometimes the data requirement information may also indicate the creation of a data buffer for storing intermediate results. The FPGA software allocates these data buffers as pile data buffers according to the requirements of the data requirement information. However, unlike conventional processing, the FPGA only creates a pile data structure according to the data requirement information, but does not fill the pile data buffer with real data.

[0052] Since it is not necessary to store real data in these pile data buffers, in one embodiment, when creating the pile data buffer, it can be created only according to the requirements of the number of buffers and data types in the data demand information, and not according to the size of the demand data. In addition, the created pile data buffer can only store data description information.

[0053] It should be noted that when the FPGA hardware executes a task, it interacts with the host memory through DMA. In this process, the FPGA usually uses a descriptor to perform DMA operations. A descriptor is a data structure that contains the information required for a DMA transfer, such as the source address, destination address, transfer size, etc. For this reason, when the FPGA software creates a stub task, it usually creates or loads a descriptor in the above-mentioned non-safe section according to the driver file. However, as mentioned above, the stub data structure does not store real data, so the descriptor loaded here is only used for alignment and compliance with the regular processing flow of the FPGA software, which does not reflect the storage information of the real data, so the descriptor loaded at this time can also be called a stub descriptor.

[0054] Optionally, some FPGAs may require the creation of a page table required for performing the task, i.e., an FPGA page table. In such a case, the FPGA software also generates an FPGA page table for performing the transmission task according to the allocated memory, which can be referred to as a pile page table. The mapping of the virtual address and the physical address of the memory during the FPGA task execution is recorded in the page table. Initially, the FPGA memory mapping MMIO (Memory-Mapped I nput / Output) is configured to point to the pile page table. Specifically, through the FPGA memory mapping MMIO, the register storing the page table base address in the FPGA hardware is mapped to the memory address storing the pile page table, thereby pointing to the pile page table.

[0055] In this way, the FPGA software creates a transmission task and configures a pile data structure for it. In a specific example, in the memory segment of the non-secure world, the FPGA software allocates data buffer 1 and data buffer 2, where data buffers 1 and 2 can only store corresponding data descriptions without storing real data. In addition, the FPGA software also loads a pile descriptor and generates a pile page table.

[0056] As you can see, the process of creating a transfer task is similar to the process of creating a regular task, except that real data is not filled into the data cache. Therefore, the created transfer task is an "empty shell" task without real data, but has the same data structure as a real task, and can be managed and scheduled.

[0057] Therefore, after creating the above transfer task, the FPGA software inserts it into the FPGA task queue as usual, arranges the execution order of the task, and submits the transfer task to the FPGA hardware via the root monitor. Specifically, when submitting the task, the FPGA software can call the smc (secure monitor call) instruction, which can be captured by the root world firmware. After the call, the CPU will enter the root world to execute the code.

[0058] When the root monitor captures the above instructions, it will create a real task in the domain world, that is, execute Figure 4 Step S42. In this step, the root monitor configures a real data structure corresponding to the pile data structure, namely, a domain data structure, in the first segment corresponding to the first domain in the memory; the domain data structure includes a domain cache area corresponding to the data cache area, and a newly created transfer descriptor. The domain cache area is used to store real confidential data, and the transfer descriptor is used to describe the storage information of the real data to be DMA transferred. The root monitor stores the confidential data to be processed in the above-mentioned domain cache area, or temporarily leaves it empty (for example, a domain cache area used to store results).

[0059] Specifically, the root monitor can copy the data requirement information and verify its correctness through a signature. After verifying its correctness, a data structure of a real FPGA task can be created in the first section corresponding to the first domain according to the data requirement information, including a domain buffer corresponding to the data buffer in the pile data structure. The root monitor stores the real confidential data in the corresponding domain buffer according to the data requirement information. In addition, the root monitor reconstructs a descriptor, called a transmission descriptor, according to the storage information of the real data in the domain buffer. In one embodiment, the transmission descriptor constructed in the first domain includes at least the following information: the starting address (Src_adr), the destination address (Dst_adr), the length (Len), etc. of the data to be transmitted.

[0060] Further, as known to those skilled in the art, the FPGA hardware can establish a data channel with the host to perform direct memory access DMA. Different FPGA hardware can establish such a data channel through different specific implementations. In terms of data transmission direction, the above data channel can be divided into a C2H channel (Card to Host, a channel for storing data from the FPGA to the host), and a H2C channel (Host to Card, a channel for loading data from the host to the FPGA). The two channels correspond to different data transmission directions. Accordingly, for such a situation, in one embodiment, the transmission descriptor created in the first field can also include data channel information (channel ID) corresponding to the buffer area in the field where the data is located.

[0061] In one embodiment, the memory length required for storing data description information is small (i.e., the buffer area in the pile data structure can be very small), while the memory length of the data actually required for transmission by a DMA request may be large, and all data cannot be completely imported into the FPGA through a single transmission. To this end, in one embodiment, the root monitor calculates the total number of transmissions required based on the total data requirement length in the data requirement information and the data length that can be imported into the FPGA by a single transmission, and then constructs multiple transmission descriptors in the first domain section and connects them in a linked list form. Specifically, the transmission descriptor includes an Nxt_adr attribute field for storing the starting address of the next transmission descriptor. Optionally, it can also include an Nxt_adj attribute field for storing the remaining number of transmissions. When constructing multiple transmission descriptors, the root monitor writes the starting address of the next transmission descriptor into the Nxt_adr attribute of the current transmission descriptor, and fills the remaining number of transmissions into the Nxt_adj attribute, so as to form a linked list structure.

[0062] Figure 5 FIG. 1 is a schematic diagram showing a plurality of transmission descriptors according to an embodiment. Figure 5 As shown, it is assumed that two buffers (i.e., domain caches) are created in the first domain segment, where buf1 is used to store input data and has a size of 0x3000. buf2 is used to store output data and has a size of 0x2000. At the same time, the FPGA has an on-chip hardware memory M.

[0063] In one example, in order to execute the FPGA task, two DMA requests need to be initiated. The first request uses the H2C data channel to load the data in buf1 to the FPGA. The second request uses the C2H data channel to store the data in the FPGA on-chip memory in buf2.

[0064] Assume that the data in buf1 is too long to be imported into the FPGA in one transmission. Therefore, in H2C transmission, Figure 5 As shown, three descriptors desc0-1, desc0-2 and desc0-3 are prepared.

[0065] Specifically, the starting address src_adr in desc0-1 points to address A of buf1, the destination address dst_adr points to address B of FPGA hardware memory M, the data length size can be 0x1000, and the nxt_adr field points to the address of desc0-2.

[0066] In desc0-2, the starting address src_adr points to the address A+0x1000 of buf1, the destination address dst_adr points to the address B+0x1000 of the FPGA hardware memory M, the data length size is 0x1000, and the nxt_adr field points to the address of desc0-3.

[0067] In Desc0-3, the starting address src_adr points to the address A+0x2000 of buf1, the destination address dst_adr points to the address B+0x2000 of the FPGA hardware memory M, the data length size is 0x1000, and the nxt_adr field is set to 0, indicating that there is no subsequent transmission.

[0068] In this way, through the three serially connected descriptors desc0-1, desc0-2 and desc0-3, the data in buf1 can be loaded into the FPGA for one H2C DMA transfer request.

[0069] Similarly, for C2H transmission, two descriptors desc1-1 and desc1-2 may be prepared.

[0070] The starting address src_adr in desc1-1 points to the address C of the FPGA hardware memory M, the destination address dst_adr points to the address D of buf2, the data length size is 0x1000, and the nxt_adr field is set to the address of desc1-2.

[0071] In desc1-2, the starting address src_adr points to the address C+0x1000 of the FPGA hardware memory M, the destination address dst_adr points to the address D+0x1000 of buf2, the data length size is 0x1000, and the nxt_adr field is set to 0, indicating that there is no subsequent transmission.

[0072] In this way, through the two serially connected descriptors desc1-1 and desc1-2, the data in the FPGA can be stored in buf2 in response to a DMA transfer request of C2H.

[0073] In addition, it is noted that some FPGA accelerated computing tasks require the transmission of multiple different types of data, and the smc instruction needs to be called frequently, and the FPGA usually waits for all data to be transmitted before starting the calculation. To this end, in one embodiment, multiple data requirements for the same FPGA can be recorded in batches, and finally merged and sent to the transmission task module of the root world. In other words, after creating multiple pile tasks / pile data structures for multiple data demand information of the same FPGA, the smc instruction is called uniformly, so that the root monitor uniformly constructs the real data structure and the transmission descriptor for the multiple data demand information, thereby reducing the number of smc calls and world switches and reducing the performance burden.

[0074] In addition, as mentioned above, in some embodiments, FPGA requires the creation of a page table to perform a computing task, and for this purpose, the FPGA software generates a pile page table in the non-secure memory segment. Correspondingly, the root monitor needs to create a real FPGA page table based on the pile page table and store it in the first domain segment. For this reason, the root monitor can first verify the page table entries recorded in the pile page table, for example, to check whether there are duplicate mappings or illegal mappings. If the verification passes, the root monitor constructs a real FPGA page table by copying or replaying the page table entries therein. It should be noted that since the data buffer in the pile data structure does not store real data and does not participate in real FPGA calculations, in the real FPGA page table, the entries related to the data buffer are modified to point to the domain buffer in the real data structure.

[0075] Continuing with the previous example, in the real task creation phase, in the protected domain section, real data buffer 1 and data buffer 2 corresponding to the two data buffers in the stub task are created. The real confidential data is stored in data buffer 1, while data buffer 2 is temporarily left empty to store the result data. In addition, the root monitor also generates a real FPGA page table and stores it in the first domain section.

[0076] When the real FPGA task needs to be executed, the FPGA protection module in the root monitor provides a protected execution environment for the execution of the real FPGA task, and isolates the execution environment from other software (including untrusted software stacks and other "domains"). Specifically, the memory interaction between the FPGA and the host mainly includes two aspects: (1) DMA data interaction, and (2) FPGAMMIO instruction interaction (i.e., by writing to the FPGA register, transferring the task execution operation). In view of the above two aspects, the root monitor implements the isolation of the FPGA operating environment through the memory protection mechanism based on granular protection check (GPC) provided in the Arm confidential computing architecture.

[0077] To this end, according to the GPC mechanism, the root monitor executes step S43 to set the first GPT table for the CPU and the second GPT table for the FPGA, so that in the first GPT table, the FPGA memory mapping MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment.

[0078] As mentioned above, the confidential computing architecture CCA maintains a granular protection table GPT in memory, which records the security status of each segment of physical memory in fine granularity for GPC checks, thereby implementing memory isolation. According to the solution of this embodiment, the root monitor can maintain multiple versions of the GPT table so that different objects have different access rights.

[0079] Specifically, the root monitor maintains at least the first GPT table and the second GPT table. The first GPT table is used for the CPU and other peripherals to access the memory. In the first GPT table, the first segment belongs to the first domain and has the authority of the domain world. Applications in the non-secure world and applications in other domains have no right to access the first segment, thereby achieving isolation between domains. In addition, in order to protect the FPGA memory-mapped MMIO segment and prohibit untrusted software stacks from accessing this area, it can be set to belong to the root world in the above-mentioned first version of the GPT table. According to Figure 2 As shown in the permissions of different worlds, various applications requesting memory access through the CPU or other peripherals, including software in the secure world, cannot access the above-mentioned first segment and the FPGA memory-mapped MMIO segment.

[0080] The second GPT table is a GPT table for the first domain of the aforementioned FPGA, and the GPT table can be generated and initialized when the first domain is created, wherein only the first segment corresponding to the first domain is set as an accessible segment. When the first domain performs FPGA confidential computing, the root monitor writes the address of the first GPT table to the SMMU (a memory access control hardware that supports GPC) that controls the FPGA, so that it performs a GPC check according to the first GPT table, thereby realizing control of memory access from the FPGA.

[0081] Furthermore, in one embodiment, in order to simplify the division of permission states, for each "domain" of the FPGA GPT table, the respective domain memory can be marked as "non-secure" state, and other memory spaces can be marked as "root" state, so that only the FPGA hardware is allowed to access the memory of its corresponding domain. That is, for the FPGA of the first domain, the corresponding first GPT table is set to the first segment of the first domain as "non-secure" state, which can be accessed; all other segments are in "root" state and cannot be accessed. In this way, the configuration of the GPT table for the FPGA only requires two states (i.e., "non-secure" and "root" states, which respectively represent the accessible and inaccessible areas of the FPGA), without the need to specifically identify the memory of other states (such as secure and domain states), which greatly simplifies the process of FPGA GPT configuration and further optimizes performance overhead.

[0082] Figure 6 FIG. 4 shows a GPT table maintained by a root monitor in an example scenario. Figure 6 As shown in the example scenario, the domain world includes at least domain R1 and domain R2. Assume that users in the two domains request to execute FPGA task 1 based on domain R1 and execute FPGA task 2 based on domain 2. Figure 3 Corresponding. Among them, combined Figure 4 The FPGA task described as being executed in the first domain is assumed to correspond to FPGA task 1 executed in domain R1.

[0083] In order to provide isolated execution environments for FPGA Task 1 and FPGA Task 2, the root monitor must maintain at least Figure 6 The 4 GPT tables shown.

[0084] In the GPT table for the CPU, the memory segments corresponding to the domain R1 and domain R2 belong to the domain world segment as usual. In addition, the FPGA memory mapping MMIO segment is set to belong to the root world.

[0085] The GPT table for untrusted peripherals is similar to the GPT table for the CPU, and the settings for domains R1 and R2 are exactly the same. The difference is that peripherals have their corresponding memory access restrictions, and some memory segments that the CPU can access (such as the small segment at the front of the figure) are set in the GPT table of the peripherals as belonging to the root world, and the peripherals have no access to them.

[0086] The FPGA GPT table for domain 1 is the GPT table applicable when the FPGA executes FPGA task 1 corresponding to domain 1, that is, the second GPT table mentioned above. In this table, domain R1 is set to belong to the non-secure world and can be accessed; all other segments are set to belong to the root world and cannot be accessed. This means that when the FPGA executes FPGA task 1 corresponding to domain 1, it can only access the memory data of domain R1 and has no right to access any other segment data.

[0087] The FPGA GPT table for domain 2 is the GPT table applicable when the FPGA executes FPGA task 2 corresponding to domain 2. In this table, domain R2 is set to belong to the non-secure world and can be accessed; all other segments are set to belong to the root world and cannot be accessed. This means that when the FPGA executes FPGA task 2 corresponding to domain 2, it can only access the memory data of domain R2 and has no right to access any other segment data.

[0088] When the hardware (CPU, FPGA or peripheral) requests to access the memory, the RME in the hardware layer performs a GPC check according to the corresponding applicable GPT table to perform memory access control.

[0089] It can be seen from the two FPGA GPT tables for domain 1 and domain 2 that memory isolation is also performed between FPGA tasks in different domains to ensure the security of the execution environment. It can be understood that if more FPGA tasks need to be executed based on more domains, more GPT tables need to be maintained.

[0090] Through the above settings, step S44 can be executed, and the root monitor interacts with the FPGA through the FPGA memory mapping MMIO, so that the FPGA reads the confidential data based on the descriptor and executes the FPGA task.

[0091] Specifically, under the memory access control of GPC based on the aforementioned GPT table, the root world will replace the original software stack to interact with the FPGA MMIO and execute the FPGA transmission task, that is, provide the source address of the transmission task (including the address of the descriptor) to a specific register, write control instructions, and realize data transmission and operation result reception. Specifically, when the FPGA page table is required, the FPGA page table base address is first pointed to the real FPGA page table stored in the first field. In this way, the pile page table is replaced with the real FPGA page table, and memory access is performed based on the real PFGA page table. Some FPGA tasks can also be executed without the FPGA page table. At this time, the root monitor interacts with the FPGA through the FPGA MMIO, so that the FPGA reads confidential data based on the descriptor and executes the FPGA task.

[0092] To ensure the confidentiality of data during FPGA execution, after executing the FPGA task as described above, the FPGA is instructed to completely clear the most recently used memory in its on-chip memory before canceling the isolation protection of the above execution environment, for example, restoring the permissions of the FPGA MMIO to the normal state.

[0093] Looking back at the above process, FPGA confidential computing compatible with the Arm confidential computing architecture CCA is implemented through transmission tasks. According to the transmission task mechanism, the FPGA software in the non-secure world creates a stub task that does not contain real data, and schedules and manages the stub task like a regular process. After the stub task is submitted, the root monitor creates a real FPGA task containing real data, generates a real descriptor, and provides a protected execution environment by setting the GPT table. Then, the root monitor interacts with the FPGA through the protected FPGAMMIO, so that the FPGA hardware reads data according to the descriptor in the protected execution environment and executes the real FPGA task. In this way, FPGA confidential computing is implemented in the Arm confidential computing architecture CCA.

[0094] On the other hand, corresponding to the above method process, the embodiment of this specification also discloses a root monitor in a confidential computing architecture, wherein the confidential computing architecture includes a secure world, a domain world, a non-secure world and a root world; the root monitor is located in the root world. The root monitor may include a transmission task module and an FPGA protection module.

[0095] The transmission task module is configured to configure the pile data structure of the FPGA task in the non-secure world segment of the memory in response to the FPGA software of the non-secure world according to the data requirement information of the FPGA, and configure the real data structure corresponding to the pile data structure in the first segment corresponding to the first domain in the memory, wherein the pile data structure includes a data cache area, the real data structure includes a domain cache area corresponding to the data cache area, and a transmission descriptor; the domain cache area is used to store confidential data to be processed; the transmission descriptor is used to describe the storage information of data to be directly accessed by DMA.

[0096] The FPGA protection module is configured to set a first GPT table for the CPU and a second GPT table for the FPGA, so that in the first GPT table, the FPGA memory mapping MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment; interact with the FPGA through the FPGA memory mapping MMIO, so that the FPGA reads the confidential data through DMA transmission based on the descriptor and executes the FPGA task.

[0097] For the specific execution process examples of the transmission task module and the FPGA protection module, please refer to the previous Figure 4 and Figure 5 The description is omitted here.

[0098] In a typical embodiment, the root monitor is implemented as secure firmware.

[0099] According to yet another embodiment, a computing device is provided, comprising a memory and several processors, wherein the computing device forms a confidential computing architecture, wherein the confidential computing architecture comprises a secure world, a domain world, a non-secure world and a root world; the root world comprises the aforementioned root monitor.

[0100] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0101] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for executing an FPGA task in a confidential computing architecture, wherein the confidential computing architecture includes a secure world, a domain world, a non-secure world, and a root world; the method includes: The FPGA software in the non-secure world configures the stub data structure of the FPGA task in the non-secure world section of the memory according to the data requirement information of the FPGA, including the data buffer area; The root monitor in the root world configures a real data structure corresponding to the stub data structure in a first section corresponding to the first domain in the memory, including a domain buffer corresponding to the data buffer and a transfer descriptor; The domain cache area is used to store confidential data to be processed; The transfer descriptor is used to describe data to be transferred by direct memory access (DMA); The root monitor sets a granular protection table GPT, which includes a first GPT table for the CPU and a second GPT table for the FPGA, so that in the first GPT table, the FPGA memory mapping MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment; The root monitor interacts with the FPGA through the FPGA MMIO, so that the FPGA reads the confidential data through DMA transmission based on the transmission descriptor and executes the FPGA task.

2. The method according to claim 1, wherein: Before configuring the FPGA task's stub data structure, also include: The first domain provides the data requirement information and its signature to the FPGA software; Configuring a real data structure corresponding to the pile data structure includes: The root monitor configures the real data structure after verifying that the signature is correct.

3. The method according to claim 1 further comprises, before configuring the stub data structure of the FPGA task: The first domain receives the confidential data provided by the user through a secure channel.

4. The method according to claim 3, further comprising: The first domain negotiates a key with the user through a key negotiation protocol; Based on the key, the secure channel is established.

5. The method according to claim 1, wherein: The transmission descriptor includes the following information: the starting address of the data to be transmitted, the destination address, the data length, and the data channel information corresponding to the domain buffer area, and the data channel is selected from the C2H channel from the FPGA to the host and the H2C channel from the host to the FPGA.

6. The method according to claim 1, wherein: The transmission descriptor includes a plurality of descriptors connected in a linked list form; A single descriptor corresponds to a single data import into the FPGA; Each descriptor has a destination field indicating the address of the next descriptor; In the linked list, the target field of the current descriptor is filled with the starting address of the next descriptor stored in the first segment.

7. The method according to claim 1, wherein: The data requirement information includes multiple data requirements for the same FPGA; Before configuring the real data structure corresponding to the pile data structure, the method further includes: After creating stub data structures respectively for the multiple data requirements, the FPGA software uniformly calls the smc instruction to switch to the root world.

8. The method according to claim 1, wherein: The domain cache area includes an input data cache area and a result data cache area. The input data cache area stores the confidential data, and the result data cache area is used to store the execution result of the FPGA task.

9. The method according to claim 1, wherein: Configuring a stub data structure of an FPGA task includes: generating a stub page table according to the data buffer area; Configuring a real data structure corresponding to the stub data structure includes: generating a real FPGA page table according to the stub page table and the domain cache area.

10. The method according to claim 9, wherein: Before the root monitor interacts with the FPGA through the FPGA MMIO, it also includes: The root monitor modifies the FPGA MMIO to point to the real FPGA page table.

11. The method according to claim 1, wherein: In the second GPT table, the first segment is set to belong to the non-secure world, and all other memory segments are set to belong to the root world.

12. The method according to claim 1, further comprising: After executing the FPGA task, the FPGA is instructed to completely clear the most recently used memory in its on-chip memory.

13. A root monitor in a confidential computing architecture, the confidential computing architecture comprising a secure world, a domain world, a non-secure world and a root world; the root monitor is located in the root world and comprises a transmission task module and an FPGA protection module, wherein: The transmission task module is configured to configure a pile data structure of the FPGA task in the non-secure world section of the memory in response to the FPGA software of the non-secure world according to the data demand information of the FPGA, and configure a real data structure corresponding to the pile data structure in the first section of the memory corresponding to the first domain, wherein the pile data structure includes a data buffer area; The real data structure includes a domain buffer corresponding to the data buffer and a transmission descriptor; The domain cache area is used to store confidential data to be processed; The transfer descriptor is used to describe data to be transferred by direct memory access (DMA); The FPGA protection module is configured to set a granularity protection table GPT, including a first GPT table for the CPU and a second GPT table for the FPGA, so that in the first GPT table, the FPGA memory mapping MMIO belongs to the root world, and in the second GPT table, only the first segment is an accessible segment; interact with the FPGA through the FPGA MMIO, so that the FPGA reads the confidential data through DMA transmission based on the transfer descriptor and executes the FPGA task.

14. A computing device comprising a memory and several processors, wherein the computing device forms a confidential computing architecture, wherein the confidential computing architecture comprises a secure world, a domain world, a non-secure world and a root world; the root world comprises the root monitor described in claim 13.

Citation Information

Patent Citations

  • Efficient PCIE DMA data transmission method based on FPGA

    CN115729870A

  • DMA data transmission system

    CN116225998A

  • Construction method of GPU trusted execution environment and GPU trusted computing execution method and device

    CN116823585A

  • Method and device for executing GPU (Graphics Processing Unit) task in confidential computing architecture

    CN117807587A