Secure communication method, computing device and medium applicable to confidential virtual machines and PCIe devices

By setting up a control bridge between a confidential virtual machine and a PCIe device, the encrypted transmission of data is solved, and the problem that cannot be used in the prior art is not synergistically is realized, and a safe and trustworthy computing environment is realized.

CN120301713BActive Publication Date: 2025-09-05SHENZHEN CONFIDENTIAL COMPUTING TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510780014.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-05
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

The existing heterogeneous acceleration computing power and special acceleration equipment cannot be used in conjunction with a confidential virtual machine-level trusted execution environment, resulting in the inability to effectively protect the internal data of the computing power card and the inability to achieve the purpose of safe and reliable computing.

Method used

By setting up a control bridge between the confidential virtual machine and the PCIe device, a security fence is realized. The control bridge encrypts/decrypts the target data, so that the data is transmitted in ciphertext form, ensuring data security.

Benefits of technology

The combined use of PCIe devices and confidential virtual machines is realized to ensure the security and credibility of data during transmission, and to meet users' security needs for heterogeneous acceleration computing power and internal data of special acceleration devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120301713B_ABST
    Figure CN120301713B_ABST
Patent Text Reader

Abstract

The present application relates to the field of confidential computing technology, and in particular to a secure communication method, computing device, and medium suitable for confidential virtual machines and PCIe devices. The method applies a computing device, which includes a confidential virtual machine, a PCIe device, and a control bridge. The control bridge implements a security fence for the PCIe device. The PCIe device communicates with the confidential virtual machine through the control bridge. The method includes the control bridge obtaining target data between the PCIe device and the confidential virtual machine; the control bridge encrypts / decrypts the target data so that the target data is transmitted in ciphertext between the PCIe device and the confidential virtual machine. The present application sets a control bridge for implementing a security fence for the PCIe device, and performs encrypted transmission with the confidential virtual machine through the control bridge, so that the PCIe device can be used in conjunction with the confidential virtual machine, and realizes the capability of secure and trusted computing through encrypted transmission between the control bridge and the confidential virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of confidential computing technology, and in particular to a secure communication method, computing device, and medium suitable for confidential virtual machines and PCIe devices. Background Art

[0002] With the rapid development of artificial intelligence (AI) and large-scale models, the demand for computing resources is growing. To meet these demands, heterogeneous acceleration computing power cards are currently widely used to perform AI and large-scale model computing tasks, and a large number of specialized acceleration devices, such as FPGA accelerator cards and ASIC accelerator cards, are also deployed. However, existing heterogeneous acceleration computing power and specialized acceleration devices cannot be used in conjunction with a confidential virtual machine-level trusted execution environment (TEE). This limits the effective protection of data security within the computing power cards and prevents the goal of secure and trusted computing.

[0003] Therefore existing technology still needs to be improved and improved. Summary of the Invention

[0004] The technical problem to be solved by this application is to provide a secure communication method, computing device and medium suitable for confidential virtual machines and PCIe devices in response to the shortcomings of the existing technology.

[0005] In order to solve the above technical problems, the first aspect of the present application provides a secure communication method applicable to a confidential virtual machine and a PCIe device, using a computing device, the computing device including a confidential virtual machine, a PCIe device, and a control bridge, the control bridge implementing a security fence for the PCIe device, the PCIe device communicating with the confidential virtual machine through the control bridge, the method comprising:

[0006] The control bridge obtains target data between the PCIe device and the confidential virtual machine;

[0007] The control bridge encrypts / decrypts the target data so that the target data is transmitted between the PCIe device and the confidential virtual machine in a ciphertext form.

[0008] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein the target data includes first data transmitted from the confidential virtual machine to the PCIe device and second data transmitted from the PCIe device to the confidential virtual machine; and the control bridge encrypts / decrypts the target data so that the target data is transmitted in ciphertext form between the PCIe device and the confidential virtual machine, specifically comprising:

[0009] When the target data is first data transmitted from the confidential virtual machine to the PCIe device, the control bridge decrypts the first data so that the PCIe device obtains the decrypted first data;

[0010] When the target data is second data transmitted from the PCIe device to the confidential virtual machine, the control bridge encrypts the second data and transmits the encrypted second data to the confidential virtual machine.

[0011] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein the confidential virtual machine is used to encrypt data to be transmitted to obtain first data and to decrypt the encrypted second data.

[0012] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein the control bridge obtains target data between the PCIe device and the confidential virtual machine specifically includes:

[0013] The control bridge obtains a triggering reason for triggering the target data transmission;

[0014] When the triggering cause is that the confidential virtual machine actively accesses the PCIe device, the control bridge obtains first data formed by the confidential virtual machine through a write operation and / or second data determined by the PCIe device based on a read operation of the confidential virtual machine, so as to obtain target data between the PCIe device and the confidential virtual machine;

[0015] When the triggering cause is active DMA of the PCIe device, the control bridge obtains the first data moved by the PCIe device from the preset shared memory and / or obtains the second data generated by the PCIe device based on the DMA write operation to obtain the target data between the PCIe device and the confidential virtual machine, wherein the first data is written into the preset shared memory by the confidential virtual machine based on the DMA read operation.

[0016] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein, when the target data is second data generated by the PCIe device based on a DMA write operation, the control bridge encrypts / decrypts the target data so that the target data is transmitted between the PCIe device and the confidential virtual machine in ciphertext form:

[0017] The control bridge encrypts the second data and transmits the encrypted second data to the preset shared memory, so that the confidential virtual machine moves the encrypted second data from the preset shared memory.

[0018] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein the preset shared memory is outside the TEE side, so that both the confidential virtual machine and the PCIe device can move memory data in the preset shared memory.

[0019] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein the method further comprises:

[0020] When the triggering cause is a PCIe device interrupt, the control bridge receives interrupt data of the PCIe device and transmits the interrupt data in plain text.

[0021] The secure communication method applicable to a confidential virtual machine and a PCIe device, wherein, before the control bridge obtains the target data between the PCIe device and the confidential virtual machine, the method further comprises:

[0022] The confidential virtual machine performs identity authentication on the control bridge;

[0023] When the identity authentication succeeds, the confidential virtual machine negotiates a communication key with the control bridge, so that the confidential virtual machine and the control bridge use the communication key to encrypt / decrypt the target data.

[0024] A second aspect of the present application provides a computing device, wherein the computing device includes a processor and a memory; the processor of the computing device is used to execute instructions stored in the memory of the computing device, so that the computing device executes the secure communication method applicable to confidential virtual machines and PCIe devices as described above.

[0025] A third aspect of the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the secure communication method applicable to a confidential virtual machine and a PCIe device as described above.

[0026] Beneficial effects: Compared with the prior art, the present application provides a secure communication method, computing device, and medium applicable to confidential virtual machines and PCIe devices. The method applies a computing device, which includes a confidential virtual machine, a PCIe device, and a control bridge. The control bridge implements a security fence for the PCIe device. The PCIe device communicates with the confidential virtual machine through the control bridge. The method includes the control bridge acquiring target data between the PCIe device and the confidential virtual machine; the control bridge encrypting / decrypting the target data so that the target data is transmitted in ciphertext between the PCIe device and the confidential virtual machine. The present application sets up a control bridge for implementing a security fence for the PCIe device, and performs encrypted transmission with the confidential virtual machine through the control bridge, so that the PCIe device can be used in conjunction with the confidential virtual machine, and realizes the capability of secure and trusted computing through encrypted transmission between the control bridge and the confidential virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0028] Figure 1 A functional block diagram of an example of a computing device provided in an embodiment of the present application.

[0029] Figure 2 A functional block diagram of another example of a computing device provided in an embodiment of the present application.

[0030] Figure 3 A flowchart of a secure communication method between a confidential virtual machine and a PCIe device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The embodiments of the present application provide a secure communication method, computing device, and medium suitable for a confidential virtual machine and a PCIe device. To clarify and clarify the objectives, technical solutions, and effects of the present application, the present application is further described below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to explain the present application and are not intended to limit the present application.

[0032] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.

[0033] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0034] It should be understood that the sequence numbers and sizes of the steps in this embodiment do not imply the order of execution. The order of execution of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of this application.

[0035] The application content will be further explained below through description of embodiments in conjunction with the accompanying drawings.

[0036] In order to make the technical solution provided by this application clearer, the relevant terms are first explained.

[0037] (1) Virtual Machine: A complete computer system that is simulated by software and has complete hardware system functions, running in a completely isolated environment. Any work that can be done on a server can also be done on a virtual machine. Each virtual machine has its own independent hard disk and operating system, and users of the virtual machine can operate the virtual machine just like using a server.

[0038] (2) PCIe devices: Devices that conform to the PCIe bus standard are called PCIe devices. They can also be called endpoints, external devices, or I / O devices. They are located at the end of the PCIe bus system topology and generally serve as the initiator or terminator of bus operations. The PCIe bus architecture can include multiple PCIe devices, such as graphics cards, network cards, sound cards, accelerators (such as GPUs and NPUs), and disks.

[0039] (3) Direct memory access (DMA): It is an interface technology that allows external devices to exchange data directly with system memory without going through the processor (also called the central processing unit (CPU)). External devices can use DMA to transfer data in batches to the memory and then send an interrupt to notify the processor. The transfer process does not go through the processor, which reduces the burden on the processor.

[0040] Next, we will introduce the application scenarios involved in this application.

[0041] The present application relates to a secure communication scenario applicable to confidential virtual machines and PCIe devices. In this secure communication scenario, a computing device (such as a server) includes a hardware layer and a software layer. The hardware layer is a conventional configuration of the computing device, wherein the PCIe device can be, for example, a network card, a GPU, an NPU, an offload card, or other device that can be inserted into a PCIe slot of a server. However, existing heterogeneous acceleration computing power and special acceleration devices cannot be used in conjunction with a confidential virtual machine-level trusted execution environment (TEE). This requires that the data inside the heterogeneous acceleration computing power and special acceleration devices need to be sent to the REE side (also referred to as the non-secure world), and the REE side cannot perform security protection on the data inside the heterogeneous acceleration computing power and special acceleration devices. This poses a security threat to the data inside the heterogeneous acceleration computing power and special acceleration devices, and fails to achieve the purpose of secure and trusted computing.

[0042] Therefore, how to enable PCIe devices to be used in conjunction with confidential virtual machines to meet users' security needs for heterogeneous acceleration computing power and data devices inside special acceleration devices has become an urgent problem to be solved in this field.

[0043] In order to solve the above problems, the present application provides a secure communication method, computing device and medium applicable to confidential virtual machines and PCIe devices. The method applies a computing device, which includes a confidential virtual machine, a PCIe device and a control bridge. The control bridge implements a security fence for the PCIe device. The PCIe device communicates with the confidential virtual machine through the control bridge. The method includes the control bridge obtaining target data between the PCIe device and the confidential virtual machine; the control bridge encrypting / decrypting the target data so that the target data is transmitted in ciphertext between the PCIe device and the confidential virtual machine. The present application sets up a control bridge for implementing a security fence for the PCIe device, and performs encrypted transmission with the confidential virtual machine through the control bridge, so that the PCIe device can be used in conjunction with the confidential virtual machine, and realizes the capability of secure and trusted computing through encrypted transmission between the control bridge and the confidential virtual machine.

[0044] Specifically, if Figure 1 As shown, the computing device 100 includes a PCIe device, a confidential virtual machine and a control bridge; the confidential virtual machine can be one or more confidential virtual machines. Figure 1 In the example above, a computing device includes a confidential virtual machine, which can be deployed on the TEE side. The control bridge is used to implement a security fence for the PCIe device. Both the PCIe device and the confidential virtual machine communicate with the control bridge to achieve the joint use of the PCIe device and the confidential virtual machine through the control bridge. That is, the PCIe device and the confidential virtual machine communicate with each other through the control bridge. The confidential virtual machine may include an operating system kernel and one or more applications (APPs) ( Figure 1 (not shown). The operating system kernel in the confidential virtual machine and the ordinary confidential virtual machine can be a powerful general operating system kernel such as Linux, and this application does not make specific limitations on this. In addition, Figure 1 This is just one example provided for this application, and the computing device 100 may have more Figure 1 The components shown may be more or less than the components shown, or may be implemented with different configurations of the components, etc., and no specific limitations are given here.

[0045] Furthermore, the control bridge cooperates with the confidential virtual machine to implement secure and trusted computing to realize the secure and trusted technology of PCIe devices. The control bridge does not change the logical layer behavior of the PCIe device and has the ability to control the data of the PCIe device. Specifically, the control bridge can be a hardware board that uses a PCIe transparent bridge to implement a security fence for the PCIe device, wherein the PCIe transparent bridge does not change the logical layer behavior of the connected PCIe device, so that there is no need to modify the device's own driver in the confidential virtual machine. The control bridge is located between the PCIe device and the confidential virtual machine. The data of the PCIe device is transmitted to the confidential virtual machine through the control bridge. The control bridge implements security enhancement of the data of the PCIe device and realizes the joint use of the PCIe device and the confidential virtual machine on the TEE side.

[0046] The following combination Figure 3 The flowchart of the secure communication method applicable to confidential virtual machines and PCIe devices provided in the present application provides a detailed description of the process of the secure communication method applicable to confidential virtual machines and PCIe devices.

[0047] like Figure 3 As shown, the secure communication method applicable to confidential virtual machines and PCIe devices specifically includes:

[0048] S10, the control bridge obtains target data between the PCIe device and the confidential virtual machine;

[0049] S20. The control bridge encrypts / decrypts the target data so that the target data is transmitted between the PCIe device and the confidential virtual machine in ciphertext form.

[0050] Specifically, in step S10, the target data is I / O data between the PCIe device and the confidential virtual machine. The I / O data may include first data transmitted from the confidential virtual machine to the PCIe device, or second data transmitted from the PCIe device to the confidential virtual machine. That is, when the confidential virtual machine transmits first data to the PCIe device, the first data is captured by the control bridge; when the PCIe device transmits second data to the confidential virtual machine, the PCIe device transmits the second data to the control bridge.

[0051] In one embodiment, since all data from the PCIe device is exchanged with the confidential virtual machine through the control bridge, to ensure the security of communication between the control bridge and the confidential virtual machine, the control bridge needs to be authenticated before secure communication between the PCIe device and the confidential virtual machine is achieved through the control bridge. Based on this, before the control bridge obtains the target data between the PCIe device and the confidential virtual machine, the method further includes:

[0052] The confidential virtual machine performs identity authentication on the control bridge;

[0053] When the identity authentication succeeds, the confidential virtual machine negotiates a communication key with the control bridge, so that the confidential virtual machine and the control bridge use the communication key to encrypt / decrypt the target data.

[0054] Specifically, identity authentication is used to verify the control bridge to ensure its security. This authentication can include remote authentication and identity verification. Remote authentication involves the confidential virtual machine verifying the legitimacy of the control bridge through remote authentication. Identity verification involves the confidential virtual machine verifying the legitimacy of the control bridge. Identity verification can be accomplished using existing methods, such as those in the national standard GB / T 15843.3-2016.

[0055] Furthermore, after the control bridge passes identity authentication, a communication key is negotiated between the control bridge and the confidential virtual machine. This communication key is used to encrypt / decrypt target data between the control bridge and the confidential virtual machine. In other words, both the confidential virtual machine and the control bridge use the communication key to encrypt / decrypt target data. Specifically, the control bridge uses the communication key to decrypt first data from the confidential virtual machine and to encrypt second data to be transmitted to the confidential virtual machine. Similarly, the confidential virtual machine uses the communication key to decrypt the second data from the control bridge and to encrypt data to be transmitted to the control bridge to obtain the first data. Among them, the communication key can be obtained by mutual negotiation between the control bridge and the confidential virtual machine, such as using the DH algorithm, SM2 key exchange protocol, etc.; it can also be directly distributed by the confidential virtual machine, and when the communication key is distributed by the confidential virtual machine, the confidential virtual machine can use the control bridge's authentication public key to encrypt the communication key, and send the encrypted communication key to the control bridge. The control bridge uses its own authentication private key to decrypt the encrypted communication key to obtain the communication key. This can avoid the leakage of the communication key during transmission from the confidential virtual machine to the control bridge, thereby improving the security of the communication key, and further improving the security and reliability of the control bridge and the confidential virtual machine.

[0056] In one implementation, the target data is IO data between a PCIe device and a confidential virtual machine. This IO data may include IO data generated by the confidential virtual machine's active access to the PCIe device (e.g., a CPU's active access to a computing device), IO data generated by PCIe device interrupts, and IO data generated by the PCIe device's active DMA. Active access by the confidential virtual machine to the PCIe device includes software access to the PCIe device's configuration space and memory mapping space. The PCIe device configuration space is unified with the PCIe device, and its data does not require encryption / decryption protection. The memory mapping space is unique to each PCIe device and is associated with task data, requiring encryption / decryption protection. Therefore, data accessed by the confidential virtual machine's active access to the PCIe device requires encryption / decryption protection. IO data generated by PCIe device interrupts is unrelated to task data and, therefore, does not require encryption / decryption protection. IO data generated by active DMA of the PCIe device is closely associated with task data and requires encryption / decryption protection.

[0057] To this end, when the control bridge obtains the target data between the PCIe device and the confidential virtual machine, it will determine whether to encrypt / decrypt the target data based on the triggering reason of the target data. Accordingly, the control bridge obtains the target data between the PCIe device and the confidential virtual machine specifically including:

[0058] The control bridge obtains a triggering reason for triggering the target data transmission;

[0059] When the triggering cause is that the confidential virtual machine actively accesses the PCIe device, the control bridge obtains first data formed by the confidential virtual machine through a write operation and / or second data determined by the PCIe device based on a read operation of the confidential virtual machine, so as to obtain target data between the PCIe device and the confidential virtual machine;

[0060] When the triggering cause is active DMA of the PCIe device, the control bridge obtains the first data moved by the PCIe device from the preset shared memory and / or obtains the second data generated by the PCIe device based on the DMA write operation to obtain the target data between the PCIe device and the confidential virtual machine, wherein the first data is written into the preset shared memory by the confidential virtual machine based on the DMA read operation.

[0061] Specifically, the triggering cause is the need to transfer data between the PCIe device and the confidential virtual machine. As mentioned above, triggering causes include the confidential virtual machine actively accessing the PCIe device, a PCIe device interrupt, and active DMA from the PCIe device. When the triggering cause is the confidential virtual machine actively accessing the PCIe device, the control bridge will obtain the first data that the confidential virtual machine needs to write to the PCIe device (i.e., the first data is the write data generated based on the confidential virtual machine's write operation) and will also obtain the second data returned by the PCIe device based on the confidential virtual machine's read operation (i.e., the second data is the return data generated based on the confidential virtual machine's read operation). In other words, when the confidential virtual machine actively accesses the PCIe device, the confidential virtual machine will perform read and write operations on the PCIe device. When performing a read operation, the PCIe device will feedback the second data required to be sent to the confidential virtual machine based on the read operation and transmit the second data to the control bridge. When performing a write operation, the confidential virtual machine will transmit the first data required to be written to the PCIe device to the control bridge.

[0062] Furthermore, when the triggering cause is a PCIe device interruption, the control bridge will directly obtain the interruption data generated by the PCIe device interruption.

[0063] Furthermore, when the triggering cause is the active DMA of the PCIe device, the DMA of the PCIe device is initiated by the device driver software in the confidential virtual machine (such as application software call, etc.), such as Figure 2 As shown, the driver can apply for a shared memory (recorded as the preset shared memory) for DMA, and the PCIe device and the confidential virtual machine realize data transmission through the preset shared memory. Specifically, the PCIe device will encrypt the data generated by DMA into second data through the control bridge and share it to the preset shared memory, so that the confidential virtual machine can move the second data from the preset shared memory; at the same time, the PCIe device will also move the first data stored in the preset shared memory based on the DMA of the PCIe device from the preset shared memory, and the control bridge will read the first data moved by the PCIe device and decrypt it. Among them, the first data is written to the preset shared memory by the confidential virtual machine based on the DMA read operation, and the second data is generated by the PCIe device based on the DMA write operation.

[0064] The above completes the description of step S10. Now, step S20 will be described.

[0065] In step S20, the control bridge will encrypt / decrypt the acquired target data. Specifically, when the target data is the first data transmitted from the confidential virtual machine to the PCIe device, the first data is the ciphertext data encrypted by the confidential virtual machine, and the control bridge will decrypt the first data; when the target data is the second data transmitted from the PCIe device to the confidential virtual machine, the second data is the plaintext data, and the control bridge will encrypt the second data and transmit the decrypted second data to the confidential virtual machine.

[0066] Furthermore, as can be seen from the description of step S10, based on the triggering cause of the target data, when the first data and the second data are interrupt data, there is no need to encrypt / decrypt the first data and the second data, and the first data and the second data can be directly transmitted in plain text between the control bridge and the confidential virtual machine. To this end, when encrypting and decrypting the target data, the control bridge can first determine whether to encrypt / decrypt the target data based on the triggering cause of the target data. Specifically, when the triggering cause is a PCIe device interruption, the control bridge does not encrypt / decrypt the target data and transmits the interruption data of the PCIe device in plain text. Of course, the confidential virtual machine also does not encrypt / decrypt the target data generated by the PCIe device interruption. When the triggering cause is the confidential virtual machine actively accessing the PCIe device and the PCIe device actively DMAing, the control bridge will encrypt / decrypt the target data and transmit the target data in ciphertext to the confidential virtual machine. The confidential virtual machine will also encrypt / decrypt the target data generated by the confidential virtual machine actively accessing the PCIe device and the PCIe device actively DMAing, so as to transmit the target data in ciphertext. Of course, in actual applications, the control bridge and confidential virtual machine can also encrypt / decrypt the target data generated by the PCIe device interruption according to user needs.

[0067] The following describes the process of encrypting / decrypting target data generated by the confidential virtual machine actively accessing the PCIe device and the process of encrypting / decrypting target data generated by the PCIe device actively performing DMA.

[0068] During the process of encrypting / decrypting the target data generated by the confidential virtual machine actively accessing the PCIe device, the software mainly uses system functions such as iowrite32() / ioread32() to access the memory mapping space. To this end, it is only necessary to modify the system functions so that when the confidential virtual machine accesses the PCIe device, the control bridge decrypts the first data that needs to be written to the PCIe device and encrypts the second data read from the PCIe device.

[0069] During the encryption / decryption process of the target data generated by the PCIe device's active DMA, since the memory space within the TEE is protected by the TEE, the data in the TEE's memory space is in ciphertext, and the key corresponding to this ciphertext is only known to the TEE. This prevents the PCIe device from knowing the key and, therefore, from decrypting the data in the TEE's memory space. Therefore, in order for the control bridge to perform DMA operations on the corresponding data, a preset shared memory is requested outside the TEE. The control bridge and the confidential virtual machine write ciphertext data to this preset shared memory. The confidential virtual machine then moves data from the preset shared memory and decrypts the moved data. The PCIe device then moves data from the preset shared memory, and the control bridge decrypts the data moved by the PCIe device. Specifically, the confidential virtual machine encrypts the data to obtain the first data and writes the first data to the preset shared memory. Simultaneously, it moves the encrypted second data from the preset shared memory and decrypts the encrypted second data. The control bridge then encrypts the second data and writes the encrypted second data to the preset shared memory. The PCIe device then moves the first data from the preset shared memory, and the control bridge decrypts the first data moved by the PCIe device.

[0070] In a specific implementation, when the PCIe device actively performs a DMA read operation, the write operation of the confidential virtual machine to write data into the preset shared memory is intercepted, and the write data formed by the write operation is encrypted to obtain the first data, and the first data is written into the preset shared memory. The PCIe device initiates a MemRd request through the PCIe bus to move the first data in the preset memory into the memory of the PCIe device, and the control bridge decrypts the first data moved into the memory of the PCIe device. This can avoid writing the data to be transmitted in plain text into the preset shared memory. In the process of the PCIe device initiating a MemRd request through the PCIe bus to move the data in the preset shared memory to the device memory, the data to be transmitted is easily snooped and stolen by high-authority users or confidential virtual machine monitors (hypervisors).

[0071] Similarly, when the PCIe device actively performs a DMA write operation, the control bridge encrypts the data of the device MemWr (i.e., the second data) and transfers the encrypted second data to the preset shared memory, and then notifies the confidential virtual machine (such as using an interrupt method, etc.). After the confidential virtual machine moves the encrypted second data in the preset shared memory to the secure memory, it decrypts the encrypted second data (if technologies such as GCM are used, the integrity of the data can also be verified).

[0072] The embodiment of the present application applies for shared memory in advance, and then encrypts the data that needs to be written into the preset shared content through the control bridge and the confidential virtual machine so that the data is stored in the preset shared memory in ciphertext, thereby preventing the data in the preset shared memory from being spied on and stolen. At the same time, the preset shared memory and the confidential virtual machine, the PCIe device and the control bridge are all transmitted in ciphertext form, which ensures the data security of the transmission link and avoids data leakage during the transmission process. In addition, the data is in a safe state in the memory space of the PCIe device and the memory space of the confidential virtual machine. Therefore, the present application ensures the full-link security protection of DMA data and further improves the security of DMA data.

[0073] Furthermore, after decrypting the first data, the control bridge can verify the integrity of the decrypted first data. If the verification passes, the data is legitimate; if the verification fails, the data is invalid. The control bridge intercepts the invalid data (i.e., the decrypted first data that fails the verification) to ensure that all decrypted first data originates from a legitimate confidential virtual machine. Simultaneously, the confidential virtual machine uses the same method to ensure that all second data originates from a legitimate PCIe device, thereby protecting the security of the memory data on the PCIe device.

[0074] Based on the above-mentioned secure communication method applicable to confidential virtual machines and PCIe devices, this embodiment provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement part or all of the steps in the secure communication method applicable to confidential virtual machines and PCIe devices as described in the above embodiment.

[0075] Based on the above-mentioned secure communication method applicable to confidential virtual machines and PCIe devices, the present application also provides a computing device, which includes a processor and a memory; the processor of the computing device is used to execute instructions stored in the memory of the computing device, so that the computing device executes the above-mentioned secure communication method applicable to confidential virtual machines and PCIe devices.

[0076] In addition, the specific process of loading and executing the multiple instructions in the storage medium and the computing device has been described in detail in the above method and will not be described here one by one.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A secure communication method for a confidential virtual machine and a PCIe device, characterized in that: An application computing device includes a confidential virtual machine, a PCIe device, and a control bridge. The control bridge uses a PCIe transparent bridge to implement a security fence for the PCIe device. The PCIe transparent bridge does not change the logical layer behavior of the connected PCIe device, so that the device driver itself does not need to be modified within the confidential virtual machine. The PCIe device communicates with the confidential virtual machine through the control bridge. The method includes: The control bridge obtains target data between the PCIe device and the confidential virtual machine, where the target data includes first data transmitted from the confidential virtual machine to the PCIe device and second data transmitted from the PCIe device to the confidential virtual machine; The control bridge encrypts / decrypts the target data so that the target data is transmitted between the PCIe device and the confidential virtual machine in a ciphertext form; The control bridge obtaining target data between the PCIe device and the confidential virtual machine specifically includes: The control bridge obtains a triggering reason for triggering the target data transmission; When the triggering cause is that the confidential virtual machine actively accesses the PCIe device, the control bridge obtains first data formed by the confidential virtual machine through a write operation and / or second data determined by the PCIe device based on a read operation of the confidential virtual machine, so as to obtain target data between the PCIe device and the confidential virtual machine; When the triggering cause is the active DMA of the PCIe device, the control bridge obtains the first data moved by the PCIe device from the preset shared memory and / or obtains the second data generated by the PCIe device based on the DMA write operation to obtain the target data between the PCIe device and the confidential virtual machine, wherein the first data is written to the preset shared memory by the confidential virtual machine based on the DMA read operation, and the first data is obtained by intercepting the write operation of the confidential virtual machine to write data to the preset shared memory and encrypting the write data generated by the write operation, and the preset shared memory is outside the confidential virtual machine, so that the confidential virtual machine and the PCIe device can both move the memory data in the preset shared memory.

2. The secure communication method for confidential virtual machines and PCIe devices according to claim 1, characterized in that: The control bridge encrypts / decrypts the target data so that the target data is transmitted between the PCIe device and the confidential virtual machine in a ciphertext form, specifically comprising: When the target data is first data transmitted from the confidential virtual machine to the PCIe device, the control bridge decrypts the first data so that the PCIe device obtains the decrypted first data; When the target data is second data transmitted from the PCIe device to the confidential virtual machine, the control bridge encrypts the second data and transmits the encrypted second data to the confidential virtual machine.

3. The secure communication method for confidential virtual machines and PCIe devices according to claim 2, characterized in that: The confidential virtual machine is used to encrypt data to be transmitted to obtain first data and to decrypt the encrypted second data.

4. The secure communication method for confidential virtual machines and PCIe devices according to claim 1, wherein: When the target data is second data generated by the PCIe device based on a DMA write operation, the control bridge encrypts / decrypts the target data so that the target data is transmitted between the PCIe device and the confidential virtual machine in a ciphertext form: The control bridge encrypts the second data and transmits the encrypted second data to the preset shared memory, so that the confidential virtual machine moves the encrypted second data from the preset shared memory.

5. The secure communication method for confidential virtual machines and PCIe devices according to claim 1, characterized in that: The method further comprises: When the triggering cause is a PCIe device interrupt, the control bridge receives interrupt data of the PCIe device and transmits the interrupt data in plain text.

6. The secure communication method for confidential virtual machines and PCIe devices according to claim 1, characterized in that: Before the control bridge obtains the target data between the PCIe device and the confidential virtual machine, the method further includes: The confidential virtual machine performs identity authentication on the control bridge; When the identity authentication succeeds, the confidential virtual machine negotiates a communication key with the control bridge, so that the confidential virtual machine and the control bridge use the communication key to encrypt / decrypt the target data.

7. A computing device, characterized in that The computing device includes a processor and a memory; the processor of the computing device is used to execute instructions stored in the memory of the computing device, so that the computing device executes the secure communication method applicable to a confidential virtual machine and a PCIe device as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that The method comprises computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the secure communication method applicable to a confidential virtual machine and a PCIe device according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Cross-bus-domain equipment virtualization method and system, terminal and storage medium

    CN118445223A

  • Secured peripheral device communication via bridge device in virtualized computer system

    US20240072995A1

  • Secure virtual machine and peripheral device communication

    US20240095059A1