Method for configuring cryptographic hardware, confidential computing method for data, and related device

By maintaining the simulated device layer in the virtual machine monitor, allowing multiple virtual machines to share encrypted hardware, solving the problem that virtual machines are difficult to efficiently utilize encrypted hardware, and achieving more efficient data processing performance.

WO2024255640A1PCT designated stage expired Publication Date: 2024-12-19HYGON INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/097172
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-15
Filing Date
2024-06-04
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

In the prior art, it is difficult for virtual machines to efficiently utilize encrypted hardware, resulting in resource conflicts in the encrypted hardware and low data processing performance.

Method used

By maintaining the encrypted hardware device status bound by multiple simulated devices, multiple virtual machines are allowed to share encrypted hardware, and the virtual machine usage request is processed based on the device status, ensuring that the encrypted hardware is used by one virtual machine at one moment.

Benefits of technology

It improves the utilization rate and data processing performance of virtual machines for encryption hardware, avoids resource conflicts, and improves the computing efficiency of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024097172_19122024_PF_FP_ABST
    Figure CN2024097172_19122024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a method for configuring cryptographic hardware, a confidential computing method for data, and a related device. The method for configuring cryptographic hardware comprises: maintaining a device state of cryptographic hardware bound to a plurality of simulation devices, which device state is an idle state or a busy state, wherein one simulation device corresponds to one virtual machine, and a plurality of simulation devices are bound to the cryptographic hardware, such that the plurality of virtual machines share the cryptographic hardware by means of the corresponding simulation devices; and on the basis of the device state of the cryptographic hardware, processing a use request of a virtual machine for the cryptographic hardware by means of the simulation device corresponding to the virtual machine, such that the virtual machine uses the cryptographic hardware, wherein the virtual machine is any one of the plurality of virtual machines. The embodiments of the present disclosure can improve the utilization rate of cryptographic hardware by virtual machines.
Need to check novelty before this filing date? Find Prior Art

Description

Configuration method of encryption hardware, data confidentiality calculation method and related equipment

[0001] This application claims priority to Chinese Patent Application No. 202310712879.1 filed on June 15, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field

[0002] The embodiments of the present disclosure relate to a configuration method for encryption hardware, a data confidentiality computing method, and related devices. Background Art

[0003] Virtualization technology allows computers to be created as multiple virtual machines (VMs), effectively utilizing the computer's hardware resources. When a VM performs cryptographic calculations on data, it utilizes the computer's encryption hardware. In this context, finding a technical solution to improve the utilization of encryption hardware by VMs has become a pressing issue for those skilled in the art.

[0004] Summary of the Invention

[0005] In view of this, the embodiments of the present disclosure provide a configuration method for encryption hardware, a data confidentiality computing method and related equipment to improve the utilization rate of encryption hardware by virtual machines and enhance the data processing performance of virtual machines.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for configuring encryption hardware, comprising:

[0007] Maintaining device states of encryption hardware bound to multiple simulated devices, the device states including an idle state and a busy state; wherein one simulated device corresponds to one virtual machine, and multiple simulated devices are bound to the encryption hardware so that the multiple virtual machines share the encryption hardware through the corresponding simulated devices;

[0008] Based on the device status of the encryption hardware, the virtual machine's request to use the encryption hardware is processed through the simulation device corresponding to the virtual machine, so that the virtual machine uses the encryption hardware. The virtual machine is any one of multiple virtual machines.

[0009] In a second aspect, an embodiment of the present disclosure provides a configuration device for encryption hardware, comprising:

[0010] State maintenance logic for maintaining device states of encryption hardware bound to multiple simulated devices, the device states including idle and busy states; wherein one simulated device corresponds to one virtual machine, and multiple simulated devices are bound to the encryption hardware so that the multiple virtual machines share the encryption hardware through the corresponding simulated devices;

[0011] The request processing logic is used to process the virtual machine's request to use the encryption hardware based on the device status of the encryption hardware through the simulated device corresponding to the virtual machine, so that the virtual machine uses the encryption hardware. The virtual machine is any one of multiple virtual machines.

[0012] In a third aspect, an embodiment of the present disclosure provides a data confidentiality computing method, including:

[0013] Obtaining a confidential computing command for a simulated device sent by a virtual machine, where the simulated device is used to simulate a program for a secure cryptographic coprocessor, wherein the secure cryptographic coprocessor is cryptographic hardware configured according to the cryptographic hardware configuration method described above;

[0014] Obtaining permission to use the secure cryptographic coprocessor so as to obtain a confidential computing result of the secure cryptographic coprocessor according to the confidential computing command, and returning the confidential computing result to the virtual machine.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a data confidentiality computing device, comprising:

[0016] Command acquisition logic, configured to acquire confidential computing commands sent by the virtual machine to the simulated device, the simulated device being used to simulate a program for a secure cryptographic coprocessor, the secure cryptographic coprocessor being cryptographic hardware configured according to the cryptographic hardware configuration method described above;

[0017] The hardware usage logic is used to obtain the usage permission of the secure cryptographic coprocessor so as to obtain the confidential computing result of the secure cryptographic coprocessor according to the confidential computing command, and return the confidential computing result to the virtual machine.

[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer system comprising: a virtual machine monitor, multiple virtual machines, and encryption hardware; the virtual machine monitor comprises a configuration device for the encryption hardware as described above, or a data confidentiality computing device as described above.

[0019] In a sixth aspect, an embodiment of the present disclosure provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run by the processor, and when the processor runs the computer program, it executes the method for configuring encryption hardware as described above, or the steps in the data confidentiality computing method as described above.

[0020] In the seventh aspect, an embodiment of the present disclosure provides a storage medium, which stores one or more computer-executable instructions. When the one or more computer-executable instructions are executed, the configuration method of the encryption hardware as described above and / or the data confidentiality computing method as described above are implemented.

[0021] In the configuration method of encryption hardware provided in the embodiment of the present disclosure, the device status of the cryptographic coprocessor bound to multiple simulated devices is maintained, and the device status includes an idle state and a busy state, wherein one simulated device corresponds to one virtual machine, and multiple simulated devices are bound to the encryption hardware, so that multiple virtual machines share the encryption hardware through the corresponding simulated devices; then, based on the device status of the encryption hardware, the virtual machine's request to use the encryption hardware is processed through the simulated device corresponding to the virtual machine, so that the virtual machine uses the encryption hardware, and the virtual machine is any one of the multiple virtual machines.

[0022] It can be seen that the embodiment of the present disclosure maintains the device status of the encryption hardware through multiple simulation devices, so that multiple virtual machines can share the encryption hardware. When the encryption hardware is in an idle state, any one of the multiple virtual machines can use the encryption hardware for calculation and processing, and then based on the device status of the encryption hardware, the virtual machine's request to use the encryption hardware is processed through the simulation device corresponding to the virtual machine, ensuring that the encryption hardware is used by one virtual machine at a time, and realizing that multiple virtual machines share the encryption hardware for cryptographic calculation and processing of data, thereby improving the utilization rate of the encryption hardware by the virtual machine and improving the data processing performance of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] FIG1 is a schematic diagram of an optional architecture of a computer system;

[0025] FIG2 is a schematic diagram of another optional architecture of a computer system;

[0026] FIG3 is a schematic diagram of another optional architecture of a computer system;

[0027] FIG4 is a schematic diagram of an optional architecture of encryption hardware;

[0028] Figure 5 is an optional configuration method for encryption hardware;

[0029] FIG6 is an optional flow chart of a method for configuring encryption hardware according to an embodiment of the present disclosure;

[0030] FIG7 is a schematic diagram of multiple virtual machines accessing encryption hardware according to an embodiment of the present disclosure;

[0031] FIG8 is a schematic diagram of an interaction between a virtual machine and encryption hardware provided by an embodiment of the present disclosure;

[0032] FIG9 is another optional flow chart of a method for configuring encryption hardware provided in an embodiment of the present disclosure;

[0033] FIG10 is a schematic diagram of address mapping for a virtual machine to access encryption hardware according to an embodiment of the present disclosure;

[0034] 11 is a schematic diagram of an interaction in which a virtual machine synchronously accesses a shared memory space through a simulated device according to an embodiment of the present disclosure;

[0035] FIG12 is a schematic diagram of address conversion of encryption hardware accessing memory provided by an embodiment of the present disclosure;

[0036] FIG13 is a calculation sequence diagram of multiple virtual machines sharing encryption hardware according to an embodiment of the present disclosure;

[0037] FIG14 is an optional block diagram of a configuration device for encryption hardware provided in an embodiment of the present disclosure;

[0038] FIG15 is an optional flow chart of a data confidentiality computing method provided by an embodiment of the present disclosure;

[0039] FIG16 is a schematic diagram of interaction of multiple virtual machines synchronously accessing a secure cryptographic coprocessor according to an embodiment of the present disclosure; and

[0040] FIG17 is an optional block diagram of a data confidentiality computing device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0041] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.

[0042] As an optional example, FIG1 shows a schematic diagram of an optional architecture of a computer system. As shown in FIG1 , the architecture of the computer system may include: a CPU (Central Processing Unit) core 1 , encryption hardware 2 , and memory 3 .

[0043] The CPU core 1 can configure a virtual machine monitor (VMM) 11 in software form, and virtualize multiple virtual machines (VMs) 12 through virtualization technology. The multiple virtual machines 12 can be managed by the virtual machine monitor 11 .

[0044] The encryption hardware 2 is a hardware device for performing cryptographic calculations, such as a cryptographic coprocessor. The encryption hardware 2 can optimize frequent data operations in cryptographic calculations, save computing time, increase computing speed, and enhance the performance of cryptographic calculations on data.

[0045] In one example, cryptographic hardware 2 can be used to perform cryptographic calculations on virtual machine data within a virtual machine. When the cryptographic hardware is called by a virtual machine, it can obtain the virtual machine's data calculation command, retrieve the corresponding data from memory based on the address information of the data calculation command, and perform cryptographic operations on the data. The cryptographic operations can be encryption, decryption, or hash calculations. The cryptographic hardware can be called through a driver program to drive the operation of the cryptographic hardware.

[0046] It should be noted that the cryptographic hardware can perform basic cryptographic calculations when operating in a standard computing environment, as described in Figure 1. However, because the hardware resources of the cryptographic hardware can be directly accessed by the virtual machine in a standard computing environment and the cryptographic hardware does not have a closed execution environment, it does not have the ability to perform confidential computing on data.

[0047] In order to improve the confidentiality and integrity of data, as well as the confidentiality of the computing process, a confidential computing environment can also be set up in the computer system. Figure 2 shows another optional architectural diagram of the computer system, in which the vertical dotted line is used to distinguish between the confidential computing environment and the ordinary computing environment. The solid line box is the component of the confidential computing environment, and the dotted line box is the component of the ordinary computing environment.

[0048] As shown in Figure 2, a computer system can include five parts: the hardware layer, the system software layer, the service layer, the application layer, and cross-layer management. The hardware layer uses hardware isolation to prevent protected resources from being accessed by open systems, and provides a trusted hardware foundation for confidential computing based on hardware security features. The system software layer provides a software-based isolation mechanism, necessary hardware resources, and basic services for confidential computing. The service layer provides a unified confidential computing service interface and security services for upper-layer applications. Security services are formed by the interaction between the underlying system software, hardware, and management modules. The unified confidential computing service interface is used to shield the differences in the development interfaces of the underlying hardware architecture and software. The application layer is an application directly facing the result demander, who performs computing operations through the application. Cross-layer management provides the necessary management modules for executing confidential computing services.

[0049] In an example, the components of the hardware layer in a confidential computing environment may mainly include a trusted execution control unit, isolated memory space, trusted firmware, a hardware cryptographic engine, a device-unique key, a random number generator, and a trust root; the components of the system software layer may mainly include a confidential computing operating system and confidential computing virtualization software; the components of the service layer may mainly include a confidential computing unified service interface, isolated computing, secure boot, remote attestation, secure channel, key derivation, storage protection, cryptographic operations, and data encapsulation; the components of the application layer may mainly include confidential computing applications; and the components of cross-layer management may mainly include key management, log management, whitelist management, and resource management.

[0050] It should be noted that, among the components of the hardware layer of the confidential computing environment, the trusted firmware can be, for example, a security processor. In a trusted execution environment implemented as a virtual machine, FIG3 exemplarily shows another optional architectural diagram of a computer system. Corresponding to FIG1 , in combination with FIG3 , the system architecture can also include: a security processor 4, which is a specially configured processor responsible for processing operations related to confidential computing of the virtual machine. For example, the security processor 4 can perform operations such as memory encryption and decryption, thereby preventing the physical host and the virtual machine monitor 11 from accessing and tampering with the virtual machine's data, thereby ensuring the data security of the virtual machine.

[0051] The operating environment of the system architecture shown in Figure 3 can include a confidential computing environment. The security processor has a closed executable environment. The virtual machine monitor 11 can be configured with an API interface to communicate with the security processor 4 to realize data interaction between the virtual machine monitor 11 and the security processor 4.

[0052] To further safeguard virtual machine data security and enhance data confidentiality and integrity from a hardware perspective, different cryptographic hardware can be used in computer systems that include both confidential and standard computing environments. Figure 4 shows an alternative architecture for cryptographic hardware, where the hardware can be configured as a separate standard cryptographic coprocessor and a secure cryptographic coprocessor.

[0053] The ordinary cryptographic coprocessor can also be called a high-performance cryptographic coprocessor, which is hardware that performs basic cryptographic calculations for virtual machines. The hardware resources of the ordinary cryptographic coprocessor can be directly accessed by the CPU core and used in ordinary computing environments; the secure cryptographic coprocessor is hardware that performs confidential computing for virtual machines, and the secure cryptographic coprocessor and the security processor can use a closed execution environment, so that the hardware resources of the secure cryptographic coprocessor cannot be directly accessed by the virtual machine. It can be configured by the security processor and can be used when the virtual machine performs confidential computing tasks with high security requirements, thereby realizing confidential computing of virtual machine data and ensuring that confidential data is not leaked.

[0054] It should be noted that, as shown in FIG3 , the virtual machines 12 in the CPU core 1 may include virtual machines 121 and 122. Virtual machine 121 is a virtual machine operating in a normal computing environment without security protection mechanisms, such as a normal virtual machine using normal memory; virtual machine 122 is a virtual machine operating in a confidential computing environment with security protection mechanisms, such as a secure virtual machine using secure memory. Furthermore, secure virtual machines can be more secure than normal virtual machines. The security processor 4 can allocate secure memory to the secure virtual machine and maintain a nested page table for the secure virtual machine, preventing the host operating system, virtual machine monitor, and other devices from accessing secure memory usage, thereby reducing the risk of virtual machine attacks.

[0055] It is understandable that through virtualization technology, a computer can virtualize multiple virtual machines. In the Trusted Execution Environment (TEE) implemented by virtual machines, that is, ordinary computing environment and confidential computing environment, although the encryption hardware can include ordinary cryptographic coprocessors and secure cryptographic coprocessors, the number of encryption hardware hardware is far less than the number of virtual machines, and the simultaneous use of encryption hardware by multiple virtual machines will lead to hardware resource conflicts of the encryption hardware.

[0056] Therefore, to enable virtual machines to use cryptographic hardware for cryptographic or confidential computing, as an optional implementation, as shown in Figure 5, the cryptographic hardware can be passed directly to any of multiple virtual machines for use. For example, in a normal computing environment, a normal cryptographic coprocessor can be passed directly to a normal virtual machine for use, or in a confidential computing environment, a secure cryptographic coprocessor can be passed directly to a secure virtual machine for use. The cryptographic hardware passed directly to the virtual machine obtains and executes the data computing tasks sent by the virtual machine, and after the calculation is completed, it notifies the passed-through virtual machine through an interrupt, thereby saving CPU computing bandwidth.

[0057] However, during the data processing process, the inventor discovered that the encryption hardware can only be used by the directly connected virtual machine, and cannot be used by other virtual machines or the host operating system. This will result in the virtual machine being unable to efficiently utilize the encryption hardware to perform computing functions, thereby reducing the data processing performance of the virtual machine.

[0058] Therefore, improving the utilization of cryptographic hardware by virtual machines is particularly important. Based on this, the disclosed embodiments utilize an improved technical solution to maintain the device status of the cryptographic hardware using multiple simulated devices of a virtual machine monitor, enabling multiple virtual machines to share the cryptographic hardware. Furthermore, based on the device status of the cryptographic hardware, the simulated devices corresponding to the virtual machines process the virtual machine's request to use the cryptographic hardware, enabling any of the multiple virtual machines to use the cryptographic hardware for cryptographic calculations. This improves the utilization of the cryptographic hardware by the virtual machines and enhances the data processing performance of the virtual machines.

[0059] Based on the above ideas, Figure 6 exemplifies an optional flowchart of a method for configuring encryption hardware provided by an embodiment of the present disclosure. This method flow can be implemented by a virtual machine monitor. Specifically, the virtual machine monitor can create multiple simulated devices through the simulated device layer when the virtual machine starts up. These simulated devices are used to simulate the configuration of the encryption hardware. One simulated device corresponds to one virtual machine. The virtual machine's use of the encryption hardware requires establishing a usage relationship through the corresponding simulated device. Furthermore, the virtual machine monitor can specify the encryption hardware to which the simulated device is bound. Referring to Figure 6 , this method flow may include the following steps.

[0060] Step S21: maintaining the device status of the encryption hardware bound to the multiple simulated devices.

[0061] The virtual machine monitor in the embodiment of the present disclosure adds a simulated device layer, which enables multiple virtual machines to share the cryptographic coprocessor, so that multiple virtual machines can concurrently access the encryption hardware and perform data processing, avoiding the use of a direct pass-through method to pass the encryption hardware directly to a single virtual machine.

[0062] Based on the simulation device layer, multiple simulation devices are set up. The simulation devices can be configurations of simulated encryption hardware. One simulation device corresponds to one virtual machine. Multiple simulation devices are bound to the encryption hardware, so that the virtual machine no longer directly accesses the encryption hardware, but accesses the corresponding simulation device, so that multiple virtual machines share the encryption hardware through the corresponding simulation devices.

[0063] Figure 7 illustrates an exemplary diagram of multiple virtual machines accessing encryption hardware in accordance with an embodiment of the present disclosure. As shown in Figure 7, multiple virtual machines access corresponding simulated devices and share the encryption hardware through the corresponding simulated devices. In Figure 7, the multiple simulated devices operate synchronously to control virtual machine access to the encryption hardware. While one virtual machine is accessing the encryption hardware through the simulated device, another virtual machine must wait for the encryption hardware to complete execution.

[0064] In some embodiments, the virtual machine monitor may correspond to a shared memory space, wherein the shared memory space may be configured to allow multiple simulated devices to read and write, and the multiple simulated devices may store the device status of the bound encryption hardware in the shared memory space, thereby recording the device status of the encryption hardware bound to the multiple simulated devices in the shared memory space, and the multiple simulated devices may share the device status of the encryption hardware based on access to the shared memory space.

[0065] The device status may include an idle state and a busy state of the cryptographic hardware. When the cryptographic hardware is in the idle state, it indicates that the cryptographic hardware is not performing any cryptographic calculations and can be used by any virtual machine. When the cryptographic hardware is in the busy state, it indicates that the cryptographic hardware is currently occupied by a virtual machine and is performing cryptographic calculations, and cannot be used by any virtual machine other than the currently used virtual machine. Because a virtual machine's use of the cryptographic hardware requires the use of the corresponding simulated device, maintaining the device status of the cryptographic hardware bound to multiple simulated devices enables multiple virtual machines to share the cryptographic hardware through the corresponding simulated devices.

[0066] Step S22 : Based on the device status of the encryption hardware, the virtual machine's request to use the encryption hardware is processed through the simulated device corresponding to the virtual machine.

[0067] The device status based on the encryption hardware includes idle state and busy state. When any virtual machine among multiple virtual machines has the need to use encryption hardware for cryptographic calculations, the virtual monitor can process the virtual machine's request to use the encryption hardware through the simulated device corresponding to the virtual machine.

[0068] As an optional implementation, the virtual machine can query the device status of the encryption hardware based on the corresponding simulated device to determine the timing of sending a request to use the encryption hardware. In one example, if the simulated device finds that the device status of the encryption hardware is idle, the virtual machine can obtain a request to use the encryption hardware through the simulated device corresponding to the virtual machine, and then respond to the request through the simulated device corresponding to the virtual machine, so that the virtual machine can use the encryption hardware, thereby realizing the virtual machine's use of the encryption hardware.

[0069] It is understandable that in virtualization technology, encryption hardware is used to perform cryptographic calculations on the virtual machine's virtual machine data. Since virtual machine data corresponds to the guest physical address (GPA) in the virtual machine's address space, and the virtual machine data processed by the encryption hardware corresponds to the host physical address (HPA) in the memory address space, the encryption hardware needs to find the corresponding data in the memory based on the host physical address. Therefore, before the encryption hardware obtains the virtual machine's calculation command, it needs to obtain the mapping relationship between the virtual machine physical address in the virtual machine address space and the host physical address in the memory address space. This mapping relationship is mainly recorded through the input and output (I / O) page table.

[0070] It should be noted that the simulation device in the embodiment of the present disclosure can maintain an I / O page table that records the mapping relationship between the virtual machine physical address in the virtual machine address space and the host physical address in the memory address space. Therefore, the first simulation device can respond to the use request to enable the first virtual machine to use the encryption hardware.

[0071] In an optional implementation, the first simulation device may respond to the use request of the first virtual machine by setting the I / O page table of the first virtual machine to the input / output memory management unit (IOMMU), so that the encryption hardware can obtain the calculation command sent by the virtual machine. The calculation command may carry the virtual machine physical address. After obtaining the calculation command, the encryption hardware can translate the virtual machine physical address in the calculation command into a host physical address through the IOMMU, and obtain the corresponding target data in the memory for calculation.

[0072] Among them, Figure 8 exemplarily shows an interactive diagram of a virtual machine accessing encryption hardware in an embodiment of the present disclosure. As shown in Figure 8, virtual machines 01 and 02 access the device status of the encryption hardware recorded in the shared memory space through the corresponding simulation devices 01' and 02' respectively; when the simulation device 01' obtains the device status of the encryption hardware in the shared memory space as "idle state", it adjusts the device status of the encryption hardware recorded in the shared memory space to "busy state" and uses the encryption hardware, and the simulation device 02' needs to wait for the execution of the encryption hardware to be completed. Furthermore, virtual machine 01 adjusts the device status recorded in the shared memory space through the simulation device 01', thereby realizing the use of the encryption hardware; the simulation device 01' sets the I / O page table to the IOMMU, and the encryption hardware translates the virtual machine physical address into the host physical address based on the IOMMU, obtains the corresponding data in the memory, and performs calculations.

[0073] It can be seen that the embodiment of the present disclosure maintains the device status of the encryption hardware through multiple simulation devices, so that multiple virtual machines can share the encryption hardware, and then based on the device status of the encryption hardware, the virtual machine's request to use the encryption hardware is processed through the simulation device corresponding to the virtual machine, ensuring that the encryption hardware is used by one virtual machine at a time, and enabling multiple virtual machines to share the encryption hardware for cryptographic calculation and processing of data, thereby improving the utilization rate of the encryption hardware by the virtual machine and improving the data processing performance of the virtual machine.

[0074] In some embodiments, since the virtual machine no longer directly accesses the encryption hardware but accesses the corresponding simulated device, the virtual machine's use of the encryption hardware can be achieved through the corresponding simulated device. Taking any one of the multiple virtual machines (for example, the first virtual machine) as an example, after the first virtual machine obtains the corresponding first simulated device to query that the device status of the encryption hardware is idle, the first virtual machine can send a use request to the corresponding first simulated device to request the use of the encryption hardware, and then can obtain the first virtual machine's use request for the use of the encryption hardware through the first simulated device corresponding to the first virtual machine, and respond to the use request through the first simulated device, so that the first virtual machine uses the encryption hardware.

[0075] Furthermore, in some embodiments, based on the maintenance of the device state of the bound encryption hardware by the simulation device, when a first virtual machine uses the encryption hardware, the device state of the encryption hardware can be adjusted to a busy state through the first simulation device corresponding to the first virtual machine, so that a second virtual machine stops sending usage requests until the device state of the encryption hardware is adjusted to an idle state. The second virtual machine can be a different virtual machine from the first virtual machine among the multiple virtual machines.

[0076] It is understood that after the first simulated device responds to the first virtual machine's request to use the cryptographic hardware, the first virtual machine can use the cryptographic hardware to perform cryptographic calculations on the data. To avoid hardware resource conflicts caused by other virtual machines using the cryptographic hardware at the same time, the first simulated device can adjust the device state of the cryptographic hardware, which is in an idle state, to a busy state. Furthermore, while the first virtual machine is using the cryptographic hardware, the simulated devices corresponding to other virtual machines will query the cryptographic hardware to be in a busy state, causing the other virtual machines to stop sending requests to the corresponding simulated devices to use the cryptographic hardware until the first virtual machine has finished using it. When the first virtual machine has finished using the cryptographic hardware, the first simulated device corresponding to the first virtual machine can adjust the device state of the cryptographic hardware to an idle state. Only when the other virtual machines detect that the cryptographic hardware is in an idle state through the corresponding simulated device can they send requests to the corresponding simulated device to use the cryptographic hardware. This ensures that the cryptographic hardware is used by only one virtual machine at a time, and by allowing any virtual machine to use the cryptographic hardware when the cryptographic hardware is in an idle state, multiple virtual machines can share the cryptographic hardware to perform cryptographic calculations on the data.

[0077] In some embodiments, maintenance of the device state of the cryptographic hardware bound to the multiple simulated devices can be achieved based on a shared memory space by allowing multiple simulated devices to read and write the device state of the bound cryptographic hardware. The shared memory space can record the device state of the cryptographic hardware bound to the multiple simulated devices, allowing multiple virtual machines to share the device state of the cryptographic hardware through access to the shared memory space by the corresponding simulated devices, thereby enabling shared cryptographic hardware and performing cryptographic calculations on data.

[0078] Based on the shared memory space, as an optional implementation, adjusting the device status of the encryption hardware to a busy state through the first simulation device corresponding to the first virtual machine can be achieved by adjusting the device status of the encryption hardware recorded in the shared memory space to a busy state through the first simulation device corresponding to the first virtual machine, so that other virtual machines can stop sending requests to use the encryption hardware, avoiding other virtual machines from sending invalid requests to use the encryption hardware and resource conflicts.

[0079] As another optional implementation, when the first virtual machine finishes using the encryption hardware, the device state of the encryption hardware recorded in the shared memory space can be adjusted to an idle state through the first simulation device corresponding to the first virtual machine, so that other virtual machines can send requests to use the encryption hardware and use the encryption hardware to perform cryptographic calculations on the data.

[0080] In some embodiments, to enable multiple virtual machines to use encryption hardware, it is necessary to map the virtual machine physical addresses of the multiple virtual machines to the register space of the encryption hardware. Therefore, it is necessary to establish a mapping relationship between the virtual machines in the address space of the encryption hardware. Figure 9 exemplifies another optional flow chart of the configuration method of encryption hardware in an embodiment of the present disclosure. As shown in Figure 9, before step S21, the following steps may also be included:

[0081] Step S20: When the virtual machine is started, the register address space of the encryption hardware is mapped to the virtual machine through the simulation device corresponding to the virtual machine.

[0082] It is understandable that, since the virtual machine no longer directly accesses the cryptographic coprocessor but instead accesses the simulated device, the cryptographic hardware register address space can be mapped to the virtual machine through the simulated device corresponding to the virtual machine. Furthermore, since the simulated device is created by the virtual machine monitor when the virtual machine starts, the cryptographic hardware register address space can also be mapped to the virtual machine through the simulated device corresponding to the virtual machine when the virtual machine starts. That is, when the virtual machine starts, the cryptographic hardware register address space can be mapped to the virtual machine through the simulated device corresponding to the virtual machine.

[0083] As an optional implementation, the virtual machine no longer directly accesses the encryption hardware but instead accesses an emulated device. Upon startup, the virtual machine can send a request to query the encryption hardware's register address to the emulated device. Specifically, upon startup, the virtual machine obtains the virtual machine's query request for the encryption hardware's register address space through the emulated device corresponding to the virtual machine. Furthermore, the corresponding emulated device queries the address information of the register address space, and, based on the queried address information of the register address space, the encryption hardware's register address space is mapped to the virtual machine.

[0084] In a further example, based on the address information of the queried register address space, the register address space of the encryption hardware is mapped to the virtual machine, and a nested page table can be established based on the address information of the register address space, and the nested page table is used to record the mapping of the virtual machine physical address of the virtual machine to the address space of the cryptographic coprocessor.

[0085] It should be noted that a virtual machine creates a nested page table through a corresponding simulated device so that before the virtual machine uses the encryption hardware, it can obtain the physical address corresponding to the virtual machine's physical address in the address space of the encryption hardware according to the nested page table. Then, the virtual machine can query the device status corresponding to the encryption hardware in the shared memory space through the simulated device and use the encryption hardware. Figure 10 exemplifies an address mapping diagram for a virtual machine to access encryption hardware. As shown in Figure 10, the virtual machine monitor creates a nested page table and maps the virtual machine's virtual machine physical address to the register space of the encryption hardware, so that the virtual machine can use the nested page table to query the physical address of the virtual machine's physical address in the register space of the encryption hardware, thereby achieving access to the encryption hardware.

[0086] Based on the created nested page tables, FIG11 exemplifies an interactive diagram of virtual machines synchronously accessing shared memory space through simulated devices. As shown in FIG11 , virtual machines 01 and 02 respectively query the mapping relationship between the virtual machine's virtual machine physical address and the address space of the encryption hardware, as recorded in the corresponding nested page tables, thereby sending device status query requests to the corresponding simulated devices 01' and 02'. The device status of the encryption hardware is queried in the shared memory space through the corresponding simulated devices 01' and 02'. When the corresponding simulated device 01' or 02' finds that the current device status of the encryption hardware is "idle", the corresponding simulated device 01' or 02' adjusts the device status in the shared memory space to "busy" based on the mapping relationship between the virtual machine's virtual machine physical address and the address space of the encryption hardware, as recorded in the corresponding nested page tables 01" or 02", thereby enabling the corresponding virtual machine 01 or 02 to use the encryption hardware.

[0087] In some embodiments, when a virtual machine uses encryption hardware to perform data calculations, the encryption hardware needs to obtain the host physical address corresponding to the virtual machine physical address of the virtual machine through the input-output memory management unit. Therefore, based on the input-output page table, the mapping relationship between the virtual machine physical address of the virtual machine and the host physical address can be recorded. The input-output page table of the first virtual machine can be written into the input-output memory management unit through the first simulation device. The input-output page table records the address mapping relationship between the virtual machine physical address and the host physical address, so that when the first virtual machine uses the cryptographic coprocessor to perform calculations, it can query the host physical address according to the input-output page table, thereby obtaining the target data to be processed in the memory, performing calculations, and returning the calculation results to the first virtual machine.

[0088] It should be noted that the virtual machine monitor can enable the IOMMU function to establish an I / O page table for the encryption hardware, providing a mapping relationship between the virtual machine physical address and the host physical address, so that the encryption hardware can access the host physical memory through the I / O page table. Figure 12 exemplifies the address conversion diagram of the encryption hardware accessing memory. As shown in Figure 12, when the virtual machine uses the encryption hardware to start computing, because the encryption hardware can obtain the virtual machine physical address (GPA) of the data sent by the virtual machine, the encryption hardware can query the I / O page table through the IOMMU, translate the GPA into the host physical address (HPA), and access the memory data.

[0089] To facilitate understanding of the above, Figure 13 illustrates a computational sequence diagram for sharing encryption hardware among multiple virtual machines, as provided in an embodiment of the present disclosure. As shown in Figure 13, upon startup of the virtual machine, step S310 is executed to send a query request for the register address space of the encryption hardware to the simulation device. The simulation device receives the query request from the virtual machine and then executes step S311 to query the register address space of the encryption hardware. In an optional example, after querying the register address space of the encryption hardware, the simulation device can feedback address information to the virtual machine so that the virtual machine obtains the register address space of the encryption hardware. The simulation device then executes step S312 to map the register address space of the encryption hardware to the virtual machine, completing the mapping of the register address space between the virtual machine and the encryption hardware. When the virtual machine is running, the virtual machine executes step S313, and the virtual machine queries the simulated device for the device status of the encryption hardware; the simulated device obtains the query request and executes step S314, and the simulated device queries and adjusts the device status of the encryption hardware in the shared memory space. In an optional example, after querying the device status of the encryption hardware, the simulated device can feedback the device status of the encryption hardware to the virtual machine (the step indicated by the dotted arrow in the figure); when the simulated device queries that the device status of the encryption hardware is idle, the simulated device executes step S315, and sets an I / O page table that records the mapping relationship between GPA and HPA to the IOMMU , so that the virtual machine can execute step S316 to send a calculation command to the encryption hardware, where the calculation command carries the GPA; the encryption hardware obtains the calculation command and executes step S317 to query the IOMMU for the HPA corresponding to the GPA; based on the corresponding HPA, step S318 can be executed to request target data from the memory; then step S319 is executed, and the memory returns the target data corresponding to the HPA to the encryption hardware; the encryption hardware obtains the target data and executes step S320 to perform calculation processing on the target data; then, after obtaining the calculation result, step S321 is executed, and the encryption hardware sends the calculation result to the virtual machine.

[0090] In some embodiments, based on the common computing environment and confidential computing environment of the computer system architecture shown in Figure 2, the cryptographic hardware may include a common cryptographic coprocessor and / or a secure cryptographic coprocessor. The common cryptographic coprocessor is used to perform common computing tasks in the common computing environment, while the secure cryptographic coprocessor is used to perform confidential computing tasks in the confidential computing environment.

[0091] As an optional implementation, the ordinary computing environment can be isolated from the confidential computing environment, the ordinary computing environment is used to perform ordinary computing tasks, and the confidential computing environment is used to perform confidential computing tasks.

[0092] It should be noted that the configuration method of the encryption hardware of the embodiment of the present disclosure is applicable to ordinary cryptographic coprocessors, and is also applicable to situations where there are one or more secure cryptographic coprocessors in a confidential computing environment; among them, when a secure cryptographic coprocessor is applied, based on the security of the data, it is necessary to convey messages to the secure cryptographic coprocessor through the secure processor.

[0093] It can be seen that the embodiment of the present disclosure maintains the device status of the encryption hardware through multiple simulation devices, so that multiple virtual machines can share the encryption hardware. When the encryption hardware is in an idle state, any one of the multiple virtual machines can use the encryption hardware for calculation and processing, and then based on the device status of the encryption hardware, the virtual machine's request to use the encryption hardware is processed through the simulation device corresponding to the virtual machine, ensuring that the cryptographic coprocessor is used by one virtual machine at a time, and realizing that multiple virtual machines share the encryption hardware for cryptographic calculation and processing of data, thereby improving the utilization rate of the encryption hardware by the virtual machine and improving the data processing performance of the virtual machine.

[0094] The following describes the configuration device for encryption hardware provided by the embodiments of the present disclosure. The device described below can be considered the functional modules required for a virtual machine monitor to implement the configuration method for encryption hardware provided by the embodiments of the present disclosure. The following description can be used in conjunction with the above description.

[0095] As an optional implementation, FIG14 exemplarily shows an optional block diagram of a configuration device for encryption hardware provided in an embodiment of the present disclosure. The device can be applied to a virtual machine monitor. Referring to FIG14 , the device can include: state maintenance logic 101 and request processing logic 102 .

[0096] The state maintenance logic 101 is configured to maintain the device state of the encryption hardware bound to the multiple simulated devices, wherein the device state includes an idle state and a busy state. One simulated device corresponds to one virtual machine, and multiple simulated devices are bound to the encryption hardware so that the multiple virtual machines share the encryption hardware through the corresponding simulated devices.

[0097] The request processing logic 102 is used to process the virtual machine's request to use the encryption hardware based on the device status of the encryption hardware through the simulated device corresponding to the virtual machine, so that the virtual machine uses the encryption hardware. The virtual machine is any one of multiple virtual machines.

[0098] Optionally, the request processing logic 102 is configured to process the virtual machine's request for use of the encryption hardware through the simulated device corresponding to the virtual machine based on the device status of the encryption hardware, including:

[0099] If the device state of the encryption hardware is an idle state, obtaining, through a first simulation device corresponding to a first virtual machine, a request from the first virtual machine to use the encryption hardware; the first virtual machine is any one of the multiple virtual machines;

[0100] The first simulation device responds to the usage request, so that the first virtual machine uses the encryption hardware.

[0101] Optionally, it also includes: adjusting the device state of the encryption hardware to a busy state through the first simulation device, so that the second virtual machine stops sending usage requests until the device state of the encryption hardware is adjusted to an idle state; wherein, the second virtual machine is a virtual machine among the multiple virtual machines that is different from the first virtual machine.

[0102] Specifically, the state maintenance logic 101 is used to execute the aforementioned encryption hardware configuration method.

[0103] Furthermore, corresponding to the aforementioned encryption hardware configuration method, the encryption hardware configuration device may further set an address mapping logic 100 for mapping the register address space of the encryption hardware to the virtual machine through the simulation device corresponding to the virtual machine when the virtual machine is started.

[0104] Optionally, in the state maintenance logic 101, the step of maintaining the device states of the encryption hardware bound to the multiple simulated devices includes:

[0105] The device states of encryption hardware bound to a plurality of simulated devices are recorded in a shared memory space, where the shared memory space is configured to allow the plurality of simulated devices to read and write.

[0106] Optionally, the state maintenance logic 101, by using the first simulated device corresponding to the first virtual machine, adjusts the device state of the encryption hardware to a busy state, including:

[0107] The device state of the encryption hardware recorded in the shared memory space is adjusted to a busy state through the first simulation device corresponding to the first virtual machine.

[0108] Optionally, the state maintenance logic 101 is further used to adjust the device state of the encryption hardware recorded in the shared memory space to an idle state through the first simulation device corresponding to the first virtual machine when the first virtual machine ends using the encryption hardware.

[0109] Optionally, the address mapping logic 100, when the virtual machine is started, is used to map the register address space of the encryption hardware for the virtual machine through the simulation device corresponding to the virtual machine, which may include:

[0110] When the virtual machine is started, the virtual machine obtains a query request for the register address space of the encryption hardware through the simulated device corresponding to the virtual machine;

[0111] The address information of the register address space is queried through a simulation device corresponding to the virtual machine, and the register address space of the encryption hardware is mapped to the virtual machine according to the queried address information of the register address space.

[0112] Optionally, the step of mapping the register address space of encryption hardware for the virtual machine according to the queried address information of the register address space may include:

[0113] A nested page table is established according to the address information of the register address space, and the nested page table is used to record the mapping of the virtual machine physical address of the virtual machine to the address space of the encryption hardware.

[0114] Optionally, the state maintenance logic 101 responding to the use request through the first simulation device so that the first virtual machine uses the encryption hardware may include:

[0115] The input / output page table of the first virtual machine is written into the input / output memory management unit through the first simulation device, wherein the input / output page table records the address mapping relationship between the virtual machine physical address and the host physical address.

[0116] The disclosed embodiments also provide a method for confidential data computing in a confidential computing environment. The secure cryptographic coprocessor in this confidential computing environment may be cryptographic hardware configured according to the aforementioned method for configuring cryptographic hardware. Based on the technical principles of the disclosed embodiments, FIG15 illustrates an optional flow chart of the method for confidential data computing provided by the disclosed embodiments. This method flow may be implemented by a virtual machine monitor. As shown in FIG15 , the method flow may include the following steps.

[0117] Step S41: Obtain the confidential computing command for the simulated device sent by the virtual machine.

[0118] The virtual machine monitor in the disclosed embodiments adds a simulated device layer, which creates a simulated device configured to simulate a secure cryptographic coprocessor. The secure cryptographic coprocessor can be cryptographic hardware configured according to the aforementioned cryptographic hardware configuration method. This allows the virtual machine to send confidential computing commands directly to the simulated device, avoiding the need to pass the secure cryptographic coprocessor directly to the virtual machine. The virtual machine monitor can then receive confidential computing commands sent by the virtual machine to the simulated device.

[0119] The confidential computing command is used to instruct the secure cryptographic coprocessor to perform confidential computing on data.

[0120] Step S42: obtaining the permission to use the secure cryptographic coprocessor so as to obtain the confidential computing result of the secure cryptographic coprocessor according to the confidential computing command, and returning the confidential computing result to the virtual machine.

[0121] In an embodiment of the present disclosure, virtual machine monitors of different virtual machines can synchronously negotiate the use of a secure cryptographic coprocessor. In one example, the virtual machine monitors have memory space, and the synchronization of the virtual machine monitors can be a virtual machine monitor corresponding to searching the memory space of another virtual machine monitor for a device status flag of the secure cryptographic coprocessor. If the device status flag indicates that the secure cryptographic coprocessor is not in use, the secure cryptographic coprocessor is currently in an idle state, so that the virtual machine monitor can obtain the right to use the secure cryptographic coprocessor, and then send a confidential computing command for performing confidential computing to the secure cryptographic coprocessor; after obtaining the confidential computing command for performing confidential computing, the secure cryptographic coprocessor can perform confidential computing on the data and send the confidential computing result to the virtual machine monitor, so that the virtual machine monitor can obtain the confidential computing result of the secure cryptographic coprocessor and return the confidential computing result to the virtual machine, completing the confidential computing of the virtual machine.

[0122] It can be seen that the data confidentiality computing method of the embodiment of the present disclosure can realize the use of the secure cryptographic coprocessor by multiple virtual machines, improve the utilization rate of the secure cryptographic coprocessor by the virtual machines, and improve the data processing performance of the virtual machines.

[0123] In some embodiments, virtual machine monitors based on different virtual machines can synchronously negotiate the use of the secure cryptographic coprocessor and the configuration of the simulated device to simulate the secure cryptographic coprocessor. The device status of the secure cryptographic coprocessor corresponding to different simulated devices can be accessed. When the device status of the secure cryptographic coprocessor corresponding to different simulated devices is in an idle state, the use permission of the secure cryptographic coprocessor can be obtained, and the device status of the secure cryptographic coprocessor simulated by the corresponding simulated device can be adjusted to a busy state, thereby obtaining the use permission of the secure cryptographic coprocessor, avoiding the use of a direct pass-through method to pass the secure cryptographic coprocessor directly to any one of multiple virtual machines.

[0124] It should be noted that the secure cryptographic coprocessor corresponding to different simulated devices may be unique, that is, the number of secure cryptographic coprocessors is 1. Therefore, when the device states of the secure cryptographic coprocessors corresponding to different simulated devices are all in idle state, the current secure cryptographic coprocessor is not in use and the use permission of the secure cryptographic coprocessor can be obtained.

[0125] In some embodiments, the confidential computing command sent by the virtual machine may carry a command ID and a command address parameter, where the command ID corresponds to the type of confidential computing to be performed, such as encryption operation, decryption operation, hash operation, etc.; the command address parameter may include the virtual machine physical address (GPA) of the data.

[0126] It should be noted that in a confidential computing environment, the secure cryptographic coprocessor can access confidential resources, such as virtual machine ciphertext and secure storage (used to store highly confidential keys). However, when accessing memory, the secure processor and secure cryptographic coprocessor do not use the IOMMU for address translation and only process the host physical address (HPA) corresponding to the memory address space. Therefore, it is necessary to convert the virtual machine physical address of the command address parameter in the confidential computing command into a host physical address.

[0127] The command address parameter includes the virtual machine physical address. To obtain the target data for confidential computing, the host physical address corresponding to the data in the memory address space must be obtained. As an optional implementation, after receiving the confidential computing command through the simulation device, the virtual machine monitor can convert the virtual machine physical address into a host physical address based on the confidential computing command, thereby obtaining a processed confidential computing command to obtain the target data to be calculated in memory. Furthermore, the virtual machine monitor can send the processed confidential computing command to the secure cryptographic coprocessor and obtain the confidential computing results of the secure cryptographic coprocessor.

[0128] In some embodiments, the virtual machine monitor can create a nested page table, which can record the address mapping relationship between the virtual machine physical address and the host physical address, so as to convert the virtual machine physical address into the host physical address according to the confidential computing command. Specifically, according to the command address parameter, the nested page table is queried to convert the virtual machine physical address into the host physical address.

[0129] It should be noted that, in an optional example, the nested page table can record the address mapping relationship of the virtual machine physical address in the register space of the encryption hardware, and in another optional example, the nested page table can record the address mapping relationship of the virtual machine physical address in the memory address space. In the embodiment of the present disclosure, the secure processor and the secure cryptographic coprocessor do not use IOMMU for address translation, and only process the host physical address (HPA). Therefore, the virtual machine monitor can query the nested page table that records the address mapping relationship of the virtual machine physical address in the memory address space, thereby converting the virtual machine physical address of the command address parameter in the confidential computing command into a host physical address, and the host physical address, that is, the virtual machine physical address, corresponds to the host physical address of the memory address space, so as to enable the secure cryptographic coprocessor to obtain data in the memory according to the host physical address and perform confidential computing. Among them, the nested page table that records the address mapping relationship of the virtual machine physical address in the memory address space can be a secure processor that sends an address query command to the memory to obtain the address space of the memory; and then, based on the obtained memory address space, establishes a host physical address mapping relationship between the virtual machine physical address and the memory address space.

[0130] It should be further explained that based on the configuration of the virtual machine monitor simulating the secure cryptographic coprocessor through the simulated device, the virtual machine sends confidential computing commands to the simulated device, and after obtaining the returned confidential computing results through the virtual machine monitor, it can enter the virtual machine exit mode.

[0131] Among them, Figure 16 exemplarily shows an interactive diagram of multiple virtual machines accessing the secure cryptographic coprocessor in an embodiment of the present disclosure. As shown in Figure 16, virtual machines A and B correspond to virtual machine monitors a and b respectively, and the simulation device layer of virtual machine monitor a is provided with a simulation device A' configured to simulate the secure cryptographic coprocessor, and the simulation device layer of virtual machine monitor b is provided with a simulation device B' configured to simulate the secure cryptographic coprocessor; virtual machine monitor a corresponds to searching the nested page table A", and virtual machine monitor b corresponds to searching the nested page table B". Moreover, virtual machines A and B can be secure virtual machines. Among them, the nested page table A" and the nested page table B" record the address mapping relationship between the virtual machine physical address (GPA) of the corresponding virtual machine and the host physical address (HPA) in the memory address space.

[0132] Based on the configuration simulation of the secure cryptographic coprocessor by simulated devices A' and B', virtual machines A and B can send data confidential computing commands to the corresponding simulated devices A' and B'. Furthermore, virtual machine monitors a and b can obtain the data confidential computing commands sent by the corresponding virtual machines to the simulated devices, query the corresponding nested page tables, and convert the virtual machine physical addresses in the data confidential computing commands into host physical addresses. Furthermore, virtual machine monitors a and b can synchronize their access rights to the secure cryptographic coprocessor. For example, when virtual machine monitor a synchronously accesses virtual machine monitor b and finds that virtual machine monitor b is not using the secure cryptographic coprocessor, virtual machine monitor a records the device status of the secure cryptographic coprocessor as "busy" for virtual machine A. Furthermore, virtual machine monitor a can send data confidential computing commands containing the host physical address to the secure cryptographic coprocessor via the security processor, allowing the secure cryptographic coprocessor to retrieve the target data from memory based on the host physical address, perform confidential computing on the target data, and send the confidential computing results to virtual machine monitor a via the security processor. Finally, virtual machine monitor a returns the confidential computing results to virtual machine A.

[0133] It can be seen that the data confidentiality computing method of the embodiment of the present disclosure can realize the use of the secure cryptographic coprocessor by multiple virtual machines, improve the utilization rate of the secure cryptographic coprocessor by the virtual machines, and improve the data processing performance of the virtual machines.

[0134] In some embodiments, since the secure cryptographic coprocessor processes confidential computing tasks in a confidential computing environment, the virtual machine needs to verify the transmission of confidential computing commands to determine the security of information interaction. In addition, based on data security considerations, it is necessary to convey messages to the secure cryptographic coprocessor through the secure processor. In one example, the secure processor can be used to perform key negotiation to generate a key pair to obtain a chip private key and a chip public key, and the secure processor can transmit the chip public key to the virtual machine, which saves the chip public key. Therefore, as an optional implementation, the confidential computing command can also carry a signature file, and the signature file is used to sign the signature file using the chip private key through the secure processor that forwards the confidential computing command to the secure cryptographic coprocessor. For example, the secure processor encrypts the signature file using the chip private key, so that the virtual machine uses the chip public key that matches the chip private key to verify the signature file in the confidential computing result to determine that the confidential computing command is conveyed to the secure cryptographic coprocessor for execution and processing through the secure processor.

[0135] It can be seen that the data confidentiality computing method of the embodiment of the present disclosure can realize the use of the secure cryptographic coprocessor by multiple virtual machines, improve the utilization rate of the secure cryptographic coprocessor by the virtual machines, and improve the data processing performance of the virtual machines.

[0136] The following describes the data confidentiality computing device provided by the embodiments of the present disclosure. The device described below can be considered the functional modules required by a virtual machine monitor corresponding to a virtual machine to implement the data confidentiality computing method provided by the embodiments of the present disclosure. The following description can be cross-referenced with the above description.

[0137] As an optional implementation, FIG17 exemplarily shows an optional block diagram of a data confidentiality computing device provided in an embodiment of the present disclosure. The device can be applied to a virtual machine monitor. Referring to FIG17 , the device may include: command acquisition logic 110 and hardware usage logic 120.

[0138] The command acquisition logic 110 is configured to acquire a confidential computing command for a simulated device sent by a virtual machine, where the simulated device is configured to simulate a program of a secure cryptographic coprocessor, where the secure cryptographic coprocessor is cryptographic hardware configured according to the above-described cryptographic hardware configuration method.

[0139] The hardware usage logic 120 is used to obtain the use permission of the secure cryptographic coprocessor, so as to obtain the confidential computing result of the secure cryptographic coprocessor according to the confidential computing command, and return the confidential computing result to the virtual machine.

[0140] Optionally, the step of the hardware usage logic 120 for obtaining permission to use the secure cryptographic coprocessor includes:

[0141] By accessing the device status of the secure cryptographic coprocessor simulated by different simulation devices, when the device status of the secure cryptographic coprocessor simulated by different simulation devices is idle, the use permission of the secure cryptographic coprocessor is obtained, and the device status of the secure cryptographic coprocessor simulated by the corresponding simulation device is adjusted to busy.

[0142] Optionally, the confidential computing command carries a command ID and a command address parameter, the command ID corresponds to the type of confidential computing to be executed, and the command address parameter includes a virtual machine physical address;

[0143] In the hardware usage logic 120, the step of obtaining the confidential computing result of the encryption hardware according to the confidential computing command includes:

[0144] According to the confidential computing command, convert the virtual machine physical address into a host physical address to obtain a processed confidential computing command;

[0145] The processed confidential computing command is sent to the secure cryptographic coprocessor, and a confidential computing result of the secure cryptographic coprocessor is obtained.

[0146] Optionally, converting the virtual machine physical address into the host physical address according to the confidential computing command can be specifically done by querying the nested page table according to the command address parameter and converting the virtual machine physical address into the host physical address; the nested page table records the address mapping relationship from the virtual machine physical address to the host physical address.

[0147] An embodiment of the present disclosure also provides a computer system, which may include: a virtual machine monitor, multiple virtual machines, and encryption hardware, wherein the virtual machine monitor includes a configuration device for the encryption hardware as described above, or a data confidentiality computing device as described above.

[0148] Optionally, the virtual machine monitor is provided with a simulation device layer, and the simulation device layer is provided with the simulation device described in the above-mentioned encryption hardware configuration method, or the simulation device described in the above-mentioned data confidentiality computing method.

[0149] An embodiment of the present disclosure also provides an electronic device, which may include a memory and a processor, wherein the memory stores a computer program that can be run by the processor, and when the processor runs the computer program, it executes the configuration method of the encryption hardware as described above, or the steps in the data confidentiality computing method as described above.

[0150] An embodiment of the present disclosure also provides a storage medium, which stores one or more computer-executable instructions. When the one or more computer-executable instructions are executed, the configuration method of encryption hardware and / or the data confidentiality computing method of the embodiment of the present disclosure are implemented.

[0151] The above describes multiple embodiment schemes provided by the embodiments of the present disclosure. The various optional methods introduced in each embodiment scheme can be combined and cross-referenced with each other without conflict, thereby extending a variety of possible embodiment schemes, which can all be considered as embodiment schemes disclosed and disclosed by the embodiments of the present disclosure.

[0152] Although the embodiments of the present disclosure are disclosed above, the present disclosure is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the scope of protection of the present disclosure shall be based on the scope defined by the claims.

Claims

1. A method for configuring encryption hardware, comprising: Maintaining device states of encryption hardware bound to multiple simulated devices, the device states including an idle state and a busy state; wherein one simulated device corresponds to one virtual machine, and multiple simulated devices are bound to the encryption hardware so that multiple virtual machines share the encryption hardware through the corresponding simulated devices; and Based on the device status of the encryption hardware, a request for use of the encryption hardware by the virtual machine is processed through a simulation device corresponding to the virtual machine, so that the virtual machine uses the encryption hardware, and the virtual machine is any one of the multiple virtual machines.

2. The method for configuring encryption hardware according to claim 1, wherein: The processing of the virtual machine's request for using the encryption hardware based on the device state of the encryption hardware through a simulated device corresponding to the virtual machine includes: If the device state of the encryption hardware is an idle state, obtaining, through a first simulation device corresponding to a first virtual machine, a use request of the first virtual machine to use the encryption hardware; the first virtual machine is any one of the multiple virtual machines; and The first simulation device responds to the use request so that the first virtual machine uses the encryption hardware.

3. The method for configuring encryption hardware according to claim 2, further comprising: Through the first simulation device, the device state of the encryption hardware is adjusted to a busy state, so that the second virtual machine stops sending usage requests until the device state of the encryption hardware is adjusted to an idle state; wherein the second virtual machine is a virtual machine among the multiple virtual machines that is different from the first virtual machine.

4. The method for configuring encryption hardware according to any one of claims 1 to 3, wherein: The device status of the encryption hardware bound to the plurality of simulated devices includes: The device states of the encryption hardware bound to the multiple simulated devices are recorded in a shared memory space, and the shared memory space is configured to allow the multiple simulated devices to read and write.

5. The method for configuring encryption hardware according to claim 4, wherein: Adjusting the device state of the encryption hardware to a busy state by using the first simulation device corresponding to the first virtual machine includes: The first simulation device corresponding to the first virtual machine records the shared memory space The device status of the encryption hardware is adjusted to busy.

6. The method for configuring encryption hardware according to claim 5, further comprising: When the first virtual machine finishes using the encryption hardware, the device state of the encryption hardware recorded in the shared memory space is adjusted to an idle state through a first simulation device corresponding to the first virtual machine.

7. The method for configuring encryption hardware according to any one of claims 1 to 6, further comprising: When the virtual machine is started, the register address space of the encryption hardware is mapped to the virtual machine through the simulation device corresponding to the virtual machine.

8. The method for configuring encryption hardware according to claim 7, wherein: When the virtual machine is started, mapping the register address space of the encryption hardware for the virtual machine through the simulation device corresponding to the virtual machine includes: When the virtual machine is started, obtaining a query request of the virtual machine for a register address space of encryption hardware through a simulation device corresponding to the virtual machine; and The address information of the register address space is queried through the simulation device corresponding to the virtual machine, and the register address space of the encryption hardware is mapped to the virtual machine according to the queried address information of the register address space.

9. The method for configuring encryption hardware according to claim 8, wherein: The step of mapping the register address space of encryption hardware for the virtual machine according to the queried address information of the register address space includes: A nested page table is established according to the address information of the register address space, and the nested page table is configured to record a mapping from a virtual machine physical address of the virtual machine to an address space of encryption hardware.

10. The method for configuring encryption hardware according to any one of claims 2 to 6, wherein: The responding to the use request by the first simulation device so that the first virtual machine uses the encryption hardware includes: The input / output page table of the first virtual machine is written into the input / output memory management unit through the first simulation device, wherein the input / output page table records the address mapping relationship between the virtual machine physical address and the host physical address.

11. The method for configuring encryption hardware according to any one of claims 1 to 10, wherein: The encryption hardware includes a common cryptographic coprocessor and / or a secure cryptographic coprocessor; wherein the common cryptographic coprocessor is configured to perform common computing tasks in a common computing environment; and the secure cryptographic coprocessor is configured to perform confidential computing tasks in a confidential computing environment.

12. The method for configuring encryption hardware according to claim 11, wherein: The ordinary computing environment is isolated from the confidential computing environment, the ordinary computing environment is configured to perform ordinary computing tasks, and the confidential computing environment is configured to perform confidential computing tasks.

13. A configuration device for encryption hardware, comprising: A state maintenance logic is configured to maintain a device state of encryption hardware bound to a plurality of simulated devices, the device state comprising an idle state and a busy state; wherein one simulated device corresponds to one virtual machine, and the plurality of simulated devices are bound to the encryption hardware so that the plurality of virtual machines share the encryption hardware through the corresponding simulated devices; and The request processing logic is configured to process the virtual machine's request to use the encryption hardware based on the device status of the encryption hardware through the simulated device corresponding to the virtual machine, so that the virtual machine uses the encryption hardware. The virtual machine is any one of the multiple virtual machines.

14. The encryption hardware configuration device according to claim 13, further comprising: The address mapping logic is configured to map the register address space of the encryption hardware for the virtual machine through the simulation device corresponding to the virtual machine when the virtual machine is started.

15. A data confidentiality computing method, comprising: Obtaining a confidential computing command for a simulated device sent by a virtual machine, wherein the simulated device is configured to simulate a configuration of a secure cryptographic coprocessor, and the secure cryptographic coprocessor is cryptographic hardware configured according to the configuration method for cryptographic hardware according to claim 1; as well as The use authority of the secure cryptographic coprocessor is obtained so that according to the confidential computing command, the confidential computing result of the secure cryptographic coprocessor is obtained, and the confidential computing result is returned to the virtual machine.

16. The data confidentiality computing method according to claim 15, wherein: The obtaining of the permission to use the secure cryptographic coprocessor includes: By accessing the device status of the secure cryptographic coprocessor simulated by different simulation devices, when the device status of the secure cryptographic coprocessor simulated by different simulation devices is all in idle state, the permission to use the secure cryptographic coprocessor is obtained, and the device status of the secure cryptographic coprocessor simulated by the corresponding simulation device is adjusted to busy state.

17. The data confidentiality computing method according to claim 15 or 16, wherein: The confidential computing command carries a command ID and a command address parameter, the command ID corresponds to the type of confidential computing to be performed, and the command address parameter includes a virtual machine physical address; The step of obtaining the confidential computing result of the secure cryptographic coprocessor according to the confidential computing command includes: According to the confidential computing command, convert the virtual machine physical address into a host physical address to obtain a processed confidential computing command; as well as The processed confidential computing command is sent to the secure cryptographic coprocessor, and a confidential computing result of the secure cryptographic coprocessor is obtained.

18. The data confidentiality computing method according to claim 17, wherein: The method of converting the virtual machine physical address into the host physical address according to the confidential computing command includes: querying the nested page table according to the command address parameter, and converting the virtual machine physical address into the host physical address; the nested page table records the address mapping relationship from the virtual machine physical address to the host physical address.

19. The data confidentiality computing method according to claim 17 or 18, wherein: The confidential computing command also carries a signature file, and the signature file is configured to sign the signature file using a chip private key through a secure processor that forwards the confidential computing command to the secure cryptographic coprocessor, so that the virtual machine uses a chip public key that matches the chip private key to verify the signature file in the confidential computing result.

20. A data confidentiality computing device, comprising: A command acquisition logic is configured to acquire a confidential computing command for a simulated device sent by a virtual machine, wherein the simulated device is configured to simulate a program of a secure cryptographic coprocessor, wherein the secure cryptographic coprocessor is cryptographic hardware configured according to the configuration method for cryptographic hardware according to claim 1; as well as The hardware usage logic is configured to obtain the use permission of the secure cryptographic coprocessor so as to obtain the confidential computing result of the secure cryptographic coprocessor according to the confidential computing command, and return the confidential computing result to the virtual machine.

21. A computer system comprising: A virtual machine monitor, multiple virtual machines, and encryption hardware, wherein the virtual machine monitor includes a configuration device for encryption hardware as described in any one of claims 13 to 14, or a data confidentiality computing device as described in claim 20.

22. The computer system of claim 21, wherein: The virtual machine monitor is provided with a simulation device layer, and the simulation device layer is provided with a simulation device in the configuration method of encryption hardware as described in any one of claims 1 to 12, or a simulation device in the data confidentiality computing method as described in any one of claims 15 to 19.

23. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be executed by the processor, and when the processor runs the computer program, it executes the configuration method of encryption hardware as described in any one of claims 1 to 12, or the steps in the data confidentiality computing method as described in any one of claims 15 to 19.

24. A storage medium, wherein: The storage medium stores one or more computer-executable instructions, which, when executed, implement the encryption hardware configuration method as described in any one of claims 1 to 12, and / or the data confidentiality computing method as described in any one of claims 15 to 19.

Citation Information

Patent Citations

  • Configuration method of encryption hardware, data confidentiality calculation method and related equipment

    CN116841691A

  • Methods and apparatus for generating endorsement credentials for software-based security coprocessors

    CN101176100A

  • A method and device for dynamic device allocation

    CN101267334A

  • Special data encryption method and encryption card suitable for Xen virtualized environment

    CN104951688A

  • Method and apparatus for synchronizing shared data between components in a group

    US20060236039A1