Method for performing operations on registers, computer device, storage medium and program product
By capturing and verifying target operation instructions and directly intercepting and processing register operations, the problem of software bypassing kernel reinforcement technology attacks in the virtual machine is solved, and the security of the virtual machine is improved.
Patent Information
- Application Number
- CN202410987349.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-23
AI Technical Summary
In the field of virtual machine technology, some software can bypass kernel reinforcement technology and then attack the virtual machine operating system, resulting in security risks.
By capturing the target operation instructions, determining its type, and performing operations on the target register based on the policy data and the original and new values of the registers in the pre-built policy table, directly intercepting and verifying modifications to avoid the occurrence of virtual machine security problems. .
It effectively prevents the security problems of virtual machines caused by software bypassing kernel reinforcement technology, improves the security of virtual machines, and ensures the security and integrity of register values.
Smart Images

Figure CN118520464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual machine technology, and in particular to a method for performing operations on registers, a computer device, a storage medium and a program product. Background Art
[0002] With the rise of cloud computing, many users now choose cloud computing, storage, network and other resources to build computing environments. As the supporting technology of cloud computing, virtualization technology has realized the functions of most physical devices.
[0003] In the field of virtual machine technology, the security measures of virtual machine operating systems are consistent with the security defense measures of physical machine operating systems, such as kernel hardening technology. Kernel hardening technology refers to improving the security of the system and its ability to resist external attacks by modifying, optimizing, and encrypting the operating system kernel. For example, kernel hardening technology can restrict key kernel functions to prevent certain software from obtaining operating system permissions by calling key kernel functions and performing destructive operations on the virtual machine operating system.
[0004] However, kernel hardening technology is implemented at the kernel level, and in a virtual machine scenario, the virtual machine kernel does not run at the highest privilege of the processor. Therefore, there is a risk that some software will bypass kernel hardening technology and attack the virtual machine operating system. Summary of the invention
[0005] In view of this, the present invention provides a method, apparatus, computer device, storage medium and program product for performing operations on registers to solve the problem that some software bypasses kernel hardening technology and attacks virtual machine operating systems.
[0006] In a first aspect, the present invention provides a method for performing an operation on a register, capturing a target operation instruction, wherein the target operation instruction is an operation instruction that causes a virtual machine to switch from a working state to an exit state;
[0007] Determining the type of the target operation instruction according to the target operation instruction;
[0008] When it is determined according to the type of the target operation instruction that the target operation instruction is an instruction for operating a target register, obtaining an original value corresponding to the target register;
[0009] Acquire a first new value corresponding to the target operation instruction;
[0010] In a pre-built policy table, determining whether there is target policy data corresponding to the target register;
[0011] When it is determined that the target policy data exists in the policy table, one or more elements are selected from the target policy data, the original value, and the first new value, and an operation is performed on the target register.
[0012] The method for performing operations on a register provided by the present invention has the following advantages:
[0013] Since modifying the value in the register is the lowest level modification method, although some software will bypass the kernel hardening technology, this solution can directly intercept the target operation instruction at the register level, and can perform specific analysis on the target operation instruction based on the policy data in the pre-built policy table, as well as the original value and the first new value of the target register obtained, before performing the operation on the target register. In this way, virtual machine security issues caused by some software directly modifying the value in the register can be avoided.
[0014] In an optional implementation, the target register is a control register;
[0015] When it is determined that the target policy data exists in the policy table, one or more elements are selected from the target policy data, the original value, and the first new value, and an operation is performed on the target register, including:
[0016] Performing an XOR operation on the original value and the first new value to determine whether there is at least one modified bit;
[0017] When it is determined that there is at least one modification bit, updating the value corresponding to each modification bit in the first new value according to each modification bit and the target policy data to obtain a second new value;
[0018] An update operation is performed on the target register according to the second new value.
[0019] Specifically, since each bit of the control register is used to indicate a function, a policy verification operation is performed on each bit to fully cover all functions. In addition, each modified bit is updated after policy verification to ensure that the final updated value is a safe value, thereby improving the security of the virtual machine.
[0020] In an optional implementation, when it is determined that there is at least one modification bit, updating the value corresponding to each modification bit in the first new value according to each modification bit and the target policy data to obtain a second new value includes:
[0021] According to the target modification bit, determining whether there is policy sub-data corresponding to the target modification bit in the target policy data, wherein the target modification bit is any modification bit of at least one of the modification bits;
[0022] When it is determined that the policy sub-data exists in the target policy data, updating the value corresponding to the target modification bit in the first new value according to the policy sub-data;
[0023] After determining that all modification bits of the existing policy sub-data have been updated, the second new value is obtained.
[0024] Specifically, by using the modification bit of the policy sub-data, after the first new value is updated, a secure value, ie, the second new value, can be obtained, which can ensure that the final updated value is a secure value, thereby improving the security of the virtual machine.
[0025] In an optional implementation, when it is determined that the target policy data contains the policy sub-data, updating the value corresponding to the target modification bit in the first new value according to the policy sub-data includes:
[0026] When it is determined that the policy sub-data includes a first fixed value corresponding to the target modification bit, modifying the value corresponding to the target modification bit in the first new value to the first fixed value;
[0027] or,
[0028] When it is determined that the policy sub-data includes indication information prohibiting modification, the value corresponding to the target modification bit in the first new value is restored to the value corresponding to the target modification bit in the original value.
[0029] Specifically, different modification bits may correspond to different modification methods, which are related to the functions of the corresponding modification bits. Through the corresponding modification methods, the first new value may be updated to a safe value, thereby improving the security of the virtual machine.
[0030] In an optional implementation, the target register is a special module MSR register;
[0031] When it is determined that the target policy data exists in the policy table, one or more elements are selected from the target policy data, the original value, and the first new value, and an operation is performed on the target register, including:
[0032] When it is determined that the target policy data includes a second fixed value corresponding to the target register, setting an execution flag for the target operation instruction according to the first new value and the second fixed value;
[0033] or,
[0034] When it is determined that the target policy data does not include the second fixed value corresponding to the target register, setting the execution flag for the target operation instruction according to whether the target policy data includes instruction information prohibiting modification;
[0035] According to the execution flag, an operation corresponding to the execution flag is performed on the target register.
[0036] Specifically, when the second fixed value exists, unauthorized modification can be prevented based on the first new value and the second fixed value, ensuring that the register value remains within a safe range. When the second fixed value does not exist but there is instruction information prohibiting modification, the modification operation is directly blocked, further strengthening the protection of the target register.
[0037] In an optional implementation, the execution flag is a first flag or a second flag, wherein the first flag is used to indicate that the target operation instruction is executed, and the second flag is used to indicate that the target operation instruction is prohibited from being executed;
[0038] When it is determined that the target policy data includes a second fixed value corresponding to the target register, setting an execution flag for the target operation instruction according to the first new value and the second fixed value includes:
[0039] comparing the first new value and the second fixed value;
[0040] When the comparison result is that the first new value and the second fixed value are consistent, setting the execution flag of the target operation instruction to the first flag;
[0041] or,
[0042] When the comparison result is that the first new value and the second fixed value are inconsistent, the execution flag of the target operation instruction is set to the second flag.
[0043] Specifically, this solution can ensure that the modification operation is allowed only when the new value is completely consistent with the preset fixed value, which effectively prevents unauthorized changes and improves the security of the virtual machine.
[0044] In an optional implementation, when it is determined that the target policy data does not include the second fixed value corresponding to the target register, setting the execution flag for the target operation instruction according to whether the target policy data includes indication information prohibiting modification includes:
[0045] When it is determined that the target policy data includes the instruction information prohibiting modification, setting the execution flag of the target operation instruction to the second flag;
[0046] or,
[0047] When it is determined that the target policy data does not include the instruction information prohibiting modification, the execution flag of the target operation instruction is set to the first flag.
[0048] Specifically, by prohibiting the modification of specific registers, unauthorized changes can be effectively prevented, the virtual machine can be protected from dangerous operations, and security can be enhanced.
[0049] In an optional implementation, performing an operation corresponding to the execution flag on the target register according to the execution flag includes:
[0050] When it is determined that the execution flag is the first flag, updating the value in the target register according to the first new value;
[0051] or,
[0052] When it is determined that the execution flag is the second flag, no update operation is performed on the target register.
[0053] Specifically, by setting the execution flag, it is ensured that only verified and authorized operations can update the target register, which effectively prevents unauthorized access or modification and enhances the security of the virtual machine.
[0054] In an optional embodiment, the method further includes:
[0055] Determining whether the target policy data includes instruction information for enabling logging;
[0056] When it is determined that the target policy data includes the indication information for enabling the log, setting a log record flag for the target operation instruction, wherein the log record flag is used to indicate recording policy verification information;
[0057] or,
[0058] When it is determined that the target policy data does not include the instruction information for enabling the log, a log record flag is not set for the target operation instruction.
[0059] Specifically, for important and valuable events, enabling log instructions helps track the history of register operations, making it easier for subsequent technicians to analyze and improve policies. For events with low value, only policy verification is performed to avoid security issues, without logging, which can save storage space.
[0060] In an optional implementation, the acquiring the first new value corresponding to the target operation instruction includes:
[0061] Obtaining a first operand stored in a first general register and a second operand stored in a second general register;
[0062] The first new value is obtained according to the first operand and the second operand.
[0063] Specifically, a complete first new value can be obtained by combining the operands respectively stored in the two general registers.
[0064] In an optional embodiment, the method further includes:
[0065] When it is determined that the target operation instruction is an instruction to create a storage area based on the type of the target operation instruction, a first storage area and a second storage area are created based on the target operation instruction, wherein the first storage area is used to store the policy table and the second storage area is used to store the log.
[0066] Specifically, by storing policy tables and logs in separate areas, data can be clearly classified and organized for easy management and retrieval. Moreover, since policy tables may need to be accessed frequently, while logs are more focused on long-term preservation and archiving, this separation can optimize their respective access and storage strategies. In addition, since policy tables and logs may have different access modes and performance requirements, dividing storage areas is more conducive to flexibly setting the access modes of policy tables and logs.
[0067] In an optional embodiment, the method further includes:
[0068] When it is determined according to the type of the target operation instruction that the target operation instruction is an instruction for obtaining negotiation information, obtaining target negotiation information;
[0069] The target negotiation information is stored in a virtual machine control structure, and the virtual machine is notified to read the target negotiation information, wherein the target negotiation information is used by the virtual machine to perform a matching operation with a virtual machine monitor according to the target negotiation information.
[0070] Specifically, the negotiation information usually includes security parameters related to the communication between the virtual machine and the virtual machine monitor, etc. By performing a matching operation through the negotiation information, the security of the interaction between the virtual machine and the virtual machine monitor can be ensured to prevent unauthorized access or data leakage.
[0071] In a second aspect, the present invention provides a device for performing an operation on a register, the device comprising:
[0072] A capture module, used to capture a target operation instruction, wherein the target operation instruction is an operation instruction that causes the virtual machine to switch from a working state to an exit state;
[0073] A determination module, used to determine the type of the target operation instruction according to the target operation instruction;
[0074] an acquisition module, configured to acquire an original value corresponding to the target register when it is determined, according to the type of the target operation instruction, that the target operation instruction is an instruction for operating a target register; and acquire a first new value corresponding to the target operation instruction;
[0075] The determination module is further used to determine whether there is target policy data corresponding to the target register in the pre-built policy table;
[0076] An execution module is used to select one or more elements from the target policy data, the original value, and the first new value to perform an operation on the target register when it is determined that the target policy data exists in the policy table.
[0077] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of performing operations on a register according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0078] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of performing operations on a register according to the first aspect or any corresponding embodiment thereof.
[0079] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for performing operations on a register according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. 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.
[0081] Figure 1 is a system architecture diagram according to an embodiment of the present invention;
[0082] Figure 2is a flow chart of a method for performing an operation on a register according to an embodiment of the present invention;
[0083] Figure 3 is a schematic diagram of a policy execution flow of a control register according to an embodiment of the present invention;
[0084] Figure 4 is a schematic diagram of a policy execution flow of an MSR register according to an embodiment of the present invention;
[0085] Figure 5 is a flow chart of a method for setting a log record flag according to an embodiment of the present invention;
[0086] Figure 6 is a schematic diagram of a process flow of a negotiation method according to an embodiment of the present invention;
[0087] Figure 7 is a flowchart of a method for creating a storage area according to an embodiment of the present invention;
[0088] Figure 8 is a flow chart of a method for writing strategy data according to an embodiment of the present invention;
[0089] Fig. 9 is a flowchart of a method for deleting policy data according to an embodiment of the present invention;
[0090] Fig.10 is a structural block diagram of an apparatus for performing operations on a register according to an embodiment of the present invention;
[0091] Fig.11 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0092] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0093] The professional terms involved in the embodiments of the present invention are explained below.
[0094] Virtual Machine Exit (VM Exit): refers to a "trap" operation triggered when certain sensitive instructions are executed in the non-root mode of the virtual machine, causing the processor to switch from non-root mode back to root mode, that is, returning to the virtual machine manager (VMM).
[0095] Virtual Machine Entery (VM Entry): is a process corresponding to VM Exit. After the virtual machine monitor has processed the sensitive instructions executed by the virtual machine, it transfers the control of the processor to the virtual machine through the VM Entry operation. This operation switches the processor from root mode to non-root mode, allowing the virtual machine to continue running.
[0096] Virtual Machine Control Structure (VMCS): A memory area used to store and manage the state and control information of a virtual machine. The virtual machine has read-only access to the data stored in the VMCS. The virtual machine monitor has read-write access to the data stored in the VMCS.
[0097] The embodiment of the present invention is applied to a computer device, and a virtual machine monitor and at least one virtual machine may be installed on the computer device. For example, the computer device may be a server, a terminal, etc. Figure 1 As shown, the virtual machine monitor may include an event filtering module and a policy verification module, and manages at least one storage area, each storage area is associated with a virtual machine, that is, each virtual machine can write and read data in the corresponding storage area. Among them, the event filtering module can be used to identify sensitive operations of the virtual machine, that is, to capture the target operation instructions. The policy verification module can be used to perform policy verification operations on the target operation instructions using the policy data in the policy table. The virtual machine may include a negotiation module, a policy management module, a log management module and a virtual machine (VM) communication module. Among them, the negotiation module can be used to authenticate the negotiation information. The policy management module can be used for writing and deleting policy data, etc. The log management module can be used to read the logs stored in the storage area. The communication module can be used to complete the interaction between the virtual machine and the virtual machine monitor. The detailed operations of each module involved above can be found in the subsequent content, and will not be repeated here.
[0098] The embodiment of the present invention provides a method for performing operations on registers, which can improve the security of a virtual machine operating system by monitoring instructions for operating registers and performing policy verification before processing.
[0099] According to an embodiment of the present invention, an embodiment of a method for performing operations on a register is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0100] In this embodiment, a method for performing an operation on a register is provided, which can be performed by the above-mentioned computer device. Figure 2 is a flowchart of a method for performing operations on a register according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0101] Step S201, capturing target operation instructions.
[0102] Among them, the target operation instruction may be an operation instruction that causes the virtual machine to switch from a working state to an exit state. The target operation instruction may be an instruction to operate on a target register, an instruction to obtain negotiation information, an instruction to create a storage area, an instruction to write policy data, an instruction to delete policy data, and the like. Taking the x86 instruction set as an example, the instruction to obtain negotiation information may be a cpuid instruction. The instruction to create a storage area, the instruction to write policy data, and the instruction to delete policy data may all be vmcall instructions, and the vmcall instruction may include custom parameters. Different custom parameters are used to indicate different instructions. For example, when the custom parameter is A, the vmcall instruction is an instruction to create a storage area, and when the custom parameter is B, the vmcall instruction is an instruction to write policy data. The instruction to operate on the target register may be a mov cr0 instruction, an rdmsr instruction, a wrmsr instruction, and the like.
[0103] Specifically, after the virtual machine obtains the target operation instruction, it executes the target operation instruction and records the relevant information of the target operation instruction in the specified area of the virtual machine control structure (VMCS). In addition, when the computer device detects that the target operation instruction is a sensitive instruction (i.e., an instruction that may cause security problems to the virtual machine), it triggers the virtual machine to enter the VM Exit mode, that is, enter the processing logic of the virtual machine monitor (VMM). The event filtering module of the virtual machine monitor can read the relevant information of the target operation instruction from the specified area of the virtual machine control structure, that is, the target operation instruction is captured.
[0104] Step S202: determining the type of the target operation instruction according to the target operation instruction.
[0105] The type of the target operation instruction may be used to indicate an operation object, which may be one of a register, a virtual machine, or a virtual machine monitor.
[0106] Specifically, the event filtering module analyzes relevant information of the target operation instruction to determine the type of the target operation instruction.
[0107] Step S203, when it is determined according to the type of the target operation instruction that the target operation instruction is an instruction for operating the target register, the original value corresponding to the target register is obtained.
[0108] Among them, the target register can be a control register (CR), a special module register (MSR), etc.
[0109] Specifically, when the operation object is determined to be a control register according to the type of the target operation instruction, the original value is stored in the control register area in the virtual machine control structure, and the original value can be read from the control register area. Alternatively, when the target register is an MSR register, the original value is stored in the MSR register area in the virtual machine control structure, and the original value can be read from the MSR register area.
[0110] Step S204: Acquire a first new value corresponding to the target operation instruction.
[0111] Specifically, when the target register is a control register, the first new value can be read from the source register area in the virtual machine control structure. Alternatively, when the target register is an MSR register, the following steps can be performed: obtain the first operand stored in the first general register and the second operand stored in the second general register, and obtain the first new value according to the first operand rax and the second operand rck (combining the first operand and the second operand after bitwise operation). The first general register can be the eax register, and the second general register can be the edx register.
[0112] Step S205: Determine whether there is target policy data corresponding to the target register in the pre-built policy table.
[0113] Among them, the policy table may store multiple policy data and policy identification information corresponding to each policy data. The policy data may include a policy verification object and policy indication information, wherein the policy indication information may be one of indication information that prohibits modification and a fixed value. The policy object may be a register. Since each bit of the control register corresponds to a function, when the policy object is a control register, the policy indication information may include at least one bit of policy indication information (that is, at least one policy sub-data). For example, for the write protection bit (Write Protect, WP) of the CR0 register, when WP=0, the program can read and write any physical page, and when WP=1, the write operation will be prohibited for the read-only physical page. An MSR register is used to process a function, such as performance monitoring, power consumption management, virtualization support, etc. Alternatively, the policy data may also include indication information for enabling the log. Alternatively, when the register is a control register, the indication information for enabling the log may also be set for the bit at the bit granularity.
[0114] Specifically, the policy verification module can match the policy object included in each policy data in the policy table according to the identification information of the target register. When the policy data corresponding to the identification information of the target register is matched, it can be determined that the policy table has the target policy data corresponding to the target register. When the policy data corresponding to the identification information of the target register is not matched, it means that the target operation instruction is a safe operation instruction and can be executed directly.
[0115] Step S206, when it is determined that the target policy data exists in the policy table, one or more elements are selected from the target policy data, the original value, and the first new value, and an operation is performed on the target register.
[0116] Specifically, since the workflows of different registers are different, it is necessary to perform the policy verification process for different registers according to their own working characteristics. The following takes the control register and the MSR register as examples for explanation.
[0117] First, the target register is the control register.
[0118] Step 1: Perform an XOR operation on the original value and the first new value to determine whether there is at least one modified bit.
[0119] Specifically, the policy verification module can traverse each bit of the original value (or the first new value), and each time a bit is traversed, the first numerical value corresponding to the traversed bit is obtained from the original value, and the second numerical value corresponding to the traversed bit is obtained from the first new value, and the first numerical value is compared with the second numerical value. If the two are the same, it can be determined that the bit is not a modification bit. If the two are different, it can be determined that the bit is a modification bit. By analogy, it can be determined whether there is a modification bit. If not, it means that the target operation instruction is a safe operation instruction and can be executed directly. If there is a modification bit, the subsequent step two can be executed.
[0120] Step 2: When it is determined that there is at least one modification bit, the value corresponding to each modification bit in the first new value is updated according to each modification bit and the target policy data to obtain a second new value.
[0121] Step 1: Determine, based on the target modification bit, whether there is policy sub-data corresponding to the target modification bit in the target policy data.
[0122] The target modification bit is any modification bit of the at least one modification bit.
[0123] Specifically, the policy verification module can traverse the policy sub-data included in the target policy data according to the target modification bit to determine whether there is policy sub-data matching the target modification bit. If yes, it means that the target operation instruction is a safe operation instruction and can be executed directly. If not, the subsequent step 2 can be executed.
[0124] Step 2: When it is determined that the target policy data contains policy sub-data, the value corresponding to the target modification bit in the first new value is updated according to the policy sub-data.
[0125] Specifically, when it is determined that the policy sub-data includes a first fixed value corresponding to the target modification bit, the value corresponding to the target modification bit in the first new value is modified to the first fixed value. Alternatively, when it is determined that the policy sub-data includes indication information prohibiting modification, the value corresponding to the target modification bit in the first new value is restored to the value corresponding to the target modification bit in the original value.
[0126] Step 3: After determining that all modification bits of the existing policy sub-data have been updated, obtain a second new value.
[0127] Step three: perform an update operation on the target register according to the second new value.
[0128] Specifically, the virtual machine monitor may update the original value in the target register to the second new value.
[0129] like Figure 3 Shown is the strategy execution flow of the control register.
[0130] Second, the destination register is an MSR register.
[0131] Step 1: when it is determined that the target policy data includes a second fixed value corresponding to the target register, an execution flag is set for the target operation instruction according to the first new value and the second fixed value.
[0132] The execution flag is a first flag or a second flag. The first flag is used to indicate that the target operation instruction is to be executed, and the second flag is used to indicate that the target operation instruction is prohibited from being executed. For example, the first flag may be "allow" and the second flag may be "redirect".
[0133] Specifically, according to the first new value and the second fixed value, the specific step of setting the execution flag for the target operation instruction may include:
[0134] Step 1: compare the first new value and the second fixed value.
[0135] Step 2: When the comparison result is that the first new value and the second fixed value are consistent, the execution flag of the target operation instruction is set to the first flag.
[0136] Step 3: When the comparison result is that the first new value and the second fixed value are inconsistent, the execution flag of the target operation instruction is set to the second flag.
[0137] Step 2: when it is determined that the target policy data does not include the second fixed value corresponding to the target register, an execution flag is set for the target operation instruction according to whether the target policy data includes instruction information prohibiting modification.
[0138] Specifically, when it is determined that the target policy data includes indication information prohibiting modification, the execution flag of the target operation instruction can be set to the second flag. Alternatively, when it is determined that the target policy data does not include indication information prohibiting modification, the execution flag of the target operation instruction can be set to the first flag.
[0139] Step three: according to the execution flag, perform the operation corresponding to the execution flag on the target register.
[0140] Specifically, when the execution flag is determined to be the first flag, the value in the target register is updated according to the first new value, that is, the original value in the target register is updated to the first new value. Alternatively, when the execution flag is determined to be the second flag, the target register is not updated.
[0141] like Figure 4 Shown is the strategy execution flow of the MSR register.
[0142] The method for performing operations on registers provided in this embodiment is the lowest level modification method because modifying the value in the register is the lowest level modification method. Although some software may bypass the kernel hardening technology, this solution directly intercepts the target operation instruction at the register level and can perform operations on the target register after performing a specific analysis of the target operation instruction based on the policy data in the pre-built policy table and the original value and the first new value of the target register obtained. In this way, the virtual machine security issues caused by some software directly modifying the value in the register can be avoided.
[0143] In this embodiment, a method for setting a log record flag is provided, which can be executed by the above-mentioned computer device. Figure 5 is a flow chart of a method for setting a log record flag according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0144] Step S501: determine whether the target policy data includes instruction information for enabling logging.
[0145] Step S502: When it is determined that the target policy data includes instruction information for enabling logging, a logging flag is set for the target operation instruction.
[0146] The log record flag is used to indicate recording the policy verification information. The policy verification information may include the above modification result, for example, the second new value.
[0147] Step S503: when it is determined that the target policy data does not include instruction information for enabling logging, a logging flag is not set for the target operation instruction.
[0148] Thus, for the control register, after the update operation is performed on the control register, it can be determined whether the target operation instruction is set with a log record flag. If so, the following can be recorded: Figure 2 The policy validation information in the process shown in Figure 4 For the MSR register, after setting the log record flag, it can be determined whether the target operation instruction has a log record flag set. If yes, it can be recorded as follows: Figure 2 The policy validation information in the process shown in Figure 5 as shown).
[0149] The method for setting the log record flag provided in this embodiment helps to track the history of register operations for important and valuable events by enabling the indication information of the log, which is convenient for subsequent technical personnel to analyze and improve the strategy. For events with low value, only strategy verification is performed to avoid the occurrence of security problems, and no log recording is required, which can save storage space.
[0150] Since there are many situations of target operation instructions, such as instructions for operating the target register, instructions for obtaining negotiation information, instructions for creating a storage area, instructions for writing policy data, instructions for deleting policy data, etc., steps S203 to S206 mainly describe the policy verification process of instructions for operating the target register. The execution of target operation instructions in other situations is described in detail below.
[0151] First, a negotiation method: when the target operation instruction is determined to be an instruction for obtaining negotiation information according to the type of the target operation instruction, the target negotiation information is obtained, the target negotiation information is stored in a virtual machine control structure, and the virtual machine is notified to read the information.
[0152] The target negotiation information is used by the virtual machine to match the virtual machine monitor according to the target negotiation information. The target negotiation information refers to the message determined in advance by the virtual machine negotiation module and the virtual machine monitor, and does not limit the specific content, and only needs to be recognized by the negotiation module.
[0153] Specifically, Figure 6 As shown, the negotiation module executes the cpuid instruction (the relevant information of the instruction is recorded in the virtual machine control structure), triggers the negotiation information request, further triggers VM Exit, and jumps to the processing logic of the virtual machine monitor. The virtual machine monitor can obtain the cpuid instruction from the virtual machine control structure, and determine that the cause of the virtual machine exit event is the execution of the cpuid instruction, that is, the virtual machine monitor captures the target operation instruction, and determines that the target operation instruction is an instruction for obtaining negotiation information. At this time, the virtual machine monitor stores the specified negotiation information (target negotiation information) in the virtual machine control structure, triggers VM Entry (also known as VM Resume), and jumps to the processing logic of the virtual machine. The virtual machine can obtain the target negotiation information from the virtual machine control structure, and determine whether it is running in a matching virtual machine monitor based on whether the target negotiation information carries flag information that matches itself. If so, it can perform subsequent operations to create a storage area.
[0154] Second, a method for creating a storage area: when the target operation instruction is determined to be an instruction for creating a storage area according to the type of the target operation instruction, a first storage area and a second storage area are created according to the target operation instruction.
[0155] The first storage area is used to store the policy table, and the second storage area is used to store the log. The first storage area is write-only for the virtual machine and read-only for the virtual machine monitor, and the second storage area is read-only for the virtual machine and write-only for the virtual monitor.
[0156] Specifically, Figure 7As shown, the virtual machine executes the vmcall instruction (the relevant information of the instruction is recorded in the virtual machine control structure), triggers the initialization request, further triggers VM Exit, and jumps to the processing logic of the virtual machine monitor. The virtual machine monitor can obtain the vmcall instruction from the virtual machine control structure, and determine that the reason for the virtual machine exit event is the execution of the vmcall instruction, that is, the virtual machine monitor captures the target operation instruction, and determines that the target operation instruction is an instruction to create a storage area according to the first custom parameter in the vmcall instruction. The virtual machine monitor initializes the shared memory area, divides the shared memory area into a policy area (first storage area) and a log area (second storage area), and stores the location information of the first storage area and the location information of the second storage area as a return value in the virtual machine control structure, triggers VM Entry, and jumps to the processing logic of the virtual machine. The virtual machine can obtain the location information of the first storage area and the location information of the second storage area from the virtual machine control structure, and map them to perform subsequent operations of writing policy data and reading log data.
[0157] Third, a method for writing policy data: when the target operation instruction is determined to be an instruction for writing policy data according to the type of the target operation instruction, multiple policy data written by the virtual machine are obtained from the first storage area. A policy table is constructed according to the multiple policies.
[0158] Specifically, Figure 8 As shown, after obtaining multiple policy data, the virtual machine can encapsulate the policy enable command and write the obtained policy data into the first storage area according to the encapsulated policy enable command. Then, the virtual machine can execute the vmcall instruction (the relevant information of the instruction is recorded in the virtual machine control structure), trigger the initialization policy request, further trigger VM Exit, and jump to the processing logic of the virtual machine monitor. The virtual machine monitor can obtain the vmcall instruction from the virtual machine control structure, and determine that the cause of the virtual machine exit event is the execution of the vmcall instruction, that is, when the virtual machine monitor captures the target operation instruction and determines that the target operation instruction is an instruction to create a storage area according to the second custom parameter in the vmcall instruction, the policy data written into the first storage area is converted to generate a policy table.
[0159] Fourth, a method for deleting policy data: when the target operation instruction is determined to be an instruction for deleting policy data according to the type of the target operation instruction, first policy identification information is obtained. According to the first policy identification information, the policy data corresponding to the first policy identification information is deleted from the policy table.
[0160] Specifically, Fig. 9As shown, after the virtual machine obtains the first policy identification information, it can encapsulate the first policy identification information into a policy shutdown instruction, and write the obtained first policy identification information into the first storage area according to the policy shutdown instruction. Then, the virtual machine can execute the vmcall instruction (the relevant information of the instruction is recorded in the virtual machine control structure), trigger the policy deletion request, further trigger VM Exit, and jump to the processing logic of the virtual machine monitor. When the virtual machine monitor obtains the vmcall instruction from the virtual machine control structure, that is, the virtual machine monitor captures the target operation instruction, and determines that the target operation instruction is an instruction to delete policy data according to the third custom parameter in the vmcall instruction, the first policy identification information is obtained from the first storage area, and according to the first policy identification information, the policy data corresponding to the first policy identification information is determined in the policy table and deleted.
[0161] In some optional implementations, since various software that may cause security issues to virtual machines are updated quickly, the policy data needs to be updated accordingly. After obtaining the policy data update instruction, the virtual machine can extract the second policy identification information and the modified policy data from the policy data update instruction, and write the second policy identification information into the first storage area. When the virtual machine monitor is in a state where no policy verification is performed, the second policy identification information and the modified policy data can be extracted from the first storage area, and according to the second policy identification information, the policy data corresponding to the second policy identification information can be determined in the policy table for deletion, and the modified policy data can be added. In this way, the policy data can be kept updated to prevent the latest software from damaging the virtual machine and improve the security of the virtual machine.
[0162] In some optional implementations, when the virtual machine monitor recognizes that the number of logs in the second storage area is greater than a preset threshold, it can notify the virtual machine to read all logs from the second storage area. After the virtual machine completes the reading operation, the virtual machine monitor can delete these logs in a timely manner to avoid the problem that the second storage data is full and important logs cannot be stored, resulting in the technicians being unable to perform subsequent technical analysis.
[0163] In some optional implementations, a third storage area may be created to back up the policy table in the third storage area. When it is detected that the policy data stored in the first storage area is lost or the first storage area is damaged by related software, the backed-up policy table is read from the third storage area and processed in time to prevent virtual machine security issues caused by failure to perform policy verification. The backup operation can further improve security.
[0164] In this embodiment, a device for performing operations on a register is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0165] This embodiment provides a device for performing operations on a register, such as Fig.10 As shown, including:
[0166] The capture module 1001 is used to capture a target operation instruction, wherein the target operation instruction is an operation instruction that causes the virtual machine to switch from a working state to an exited state;
[0167] A determination module 1002 is used to determine the type of the target operation instruction according to the target operation instruction;
[0168] The acquisition module 1003 is used to acquire the original value corresponding to the target register when it is determined according to the type of the target operation instruction that the target operation instruction is an instruction for operating the target register; and acquire the first new value corresponding to the target operation instruction;
[0169] The determination module 1002 is further used to determine whether there is target policy data corresponding to the target register in the pre-built policy table;
[0170] The execution module 1004 is used to select one or more elements from the target policy data, the original value, and the first new value to perform an operation on the target register when it is determined that the target policy data exists in the policy table.
[0171] In an optional implementation, the target register is a control register;
[0172] The execution module 1004 is specifically used for:
[0173] Performing an XOR operation on the original value and the first new value to determine whether there is at least one modified bit;
[0174] When it is determined that there is at least one modification bit, updating the value corresponding to each modification bit in the first new value according to each modification bit and the target policy data to obtain a second new value;
[0175] An update operation is performed on the target register according to the second new value.
[0176] In an optional implementation, the execution module 1004 is specifically configured to:
[0177] Determining, according to the target modification bit, whether there is policy sub-data corresponding to the target modification bit in the target policy data, wherein the target modification bit is any modification bit of the at least one modification bit;
[0178] When it is determined that the target policy data contains policy sub-data, updating the value corresponding to the target modification bit in the first new value according to the policy sub-data;
[0179] After determining that all modification bits of the existing policy sub-data have been updated, a second new value is obtained.
[0180] In an optional implementation, the execution module 1004 is specifically configured to:
[0181] When it is determined that the policy sub-data includes a first fixed value corresponding to the target modification bit, modifying the value corresponding to the target modification bit in the first new value to the first fixed value;
[0182] or,
[0183] When it is determined that the policy sub-data includes indication information prohibiting modification, the value corresponding to the target modification bit in the first new value is restored to the value corresponding to the target modification bit in the original value.
[0184] In an optional implementation, the target register is a module-specific MSR register;
[0185] The execution module 1004 is specifically used for:
[0186] When it is determined that the target policy data includes a second fixed value corresponding to the target register, setting an execution flag for the target operation instruction according to the first new value and the second fixed value;
[0187] or,
[0188] When it is determined that the target policy data does not include the second fixed value corresponding to the target register, setting an execution flag for the target operation instruction according to whether the target policy data includes instruction information prohibiting modification;
[0189] According to the execution flag, an operation corresponding to the execution flag is performed on the target register.
[0190] In an optional implementation, the execution flag is a first flag or a second flag, wherein the first flag is used to indicate that the target operation instruction is executed, and the second flag is used to indicate that the target operation instruction is prohibited from being executed;
[0191] The execution module 1004 is specifically used for:
[0192] Comparing the first new value and the second fixed value;
[0193] When the comparison result is that the first new value and the second fixed value are consistent, setting the execution flag of the target operation instruction to the first flag;
[0194] or,
[0195] When the comparison result is that the first new value and the second fixed value are inconsistent, the execution flag of the target operation instruction is set to the second flag.
[0196] In an optional implementation, the execution module 1004 is specifically configured to:
[0197] When it is determined that the target policy data includes instruction information prohibiting modification, setting the execution flag of the target operation instruction to a second flag;
[0198] or,
[0199] When it is determined that the target policy data does not include instruction information prohibiting modification, the execution flag of the target operation instruction is set to the first flag.
[0200] In an optional implementation, the execution module 1004 is specifically configured to:
[0201] When it is determined that the execution flag is the first flag, an update operation is performed on the value in the target register according to the first new value;
[0202] or,
[0203] When it is determined that the execution flag is the second flag, no update operation is performed on the target register.
[0204] In an optional implementation, the device further includes a setting module 1005, wherein the setting module 1005 is configured to:
[0205] determining whether the target policy data includes an instruction to enable logging;
[0206] When it is determined that the target policy data includes instruction information for enabling logging, setting a logging flag for the target operation instruction, wherein the logging flag is used to indicate recording of policy verification information;
[0207] or,
[0208] When it is determined that the target policy data does not include instruction information for enabling logging, the logging flag is not set for the target operation instruction.
[0209] In an optional implementation, the acquisition module 1003 is specifically configured to:
[0210] Obtaining a first operand stored in a first general register and a second operand stored in a second general register;
[0211] A first new value is obtained based on the first operand and the second operand.
[0212] In an optional implementation, the apparatus further includes a creation module 1006, wherein the creation module 1006 is configured to:
[0213] When the target operation instruction is determined to be an instruction for creating a storage area according to the type of the target operation instruction, a first storage area and a second storage area are created according to the target operation instruction, wherein the first storage area is used to store a policy table and the second storage area is used to store a log.
[0214] In an optional implementation, the acquisition module 1003 is further configured to:
[0215] When it is determined according to the type of the target operation instruction that the target operation instruction is an instruction for obtaining negotiation information, obtaining the target negotiation information;
[0216] The target negotiation information is stored in a virtual machine control structure, and the virtual machine is notified to read the target negotiation information, wherein the target negotiation information is used by the virtual machine to perform a matching operation with the virtual machine monitor according to the target negotiation information.
[0217] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0218] The device for performing operations on the register in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0219] The embodiment of the present invention also provides a computer device having the above Fig.10 The apparatus shown performs operations on registers.
[0220] See also Fig.11 , Fig.11 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.11As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.11 A processor 10 is taken as an example.
[0221] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0222] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0223] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0224] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0225] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.11 The example of connecting through bus is taken in the following.
[0226] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0227] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0228] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0229] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0230] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method of performing an operation on a register, It is characterized in that The method comprises: Capturing a target operation instruction, wherein the target operation instruction is one of an instruction to operate a target register, an instruction to obtain negotiation information, an instruction to create a storage area, an instruction to write policy data, and an instruction to delete policy data, the negotiation information is used to match a virtual machine and a virtual machine monitor, the target register is a control register or a module specific register MSR, and the instruction to operate the target register, the instruction to obtain negotiation information, the instruction to create a storage area, the instruction to write policy data, and the instruction to delete policy data are all instructions that cause the virtual machine to switch from a working state to an exit state; Determining, according to the target operation instruction, a type of the target operation instruction, wherein the type of the target operation instruction is used to indicate an operation object of the target operation instruction, and the operation object is one of the target register, the virtual machine, and the virtual machine monitor; When it is determined, according to the type of the target operation instruction, that the target operation instruction is the instruction for operating the target register, obtaining an original value corresponding to the target register; Acquire a first new value corresponding to the target operation instruction; In the pre-built policy table, determine whether there is target policy data corresponding to the target register, wherein the target policy data includes a policy verification object and policy indication information, when the policy verification object is the MSR, the policy indication information includes one piece, or when the policy verification object is the control register, the policy indication information includes at least one policy sub-data, each of which is the policy indication information of the corresponding bit in the control register, and the policy indication information is indication information prohibited from modification or a fixed value; When it is determined that the target policy data exists in the policy table, an operation is performed on the target register according to the target policy data, the original value, and a plurality of elements in the first new value.
2. The method according to claim 1, It is characterized in that The target register is the control register; When it is determined that the target policy data exists in the policy table, performing an operation on the target register according to the target policy data, the original value, and multiple elements in the first new value, including: Performing an XOR operation on the original value and the first new value to determine whether there is at least one modified bit; When it is determined that there is at least one modification bit, updating the value corresponding to each modification bit in the first new value according to each modification bit and the target policy data to obtain a second new value; An update operation is performed on the target register according to the second new value.
3. The method according to claim 2, It is characterized in that When it is determined that there is at least one modification bit, updating the value corresponding to each modification bit in the first new value according to each modification bit and the target policy data to obtain a second new value, comprising: According to the target modification bit, determining whether there is policy sub-data corresponding to the target modification bit in the target policy data, wherein the target modification bit is any modification bit of at least one of the modification bits; When it is determined that the policy sub-data exists in the target policy data, updating the value corresponding to the target modification bit in the first new value according to the policy sub-data; After determining that all modification bits of the existing policy sub-data have been updated, the second new value is obtained.
4. The method according to claim 3, It is characterized in that When it is determined that the target policy data contains the policy sub-data, updating the value corresponding to the target modification bit in the first new value according to the policy sub-data includes: When it is determined that the policy sub-data includes a first fixed value corresponding to the target modification bit, modifying the value corresponding to the target modification bit in the first new value to the first fixed value; or, When it is determined that the policy sub-data includes the indication information of prohibiting modification, the value corresponding to the target modification bit in the first new value is restored to the value corresponding to the target modification bit in the original value.
5. The method according to claim 1, It is characterized in that The target register is the MSR; When it is determined that the target policy data exists in the policy table, performing an operation on the target register according to the target policy data, the original value, and multiple elements in the first new value, including: When it is determined that the target policy data includes a second fixed value corresponding to the target register, setting an execution flag for the target operation instruction according to the first new value and the second fixed value; or, When it is determined that the target policy data does not include the second fixed value corresponding to the target register, setting the execution flag for the target operation instruction according to whether the target policy data includes the instruction information prohibiting modification; According to the execution flag, an operation corresponding to the execution flag is performed on the target register.
6. The method according to claim 5, It is characterized in that The execution flag is a first flag or a second flag, wherein the first flag is used to indicate that the target operation instruction is to be executed, and the second flag is used to indicate that the target operation instruction is to be prohibited from being executed; When it is determined that the target policy data includes a second fixed value corresponding to the target register, setting an execution flag for the target operation instruction according to the first new value and the second fixed value includes: comparing the first new value and the second fixed value; When the comparison result is that the first new value and the second fixed value are consistent, setting the execution flag of the target operation instruction to the first flag; or, When the comparison result is that the first new value and the second fixed value are inconsistent, the execution flag of the target operation instruction is set to the second flag.
7. The method according to claim 6, It is characterized in that When it is determined that the target policy data does not include the second fixed value corresponding to the target register, setting the execution flag for the target operation instruction according to whether the target policy data includes instruction information prohibiting modification, includes: When it is determined that the target policy data includes the instruction information prohibiting modification, setting the execution flag of the target operation instruction to the second flag; or, When it is determined that the target policy data does not include the instruction information prohibiting modification, the execution flag of the target operation instruction is set to the first flag.
8. The method according to claim 5, It is characterized in that The step of performing an operation corresponding to the execution flag on the target register according to the execution flag includes: When it is determined that the execution flag is the first flag, updating the value in the target register according to the first new value; or, When it is determined that the execution flag is the second flag, no update operation is performed on the target register.
9. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: Determining whether the target policy data includes instruction information for enabling logging; When it is determined that the target policy data includes the indication information for enabling the log, setting a log record flag for the target operation instruction, wherein the log record flag is used to indicate recording policy verification information; or, When it is determined that the target policy data does not include the instruction information for enabling the log, a log record flag is not set for the target operation instruction.
10. The method according to claim 5, It is characterized in that The obtaining of a first new value corresponding to the target operation instruction includes: Obtaining a first operand stored in a first general register and a second operand stored in a second general register; The first new value is obtained according to the first operand and the second operand.
11. The method according to claim 9, It is characterized in that The method further comprises: When it is determined that the target operation instruction is an instruction for creating a storage area based on the type of the target operation instruction, a first storage area and a second storage area are created based on the target operation instruction, wherein the first storage area is used to store the policy table and the second storage area is used to store the log.
12. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: When it is determined according to the type of the target operation instruction that the target operation instruction is the instruction for obtaining negotiation information, obtaining target negotiation information; The target negotiation information is stored in a virtual machine control structure, and the virtual machine is notified to read the information, so that the virtual machine performs a matching operation with a virtual machine monitor according to the target negotiation information.
13. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for performing operations on a register according to any one of claims 1 to 12 by executing the computer instructions.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for performing an operation on a register according to any one of claims 1 to 12.
15. A computer program product, It is characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the method for performing an operation on a register according to any one of claims 1 to 12.
