CN113094153B - System for improving virtualization performance and physical machine - Google Patents

System for improving virtualization performance and physical machine Download PDF

Info

Publication number
CN113094153B
CN113094153B CN202110639791.2A CN202110639791A CN113094153B CN 113094153 B CN113094153 B CN 113094153B CN 202110639791 A CN202110639791 A CN 202110639791A CN 113094153 B CN113094153 B CN 113094153B
Authority
CN
China
Prior art keywords
virtual machine
vmm
vmacc
timer
physical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110639791.2A
Other languages
Chinese (zh)
Other versions
CN113094153A (en
Inventor
范文一
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Zeta Cloud Technology Co ltd
Original Assignee
Wuhan Zeta Cloud Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Zeta Cloud Technology Co ltd filed Critical Wuhan Zeta Cloud Technology Co ltd
Priority to CN202110639791.2A priority Critical patent/CN113094153B/en
Publication of CN113094153A publication Critical patent/CN113094153A/en
Application granted granted Critical
Publication of CN113094153B publication Critical patent/CN113094153B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a system and a physical machine for improving virtualization performance, which comprise a computing device, a virtual machine program and a virtual machine program, wherein the computing device is used for directly interacting with the virtual machine program through a computer system bus; the direct interaction comprises interaction in a mode of accessing and/or sending a message through a memory address space; the message sending mode comprises an interrupt mode and/or a mode of setting a signal value at a certain memory address; the system provides a mode different from the mode of carrying out equipment virtualization by utilizing the traditional mmo, pio and vintr mechanisms, provides a method for greatly reducing vmexit related to equipment virtualization, further improves virtualization efficiency and reduces virtualization performance loss.

Description

System for improving virtualization performance and physical machine
Technical Field
The invention relates to the technical field of virtualization, in particular to a system and a physical machine for improving virtualization performance.
Background
Virtualization is one of key technologies of cloud computing, and physical resources are abstracted, encapsulated and isolated through a virtualization technology to improve the utilization rate of the physical resources, so that differences brought by different physical hardware are shielded for application programs, and software defined computing is realized; in the virtualization technology, VMM (also called Hypervisor, virtual machine monitor) is one of the most critical core software, the stability and efficiency of VMM determine the virtualization effect of application programs, since the birth of virtualization technology, hardware manufacturers and VMM software manufacturers have been dedicated to improving virtualization efficiency, reducing performance loss, and improving the scalability of virtualization technology.
The realization method of the virtualization device commonly used in the industry comprises the following steps: the VMM intercepts sensitive instructions and privileged instructions through binary translation, instruction stream patches, hardware-assisted virtualization and other modes, so as to intercept and distribute the access of the virtual machine to physical resources; in the process of implementing the VMM, the execution of the CPU needs to be switched between a physical machine (Host) and a Virtual Machine (VM), and in this process, vmentiy and vmexit are generally used to respectively indicate that the CPU is switched from the physical machine to the virtual machine and from the virtual machine to the physical machine; the VMM firstly prepares the running context of the virtual machine, then carries out vmentry operation, vmexit can occur when the virtual machine accesses the virtualization equipment, and the VMM can flexibly allocate resources which can be accessed by the virtual machine according to application requirements; in order to improve virtualization efficiency, the industry is constantly striving to reduce vmexit, and most of vmexit is related to device IO and memory access in the running process of a virtual machine; the vmexit associated with the device IO mainly includes mmio (Memory-Mapped IO Memory Mapped IO), pio (Port IO) and vintr (virtual interrupt).
In the data exchange between the IO equipment and the CPU, the mmio and the intr are the most frequent; typical VMM architecture as shown in fig. 1, in order to simplify the VMM implementation, the VMM is generally divided into a kernel state (VMM _ kernel) and a user state (VMM _ user); the VMM _ kernel generally implements the most core part of virtualization, such as the core parts of execution and interception of CPU instructions of a virtual machine, allocation and virtualized page table management of memory of a Virtual Machine (VM), interrupt management of a virtual machine, IO interception of a virtual machine, and the like; the VMM _ user is a user-mode process running on the VMM _ kernel, and the VMs are isolated from each other by the characteristics of the process; the virtualization device is realized on a VMM _ user layer, the access of a virtual machine program (Guest) to virtual hardware through mmo and pio is intercepted by a VMM _ kernel, and the virtualization device exiting to the VMM _ user is simulated; as shown in fig. 2, performance penalties of different vmexits are typically different in VMM implementations, vmexits that can be handled at VMM _ kernel are called light-weight vmexits (mild vmexits), while vmexits that need to be returned to VMM _ user for processing are called extreme vmexits (severe vmexits); heavy vmexit occurs normally for Guest accesses to virtualized devices; the severe vmexit needs to return to the user state from the kernel state, so that the VMM _ kernel needs to switch more contexts and process states, and the cost of context switching is higher.
Disclosure of Invention
In view of the foregoing problems, an object of the present invention is to provide a system for improving virtualization performance, which provides a method for greatly reducing vmexit related to device virtualization, which further improves virtualization efficiency and reduces virtualization performance loss, different from a method for device virtualization by using a conventional mmo, pio, and vintr mechanism.
It is a second object of the present invention to provide a physical machine.
The first technical scheme adopted by the invention is as follows: a system for enhancing virtualization performance, comprising a computing device for interacting directly with a virtual machine program over a computer system bus; the direct interaction comprises interaction in a mode of accessing and/or sending a message through a memory address space;
the interaction through the memory address space access specifically includes:
the virtual machine program operates an interface of a protocol by accessing a memory address space on the computer system bus; an interface for the protocol is provided by the computing device;
the interacting in the message sending manner specifically includes:
the computing device sends an interrupt message on the computer system bus and/or sets a signal value in a memory address to inform the virtual machine program so as to realize direct interaction between the computing device and the virtual machine program.
Preferably, a first-level page table or a second-level page table is established in the processor, which satisfies the mapping relationship from the physical address of the virtual machine to the physical address of the physical machine, so that the virtual machine program accesses the physical address of the physical machine where the corresponding resource is located by accessing the physical address of the virtual machine, thereby operating the interface.
Preferably, the computing device writes the data required by the virtual machine program directly into the memory address space of the virtual machine by:
the virtual machine program configures the physical address of the virtual machine written by the computing device, and the kernel VMM _ kernel of the virtual machine monitor translates the physical address of the virtual machine into the physical address of the physical machine, so that the computing device can write the corresponding physical address of the virtual machine by using the physical address of the physical machine in an addressing mode.
Preferably, in the system with the IOMMU, the VMM _ kernel sets the IOMMU based on a relationship between the virtual machine physical address and the physical machine physical address, and performs a translation from the IO virtual address to the physical machine physical address, so as to enable the computing device to write the IO virtual address into the virtual machine memory directly.
The second technical scheme adopted by the invention is as follows: a physical machine comprising a processor, a memory, a virtual machine monitor and a system VMACC for improving virtualisation performance as described in the first aspect; the VMM _ kernel in the virtual machine monitor manages hardware resources and runs a plurality of VMM _ user processes, the VMM _ user processes run a plurality of virtual machines, and the virtual machines run virtual machine programs.
Preferably, the VMM _ kernel sets a parameter of the vmac, so that the vmac directly initiates a memory read-write operation to a virtual machine physical address corresponding to the virtual machine by using the physical machine physical address;
the VMM _ kernel and the virtual machine program negotiate an interrupt vector number, and the VMACC is configured to send an interrupt message to the interrupt vector number.
Preferably, an IOMMU is also included;
the VMM _ kernel configures an interrupt translation table of the IOMMU, maps a physical interrupt vector number of the VMACC to an interrupt vector number set by a virtual machine program, configures a page table of the IOMMU, maps an IO virtual address to a physical machine physical address, the IO virtual address is equal to the virtual machine physical address, and the VMACC directly uses the physical interrupt vector number to deliver interrupt and directly uses a virtual machine physical address configured by the virtual machine program to initiate memory read-write operation to the virtual machine.
Preferably, the VMM _ kernel reads and writes the operating state data of the vmac to implement an online migration operation of the virtual machine using the vmac, specifically:
the VMM _ kernel reads the working state data of the corresponding VMACC on the original physical machine and sends the working state data to the VMM _ kernel of the target physical machine, and the VMM _ kernel of the target physical machine writes the received working state data of the VMACC of the original physical machine so as to realize the online migration of the virtual machine using the VMACC acceleration function.
The beneficial effects of the above technical scheme are that:
(1) the system for improving the virtualization performance disclosed by the invention provides a mode different from the mode of carrying out equipment virtualization by utilizing the traditional mmo, pio and vintr mechanisms, and provides a method for greatly reducing vmexit related to equipment virtualization, thereby further improving the virtualization efficiency and reducing the virtualization performance loss.
(2) The interaction between the VMACC and the virtual machine program can be directly finished without the intervention of a VMM except for the initialization operation, so that when the virtual machine program realizes the corresponding function, vmexit is reduced to a negligible level, a small amount of vmexit can be generated only when VMACC resources are configured, and during the normal operation of the VMACC, the vmexit can be avoided, thereby improving the virtualization efficiency.
(3) The VMACC can realize functions and logic required by the virtual machine, and in the process of accelerating the virtual machine program by the VMACC, the virtual machine program and the VMACC directly finish interaction without vmentry and vmexit, and acceleration can be finished without VMM intervention, so that the performance influence of virtualization equipment on the virtual machine is greatly reduced, and the virtualization efficiency is improved.
(4) The invention can customize the communication data structure and mode between the VMACC and the functional logic of the VMACC according to the specific requirements of the virtual machine program.
(5) The invention uses the online migration function of the virtual machine of the VMACC, expands the flexibility and the maintainability of the VMACC, and in the whole virtualization process, the virtual machine program can directly realize the specific function by using the VMACC without using the resources of the central processing unit, thereby greatly improving the virtualization performance, reducing the virtualization performance loss and expanding the use scene of the virtualization technology.
Drawings
FIG. 1 is a schematic diagram of a typical VMM architecture in the context of the present invention;
FIG. 2 is a schematic diagram of the VMM processing of different vmexits in the background of the invention;
fig. 3 is a schematic structural diagram of a system for promoting virtualization performance (VMACC) according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a VMACC installed in a physical machine according to one embodiment of the present invention;
FIG. 5 is a flowchart of VMACC and virtual machine program interaction in a physical machine environment without an IOMMU according to one embodiment of the present invention;
FIG. 6 is a flowchart of VMACC and virtual machine program interaction in a physical machine environment with an IOMMU according to one embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. The following detailed description of the embodiments and the accompanying drawings are provided to illustrate the principles of the invention and are not intended to limit the scope of the invention, which is defined by the claims, i.e., the invention is not limited to the preferred embodiments described.
In the description of the present invention, it is to be noted that, unless otherwise specified, "a plurality" means two or more; the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance; the specific meaning of the above terms in the present invention can be understood as appropriate to those of ordinary skill in the art.
Example 1
As shown in fig. 3, the present embodiment discloses a system (VMACC) for enhancing virtualization performance, which includes a built-in independent memory, a computing device and a network switching device, where the memory is used to store computing data of the computing device, Firmware and data temporarily stored in a virtual machine program, and the memory includes forms of DDR RAM, ROM, NAND Flash, disk storage, etc. (but is not limited thereto); the computing device is used for directly interacting with a virtual machine program running in the central processing unit and running a built-in program of the VMACC to realize functions and logic which need acceleration and are appointed to the virtual machine; the network switching device is used for exchanging data with other devices in the network, and extending the application capability and the scenario of the VMACC, for example, but not limited to, ethernet, Infiniband, fibre channel (fibre channel).
The program running in the VMACC computing device directly interacts with the virtual machine program running in the central processing unit through a computer system bus so as to realize the accelerated virtualization of the virtual machine and realize the functions required by the virtual machine program; computer system buses such as, but not limited to, PCIe bus, internal bus, QPI, front side bus, etc.; the direct interaction comprises the interaction of bus messages such as access through a memory address space, message sending and the like; sending the message includes using an interrupt or setting a signal value at a certain memory address.
(1) The VMACC interacts with the virtual machine program through memory address space access;
the VMACC provides a corresponding interface protocol for the virtual machine program, and a computing device in the VMACC provides an interface of the protocol for the virtual machine program to access through a memory address space on a computer system bus so as to realize direct interaction between the VMACC and the virtual machine program; the VMACC provides the interface of the protocol to the virtual machine program access, e.g., in registers, device memory, etc.
In order to ensure that the virtual machine program correctly accesses the resources corresponding to the VMACC, when the acceleration function provided by the VMACC is initialized, the virtual machine monitor kernel (VMM _ kernel) establishes a primary page table or a secondary page table in the processor (CPU) to satisfy the mapping relationship between the GPA and the HPA, so that the virtual machine program can directly read and write the register and the device memory provided by the VMACC, that is, the virtual machine program can access the HPA where the corresponding resources are located by accessing the GPA, thereby operating (accessing and reading and writing) the interfaces provided by the VMACC, such as the register, the device memory and the like.
The computing device in the VMACC can directly write data required by a virtual machine program into a memory address space of the virtual machine, and the method is specifically realized by the following steps:
the virtual machine program configures a writable virtual machine physical address (GPA) of the computing device in the VMACC, the VMM _ kernel performs address translation, the virtual machine physical address (GPA) is translated into a physical machine physical address (HPA), and the computing device in the VMACC is ensured to be capable of writing the corresponding GPA by using HPA addressing.
Further, in an embodiment, in a system having an IOMMU (input/output memory management unit), the VMM _ kernel can set the IOMMU according to a relationship between the GPA and the HPA when the acceleration function provided by the vmac is initialized, and perform translation from an IO virtual address (IOVA) to an HPA, so that the VMM _ kernel does not need to process the GPA when the virtual machine program configures the GPA, and the computing device in the vmac can directly write the IOVA into the virtual machine memory.
(2) VMACC interacts with virtual machine programs by sending messages
The VMACC can send a message on the computer system bus to inform the virtual machine program to realize direct interaction between the VMACC and the virtual machine program, such as using an interrupt or setting a signal value at a certain memory address; interrupts can be sent, for example, in a direct physical interrupt manner or using an interrupt controller virtualization function to send virtual interrupts for virtual machines (but are not limited to such).
The VMM _ kernel can directly read or write in an interface of a protocol provided by the VMACC, namely resources such as a corresponding register, a device memory and the like, when the VMM initiates the online migration operation of the virtual machine, the VMM _ kernel in the VMM reads the working state data of the VMACC on the original physical machine and sends the working state data to the VMM _ kernel of the target physical machine, and the VMM _ kernel of the target physical machine writes in the received working state data of the VMACC of the original physical machine, so that the online migration of the virtual machine is realized when the VMACC acceleration function is used; the operating state data of the VMACC comprises data in the memory, computing state data in the computing device, and operating state data of the network switching device; the invention uses the online migration function of the virtual machine of the VMACC, so that the VMACC has flexibility and maintainability, and in the whole virtualization process, a virtual machine program can directly realize a specific function by using the VMACC without using the resources of a processor, so that the virtualization performance is greatly improved, the virtualization performance loss is reduced, and the use scene of the virtualization technology is expanded.
The interaction between the VMACC and the virtual machine program can be directly finished without the intervention of a VMM except for the initialization operation, so that when the virtual machine program realizes the corresponding function, vmexit is reduced to a negligible level, a small amount of vmexit can be generated only when VMACC resources are configured, and during the normal operation of the VMACC, the vmexit can be avoided, thereby improving the virtualization efficiency.
The VMACC can realize functions and logic required by the virtual machine, and in the process of accelerating the virtual machine program by the VMACC, the virtual machine program and the VMACC directly finish interaction without vmentry and vmexit, and acceleration can be finished without VMM intervention, so that the performance influence of virtualization equipment on the virtual machine is greatly reduced, and the virtualization efficiency is improved.
The VMACC is, for example, a PCIe device, and directly interacts with a virtual machine program running in the central processor through a PCIe bus; the VMACC is, for example, one or several cores of the central processor, and directly interacts with a virtual machine program running in the central processor through a central processor internal bus, a QPI, or a front-end bus.
The practical effects of the present invention are analyzed below with reference to specific examples:
the VMACC can be used for accelerating functions of a timer, a video codec, an encryption/decryption algorithm, a compression/decompression algorithm and other virtual machine programs needing acceleration;
in one example of the invention, a Timer VMACC _ Timer is realized by using the VMACC, an iperf test tool is used for testing between a physical machine and a virtual machine, and on the premise of achieving the same network throughput bandwidth, compared with the traditional virtual machine, the virtual machine using the VMACC has the advantages that the utilization rate of a CPU in the virtual machine is reduced by 30%, and the delay of receiving and sending network packets is reduced by 7%; in a scenario where timers are frequently used, vmexit of a physical machine in relation to timer virtualization drops from tens of thousands to tens of times per second; the embodiment has great performance improvement aiming at scenes such as IO intensive type, real-time tasks, high-frequency transactions and the like, and the service performance is almost consistent with that of a physical machine; the application scenes of a virtualization technology and a cloud computing architecture are increased; the above example can also be extended to more devices and architectures, further extending the application area of virtualization technology.
The invention can also customize the communication data structure and mode between the VMACC and the functional logic of the VMACC according to the specific requirements of the virtual machine program; for example, in the case of the Timer VMACC _ Timer, a physical machine system with an IOMMU is used, and the process of customizing the data structures, modes, and functional logic of the VMACC and the virtual machine program is as follows:
1) define the data structure, timer _ info, which contains 24 bytes of data: frequency represents timer frequency, 8 bytes, and is read only for the virtual machine program and VMM _ kernel; current _ count represents the counting period value of the timer when counting down currently, 8 bytes are read only for the virtual machine program and the VMM _ kernel; initial _ count represents a count initialization value of start timing set by the virtual machine program, 8 bytes, and can be read and written for the virtual machine program and the VMM _ kernel; wherein frequency is set by VMACC _ Timer, for example, 100 MHz;
2) define data structure, timer _ irq _ info, containing 16 bytes of data: the irq _ vector is used for the VMM _ kernel to configure the VMACC _ Timer to send an interrupted vector number to the central processing unit when the Timer expires, and the vector number is 8 bytes and can be read and written for the VMM _ kernel; the destination _ cpu is used for the VMM _ kernel to configure the VMACC _ Timer to send interrupt to a certain logic core of the central processing unit when the Timer expires, 8 bytes are used for reading and writing the VMM _ kernel;
3) the VMM _ kernel sets the VMACC to provide an acceleration function in a mode of VMACC _ Timer, the VMM _ kernel sets the VMACC to map the Base address of the Timer _ info structure to the HPA address Base _ HAddr1 of the physical machine, and simultaneously define the Base address Base _ GAddr1 of the virtual machine, and establish a page table mapping relationship from Base _ GAddr1 to Base _ HAddr1 in the central processor; the page table mapping relation can be completely established in the initialization process or additionally established when the subsequent page missing exception occurs; through this step, the virtual machine program can directly access the Timer _ info data structure in the VMACC _ Timer;
4) the VMM _ kernel provides a logical data structure VMM _ Timer _ irq _ info for the virtual machine program to configure the virtual CPU and interrupt vector number for which the virtual machine program wants the VMACC _ Timer to send an interrupt, VMM _ Timer _ irq _ info is identical to the structure of the Timer _ irq _ info, except that irq _ vector and destination _ CPU in VMM _ Timer _ irq _ info are readable and writable to the virtual machine program;
5) the VMM _ kernel sets VMM _ timer _ irq _ info initialized according to virtual hardware topology of the virtual machine; set vmm _ timer _ irq _ info _ irq _ vector to VEC _ G, vmm _ timer _ irq _ info _ destination _ cpu to DESTCPU _ G;
the VMM _ kernel sets the timer _ irq _ info according to the physical machine resource planning; setting timer _ irq _ info _ vector to VEC _ H, vmm _ timer _ irq _ info _ destination _ CPU to DESTPUT _ H;
6) the VMM _ kernel configures an IOMMU, maps DESTPUT _ H into DESTPUT _ G, maps VEC _ H into VEC _ G, and when VMACC _ Timer sends an interrupt to DESTPUT _ H by VEC _ H, the VMACC _ Timer is converted into sending the interrupt to DESTPUT _ G of the virtual machine by VEC _ G; the virtual machine program can receive the interrupt of the expiration of the timer; the timer interrupt processing program of the virtual machine program can process the event that the timer expires;
7) VMM _ kernel maps VMM _ timer _ irq _ info to the virtual machine's GPA address Base _ GAddr 2;
optionally, the virtual machine program may access the Base _ GAddr2 for adjusting the virtual CPU and interrupt vector number that the virtual machine program wishes to receive the timer expired interrupt, when the virtual machine program accesses the Base _ GAddr2 and its corresponding GPA address within the VMM _ timer _ irq _ info structure range, a page fault exception occurs, and the VMM _ kernel acquires the VMM _ timer _ irq _ info value that the virtual machine program wishes to configure, for example, VMM _ timer _ irq _ info, irq _ vector is VEC _ G2, VMM _ timer _ irq _ info, destination _ CPU is DEST _ CPUG 2; the VMM _ kernel configures an IOMMU, maps DESTPUT _ H to DESTPUT _ G2, maps VEC _ H to VEC _ G2, and when VMACC _ Timer sends an interrupt to DESTPUT _ H through VEC _ H, the VMACC _ Timer is converted into sending an interrupt to DESTPUT _ G2 of the virtual machine through VEC _ G2;
8) in the timer _ info structure, reading a frequency value by a virtual machine program, and calculating a count value C required to be set according to a required target expiration time T, wherein C = T/frequency; the virtual machine program sets initial _ count as C, and VMACC _ Timer starts to work regularly;
9) the virtual machine program can obtain the current remaining count value of the timer by reading the current _ count value and obtain the last set count initialization value by reading the initial _ count value;
10) after receiving a new initial _ count setting, VMACC _ Timer sets a current _ count value as initial _ count, namely, current _ count is periodically decremented by 1 according to frequency, when current _ count is decremented to 0, timing operation is stopped, namely, current _ count is periodically decremented by 1, and according to the set Timer _ irq _ info, interrupt is sent to a destination _ cpu logic core corresponding to the central processing unit by irq _ vector; according to the setting of the VMM _ kernel to the IOMMU, the virtual machine receives the Timer expiration interrupt sent by the VMACC _ Timer, and the Timer expiration interrupt processing function of the virtual machine program can process the Timer event.
Example 2
As shown in fig. 4, the present invention provides a physical machine, which includes a processor (CPU), a memory, a VMM _ kernel, and the VMACC provided in embodiment 1, where the VMACC can be accessed to a PCIE slot of the physical machine as a PCIE device, for example; processors such as ARM, PowerPC, MIPS, etc.; the VMM _ kernel directly runs in the physical machine, manages all hardware resources, and simultaneously runs a plurality of VMM _ user processes, wherein the VMM _ user processes run virtual machines VM1, VM2 to VMn, and virtual machine programs (Guest) run in the virtual machines; the physical machine adopts a modern computer architecture, such as a PC, a server, a small computer, a notebook computer, a vehicle computer and the like.
Further, in one embodiment, an IOMMU is included in the physical machine for more flexibly configuring memory access and interrupt message delivery for the VMACC.
The VMM _ kernel initializes the setting of the VMACC, establishes a primary page table or a secondary page table in a processor (CPU) and meets the mapping relation from GPA to HPA, so that a virtual machine program can directly read and write a register and a device memory provided by the VMACC, and only a small amount of vmexit caused by page fault exception can appear in the whole reading and writing process.
As shown in fig. 5, in a physical machine hardware environment without an IOMMU or with an IOMMU turned off, the VMM _ kernel sets parameters of the vmac in cooperation with a virtual machine program, so that the vmac directly initiates a memory read-write operation to a GPA memory address corresponding to the virtual machine with an HPA memory address; the VMM _ kernel negotiates an interrupt vector number with the virtual machine program at the same time, and configures the VMACC to send an interrupt message to the corresponding interrupt vector number.
As shown in fig. 6, in the physical machine environment with an IOMMU, the VMM _ kernel configures an interrupt translation table of the IOMMU, maps a physical interrupt vector number of the VMACC to an interrupt vector number set by the virtual machine program, and configures a page table of the IOMMU to map the IOVA to the HPA.
Note 1 in fig. 5 and 6 is that a read/write is initiated on the memory address bus using a GPA address, and the CPU translates the GPA into HPA by setting a page table, which is used for the following functions:
Figure 698188DEST_PATH_IMAGE001
accessing registers and device memory of the VMACC to invoke the VMACC, an acceleration function;
Figure 461614DEST_PATH_IMAGE002
accessing data interacted with the VMACC in the memory; note 2 is a working state request to read and write the VMACC to implement online migration of the virtual machine; and reading and writing the register and the device memory of the VMACC to configure the working state data of the VMACC and the corresponding interrupt vector number and address of the virtual machine.
Aiming at the functions provided by the VMACC, the VMM _ kernel performs online migration operation of the accelerated virtual machine by reading and writing the working state data of the corresponding VMACC, wherein the working state data of the VMACC comprises data in a memory, calculation state data in a calculation device and the working state data of a network exchange device; the read-write mode is, for example, reading through a register and a device memory; when the VMM initiates the online migration operation of the virtual machine, the VMM _ kernel in the VMM reads the working state data of the corresponding VMACC on the original physical machine and sends the working state data to the VMM _ kernel of the target physical machine, and the VMM _ kernel of the target physical machine writes the working state data of the VMACC of the original physical machine, so that the online migration of the virtual machine is realized when the VMACC acceleration function is used.
While the invention has been described with reference to a preferred embodiment, various modifications may be made and equivalents may be substituted for elements thereof without departing from the scope of the invention. In particular, the technical features mentioned in the embodiments can be combined in any way as long as there is no structural conflict. It is intended that the invention not be limited to the particular embodiments disclosed, but that the invention will include all embodiments falling within the scope of the appended claims. The invention has not been described in detail and is part of the common general knowledge of a person skilled in the art.

Claims (7)

1. A system for enhancing virtualization performance, comprising a computing device that interacts directly with a virtual machine program over a computer system bus; the direct interaction comprises interaction in a mode of accessing and/or sending a message through a memory address space;
the interaction through the memory address space access specifically includes:
the virtual machine program operates an interface of a protocol by accessing a memory address space on the computer system bus; an interface for the protocol is provided by the computing device;
the interacting in the message sending manner specifically includes:
the computing device sends an interrupt message on a computer system bus and/or sets a signal value in a memory address to inform a virtual machine program so as to realize direct interaction between the computing device and the virtual machine program;
when the VMM initiates online migration operation of the virtual machine, the VMM _ kernel in the VMM reads the working state data of the system VMACC for improving virtualization performance on the original physical machine and sends the working state data to the VMM _ kernel of the target physical machine, and the VMM _ kernel of the target physical machine writes the received working state data of the VMACC of the original physical machine so as to realize online migration of the virtual machine when the VMACC acceleration function is used;
the VMACC can customize communication data and functional logic between the virtual machine program and the VMACC according to the specific requirements of the virtual machine program; the method comprises the following steps that in a Timer VMACC _ Timer, a physical machine system with an IOMMU is adopted, and data structures and functional logics of a VMACC and a virtual machine program are customized, and the method specifically comprises the following steps:
1) defining a data structure, timer _ info, the timer _ info data structure containing a frequency, current _ count, and initial _ count; the frequency represents the timer frequency, the current _ count represents the counting period value counted down by the timer currently, and the initial _ count represents the counting initialization value set by the virtual machine program for starting timing;
2) defining a data structure, timer _ irq _ info, the timer _ irq _ info comprising an irq _ vector and a destination _ cpu; the irq _ vector is used for sending an interrupt vector number to the central processing unit when the VMM _ kernel configures the VMACC _ Timer when the Timer expires, and the destination _ cpu is used for sending an interrupt to a certain logic core of the central processing unit when the VMM _ kernel configures the VMACC _ Timer when the Timer expires;
3) the VMM _ kernel sets a VMACC to map the base address of the timer _ info structure to the HPA address of the physical machine, and establishes a page table mapping relation from the GPA address of the virtual machine to the HPA address of the physical machine in the central processing unit;
4) the VMM _ kernel provides a logical data structure VMM _ Timer _ irq _ info for the virtual machine program to configure the virtual CPU and interrupt vector number for which the VMACC _ Timer is expected to send an interrupt;
5) the VMM _ kernel sets VMM _ timer _ irq _ info initialized according to virtual hardware topology of the virtual machine;
6) VMM _ kernel configures the IOMMU;
7) VMM _ kernel maps VMM _ timer _ irq _ info to GPA address of virtual machine;
8) in the timer _ info structure, a virtual machine program reads a frequency value first, and calculates a count value C which needs to be set according to a required target expiration time T, wherein C is T/frequency; the virtual machine program sets initial _ count as C, and VMACC _ Timer starts to work regularly;
9) the virtual machine program can obtain the current remaining count value of the timer by reading the current _ count value and obtain the last set count initialization value by reading the initial _ count value;
10) after receiving a new initial _ count setting, VMACC _ Timer sets a current _ count value as initial _ count, starts to periodically subtract 1 from current _ count according to frequency, stops performing the operation of periodically subtracting 1 from current _ count when current _ count is reduced to 0, and sends an interrupt to a destination _ cpu logic core corresponding to the central processing unit by irq _ vector according to the set Timer _ irq _ info; according to the setting of the VMM _ kernel to the IOMMU, the virtual machine receives a Timer expiration interrupt sent by the VMACC _ Timer, and a Timer expiration interrupt processing function of the virtual machine program processes a Timer event.
2. The system for improving virtualization performance of claim 1, wherein a primary page table or a secondary page table is established in the processor, and a mapping relationship between a physical address of the virtual machine and a physical address of the physical machine is satisfied, so that the virtual machine program accesses the physical address of the physical machine where the corresponding resource is located by accessing the physical address of the virtual machine, thereby operating the interface.
3. The system for improving virtualization performance of claim 1, wherein the computing device writes data needed by the virtual machine program directly into a memory address space of a virtual machine by:
the virtual machine program configures the physical address of the virtual machine written by the computing device, and the kernel VMM _ kernel of the virtual machine monitor translates the physical address of the virtual machine into the physical address of the physical machine, so that the computing device can write the corresponding physical address of the virtual machine by using the physical address of the physical machine in an addressing mode.
4. The system according to claim 3, wherein in the system with an IOMMU, the VMM _ kernel sets the IOMMU based on a relationship between a virtual machine physical address and a physical machine physical address, and performs the translation from the IO virtual address to the physical machine physical address, so as to enable the computing device to write the IO virtual address into the virtual machine memory directly.
5. A physical machine comprising a processor, a memory, a virtual machine monitor, and a system VMACC for enhancing virtualization performance as claimed in any one of claims 1-4; the VMM _ kernel in the virtual machine monitor manages hardware resources and runs a plurality of VMM _ user processes, the VMM _ user processes run a plurality of virtual machines, and the virtual machines run virtual machine programs.
6. The physical machine according to claim 5, wherein the VMM _ kernel sets parameters of the VMACC, so that the VMACC directly initiates memory read-write operation to a virtual machine physical address corresponding to the virtual machine by using the physical machine physical address;
the VMM _ kernel and the virtual machine program negotiate an interrupt vector number, and the VMACC is configured to send an interrupt message to the interrupt vector number.
7. The physical machine of claim 5, further comprising an IOMMU;
the VMM _ kernel configures an interrupt translation table of the IOMMU, maps a physical interrupt vector number of the VMACC to an interrupt vector number set by a virtual machine program, configures a page table of the IOMMU, maps an IO virtual address to a physical machine physical address, the IO virtual address is equal to the virtual machine physical address, and the VMACC directly uses the physical interrupt vector number to deliver interrupt and directly uses a virtual machine physical address configured by the virtual machine program to initiate memory read-write operation to the virtual machine.
CN202110639791.2A 2021-06-09 2021-06-09 System for improving virtualization performance and physical machine Active CN113094153B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110639791.2A CN113094153B (en) 2021-06-09 2021-06-09 System for improving virtualization performance and physical machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110639791.2A CN113094153B (en) 2021-06-09 2021-06-09 System for improving virtualization performance and physical machine

Publications (2)

Publication Number Publication Date
CN113094153A CN113094153A (en) 2021-07-09
CN113094153B true CN113094153B (en) 2021-10-26

Family

ID=76664500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110639791.2A Active CN113094153B (en) 2021-06-09 2021-06-09 System for improving virtualization performance and physical machine

Country Status (1)

Country Link
CN (1) CN113094153B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876954B (en) * 2009-12-23 2012-08-15 中国科学院计算技术研究所 Virtual machine control system and working method thereof
CN101968746B (en) * 2010-09-02 2016-03-02 北京航空航天大学 A kind of implementation method of kernel virtual machine Organizational Structure Mode
US9684605B2 (en) * 2015-02-23 2017-06-20 Intel Corporation Translation lookaside buffer for guest physical addresses in a virtual machine
US20180067866A1 (en) * 2016-09-08 2018-03-08 Intel Corporation Translate on virtual machine entry
US11593529B2 (en) * 2019-07-29 2023-02-28 Intel Corporation Device interface security management for computer buses

Also Published As

Publication number Publication date
CN113094153A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
US10691363B2 (en) Virtual machine trigger
US9213567B2 (en) System and method for controlling the input/output of a virtualized network
US8799891B2 (en) System and method for attributing CPU usage of a virtual machine monitor to a corresponding virtual machine
Sugerman et al. Virtualizing I/O Devices on VMware Workstation's Hosted Virtual Machine Monitor.
US20110153909A1 (en) Efficient Nested Virtualization
US8028184B2 (en) Device allocation changing method
RU2532708C2 (en) Method and apparatus for input/output operation in virtualisation environment
US10176007B2 (en) Guest code emulation by virtual machine function
US9697024B2 (en) Interrupt management method, and computer implementing the interrupt management method
US20110197190A1 (en) Virtualization method and virtual machine
US9792136B2 (en) Hardware assisted inter hypervisor partition data transfers
KR20160033517A (en) Hybrid virtualization scheme for interrupt controller
US20230259380A1 (en) Chip system, virtual interrupt processing method, and corresponding apparatus
US10853119B2 (en) GiantVM for resource aggregation
WO2022001808A1 (en) System and interrupt processing method
CN103984591A (en) PCI (Peripheral Component Interconnect) device INTx interruption delivery method for computer virtualization system
CN112352221A (en) Shared memory mechanism to support fast transfer of SQ/CQ pair communications between SSD device drivers and physical SSDs in virtualized environments
CN114691286A (en) Server system, virtual machine creation method and device
Chang et al. Virtualization technology for TCP/IP offload engine
CN113094153B (en) System for improving virtualization performance and physical machine
Dey et al. Vagabond: Dynamic network endpoint reconfiguration in virtualized environments
US20230333921A1 (en) Input/output (i/o) virtualization acceleration
Maffione et al. BPFHV: Adaptive network paravirtualization for continuous Cloud Provider evolution
Huang High performance network I/O in virtual machines over modern interconnects
Tu Memory-Based Rack Area Networking

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 430050 No. 1, 14 / F, HUAFA Siji phase II office building, No. 19, Meilin East Road, Hanyang District, Wuhan City, Hubei Province

Applicant after: Wuhan zeta cloud Technology Co.,Ltd.

Address before: 100041 room a-0572, 2nd floor, building 3, yard 30, Shixing street, Shijingshan District, Beijing

Applicant before: BEIJING ZETTAKIT TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A system and physical machine for improving virtualization performance

Effective date of registration: 20220824

Granted publication date: 20211026

Pledgee: Bank of China Limited Wuhan Hanyang sub branch

Pledgor: Wuhan zeta cloud Technology Co.,Ltd.

Registration number: Y2022420000273

PE01 Entry into force of the registration of the contract for pledge of patent right
CB03 Change of inventor or designer information

Inventor after: Zha Qian

Inventor after: Fan Wenyi

Inventor before: Fan Wenyi

CB03 Change of inventor or designer information