Secret computing mode switching method and system, electronic equipment and storage medium
By receiving and verifying user identity information, dynamically switching the computing mode of the virtual machine, the problem of complex and long-term mode switching in the existing technology is solved, efficient and secure mode switching is achieved, and the continuity and high value of virtual machine services is ensured. Availability.
Patent Information
- Application Number
- CN202411337871.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, confidential computing mode switching operations are complex, long and inefficient, and require restarting the virtual machine and configuring the execution environment, affecting service availability and user experience.
By receiving mode switching requests, obtaining user identity information for verification, and sending mode switching instructions to the device when the verification is passed, dynamically switching the calculation mode of the virtual machine, reducing manual intervention and improving switching efficiency.
It realizes rapid switching of computing mode without restarting the virtual machine, enhances system security and service continuity, and improves the efficiency and availability of mode switching.
Smart Images

Figure CN119203159A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, in particular to the field of confidential computing technology of artificial intelligence, and more particularly to a mode switching method, system, electronic device and storage medium for confidential computing. Background Art
[0002] In the era of big data, with the explosive growth of data volume and the increase in data processing complexity, high-performance computing and artificial intelligence (AI) training scenarios have put forward higher and higher requirements for data security and computer confidentiality. In order to ensure that user sensitive data is not spied on or leaked during processing, equipment manufacturers have proposed solutions based on confidential computing. These solutions distinguish the security level of data processing by dividing different confidential computing modes, such as normal computing mode (also known as Normal mode) and confidential computing mode (also known as Confidential mode).
[0003] With the in-depth application of technology, users' demand for performance analysis and debugging in confidential computing environments is also growing. To meet this demand, device manufacturers have further provided confidential debugging mode (also known as CCDevTool mode), which, while maintaining similar data paths and security restrictions as the Confidential mode, opens up software access to hardware debugging facilities and allows external transmission of performance data, making it easier for developers to conduct in-depth performance analysis and debugging.
[0004] However, the current solution for implementing mode switching of confidential computing mainly adopts static configuration. For example, when the confidential computing mode needs to be switched from Normal mode or Confidential mode to CCDevTool mode, it is necessary to restart the virtual machine and configure the execution environment. This not only increases the complexity of the operation, but also significantly prolongs the switching time and has low switching efficiency. Summary of the invention
[0005] The present invention provides a confidential computing mode switching method, system, electronic device and storage medium to solve the defects of confidential computing mode switching in related technologies, such as complex operation, long switching time and low efficiency.
[0006] The present invention provides a confidential computing mode switching method, which is applied to a host and includes: receiving a mode switching request for a virtual machine, the virtual machine running on the host and using a device to perform data calculation; Based on the mode switching request, obtaining user identity information; The user identity information is verified, and if the verification is passed, a mode switching instruction is sent to the device, where the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0007] According to a confidential computing mode switching method provided by the present invention, sending a mode switching instruction to the device includes: Based on a preset configuration policy, the mode switching request is reviewed, and if the review is passed, a mode switching instruction is sent to the device.
[0008] According to a confidential computing mode switching method provided by the present invention, the mode switching request is reviewed based on a preset configuration policy, including: Based on the mode switching request, determining a target computing mode; Determining a mode switching direction based on the current computing mode of the virtual machine and the target computing mode; The mode switching direction is matched with each preset mode switching direction in the preset configuration policy, and if the match is successful, it is determined that the mode switching request is approved.
[0009] According to a confidential computing mode switching method provided by the present invention, sending a mode switching instruction to the device includes: A mode switching instruction is generated, the mode switching instruction is encrypted, and the encrypted mode switching instruction is sent to the device.
[0010] A method for switching modes of confidential computing provided by the present invention further includes: When the computing mode of the virtual machine is a confidential computing mode or a confidential debugging mode, the data in the virtual machine is encrypted, and the encrypted data is transmitted to the device, so that the device uses the encrypted data for calculation.
[0011] The present invention also provides a confidential computing mode switching method, which is applied to a device and includes: receiving a mode switching instruction, wherein the mode switching instruction is sent by the host when user identity information is authenticated, the user identity information is obtained by the host based on a received mode switching request, the mode switching request is for a virtual machine, the virtual machine runs on the host and uses the device to perform data calculation; Based on the mode switching instruction, the computing mode of the virtual machine is switched.
[0012] According to a confidential computing mode switching method provided by the present invention, switching the computing mode of the virtual machine based on the mode switching instruction includes: Based on the mode switching instruction, the security attributes of each computing unit and each execution unit are reconfigured to switch the computing mode of the virtual machine from the current computing mode to the target computing mode. The computing units and the execution units are set on the device, and the target computing mode is determined based on the mode switching instruction.
[0013] The present invention also provides a confidential computing mode switching device, which is applied to a host and includes: A receiving unit, configured to receive a mode switching request for a virtual machine, wherein the virtual machine runs on the host and uses a device to perform data calculation; an acquiring unit, configured to acquire user identity information based on the mode switching request; The verification unit is used to verify the user identity information and, if the verification is successful, send a mode switching instruction to the device, wherein the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0014] The present invention also provides a confidential computing mode switching device, which is applied to a device and includes: an instruction receiving unit, configured to receive a mode switching instruction, wherein the mode switching instruction is sent by the host when user identity information is authenticated, the user identity information is obtained by the host based on a received mode switching request, and the mode switching request is for a virtual machine, the virtual machine runs on the host and uses the device to perform data calculation; A mode switching unit is used to switch the computing mode of the virtual machine based on the mode switching instruction.
[0015] The present invention also provides a confidential computing mode switching system, comprising a host and a device, wherein a virtual machine runs on the host, the virtual machine uses the device to perform data calculation, a receiving module and a verification module are arranged on the host, and a switching module is arranged on the device; The receiving module is used to receive a mode switching request for the virtual machine, and obtain user identity information based on the mode switching request; The verification module is used to verify the user identity information and send a mode switching instruction to the switching module if the verification passes; The switching module is used to switch the computing mode of the virtual machine based on the mode switching instruction.
[0016] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for switching the confidential computing mode as described in any one of the above is implemented.
[0017] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the mode switching method of confidential computing as described in any one of the above.
[0018] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements a mode switching method for confidential computing as described in any one of the above.
[0019] The mode switching method, system, electronic device and storage medium for confidential computing provided by the present invention receive a mode switching request for a virtual machine through a host, and obtain user identity information based on the mode switching request, thereby verifying the user identity information, and sending a mode switching instruction to the device when the verification is passed, so as to ensure that only authorized users can initiate a mode switching request, thereby enhancing the security of the system. When the user identity information is verified, the host sends a mode switching instruction to the device, so that the device can automatically switch the computing mode of the virtual machine according to the instruction, reducing manual intervention, and the user does not need to manually restart or configure the virtual machine, which greatly improves the switching efficiency. In addition, the present invention can achieve the switching of computing modes without restarting the virtual machine, avoiding service interruption caused by restarting the virtual machine, thereby ensuring the continuity and high availability of online services on the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 is a schematic diagram of a mode switching method for confidential computing in the related art; Figure 2 It is a structural schematic diagram of a mode switching system for confidential computing provided by the present invention; Figure 3 This is one of the flow charts of the method for switching modes of confidential computing provided by the present invention; Figure 4 This is the second flow chart of the method for switching modes of confidential computing provided by the present invention; Figure 5 This is the third flow chart of the method for switching modes of confidential computing provided by the present invention; Figure 6 This is one of the structural schematic diagrams of the mode switching device for confidential computing provided by the present invention; Figure 7 This is the second structural schematic diagram of the mode switching device for confidential computing provided by the present invention; Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] With the widespread application of devices such as graphics processing units (GPUs), general-purpose graphics processing units (GPGPUs), and tensor processing units (TPUs) in the fields of artificial intelligence and big data analysis, the data and code processed on the devices increasingly contain sensitive information. In order to protect this information from unauthorized access or tampering, device manufacturers have proposed a secure and reliable solution. A virtual machine based on confidential computing is such a solution, which can provide hardware-based confidentiality and integrity protection for data and code on the device.
[0024] In the confidential computing scenario, equipment manufacturers divide the virtual machine's software and hardware execution environment into two types, namely, Confidential Computing Off (CC Off) and Confidential Computing On (CC On). Different execution environments correspond to different computing modes, where the execution environment with confidential computing off corresponds to Normal mode, and the execution environment with confidential computing on corresponds to Confidential mode. In Normal mode, data is not specially protected, the hardware data path does not have permission checks and information hiding, and the software can execute code and process data; in Confidential mode, the hardware data path and access rights are restricted according to preset rules, the information channel is encrypted and hidden, and software execution and data processing are restricted, so as to ensure the security and confidentiality of user data.
[0025] With the in-depth application of technology, users' demand for performance analysis and debugging in confidential computing scenarios is also growing. In order to meet this demand, equipment manufacturers have further proposed the CCDevTool mode, which, while maintaining similar data paths and security restrictions as the Confidential mode, opens up software access to hardware debugging facilities and allows external transmission of performance data, making it easier for developers to conduct in-depth performance analysis and debugging.
[0026] In confidential computing scenarios, static configuration is usually used to switch the computing mode (i.e., execution environment) of a virtual machine. Figure 1 is a schematic diagram of a mode switching method for confidential computing in related technologies, such as Figure 1 As shown, before the virtual machine starts, the management system firmware determines the execution environment that the virtual machine should enter based on the configuration information in the EEPROM (Electrically Erasable Programmableread only memory), and configures the hardware state accordingly. However, each time a mode switch is performed, such as switching from Normal mode or Confidential mode to CCDevTool mode, the virtual machine must be shut down and FLR (Function Level Reset) must be performed to enter the initial state and re-execute the configuration process. This restart process will cause interruptions to services that need to run continuously on the virtual machine (such as databases, real-time analysis systems, etc.), seriously affecting their availability and user experience. Secondly, each mode switch requires a complete restart and configuration process, which not only increases the complexity of the operation, but also significantly prolongs the switching time, resulting in low switching efficiency. It should be noted that Figure 1 The POR (Power-On Reset) in the figure refers to the process of powering on a virtual machine. HyperVisor refers to the virtual machine management program, which is used to determine the execution environment that the virtual machine should enter according to the configuration information in the EEPROM. Figure 1 The VM (CC=0) in the table indicates that the computing mode of the virtual machine is Normal mode, and the CVM (CC=1) indicates that the computing mode of the virtual machine is Confidential mode.
[0027] In this regard, the present invention provides a mode switching method and system for confidential computing, which can realize dynamic switching of computing modes without restarting and resetting the virtual machine, greatly improving the availability of online services and the efficiency of mode switching, thereby overcoming the above-mentioned defects.
[0028] Figure 2 : is a schematic diagram of the structure of the confidential computing mode switching system provided by the present invention, such as Figure 2 As shown, the overall system architecture may include a host and a device, wherein the device may be a GPU, a GPGPU, a TPU, etc., and the host may be a central processing unit or a computer connected to the device, such as a CPU (Central Processing Unit), a microprocessor, etc. The following will take the host as a CPU and the device as a GPU as an example to introduce the technical solution of the present invention.
[0029] It should be noted that although the GPU has powerful parallel computing capabilities, its ability to directly access the CPU memory is strictly limited, especially the ability to access the memory area protected by the CPU's TEE (Trusted Execution Environment). Since the CPU and GPU are relatively independent computing units physically and logically, they each have independent memory space and control mechanisms. Therefore, the GPU cannot directly access the memory area protected in the CPU's TEE, which limits the direct application of the GPU in a confidential computing environment. To solve this problem, the confidential computing solution can be implemented based on the CPU's TEE, that is, running a virtual machine in the CPU so that when performing confidential computing, the security features of the TEE can be used to protect the data and code processed on the GPU.
[0030] like Figure 2As shown, multiple virtual machines can be run on the CPU, such as VM1, VM2, ... VMn, and these virtual machines can use the GPU to perform parallel computing on data. It should be understood that the CPU, as the core processing unit of the computer system, is responsible for executing the operating system and applications in the virtual machines (such as VM1, VM2, ... VMn). In a virtualized environment, the CPU can manage multiple virtual machines to ensure isolation and effective resource allocation between them. Virtual machines are independent computing environments running on the CPU side, and they simulate a complete hardware environment through virtualization technology. As a dedicated graphics and parallel processing unit, the GPU can provide powerful graphics rendering and computing capabilities for virtual machines. In a virtualized environment, GPU resources can be shared by multiple virtual machines. The GPU Driver is a software component running on the CPU side, which is responsible for managing and controlling the hardware resources of the GPU. The GPU Driver provides a set of application programming interfaces, so that applications in the virtual machine can interact with the GPU through these interfaces to perform tasks such as graphics rendering and parallel computing. As a bridge between the GPU and the virtual machine, the GPU Driver is responsible for processing the virtual machine's request for the GPU to ensure that the GPU resources are used correctly and efficiently.
[0031] Each virtual machine is set with its own execution environment. For example, the execution environment of VM1 is the confidential computing on environment (i.e. CC=On), and its corresponding computing mode is the confidential computing mode. The execution environment of VM2 is the confidential computing off environment (i.e. CC=Off), and its corresponding computing mode is the conventional computing mode. The CPU is provided with an AR (Authentication Request) module and an ACL (Access Control List) module, wherein the AR module is located in the virtual machine on the CPU side, and the ACL module is located in the TEE of the CPU. When the user needs to switch the computing mode of the virtual machine, he can initiate a mode switching request through the AR module. After receiving the mode switching request, the AR module will obtain the identity information of the user who initiated the request and transmit the user identity information to the ACL module. After receiving the user identity information, the ACL module will verify it to determine whether the user has the authority to switch the computing mode of the virtual machine. If the user identity information is verified, the subsequent mode switching process will continue, otherwise the mode switching operation will be terminated.
[0032] In addition, considering the security of mode switching, there may be a certain risk of data leakage when switching from a high security level (such as confidential computing mode) to a low security level (such as regular computing mode). In order to avoid this risk, after the user identity information is verified, the mode switching request can be further reviewed through the ACL module to determine whether the current mode switching operation is allowed to be executed. The ACL module stores a configuration policy, which includes relevant configuration information on whether to allow switching from one computing mode to another, such as allowing switching from Normal mode to CCDevTool mode, and not allowing switching from Confidential mode to Normal mode. If the mode switching request is reviewed and approved, a mode switching instruction can be sent to the GPU; otherwise, the mode switching operation will be terminated.
[0033] The GPU is provided with a DT (Dynamic Transition) module. When the ACL module determines that the mode switching request has passed the review, it can send a mode switching instruction to the DT module to notify the DT module to dynamically configure the execution environment of the GPU system and implement the switching of the computing mode. Here, the ACL module can notify the DT module through an encrypted channel (i.e., the path corresponding to the dotted line marked with an envelope in the figure). The purpose of using an encrypted channel for notification is to ensure the security and reliability of the mode switching instruction. Specifically, after the ACL module completes the identity, authority, and configuration policy verification and review, the execution right of the mode switching is transferred to the GPU side, and this decision-making process and the switching execution are located in the CPU and GPU respectively, forming a separation of the execution environment. If the mode switching instruction is transmitted in plain text, the new computing mode that the GPU is about to enter will be exposed, increasing the risk of the system being snooped and attacked. Moreover, if encryption protection is not used, malicious parties may forge or tamper with the switching instruction, causing the GPU to unexpectedly execute the mode switch, seriously damaging the system's operating security and stability. Therefore, using an encrypted channel as the communication medium for the DT module to receive the switching instruction can effectively prevent information leakage and command forgery. This measure is essentially achieved by encrypting the instructions and related data when transmitting mode switching instructions through the PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) link, thereby ensuring the confidentiality and integrity of the instructions and guaranteeing the legality and security of the mode switching.
[0034] After receiving the mode switching instruction, the DT module can start to configure the execution environment of the GPU system. Specifically, the DT module will change the security attributes of each computing unit (i.e., CUCluster in the figure) and execution unit in the GPU through the Secure Processor to achieve the switching of the computing mode. For example, when the computing mode of the virtual machine needs to be switched from Confidential mode to CCDevTool mode, the DT module can change the security attributes of each computing unit and performance counter of the GPU through the security processor to switch it to CCDevTool mode, thereby making it possible to access the performance counters and performance data output path. It should be understood that the security processor can be a single-chip microcomputer, and when changing the security attributes of each computing unit and execution unit, it can be achieved by changing the value of the corresponding register through the single-chip microcomputer.
[0035] also, Figure 2 The process of transmitting sensitive data in confidential computing mode is also involved, which will be introduced below. Figure 2 As shown in the figure, the computing mode of VM1 is confidential computing mode, where Data represents sensitive data. The specific transmission path of the data is as follows: First, the sensitive data is securely transmitted from VM1 to Enclave (i.e., the secure buffer located in the CPU-side TEE). Enclave provides the first line of defense for data through its physical isolation and encryption protection mechanism, effectively resisting external snooping and tampering attempts. Subsequently, the data will be further transferred to Bounce Buffer, which is a buffer located outside the TEE in the CPU and is used as a bridge for data transmission between the TEE and the GPU. It should be understood that the Bounce Buffer itself is not in a trusted execution environment, and there is a significant security risk in directly transmitting plaintext data to this area. Therefore, before the data is migrated to the Bounce Buffer, it will first undergo strict encryption processing to ensure the security of the data during transmission. The encrypted data is securely transmitted to the GPU via the PCIe link. Here, the GPU not only serves as a powerful computing engine, but also has a built-in dedicated crypt module for decrypting the received encrypted data. After decryption is successful, the data is ready to be further processed by the DMA (Direct Memory Access) Engines inside the GPU. As an efficient data transmission tool, DMA Engines can quickly move the decrypted data to the GPU's HBM (High Bandwidth Memory), significantly improving data processing and computing efficiency. After the GPU completes the data calculation and obtains the calculation result, it can encrypt the result through the crypt module and send it back to the CPU.
[0036] In particular, the HBM in the GPU is divided into two areas with different security levels: HBM-S (secure area) and HBM-NS (non-secure area). After decryption, the data will be directed to the HBM-S area, which has higher access control to ensure that only authorized computing units can access and process the data, thereby achieving double protection for sensitive data during the calculation process. This partitioning strategy effectively prevents the risk of data leakage and ensures the confidentiality and integrity of the calculation process.
[0037] Based on the above embodiments, Figure 3 This is one of the flow charts of the method for switching modes of confidential computing provided by the present invention, such as Figure 3 As shown, the method is applied to a host, and the method includes: Step 310, receiving a mode switching request for a virtual machine, the virtual machine running on the host and using a device to perform data calculation; It should be noted that the method provided in the embodiment of the present invention can be applied to a host (such as a CPU), and one or more virtual machines are running on the CPU. In order to improve computing performance or meet specific computing requirements (such as graphics processing, large-scale parallel computing, etc.), these virtual machines can use devices (such as a GPU) to perform part or all of the data computing work.
[0038] It is understandable that in the field of confidential computing, the computing modes of virtual machines mainly include conventional computing mode (i.e. Normal mode) and confidential computing mode (i.e. Confidential mode). In order to meet the needs of users for performance analysis and debugging in confidential computing scenarios, a confidential debugging mode (i.e. CCDevTool mode) is further proposed. In actual applications, according to changes in business needs or security policies, it may be necessary to adjust the computing mode of the virtual machine, such as switching from confidential computing mode to confidential debugging mode. In this regard, an embodiment of the present invention proposes a mode switching method for confidential computing applied to the CPU side. Through the collaborative work between the CPU and the GPU, flexible switching of the computing mode of the virtual machine running on the CPU can be achieved.
[0039] Specifically, when it is necessary to switch the computing mode of the virtual machine, the user can initiate a mode switching request through the AR module in the CPU. The AR module is set in the virtual machine, and the user only needs to open the interface or window of the AR module in the virtual machine to initiate the request. Here, a mode switching request refers to an instruction or signal that requires a change in the computing mode or execution environment currently being used by the virtual machine. The request can be initiated by an application, a system administrator, or other entity with corresponding authority within the virtual machine. It should be understood that the mode switch can be a switch from a conventional computing mode (ie, Normal mode) to a confidential computing mode (ie, Confidential mode), or from a conventional computing mode to a confidential debugging mode (ie, CCDevTool mode), or from a confidential computing mode to a confidential debugging mode, etc., and the embodiments of the present invention do not specifically limit this.
[0040] Step 320, obtaining user identity information based on the mode switching request; Specifically, after receiving the mode switching request, the AR module may require the requester to authenticate, such as username and password login verification, multi-factor authentication (such as SMS verification code, email verification, fingerprint recognition, etc.), etc., to obtain the user's identity information. In addition, in some cases, the mode switching request itself already contains the user's identity information, such as Token, Session ID, etc. These identification information are generated during the previous user login or authorization process and are authenticated by the user's subsequent authentication request. In this case, the AR module can parse the mode switching request to obtain the user's identity information. Here, user identity information refers to information that can identify the user's personal identity alone or in combination with other information, including but not limited to the user's username, password, UID (user identifier), email address, telephone number, ID number, etc. This information is used to confirm the user's identity in the system to ensure that only legitimate and authorized users can initiate mode switching requests.
[0041] It is understandable that different users have different permission levels. By obtaining user identity information, the system can determine whether the user has the right to initiate a mode switching request, which helps prevent unauthorized access and malicious operations and protect the security and stability of the system.
[0042] Step 330, verifying the user identity information, and if the verification is successful, sending a mode switching instruction to the device, wherein the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0043] Specifically, after extracting the user's identity information (such as user name, password, etc.) from the request, the extracted identity information can be compared with the user information stored in the system to verify whether the user has the right to initiate a mode switching request. This can be achieved by determining whether the user's user name and password match and are legal, checking the user's role, permission level, or specific authorization information, etc. If the verification fails, it means that the identity information provided by the user cannot match the information stored in the system, or the user does not have sufficient authority to initiate a mode switching request. In this case, an error message can be returned and the mode switching operation can be refused.
[0044] If the user identity information is verified, it means that the user has successfully passed the identity authentication and permission check and has the right to initiate a mode switching request. At this time, the system will continue to process the user's request and adjust the execution environment of the virtual machine according to the mode switching instruction to switch the computing mode of the virtual machine. Here, the mode switching instruction refers to a specific command or signal that instructs a device (such as a GPU) to change its current execution environment.
[0045] Specifically, after the user identity information is verified, the CPU will send a mode switching instruction to the GPU. After receiving the mode switching instruction, the GPU will parse the information in the instruction and determine the target computing mode and its related parameters to be switched to. Subsequently, according to the requirements and related parameters of the target computing mode, the GPU will update its execution environment to match the target computing mode.
[0046] The method provided by the embodiment of the present invention receives a mode switching request for a virtual machine through a host, and obtains user identity information based on the mode switching request, thereby verifying the user identity information, and sending a mode switching instruction to the device when the verification is passed, so that it can be ensured that only authorized users can initiate a mode switching request, thereby enhancing the security of the system. When the user identity information is verified, the host sends a mode switching instruction to the device, so that the device can automatically switch the computing mode of the virtual machine according to the instruction, reducing manual intervention, and the user does not need to manually restart or configure the virtual machine, which greatly improves the switching efficiency. In addition, the present invention can realize the switching of the computing mode without restarting the virtual machine, avoiding the service interruption caused by restarting the virtual machine, thereby ensuring the continuity and high availability of the online service on the virtual machine.
[0047] Based on any of the above embodiments, in step 330, sending a mode switching instruction to the device includes: Step 331: based on a preset configuration policy, review the mode switching request, and if the review is passed, send a mode switching instruction to the device.
[0048] It should be noted that, considering the security of mode switching, for example, when switching from confidential computing mode to conventional computing mode, there is a certain risk of data leakage. In this regard, the embodiment of the present invention audits the mode switching by presetting the configuration policy, which can further ensure the security of the mode switching.
[0049] Specifically, the preset configuration policy refers to a series of rules or condition sets predefined in the ACL module in the CPU's TEE. These rules are used to guide the system on how to respond to different types of computing mode switching requests. The preset configuration policy may contain multiple predefined rules, each of which clearly indicates which switches between computing modes are allowed and which are not allowed. For example, switching from normal computing mode to confidential computing mode is allowed, but switching directly from confidential computing mode back to normal computing mode is not allowed. For another example, switching from normal computing mode or confidential computing mode to confidential debugging mode is allowed.
[0050] After the ACL module verifies the user's identity information, it can further review the mode switching request according to the preset configuration policy. This can be achieved through the following steps: First, the ACL module will clarify the current computing mode of the virtual machine (such as regular computing mode or confidential computing mode); when receiving a mode switching request, the request will carry information about the target computing mode. The AR module can obtain the information about the target computing mode by parsing the mode switching request and transmit it to the ACL module for review; then, the ACL module will query the preset configuration policy to find out whether there is a rule that explicitly allows switching from the current computing mode to the target computing mode, and match the current computing mode and the target computing mode with the rules in the preset configuration policy. If a matching allowed rule is found, the review is passed; if an unallowed rule is found or there is no matching rule, the review is not passed.
[0051] It is understandable that if the audit passes, it means that the requested computing mode switch complies with the rules defined in the preset configuration policy and is allowed. In this case, the switching process can continue to be executed and the mode switching instruction can be sent to the GPU to update the computing mode of the virtual machine. If the audit fails, it means that the requested computing mode switch violates the rules defined in the preset configuration policy. In this case, the switching request will be rejected and an error message can be returned to the requester, indicating the reason why the switching request was rejected.
[0052] Based on any of the above embodiments, in step 331, the reviewing of the mode switching request based on a preset configuration policy includes: Based on the mode switching request, determining a target computing mode; Determining a mode switching direction based on the current computing mode of the virtual machine and the target computing mode; The mode switching direction is matched with each preset mode switching direction in the preset configuration policy, and if the match is successful, it is determined that the mode switching request is approved.
[0053] Specifically, when a mode switching request is received, the request usually contains clear information about the target computing mode, which can appear in the form of a code, an identifier, or a clear description to indicate the computing mode to which the virtual machine should switch. The AR module can extract the specific identifier of the target computing mode from the parsing of the mode switching request and transmit it to the ACL module. Here, the target computing mode refers to the computing mode that the virtual machine plans to switch to, which can be a confidential computing mode or a confidential debugging mode, etc.
[0054] Subsequently, the ACL module can determine the mode switching direction based on the current computing mode and the target computing mode of the virtual machine. Here, the current computing mode refers to the computing mode that the virtual machine is currently running, which reflects the current operating state of the virtual machine, including its security level, performance characteristics, and available computing resources. The mode switching direction refers to the conversion path from the current computing mode of the virtual machine to the target computing mode, which indicates which computing mode the virtual machine will switch from.
[0055] After determining the mode switching direction, by matching the mode switching direction with each preset mode switching direction in the preset configuration policy, it can be determined whether the mode switching request has passed the review. Here, each preset mode switching direction in the preset configuration policy refers to a series of allowed or disallowed computing mode conversion paths pre-defined in the ACL module. These paths exist in the form of rules, which clearly define which switching between computing modes is allowed and which is prohibited. Specifically, the determined mode switching direction can be compared with each rule in the preset configuration policy (i.e., the preset mode switching direction). The system will check the rules in the preset configuration policy one by one to see if there is a rule that allows switching from the current computing mode to the target computing mode. If such a rule exists, the match is successful, otherwise the match is unsuccessful.
[0056] It can be understood that a successful match indicates that the mode switching direction complies with the rules defined in the preset configuration policy, that is, this mode switching is allowed. In this case, the switching process can continue to be executed and the mode switching instruction can be sent to the GPU to update the computing mode state of the virtual machine. An unsuccessful match indicates that the mode switching direction in the request violates the rules defined in the preset configuration policy. In this case, the switching request will be rejected and an error message can be returned to the requester, indicating the reason why the switching request was rejected.
[0057] Based on any of the above embodiments, in step 330, sending a mode switching instruction to the device includes: A mode switching instruction is generated, the mode switching instruction is encrypted, and the encrypted mode switching instruction is sent to the device.
[0058] It should be noted that after the ACL module completes the audit and verification of user identity, permissions and configuration policies, it will send a mode switching instruction to the GPU, and the GPU will execute the mode switching operation. Since the decision-making process and execution process of mode switching are located in the CPU and GPU respectively, the transmission process of the mode switching instruction is at risk of being attacked or tampered with. In this regard, the embodiment of the present invention encrypts the mode switching instruction before transmitting it to the GPU to ensure the confidentiality and integrity of the instruction.
[0059] Specifically, after obtaining the current computing mode and the target computing mode of the virtual machine, the ACL module can generate a corresponding mode switching instruction according to the current computing mode and the target computing mode, and encode the instruction into a binary form that can be directly recognized by the computer. Then, the encoded instruction is encapsulated into a data packet suitable for transmission. In addition to the mode switching instruction itself, the data packet can also contain additional information such as a checksum and a timestamp to ensure the integrity and timeliness of the data. Next, an encryption algorithm suitable for the encryption mode switching instruction (such as AES, RSA, etc.) can be selected, and keys for encryption and decryption can be generated and managed at the same time, and the mode switching instruction is encrypted using the selected encryption algorithm and key. It should be understood that the encryption process will convert the original mode switching instruction into a ciphertext form, and only the recipient holding the corresponding key can decrypt and restore the original instruction.
[0060] The encrypted mode switching instruction will be transmitted from the CPU to the GPU via the PCIe link. After receiving the encrypted instruction, the GPU will first verify the integrity of the instruction and the reliability of the source. Then, the encrypted instruction will be decrypted using the same key as the CPU to restore the original mode switching instruction. The GPU can perform the corresponding computing mode switching operation based on the decrypted mode switching instruction.
[0061] Based on any of the above embodiments, the method further includes: When the computing mode of the virtual machine is a confidential computing mode or a confidential debugging mode, the data in the virtual machine is encrypted, and the encrypted data is transmitted to the device, so that the device uses the encrypted data for calculation.
[0062] It should be noted that confidential computing mode is a secure computing environment that protects the confidentiality, integrity, and availability of data and code during the computing process. In confidential computing mode, data is stored encrypted in memory and remains encrypted during the computing process to prevent unauthorized access. Confidential debugging mode is a debugging function added on the basis of confidential computing, allowing developers to debug and analyze encrypted data without affecting data security. This mode is usually used in the development and testing phases to help developers locate and fix errors in the program while ensuring that sensitive data is not leaked.
[0063] Specifically, in the virtual machine, data is encrypted when it is generated or transmitted, and the encrypted data is transmitted from the virtual machine to the GPU through a high-speed interface such as a PCIe link. During this process, the data always remains encrypted to prevent it from being intercepted or tampered with during transmission. After receiving the encrypted data, the GPU will use its powerful parallel computing capabilities to process the encrypted data. It should be understood that after the sensitive data in the virtual machine is encrypted, how it is specifically transmitted to the GPU end through the PCIe link can refer to the relevant introduction of the transmission process of sensitive data in the confidential computing mode in the above embodiment, and the embodiments of the present invention will not be repeated.
[0064] Based on any of the above embodiments, Figure 4 This is a second flow chart of the method for switching modes of confidential computing provided by the present invention. Figure 4 As shown, the method is applied to a device, and the method includes: Step 410, receiving a mode switching instruction, wherein the mode switching instruction is sent by the host when user identity information is authenticated, wherein the user identity information is obtained by the host based on a received mode switching request, wherein the mode switching request is for a virtual machine, wherein the virtual machine runs on the host and uses the device for data calculation; Step 420: Switch the computing mode of the virtual machine based on the mode switching instruction.
[0065] It should be noted that the method provided in the embodiment of the present invention can be applied to a device (such as a GPU). Considering that the data and code processed on the GPU increasingly contain sensitive information, in order to protect this information from unauthorized access or leakage, a virtual machine based on confidential computing is proposed. The virtual machine runs in the CPU and can use the GPU to perform parallel calculations on the data.
[0066] In the field of confidential computing, the computing modes of virtual machines mainly include conventional computing mode (i.e. Normal mode) and confidential computing mode (i.e. Confidential mode). In order to meet the needs of users for performance analysis and debugging in confidential computing scenarios, a confidential debugging mode (i.e. CCDevTool mode) is further proposed. In practical applications, according to changes in business needs or security policies, it may be necessary to adjust the computing mode of the virtual machine, such as switching from confidential computing mode to confidential debugging mode. In this regard, an embodiment of the present invention proposes a mode switching method for confidential computing applied to the GPU side. Through the collaborative work between the CPU and the GPU, flexible switching of the computing mode of the virtual machine running on the CPU can be achieved.
[0067] Specifically, the virtual machine on the CPU side is provided with an AR module and an ACL module. When the computing mode of the virtual machine needs to be switched, a mode switching request can be initiated through the AR module. After receiving the mode switching request, the AR module obtains the user's identity information (such as user name, password, etc.) and transmits this information to the ACL module, which performs identity authentication based on the received user identity information. Only when the verification is passed will the request continue to be processed, that is, the ACL module will generate a mode switching instruction and send it to the GPU through a certain communication mechanism (such as a PCIe link).
[0068] After receiving the mode switch instruction from the CPU, the GPU first parses the instruction to determine the target computing mode to switch to. Based on the parsing results, the GPU adjusts its internal configuration or execution environment to switch to the new computing mode. After completing the mode switch, the GPU can send a confirmation message to the CPU indicating that the switch operation has been completed.
[0069] The method provided by the embodiment of the present invention receives a mode switching request for a virtual machine through a host, and obtains user identity information based on the mode switching request, thereby verifying the user identity information, and sending a mode switching instruction to the device when the verification is passed, so that it can be ensured that only authorized users can initiate a mode switching request, thereby enhancing the security of the system. When the user identity information is verified, the host sends a mode switching instruction to the device, so that the device can automatically switch the computing mode of the virtual machine according to the instruction, reducing manual intervention, and the user does not need to manually restart or configure the virtual machine, which greatly improves the switching efficiency. In addition, the present invention can realize the switching of the computing mode without restarting the virtual machine, avoiding the service interruption caused by restarting the virtual machine, thereby ensuring the continuity and high availability of the online service on the virtual machine.
[0070] Based on any of the above embodiments, step 420 specifically includes: Based on the mode switching instruction, the security attributes of each computing unit and each execution unit are reconfigured to switch the computing mode of the virtual machine from the current computing mode to the target computing mode. The computing units and the execution units are set on the device, and the target computing mode is determined based on the mode switching instruction.
[0071] Specifically, the GPU is provided with a DT module. When the DT module receives a mode switching instruction from the CPU, it will change the security attributes of each computing unit and each execution unit in the GPU through the security processor to achieve the switching of the virtual machine computing mode. Here, in the GPU architecture, the computing unit and the execution unit are the core components responsible for executing various computing tasks, among which the computing unit is the basic unit in the GPU for executing parallel computing tasks. Each computing unit contains multiple processing cores and can process computing tasks of multiple threads at the same time. The execution unit refers to a single processing core in the GPU, which is located inside the computing unit. The execution unit is responsible for executing specific arithmetic and logical operation instructions. When the GPU receives a computing task, these tasks are decomposed into multiple threads and processed in parallel by different execution units.
[0072] It is understandable that the security attributes of the computing unit and the execution unit refer to the security policies and rules that they need to comply with when performing computing tasks. These attributes may include data encryption / decryption mechanisms, access control policies, security isolation levels, etc. When the DT module receives the mode switching instruction from the CPU, it can determine the target computing mode and its required security attribute configuration by parsing the instruction. According to these security attribute configurations, the security attributes of the corresponding computing unit and the execution unit can be changed through the security processor. For example, if the target computing mode requires encrypted data transmission, the corresponding encryption / decryption mechanism can be configured for the computing unit and the execution unit to ensure that the data remains encrypted during transmission and calculation.
[0073] Based on any of the above embodiments, Figure 5 This is a flow chart of the third method for switching modes of confidential computing provided by the present invention. Figure 5 As shown, the method is applied to a mode switching system for confidential computing. Assuming that the computing mode of the current virtual machine is either a conventional computing mode or a confidential computing mode, and the computing mode of the virtual machine needs to be switched from the current computing mode to the confidential debugging mode, the method includes the following steps: Step S1, the performance analysis user initiates a mode switching request through the AR module on the CPU side; Step S2, the AR module parses the mode switching request to obtain user identity information and target computing mode; Step S3, the ACL module in the CPU-side AEE verifies the user identity information and checks the configuration policy to determine whether the current mode switching request has passed the review; Step S4: if the review is passed, proceed to step S5; otherwise, terminate the mode switching process; Step S5, the ACL module notifies the DT module on the GPU side through an encrypted channel, and the DT module dynamically configures the system execution environment. The DT module will change the security attributes of the computing unit and execution unit in the GPU through the security processor, switching it to a confidential debugging mode, so that it can access the performance counters and performance data output path for performance analysis and debugging; Step S6: the dynamic switching of the current computing mode is completed.
[0074] The method provided by the embodiment of the present invention can support user program performance debugging without restarting and resetting the virtual machine, thereby greatly improving the availability of online services.
[0075] Based on any of the above embodiments, Figure 6 is one of the structural schematic diagrams of the mode switching device for confidential computing provided by the present invention, such as Figure 6 As shown, the device is applied to a host, and the device includes: A receiving unit 610 is used to receive a mode switching request for a virtual machine, the virtual machine running on the host and using a device to perform data calculation; An acquisition unit 620, configured to acquire user identity information based on the mode switching request; The verification unit 630 is used to verify the user identity information, and if the verification is successful, send a mode switching instruction to the device, wherein the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0076] The device provided by the embodiment of the present invention receives a mode switching request for a virtual machine through a host, and obtains user identity information based on the mode switching request, thereby verifying the user identity information, and sending a mode switching instruction to the device when the verification is passed, so that it can be ensured that only authorized users can initiate a mode switching request, thereby enhancing the security of the system. When the user identity information is verified, the host sends a mode switching instruction to the device, so that the device can automatically switch the computing mode of the virtual machine according to the instruction, reducing manual intervention, and the user does not need to manually restart or configure the virtual machine, which greatly improves the switching efficiency. In addition, the present invention can realize the switching of computing modes without restarting the virtual machine, avoiding service interruption caused by restarting the virtual machine, thereby ensuring the continuity and high availability of online services on the virtual machine.
[0077] Based on any of the above embodiments, the device further includes a review unit, and the review unit is used to: Based on a preset configuration policy, the mode switching request is reviewed, and if the review is passed, a mode switching instruction is sent to the device.
[0078] Based on any of the above embodiments, the audit unit is specifically used for: Based on the mode switching request, determining a target computing mode; Determining a mode switching direction based on the current computing mode of the virtual machine and the target computing mode; The mode switching direction is matched with each preset mode switching direction in the preset configuration policy, and if the match is successful, it is determined that the mode switching request is approved.
[0079] Based on any of the above embodiments, the device further includes an instruction encryption unit, and the instruction encryption unit is used to: A mode switching instruction is generated, the mode switching instruction is encrypted, and the encrypted mode switching instruction is sent to the device.
[0080] Based on any of the above embodiments, the device further includes a data encryption unit, and the data encryption unit is used to: When the computing mode of the virtual machine is a confidential computing mode or a confidential debugging mode, the data in the virtual machine is encrypted, and the encrypted data is transmitted to the device, so that the device uses the encrypted data for calculation.
[0081] Based on any of the above embodiments, Figure 7 This is a second structural diagram of the mode switching device for confidential computing provided by the present invention, such as Figure 7 As shown, the device is applied to a device, and the device includes: The instruction receiving unit 710 is used to receive a mode switching instruction, wherein the mode switching instruction is sent by the host when the user identity information is authenticated, the user identity information is obtained by the host based on the received mode switching request, and the mode switching request is for a virtual machine, the virtual machine runs on the host and uses the device to perform data calculation; The mode switching unit 720 is used to switch the computing mode of the virtual machine based on the mode switching instruction.
[0082] The device provided by the embodiment of the present invention receives a mode switching request for a virtual machine through a host, and obtains user identity information based on the mode switching request, thereby verifying the user identity information, and sending a mode switching instruction to the device when the verification is passed, so that it can be ensured that only authorized users can initiate a mode switching request, thereby enhancing the security of the system. When the user identity information is verified, the host sends a mode switching instruction to the device, so that the device can automatically switch the computing mode of the virtual machine according to the instruction, reducing manual intervention, and the user does not need to manually restart or configure the virtual machine, which greatly improves the switching efficiency. In addition, the present invention can realize the switching of computing modes without restarting the virtual machine, avoiding service interruption caused by restarting the virtual machine, thereby ensuring the continuity and high availability of online services on the virtual machine.
[0083] Based on any of the above embodiments, the mode switching unit 720 is specifically used for: Based on the mode switching instruction, the security attributes of each computing unit and each execution unit are reconfigured to switch the computing mode of the virtual machine from the current computing mode to the target computing mode. The computing units and the execution units are set on the device, and the target computing mode is determined based on the mode switching instruction.
[0084] Based on any of the above embodiments, an embodiment of the present invention provides a confidential computing mode switching system, the system comprising a host and a device, a virtual machine running on the host, the virtual machine using the device to perform data calculation, a receiving module and a verification module being provided on the host, and a switching module being provided on the device; The receiving module is used to receive a mode switching request for the virtual machine, and obtain user identity information based on the mode switching request; The verification module is used to verify the user identity information and send a mode switching instruction to the switching module if the verification passes; The switching module is used to switch the computing mode of the virtual machine based on the mode switching instruction.
[0085] Specifically, the overall system architecture may include a host and a device, wherein the device may be a GPU, a GPGPU, a TPU, etc., and the host may be a CPU, a microprocessor, etc., which is not specifically limited in the embodiment of the present invention. Multiple virtual machines may be run on the CPU, and these virtual machines may use the GPU to perform parallel calculations on data. A receiving module (i.e., an AR module) and a verification module (i.e., an ACL module) are provided in the CPU, wherein the receiving module is located in the virtual machine on the CPU side, and the verification module is located in the TEE of the CPU. When a user needs to switch the computing mode of the virtual machine, he may initiate a mode switching request through the receiving module. After receiving the mode switching request, the receiving module will obtain the identity information of the user who initiated the request, and transmit the user identity information to the verification module. After receiving the user identity information, the verification module will verify it to determine whether the user has the authority to switch the computing mode of the virtual machine. If the user identity information is verified, the subsequent mode switching process will continue, otherwise the mode switching operation will be terminated.
[0086] A switching module (i.e., DT module) is set in the GPU. When the verification module determines that the mode switching request has passed the review, it can send a mode switching instruction to the switching module to notify the switching module to dynamically configure the execution environment of the GPU system to achieve the switching of the virtual machine computing mode.
[0087] The system provided by the embodiment of the present invention receives a mode switching request for a virtual machine through a host, and obtains user identity information based on the mode switching request, thereby verifying the user identity information, and sending a mode switching instruction to the device when the verification is passed, so that it can be ensured that only authorized users can initiate a mode switching request, thereby enhancing the security of the system. When the user identity information is verified, the host sends a mode switching instruction to the device, so that the device can automatically switch the computing mode of the virtual machine according to the instruction, reducing manual intervention, and the user does not need to manually restart or configure the virtual machine, which greatly improves the switching efficiency. In addition, the present invention can realize the switching of the computing mode without restarting the virtual machine, avoiding the service interruption caused by restarting the virtual machine, thereby ensuring the continuity and high availability of the online service on the virtual machine.
[0088] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute a mode switching method for confidential computing, which is applied to a host, and the method includes: receiving a mode switching request for a virtual machine, the virtual machine running on the host, and using a device to perform data calculation; based on the mode switching request, obtaining user identity information; verifying the user identity information, and sending a mode switching instruction to the device if the verification is passed, the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0089] The processor 810 can also call the logic instructions in the memory 830 to execute a mode switching method for confidential computing, which is applied to the device. The method includes: receiving a mode switching instruction, which is sent by the host after the user identity information is verified, and the user identity information is obtained by the host based on the received mode switching request, and the mode switching request is for a virtual machine, which runs on the host and uses the device to perform data calculations; based on the mode switching instruction, switching the computing mode of the virtual machine.
[0090] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0091] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the mode switching method for confidential computing provided by the above methods. The method is applied to a host, and the method includes: receiving a mode switching request for a virtual machine, the virtual machine runs on the host, and uses a device to perform data calculations; based on the mode switching request, obtaining user identity information; verifying the user identity information, and if the verification passes, sending a mode switching instruction to the device, wherein the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0092] When the computer program is executed by the processor, the computer can execute the mode switching method for confidential computing provided by the above methods. The method is applied to a device, and the method includes: receiving a mode switching instruction, wherein the mode switching instruction is sent by the host after the user identity information is verified, and the user identity information is obtained by the host based on the received mode switching request, and the mode switching request is for a virtual machine, which runs on the host and uses the device for data calculation; based on the mode switching instruction, switching the computing mode of the virtual machine.
[0093] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements a mode switching method for confidential computing provided by the above methods. The method is applied to a host, and the method includes: receiving a mode switching request for a virtual machine, the virtual machine running on the host, and using a device to perform data calculations; based on the mode switching request, obtaining user identity information; verifying the user identity information, and if the verification is passed, sending a mode switching instruction to the device, the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
[0094] In addition, when the computer program is executed by the processor, it is implemented to execute the mode switching method for confidential computing provided by the above methods. The method is applied to a device, and the method includes: receiving a mode switching instruction, wherein the mode switching instruction is sent by the host after the user identity information is verified, and the user identity information is obtained by the host based on the received mode switching request, and the mode switching request is for a virtual machine, which runs on the host and uses the device to perform data calculations; based on the mode switching instruction, the computing mode of the virtual machine is switched.
[0095] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 invention.
Claims
1. A method for switching modes of confidential computing, characterized in that: The method is applied to a host, and the method comprises: receiving a mode switching request for a virtual machine, the virtual machine running on the host and using a device to perform data calculation; Based on the mode switching request, obtaining user identity information; The user identity information is verified, and if the verification is passed, a mode switching instruction is sent to the device, where the mode switching instruction is used to instruct the device to switch the computing mode of the virtual machine.
2. The method for switching modes of confidential computing according to claim 1, characterized in that: The sending a mode switching instruction to the device includes: Based on a preset configuration policy, the mode switching request is reviewed, and if the review is passed, a mode switching instruction is sent to the device.
3. The method for switching modes of confidential computing according to claim 2, characterized in that: The reviewing of the mode switching request based on the preset configuration policy includes: Based on the mode switching request, determining a target computing mode; Determining a mode switching direction based on the current computing mode of the virtual machine and the target computing mode; The mode switching direction is matched with each preset mode switching direction in the preset configuration policy, and if the match is successful, it is determined that the mode switching request is approved.
4. The method for switching modes of confidential computing according to any one of claims 1 to 3, characterized in that: The sending a mode switching instruction to the device includes: A mode switching instruction is generated, the mode switching instruction is encrypted, and the encrypted mode switching instruction is sent to the device.
5. The method for switching modes of confidential computing according to any one of claims 1 to 3, characterized in that: Also includes: When the computing mode of the virtual machine is a confidential computing mode or a confidential debugging mode, the data in the virtual machine is encrypted, and the encrypted data is transmitted to the device, so that the device uses the encrypted data for calculation.
6. A method for switching modes of confidential computing, characterized in that: The method is applied to a device, and the method comprises: receiving a mode switching instruction, wherein the mode switching instruction is sent by the host when user identity information is authenticated, the user identity information is obtained by the host based on a received mode switching request, the mode switching request is for a virtual machine, the virtual machine runs on the host and uses the device to perform data calculation; Based on the mode switching instruction, the computing mode of the virtual machine is switched.
7. The method for switching modes of confidential computing according to claim 6, characterized in that: The switching of the computing mode of the virtual machine based on the mode switching instruction includes: Based on the mode switching instruction, the security attributes of each computing unit and each execution unit are reconfigured to switch the computing mode of the virtual machine from the current computing mode to the target computing mode. The computing units and the execution units are set on the device, and the target computing mode is determined based on the mode switching instruction.
8. A confidential computing mode switching system, characterized in that: It includes a host and a device, wherein a virtual machine runs on the host, the virtual machine uses the device to perform data calculation, a receiving module and a verification module are arranged on the host, and a switching module is arranged on the device; The receiving module is used to receive a mode switching request for the virtual machine, and obtain user identity information based on the mode switching request; The verification module is used to verify the user identity information and send a mode switching instruction to the switching module if the verification passes; The switching module is used to switch the computing mode of the virtual machine based on the mode switching instruction.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the mode switching method for confidential computing as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the mode switching method for confidential computing as described in any one of claims 1 to 7.
