Secure operation and maintenance system and method for confidential virtual machine based on host machine scheduling

By adopting the virtual processor thread scheduling and secondary page table isolation technology co-designed by the host and the client in the confidential virtual machine, the problems of improper running position and insufficient security of the operation and maintenance module in the existing technology are solved, and flexible , safe and efficient operation and maintenance solution, suitable for multi-platform environments.

CN118656174APending Publication Date: 2024-09-17SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410837441.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing confidential virtual machine operation and maintenance technology lacks flexibility, security and performance, especially in scenarios such as live migration and disaster recovery. There are performance bottlenecks and security risks. Moreover, traditional methods rely on hardware modifications and firmware extensions, making it difficult to support cross-platform compatibility. and rich customized services.

Method used

The host and client are co-designed, and the client's internal isolation technology is based on the process call of the host's virtual processor thread scheduling and the secondary page table to achieve flexible operation and safe isolation of the operation and maintenance module to avoid This reduces the risk of the host running the operation and maintenance module.

Benefits of technology

It improves the flexibility and security of the operation and maintenance module, reduces performance bottlenecks, enhances the adaptability and security of the cloud computing environment, supports multi-platform compatibility, and reduces the amount of firmware code and operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656174A
    Figure CN118656174A
Patent Text Reader

Abstract

The invention provides a security operation and maintenance system and method for a confidential virtual machine based on host machine scheduling, and the method comprises the steps: employing a mode of collaborative design of a host machine and a client machine, and carrying out the process calling of the thread scheduling of a virtual processor of the client machine based on the host machine, and the internal isolation technology of the client machine based on a second-level page table; in the design of process calling of client virtual processor thread scheduling based on a host machine, a client operating system directly runs operation and maintenance modules in the client, and a client operating system binds a corresponding virtual processor thread for each operation and maintenance module and registers the virtual processor thread in the host system. And when operation and maintenance operation is needed, the host system triggers operation of an internal operation and maintenance module of the client by waking up and scheduling a corresponding virtual processor thread. The operation and maintenance module disclosed by the invention can avoid the semantic difference between the host machine and the client machine in the client machine, so that the operation and maintenance module can cooperate with the client machine more efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtualization technology and confidential computing, and in particular, to a confidential virtual machine security operation and maintenance system and method based on host machine scheduling. Background Art

[0002] Confidential Virtual Machines (CVMs) can effectively protect the privacy of cloud tenants and prevent damage from curious or malicious host software stacks. They are becoming increasingly popular among major cloud providers such as AWS and Google Cloud. As a result, mainstream hardware vendors have released their own CVM support, such as AMD SEV, ARM CCA, and Intel TDX solutions. These solutions usually make the internal data of the client inaccessible to the host software stack of the cloud vendor. However, such solutions also bring great challenges to virtual machine operation and maintenance (such as live migration operations and client snapshot operations that are very common in cloud computing), which is critical to cloud computing operations. For example, cloud providers rely on live virtual machine migration to upgrade infrastructure and optimize deployment strategies without stopping virtual machines. At the same time, cloud tenants rely on maintenance services such as monitoring and security scanning to ensure the safe and stable operation of their workloads.

[0003] Traditional maintenance methods usually require intrusive access to the client from the host (host-driven) or deploying agent software in the client to access its internal data (client-driven). In the CVM scenario, this traditional method becomes impractical because CVM basically blocks intrusive direct access from the host to the client, and the client will reject the untrusted agent software provided by the host.

[0004] Recent approaches to addressing the above challenges require CVM hardware vendors to make nontrivial modifications to the firmware and / or hardware. In particular, these approaches offload maintenance functions that cannot be performed by the host software stack to more privileged components, such as firmware. However, this approach has several limitations. First, it lacks sufficient flexibility to support the increasingly rich customization services of cloud vendors. This is mainly due to the difficulty in modifying firmware and hardware and the lack of cross-platform compatibility.

[0005] Second, this approach increases the firmware's code size and complicates its interaction with the host and guest, which increases the firmware's operating cost and makes it more vulnerable to security vulnerabilities. Given that the firmware serves as the common trusted computing base (TCB) of the entire system, any reduction in its security will bring risks to both the guest and the host.

[0006] Finally, current approaches suffer from severe performance issues in critical scenarios. For example, on AMD SEV platforms, the firmware runs on the AMD Secure Processor (AMD-SP), whose limited computing power becomes a bottleneck for maintenance operations. According to our tests, it causes 1,986× overhead in live migration scenarios.

[0007] A fundamental problem with current approaches is that they inappropriately choose where to run the operation and maintenance module. We believe that a more attractive solution is to place the maintenance module that tenants trust inside the client, especially considering that there are already mechanisms such as upcall in traditional virtual machine solutions that support calls from the host to the client module. Nevertheless, there are two challenges in directly applying existing mechanisms to support maintenance modules in the client. First, maintenance activities within these computer virtual machines may cause performance degradation due to resource contention with customer workloads, which may cause resource shortages when the host starts maintenance functions. According to our tests, it will cause about 3 times slowdown in resource recovery.

[0008] Secondly, some maintenance tasks, such as disaster recovery, have strong fault tolerance requirements and must work normally even if the client operating system fails. However, current methods cannot provide an isolated execution environment for them.

[0009] Due to the above difficulties, the current operation and maintenance technology of confidential virtual machines has progressed slowly and is scarce in variety, which seriously hinders the widespread deployment of confidential virtual machine solutions in cloud computing. Summary of the invention

[0010] In view of the defects in the prior art, the purpose of the present invention is to provide a confidential virtual machine security operation and maintenance system and method based on host machine scheduling.

[0011] A confidential virtual machine security operation and maintenance system based on host machine scheduling provided by the present invention includes:

[0012] The host and client are co-designed in a way that includes process calls based on the host scheduling of client virtual processor threads and client internal isolation technology based on the secondary page table.

[0013] Among them, in the design of process call based on the host machine's scheduling of the client's virtual processor thread, the client operating system runs the operation and maintenance module directly inside the client. The client operating system binds a corresponding virtual processor thread to each operation and maintenance module and registers it with the host system. When operation and maintenance operations are required, the host system wakes up and schedules the corresponding virtual processor thread to trigger the operation of the operation and maintenance module inside the client.

[0014] Preferably, the operation and maintenance module bound to the client on the virtual processor is implemented as an infinite loop state machine; the loop process of the state machine during operation includes the following four states:

[0015] State reset: When the host machine needs to perform an operation and maintenance task, the corresponding virtual processor thread of the operation and maintenance module is scheduled, and the operation and maintenance module in the virtual machine then starts to reset the various state environments required for this task;

[0016] Authorization verification: The operation and maintenance module actively checks the client's authorization to confirm whether the execution is permitted by the client. If authorization is not obtained, the operation and maintenance module will loop infinitely in this step until the client's authorization is obtained before proceeding to the next step.

[0017] Core business: After confirming that the client has authorized this operation and maintenance task, the operation and maintenance module performs the core business logic of this operation and maintenance;

[0018] Transfer termination: When the core business logic of this operation and maintenance task is completed, this module actively sinks to notify the host system to stop scheduling this virtual processor thread, thereby stopping operation and releasing the occupied computing resources.

[0019] Preferably, the host system places the virtual processor threads bound to all operation and maintenance modules in the sleep scheduling queue by default. When the operation and maintenance function is not needed, the virtual processor threads bound to the client operation and maintenance function will not run and occupy computing resources.

[0020] Preferably, a confidential page table isolation scheme is provided, which utilizes the client secondary memory address translation characteristics of the virtualization hardware platform, and upgrades the design in which each client uses only one secondary page table in the previous scheme to configure different secondary page tables according to the internal software isolation requirements of each virtual processor, so that each software component bound to different virtual processors of the same virtual machine has different client secondary memory address translations and different accessible memory ranges, thereby achieving secure isolation or partial memory sharing between various software modules.

[0021] Preferably, the confidential page table isolation solution is applicable to common virtual machines and confidential virtual machine solutions currently on the market. Since the components configuring the secondary page table in some confidential virtual machine solutions are trusted firmware trusted by the confidential client, the confidential virtual machine solutions continue to obtain security isolation capabilities in scenarios where the host system is not trusted.

[0022] The confidential page table isolation scheme saves the overall memory usage and configuration calculation burden of the secondary page table by reusing some page table entries and non-root page tables, and realizes inter-module sharing of some client memory.

[0023] According to a confidential virtual machine security operation and maintenance method based on host scheduling provided by the present invention, the confidential virtual machine security operation and maintenance system based on host scheduling is adopted to perform the following steps:

[0024] Step S1: the system is initialized;

[0025] Step S2: After completing the initialization, the operation and maintenance process of the confidential process call is performed;

[0026] Step S3: Enable the client internal isolation technology based on the secondary page table and perform a new initialization process.

[0027] Preferably, in step S1:

[0028] Step S1.1: The client starts and loads the confidential procedure call loader;

[0029] Step S1.2: The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure call;

[0030] Step S1.3: The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system;

[0031] Step S1.4: The loader initializes the operating environment for each confidential procedure call of the loaded operation and maintenance module;

[0032] Step S1.5: The loader or the confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the sleep queue of the scheduler to wait for being awakened;

[0033] In the above initialization process, the order of step S1.3 and step S1.4 can be swapped;

[0034] The loader in step S1.1 is in the form of a kernel module of the client operating system, compiled with the client operating system or independently, or is an application that needs to be checked by the cloud tenant or client to verify its security before running;

[0035] In step S1.3 and step S1.5, the loader registers information with the host system by virtual machine sinking or asynchronous information sharing based on shared memory;

[0036] In step S1.4, the operating environment required to be initialized for the confidential procedure call includes register status, memory data status, and program counter.

[0037] Preferably, in step S2:

[0038] Step S2.1: When the host system needs to initiate an operation and maintenance operation, the virtual processor thread corresponding to the operation and maintenance operation is awakened from the scheduler sleep queue and scheduled to the physical processor core according to the number registration information;

[0039] Step S2.2: the thread then starts running the infinite loop state machine in the client to perform the operation and maintenance task;

[0040] Step S2.3: After the operation and maintenance task is completed, the state machine of the confidential process call enters the transfer termination state, and the confidential process call notifies the host machine from within the client machine to give up the occupied physical processor core and re-enters the sleep queue of the host machine scheduler to wait for the next operation and maintenance task;

[0041] The notification method used by the confidential procedure call in the yield-terminated state is a synchronous virtual machine fallback or an asynchronous notification mechanism based on shared memory.

[0042] Preferably, in step S3:

[0043] In the design of the client internal isolation technology based on the secondary page table, the cloud tenant allows some confidential procedure calls to run in an environment isolated from the client operating system. When the client operating system fails or is attacked by an attacker, the confidential procedure calls can run correctly. The new initialization process of the design scheme for enabling the client internal isolation technology based on the secondary page table is as follows:

[0044] Step S3.1: The client starts and loads the confidential procedure call loader;

[0045] Step S3.2: The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure call;

[0046] Step S3.3: The loader registers the physical memory range confidential range required for the confidential procedure call to run with module A that controls the secondary page table of the client, so that module A creates an additional secondary page table for the virtual processor called by the confidential procedure and maps these physical addresses in the secondary page table, while deleting the mapping of these physical addresses in the secondary page tables of other virtual processors of the client;

[0047] Step S3.4: The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system;

[0048] Step S3.5: The confidential process calls itself to establish a secure operating environment, including establishing a trusted first-level page table mapping and a trusted interrupt processing vector table within the above confidential scope;

[0049] Step S3.6: The confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the scheduler's sleep queue to wait for wake-up;

[0050] After enabling the client internal isolation technology based on the secondary page table, the client no longer needs to repeatedly authorize in the authorization verification state, but the client directly authorizes once and permanently in the initialization steps S3.3 to S3.5.

[0051] Preferably, the module A controlling the secondary page table in step S3.3 is a host operating system or virtual machine management software capable of controlling the secondary page table, or a confidential virtual machine trusted firmware module capable of controlling the secondary page table, according to the specific hardware platform;

[0052] In step S3.4, the loader registers information with the host system by virtual machine sinking or asynchronous information sharing based on shared memory;

[0053] The operating environment that needs to be initialized in step S3.5 also includes register status, memory data status and program counter.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. The present invention has extremely high flexibility: the operation and maintenance module is no longer limited to cloud vendors and hardware vendors, but can be customized by customers according to their own needs. At the same time, this design is applicable to mainstream hardware platforms on the market (including but not limited to Intel platform, AMD platform and ARM platform), and is not limited to the virtualization hardware platform of a specific vendor.

[0056] 2. The present invention has excellent security: In the present invention, the host machine no longer runs the operation and maintenance module, thereby reducing its code volume and improving the security of the host system. On the other hand, the host system no longer needs to access the internal data of the client in order to support the operation and maintenance module, and the privacy security of the client data is also improved.

[0057] 3. The present invention has high efficiency: the operation and maintenance module of the present invention can avoid the semantic difference between the host machine and the client machine inside the client machine, thereby cooperating with the client machine more efficiently. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0059] Figure 1 This is a comparison chart of the differences between the host system's calling of confidential procedures and the calling of ordinary operation and maintenance module functions;

[0060] Figure 2 Schematic diagram of the internal state machine called for the confidentiality process;

[0061] Figure 3 The multi-level page table isolation principle diagram for the confidential page table isolation solution;

[0062] Figure 4 This is the page table entry reuse principle diagram of the secondary page table of the confidential page table isolation scheme;

[0063] Figure 5 An architectural diagram of the current system virtualization solution's support for virtual machine operation and maintenance operations;

[0064] Figure 6 This is an architecture diagram of the support for the operation and maintenance module of the present invention;

[0065] Figure 7 It is a software flow chart of the present invention. DETAILED DESCRIPTION

[0066] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0067] Embodiment 1:

[0068] The present invention relates to a secure operation and maintenance solution for confidential virtual machines based on host machine scheduling. The solution adopts a collaborative approach between the host machine and the client machine, and can be divided into a process call based on the host machine's scheduling of the client machine's virtual processor thread, and a client machine's internal isolation technology based on a secondary page table. Compared with the prior art, the present invention has extremely strong versatility and can be adapted to all traditional virtual machine solutions and confidential virtual machine solutions, and no longer relies on the specific hardware characteristics of individual manufacturers. At the same time, the technology has great flexibility, opening up the definition and development capabilities of confidential virtual machine operation and maintenance operations to cloud tenants and cloud vendors, and is no longer monopolized by hardware manufacturers.

[0069] According to a confidential virtual machine security operation and maintenance method based on host machine scheduling provided by the present invention, Figure 1-Figure 7 As shown, the confidential virtual machine security operation and maintenance system based on host scheduling is used to perform the following steps:

[0070] Step S1: the system is initialized;

[0071] Specifically, in step S1:

[0072] Step S1.1: The client starts and loads the confidential procedure call loader;

[0073] Step S1.2: The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure call;

[0074] Step S1.3: The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system;

[0075] Step S1.4: The loader initializes the operating environment for each confidential procedure call of the loaded operation and maintenance module;

[0076] Step S1.5: The loader or the confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the sleep queue of the scheduler to wait for being awakened;

[0077] In the above initialization process, the order of step S1.3 and step S1.4 can be swapped;

[0078] The loader in step S1.1 is in the form of a kernel module of the client operating system, compiled with the client operating system or independently, or is an application that needs to be checked by the cloud tenant or client to verify its security before running;

[0079] In step S1.3 and step S1.5, the loader registers information with the host system by virtual machine sinking or asynchronous information sharing based on shared memory;

[0080] In step S1.4, the operating environment required to be initialized for the confidential procedure call includes register status, memory data status, and program counter.

[0081] Step S2: After completing the initialization, the operation and maintenance process of the confidential process call is performed;

[0082] Specifically, in step S2:

[0083] Step S2.1: When the host system needs to initiate an operation and maintenance operation, the virtual processor thread corresponding to the operation and maintenance operation is awakened from the scheduler sleep queue and scheduled to the physical processor core according to the number registration information;

[0084] Step S2.2: the thread then starts running the infinite loop state machine in the client to perform the operation and maintenance task;

[0085] Step S2.3: After the operation and maintenance task is completed, the state machine of the confidential process call enters the transfer termination state, and the confidential process call notifies the host machine from within the client machine to give up the occupied physical processor core and re-enters the sleep queue of the host machine scheduler to wait for the next operation and maintenance task;

[0086] The notification method used by the confidential procedure call in the yield-terminated state is a synchronous virtual machine fallback or an asynchronous notification mechanism based on shared memory.

[0087] Step S3: Enable the client internal isolation technology based on the secondary page table and perform a new initialization process.

[0088] Specifically, in step S3:

[0089] In the design of the client internal isolation technology based on the secondary page table, the cloud tenant allows some confidential procedure calls to run in an environment isolated from the client operating system. When the client operating system fails or is attacked by an attacker, the confidential procedure calls can run correctly. The new initialization process of the design scheme for enabling the client internal isolation technology based on the secondary page table is as follows:

[0090] Step S3.1: The client starts and loads the confidential procedure call loader;

[0091] Step S3.2: The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure call;

[0092] Step S3.3: The loader registers the physical memory range confidential range required for the confidential procedure call to run with module A that controls the secondary page table of the client, so that module A creates an additional secondary page table for the virtual processor called by the confidential procedure and maps these physical addresses in the secondary page table, while deleting the mapping of these physical addresses in the secondary page tables of other virtual processors of the client;

[0093] Step S3.4: The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system;

[0094] Step S3.5: The confidential process calls itself to establish a secure operating environment, including establishing a trusted first-level page table mapping and a trusted interrupt processing vector table within the above confidential scope;

[0095] Step S3.6: The confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the scheduler's sleep queue to wait for wake-up;

[0096] After enabling the client internal isolation technology based on the secondary page table, the client no longer needs to repeatedly authorize in the authorization verification state, but the client directly authorizes once and permanently in the initialization steps S3.3 to S3.5.

[0097] Specifically, the module A controlling the secondary page table in step S3.3 is a host operating system or virtual machine management software capable of controlling the secondary page table, or a confidential virtual machine trusted firmware module capable of controlling the secondary page table, according to the specific hardware platform;

[0098] In step S3.4, the loader registers information with the host system by virtual machine sinking or asynchronous information sharing based on shared memory;

[0099] The operating environment that needs to be initialized in step S3.5 also includes register status, memory data status and program counter.

[0100] Embodiment 2:

[0101] Embodiment 2 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.

[0102] The present invention also provides a confidential virtual machine security operation and maintenance system based on host scheduling. The confidential virtual machine security operation and maintenance system based on host scheduling can be implemented by executing the process steps of the confidential virtual machine security operation and maintenance method based on host scheduling, that is, technical personnel in this field can understand the confidential virtual machine security operation and maintenance method based on host scheduling as the preferred implementation mode of the confidential virtual machine security operation and maintenance system based on host scheduling.

[0103] A confidential virtual machine security operation and maintenance system based on host machine scheduling provided by the present invention includes:

[0104] The host and client are co-designed in a way that includes process calls based on the host scheduling of client virtual processor threads and client internal isolation technology based on the secondary page table.

[0105] Among them, in the design of process call based on the host machine's scheduling of the client's virtual processor thread, the client operating system runs the operation and maintenance module directly inside the client. The client operating system binds a corresponding virtual processor thread to each operation and maintenance module and registers it with the host system. When operation and maintenance operations are required, the host system wakes up and schedules the corresponding virtual processor thread to trigger the operation of the operation and maintenance module inside the client.

[0106] Specifically, the operation and maintenance module bound to the client on the virtual processor is implemented as an infinite loop state machine; the loop process of the state machine during operation includes the following four states:

[0107] State reset: When the host machine needs to perform an operation and maintenance task, the corresponding virtual processor thread of the operation and maintenance module is scheduled, and the operation and maintenance module in the virtual machine then starts to reset the various state environments required for this task;

[0108] Authorization verification: The operation and maintenance module actively checks the client's authorization to confirm whether the execution is permitted by the client. If authorization is not obtained, the operation and maintenance module will loop infinitely in this step until the client's authorization is obtained before proceeding to the next step.

[0109] Core business: After confirming that the client has authorized this operation and maintenance task, the operation and maintenance module performs the core business logic of this operation and maintenance;

[0110] Transfer termination: When the core business logic of this operation and maintenance task is completed, this module actively sinks to notify the host system to stop scheduling this virtual processor thread, thereby stopping operation and releasing the occupied computing resources.

[0111] Specifically, the host system places all virtual processor threads bound to the operation and maintenance modules in the sleep scheduling queue by default. When the operation and maintenance function is not needed, the virtual processor threads bound to the client operation and maintenance function will not run and occupy computing resources.

[0112] Specifically, a confidential page table isolation scheme is proposed. This scheme utilizes the client secondary memory address translation characteristics of the virtualization hardware platform. By upgrading the design in the previous scheme that each client only uses one secondary page table to configuring different secondary page tables according to the internal software isolation requirements of each virtual processor, each software component bound to different virtual processors of the same virtual machine has different client secondary memory address translations and different accessible memory ranges, thereby achieving secure isolation or partial memory sharing between various software modules.

[0113] Specifically, the confidential page table isolation solution is applicable to common virtual machines and confidential virtual machine solutions currently on the market. Since the components configuring the secondary page table in some confidential virtual machine solutions are trusted by the confidential client, the confidential virtual machine solutions continue to obtain security isolation capabilities in scenarios where the host system is not trusted.

[0114] The confidential page table isolation scheme saves the overall memory usage and configuration calculation burden of the secondary page table by reusing some page table entries and non-root page tables, and realizes inter-module sharing of some client memory.

[0115] Embodiment 3:

[0116] Embodiment 3 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.

[0117] The purpose of the present invention is to overcome the defects of the prior art and provide a more flexible, secure and efficient confidential virtual machine operation and maintenance solution.

[0118] The purpose of the present invention can be achieved by the following technical solutions:

[0119] The present invention relates to a secure operation and maintenance solution for confidential virtual machines based on host machine scheduling. The solution adopts a host machine and a client machine in a collaborative manner and is divided into a confidential process call part (process call based on host machine scheduling of client machine virtual processor thread) and a confidential page table isolation part (client machine internal isolation technology based on a secondary page table).

[0120] First, in the design of confidential process call, the present invention extends the semantics of "scheduling" the confidential virtual machine virtual processor of the host machine to the semantics of "calling" the software function module inside the virtual machine. Thus, the host system can trigger the operation of the software module bound to the virtual machine processor by the client by scheduling a virtual processor thread.

[0121] In the design of process call based on the host machine scheduling the client virtual processor thread, the present invention allows the client operating system to run the operation and maintenance module directly inside the client, instead of running them on the host side or authorized by the hardware manufacturer to run in firmware or even hardware like in the traditional virtual machine solution. The client operating system will bind a corresponding virtual processor thread to each operation and maintenance module and register it with the host system. When the host system needs operation and maintenance operations, it can trigger the operation of the operation and maintenance module inside the client by waking up and scheduling the corresponding virtual processor thread.

[0122] The system initialization process of this technical solution is as follows:

[0123] Step (1.1) The client starts and loads the confidential procedure call loader (hereinafter referred to as the loader)

[0124] Step (1.2) The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure calls.

[0125] Step (1.3) The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system.

[0126] Step (1.4) The loader initializes the operating environment for each confidential process call of the loaded operation and maintenance module.

[0127] Step (1.5) The loader or the confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the sleep queue of the scheduler to wait for being awakened.

[0128] The order of steps (1.3) and (1.4) in the above initialization process can be swapped. After completing the initialization, the operation and maintenance process of a complete confidential process call has the following steps:

[0129] Step (2.1) When the host system needs to initiate an operation and maintenance operation, according to the information registered in the above step (1.3), the virtual processor thread corresponding to the operation and maintenance operation is awakened from the scheduler sleep queue and scheduled to the physical processor core.

[0130] In step (2.2), the thread then starts running the state machine described in claim (3) in the client to perform operation and maintenance tasks.

[0131] After the operation and maintenance task in step (2.3) is completed, the state machine of the confidential procedure call should enter the "transfer termination" state described in claim (3). At this time, the confidential procedure call will notify the host from within the client to give up the physical processor core it occupies, and re-enter the sleep queue of the host scheduler to wait for the next operation and maintenance task.

[0132] Second, in the design of client internal isolation technology based on the secondary page table, cloud tenants can allow some sensitive and critical confidential procedure calls to run in an environment isolated from the client operating system, so that when the client operating system fails or is attacked by attackers, these sensitive and critical confidential procedure calls can still run correctly. Enabling this solution can enhance the security and reliability of the above confidential procedure calls, and the steps (1.1 to 1.5) of the initialization process of the above confidential procedure calls will also change. The new initialization process is as follows:

[0133] Step (3.1) The client starts and loads the confidential procedure call loader (hereinafter referred to as the loader).

[0134] Step (3.2) The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure calls.

[0135] In step (3.3), the loader registers the physical memory range (hereinafter referred to as the confidential range) required for the confidential procedure call to run with module A that controls the client's secondary page table, so that module A creates an additional secondary page table for the virtual processor called by the confidential procedure and maps these physical addresses in the secondary page table, while the mapping of these physical addresses will be deleted from the secondary page tables of other virtual processors of the client.

[0136] Step (3.4) The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system.

[0137] Step (3.5) The confidential process call sets up a secure operating environment by itself, including establishing a trusted first-level page table mapping and a trusted interrupt processing vector table within the above confidential scope.

[0138] Step (3.6) The confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the scheduler's sleep queue to wait for being awakened.

[0139] After enabling the client internal isolation technology based on the secondary page table, the above step (2.2) and the state machine process will also change. The client no longer needs to repeatedly authorize in the "authorization verification" state. Instead, the client directly authorizes once and permanently in the above initialization steps (3.3) to (3.5).

[0140] (2) Design limitations based on process calls of the host machine to the client machine's virtual processor thread scheduling:

[0141] The following limitations are made for the design part of the process call based on the host machine scheduling the client virtual machine processor thread in the above solution:

[0142] Limitation (1): The loader described in step (1.1) can be in the form of a kernel module of the client operating system, which can be compiled together with the client operating system or independently, or it can be an application, but it needs to be checked by the cloud tenant or client to verify its security before running.

[0143] Limitation (2): In step (1.3) and step (1.5), the way in which the loader registers information with the host system can be a synchronous operation such as virtual machine sinking, or it can be asynchronous information sharing based on shared memory.

[0144] Limitation (3): In step (1.4), the operating environment that needs to be initialized for the confidential procedure call includes, but is not limited to, register status, memory data status, and program counter.

[0145] Limitation (4): The notification method used by the confidential procedure call in the "transfer termination" state described in step (2.3) can be a synchronous virtual machine fallback or an asynchronous notification mechanism based on shared memory.

[0146] (3) Design limitations of client internal isolation technology based on secondary page table:

[0147] The following limitations are made for the design of the client internal isolation technology based on the secondary page table of the above solution:

[0148] Limitation (1): Module A that controls the secondary page table in step (3.3) may be a host operating system or virtual machine management software (Hypervisor) that can control the secondary page table, or a confidential virtual machine trusted firmware module that can control the secondary page table, depending on the specific hardware platform.

[0149] Limitation (2): In step (3.4), the way in which the loader registers information with the host system can be a synchronous operation such as virtual machine sinking, or it can be asynchronous information sharing based on shared memory.

[0150] Limitation (3): The operating environment that needs to be initialized in step (3.5) also includes, but is not limited to, register status, memory data status, and program counter.

[0151] Compared with the existing scheme ( Figure 5 ) compared to the present invention ( Figure 6 ) can transfer the operation and maintenance module to the client for the host system to call, which improves the client's ability to flexibly customize and perform security checks on the operation and maintenance module. At the same time, the closer and semantically insensitive collaboration between the operation and maintenance module and the client can also achieve better operation and maintenance performance. On the other hand, the host system and confidential virtual machine firmware can no longer run the operation and maintenance module, thereby reducing their own code size, reducing the risk of software security vulnerabilities, and improving security and reliability.

[0152] like Figure 7 As shown, the specific software process of the present invention in the entire virtual client life cycle is combined with Figure 7 A detailed description of the process is given below:

[0153] In process 401 , the host system starts to launch a client for a cloud tenant.

[0154] In process 402, the loader is loaded during the startup of the client operating system (corresponding to the above step 1.1).

[0155] In process 403, the loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legal operation and maintenance modules into the corresponding confidential process call. (Corresponding to step 1.2 above)

[0156] In process 404, the loader needs to determine whether the operation and maintenance module is a security-sensitive operation module. If so, it needs to enable the client internal isolation technology based on the secondary page table for it, and needs to enter process 405. If not, then directly apply the ordinary confidential procedure call and enter process 406.

[0157] In process 405, the loader registers the physical memory range (hereinafter referred to as the confidential range) required for the confidential procedure call to run with module A that controls the client's secondary page table, so that module A creates an additional secondary page table for the virtual processor called by the confidential procedure and maps these physical addresses in the secondary page table, while the secondary page tables of other virtual processors of the client delete the mapping of these physical addresses. (Corresponding to the above step 3.3)

[0158] In process 406, the loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system. (Corresponding to the above step 1.3)

[0159] In process 407, the loader initializes the operating environment for each confidential procedure call of the loaded operation and maintenance module (corresponding to the above step 1.4). If it is a security-sensitive operation and maintenance module, the confidential procedure call will set up a secure operating environment by itself, including establishing a trusted first-level page table mapping and a trusted interrupt processing vector table within the above confidential scope (corresponding to the above step 3.5).

[0160] In process 408, the loader or the confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the scheduler's sleep queue to wait for wake-up. (Corresponding to the above step 1.3)

[0161] In process 409, the client runs normally. If the customer wants to shut down the client, the client end step 416 is started.

[0162] In process 410 , when the client is operating normally, if the host system needs to initiate a maintenance operation, it proceeds to step 411 ; if not, it continues to operate normally and proceeds to process 409 .

[0163] In process 411, when the host system needs to initiate an operation, according to the information registered in the above step (1.3), the virtual processor thread corresponding to the operation is awakened from the scheduler sleep queue and scheduled to the physical processor core. (Corresponding to the above step 2.1)

[0164] In process 412, the confidential process call is in the "state reset" stage, and the various state environments required for this task are reset in the virtual machine. (Corresponding to the above step 2.2 and step a in claim 3)

[0165] In process 413, the operation and maintenance module will actively check the authorization of the client to confirm whether the execution is permitted by the client. If authorization is not obtained, the operation and maintenance module will loop infinitely in the process until the client authorization is obtained before entering the next step. For security-sensitive operation and maintenance modules, the authorization has been permanently granted during the initialization phase. (Corresponding to the above step 2.2 and step b in claim 3)

[0166] In process 414, after confirming that the client has authorized this operation and maintenance task, the operation and maintenance module will perform the core business logic of this operation and maintenance. (Corresponding to the above step 2.2 and step c in claim 3)

[0167] In process 415, when the core business logic of this operation and maintenance task is executed, this module will actively sink to notify the host system to stop scheduling this virtual processor thread, thereby stopping operation and releasing the occupied computing resources. Then enter process 408. Corresponding to the above step 2.2 and step d in claim 3)

[0168] In process 416, the client shuts down and the life cycle ends.

[0169] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0170] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A confidential virtual machine security operation and maintenance system based on host scheduling, characterized in that: include: The host and client are co-designed in a way that includes process calls based on the host scheduling of client virtual processor threads and client internal isolation technology based on the secondary page table. Among them, in the design of process call based on the host machine's scheduling of the client's virtual processor thread, the client operating system runs the operation and maintenance module directly inside the client. The client operating system binds a corresponding virtual processor thread to each operation and maintenance module and registers it with the host system. When operation and maintenance operations are required, the host system wakes up and schedules the corresponding virtual processor thread to trigger the operation of the operation and maintenance module inside the client.

2. The confidential virtual machine security operation and maintenance system based on host machine scheduling according to claim 1 is characterized by: The operation and maintenance module bound to the client on the virtual processor is implemented as an infinite loop state machine; the loop process of the state machine during operation includes the following four states: State reset: When the host machine needs to perform an operation and maintenance task, the corresponding virtual processor thread of the operation and maintenance module is scheduled, and the operation and maintenance module in the virtual machine then starts to reset the various state environments required for this task; Authorization verification: The operation and maintenance module actively checks the client's authorization to confirm whether this execution is permitted by the client; If authorization is not obtained, the operation and maintenance module will loop infinitely in this step until the customer's authorization is obtained before moving to the next step; Core business: After confirming that the client has authorized this operation and maintenance task, the operation and maintenance module performs the core business logic of this operation and maintenance; Transfer termination: When the core business logic of this operation and maintenance task is completed, this module actively sinks to notify the host system to stop scheduling this virtual processor thread, thereby stopping operation and releasing the occupied computing resources.

3. The confidential virtual machine security operation and maintenance system based on host machine scheduling according to claim 1 is characterized in that: By default, the host system places all virtual processor threads bound to the operation and maintenance modules in the sleep scheduling queue. When the operation and maintenance function is not needed, the virtual processor threads bound to the client operation and maintenance function will not run and occupy computing resources.

4. The confidential virtual machine security operation and maintenance system based on host machine scheduling according to claim 1 is characterized in that: A confidential page table isolation scheme is proposed. The scheme utilizes the client secondary memory address translation characteristics of the virtualization hardware platform. By upgrading the design in the previous scheme that each client only uses one secondary page table to configuring different secondary page tables according to the internal software isolation requirements of each virtual processor, each software component bound to different virtual processors of the same virtual machine has different client secondary memory address translations and different accessible memory ranges, thereby achieving secure isolation or partial memory sharing between various software modules.

5. The confidential virtual machine security operation and maintenance system based on host machine scheduling according to claim 4 is characterized in that: The confidential page table isolation solution is applicable to common virtual machines and confidential virtual machine solutions on the current market. Since the components that configure the secondary page table in some confidential virtual machine solutions are trusted by the confidential client, the confidential virtual machine solution can continue to obtain security isolation capabilities in scenarios where the host system is not trusted. The confidential page table isolation scheme saves the overall memory usage and configuration calculation burden of the secondary page table by reusing some page table entries and non-root page tables, and realizes inter-module sharing of some client memory.

6. A confidential virtual machine security operation and maintenance method based on host scheduling, characterized in that: The confidential virtual machine security operation and maintenance system based on host machine scheduling according to any one of claims 1 to 5 is used to execute the following steps: Step S1: the system is initialized; Step S2: After completing the initialization, the operation and maintenance process of the confidential process call is performed; Step S3: Enable the client internal isolation technology based on the secondary page table and perform a new initialization process.

7. The method for secure operation and maintenance of confidential virtual machines based on host scheduling according to claim 6, characterized in that: In step S1: Step S1.1: The client starts and loads the confidential procedure call loader; Step S1.2: The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure call; Step S1.3: The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system; Step S1.4: The loader initializes the operating environment for each confidential procedure call of the loaded operation and maintenance module; Step S1.5: The loader or the confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the sleep queue of the scheduler to wait for being awakened; In the above initialization process, the order of step S1.3 and step S1.4 can be swapped; The loader in step S1.1 is in the form of a kernel module of the client operating system, compiled with the client operating system or independently, or is an application that needs to be checked by the cloud tenant or client to verify its security before running; In step S1.3 and step S1.5, the loader registers information with the host system by virtual machine sinking or asynchronous information sharing based on shared memory; In step S1.4, the operating environment required to be initialized for the confidential procedure call includes register status, memory data status, and program counter.

8. The method for secure operation and maintenance of confidential virtual machines based on host scheduling according to claim 6, characterized in that: In step S2: Step S2.1: When the host system needs to initiate an operation and maintenance operation, the virtual processor thread corresponding to the operation and maintenance operation is awakened from the scheduler sleep queue and scheduled to the physical processor core according to the number registration information; Step S2.2: the thread then starts running the infinite loop state machine in the client to perform the operation and maintenance task; Step S2.3: After the operation and maintenance task is completed, the state machine of the confidential process call enters the transfer termination state, and the confidential process call notifies the host machine from within the client machine to give up the occupied physical processor core and re-enters the sleep queue of the host machine scheduler to wait for the next operation and maintenance task; The notification method used by the confidential procedure call in the yield-terminated state is a synchronous virtual machine fallback or an asynchronous notification mechanism based on shared memory.

9. The method for secure operation and maintenance of confidential virtual machines based on host scheduling according to claim 6, characterized in that: In step S3: In the design of the client internal isolation technology based on the secondary page table, the cloud tenant allows some confidential procedure calls to run in an environment isolated from the client operating system. When the client operating system fails or is attacked by an attacker, the confidential procedure calls can run correctly. The new initialization process of the design scheme for enabling the client internal isolation technology based on the secondary page table is as follows: Step S3.1: The client starts and loads the confidential procedure call loader; Step S3.2: The loader checks and verifies the operation and maintenance modules that the cloud tenant needs to use, and loads the legitimate operation and maintenance modules into the corresponding confidential procedure call; Step S3.3: The loader registers the physical memory range confidential range required for the confidential procedure call to run with module A that controls the secondary page table of the client, so that module A creates an additional secondary page table for the virtual processor called by the confidential procedure and maps these physical addresses in the secondary page table, while deleting the mapping of these physical addresses in the secondary page tables of other virtual processors of the client; Step S3.4: The loader registers the operation and maintenance module function and virtual processor number loaded by each confidential process call to the host system; Step S3.5: The confidential process calls itself to establish a secure operating environment, including establishing a trusted first-level page table mapping and a trusted interrupt processing vector table within the above confidential scope; Step S3.6: The confidential procedure call notifies the host system to put all virtual processor threads corresponding to the confidential procedure call into the scheduler's sleep queue to wait for wake-up; After enabling the client internal isolation technology based on the secondary page table, the client no longer needs to repeatedly authorize in the authorization verification state, but the client directly authorizes once and permanently in the initialization steps S3.3 to S3.

5.

10. The method for secure operation and maintenance of confidential virtual machines based on host scheduling according to claim 9, characterized in that: The module A controlling the secondary page table in step S3.3 is, according to the specific hardware platform, a host operating system or virtual machine management software capable of controlling the secondary page table, or a confidential virtual machine trusted firmware module capable of controlling the secondary page table; In step S3.4, the loader registers information with the host system by virtual machine sinking or asynchronous information sharing based on shared memory; The operating environment that needs to be initialized in step S3.5 also includes register status, memory data status and program counter.