CN109284178A - A kind of interruption transmitting method and device based on KVM virtualization - Google Patents

A kind of interruption transmitting method and device based on KVM virtualization Download PDF

Info

Publication number
CN109284178A
CN109284178A CN201710602307.2A CN201710602307A CN109284178A CN 109284178 A CN109284178 A CN 109284178A CN 201710602307 A CN201710602307 A CN 201710602307A CN 109284178 A CN109284178 A CN 109284178A
Authority
CN
China
Prior art keywords
guest
interruption
transmission equipment
hypervisor
interrupt vector
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.)
Withdrawn
Application number
CN201710602307.2A
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201710602307.2A priority Critical patent/CN109284178A/en
Publication of CN109284178A publication Critical patent/CN109284178A/en
Withdrawn legal-status Critical Current

Links

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • 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
    • 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
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Abstract

A kind of interruption transmitting method and device based on KVM virtualization is disclosed herein, comprising: the MSI register for configuring transmission equipment, the client operating system Guest OS interrupt vector for the MSI interrupt vector information transmission equipment for issuing the MSI register;When transmission equipment interrupts, the physical cpu that the Guest OS is run is in non-root mode non-root, then Guest OS receives the interruption, and directly responds this interruption using the corresponding interrupt processing function of the Guest OS interrupt vector.The application can be interrupted directly by Guest OS processing VFIO transmission equipment in most cases, to reduce the switching of Guest OS to Hypervisor, not only save the transparent transmission time, and improve the performance of transmission equipment.

Description

A kind of interruption transmitting method and device based on KVM virtualization
Technical field
The present invention relates to field of computer technology, and in particular to one kind is based on kernel virtual machine (KVM, Kernel Virtual Machine) virtualization interruption transmitting method and device.
Background technique
Intel Virtualization Technology application is increasingly extensive at present, can be straight in order to meet the performance requirement under the scene of part to virtual machine Connect and some hardware device is provided is used to designated virtual machine is exclusive, at this time generally can using it is external component interconnected (PCI, Peripheral Component Interconnect) equipment directly passes through void by Passthrough (PCI transparent transmission) mode Quasi- machine uses.By PCI Passthrough technology, although client operating system (Guest OS) can directly access PCI and set It is standby, but its device interrupt still needs to distribute by Hypervisor, is injected into Guest OS.
As shown in Figure 1, for the transparent transmission schematic diagram of device interrupt in the related technology.Wherein, transmission equipment A uses a set of user The VFIO-MSI of state driver framework (VFIO, Virtual Function I/O) general driving, registration is interrupted first by real-time Embedded type virtual component (Hypervisor) response, Hypervisor obtain corresponding CPU according to VFIO-MSI interrupt vector Interrupt requests (IRQ) number, call No. IRQ corresponding interrupt processing function, which will inject interruption to virtually Machine, last Guset OS call the driving of equipment A specifically to handle this interruption according to interrupt vector table.In this process In, virtual machine needs to be switched to non-root mode (Non-Root) (being namely switched to Hypervisor) from root mode (Root) It can respond and interrupt, and this switching action is than relatively time-consuming, frequent switching also inevitably results in performance decline.
For can just be injected into Guest OS because device interrupt needs to distribute by Hypervisor in the related technology and lead The technical issues of time-consuming, performance decline is caused, currently no effective solution has been proposed.
Summary of the invention
In order to solve the above-mentioned technical problem, the embodiment of the invention provides a kind of interruption transparent transmission side based on KVM virtualization Method and device can be interrupted directly by Guest OS processing VFIO transmission equipment, in most cases to reduce Guest The switching of OS to Hypervisor not only saves the transparent transmission time, and improves the performance of transmission equipment.
This application provides:
A kind of interruption transmitting method based on KVM virtualization, comprising:
The MSI register for configuring transmission equipment, the MSI interrupt vector information for issuing the MSI register are described Pass the client operating system Guest OS interrupt vector of equipment;
When transmission equipment interrupts, the physical cpu that the Guest OS is run is in non-root mode non-root, Then Guest OS receives the interruption, and directly responds this using the corresponding interrupt processing function of the Guest OS interrupt vector It interrupts.
Wherein, described when transmission equipment interrupts, further includes: the physical cpu that the Guest OS is run is in Root mode root, then real-time embedded virtualization component Hypervisor receives the interruption, by Hypervisor will be described in It is disconnected to be injected into inside the Guest OS.
Wherein, before the interruption being injected into inside the Guest OS by Hypervisor, further includes: Hypervisor is pre-configured with the Guest OS interrupt vector of each transmission equipment and the corresponding relationship of Hypervisor interrupt vector Table;The interruption is injected into inside the Guest OS by Hypervisor, comprising: Hypervisor is set according to the transparent transmission Standby Guest OS interrupt vector finds the Hypervisor interrupt vector of the transmission equipment from the mapping table, then The interruption is injected inside the Guest OS using the Hypervisor interrupt vector corresponding interrupt processing function.
Wherein, before the MSI register of the configuration transmission equipment, further includes: the void of the transmission equipment will be configured with The virtual cpu of quasi- machine is tied on physical cpu, while it is " not automatically from non-root when hardware interrupts that the physical cpu, which is arranged, It is withdrawn into root ", and the interruption of the transmission equipment is tied on the physical cpu.
Wherein, before the MSI register of the configuration transmission equipment, further includes: the transmission equipment is driven using VFIO.
A kind of interruption transparent transmission device based on KVM virtualization, comprising:
Configuration unit, for configuring the MSI register of transmission equipment, the MSI interrupt vector for issuing the MSI register Information is the client operating system Guest OS interrupt vector of the transmission equipment;
Guest OS unit, for when transmission equipment interrupts, the physical cpu that the Guest OS is run to be in Non-root mode non-root, then Guest OS receives the interruption, and directly corresponding using the Guest OS interrupt vector Interrupt processing function responds this interruption.
Wherein, further includes: real-time embedded virtualization component Hypervisor unit, for being sent out in the transmission equipment of working as When raw interruption, the physical cpu that the Guest OS is run is in root mode root, then receives the interruption, by The interruption is injected into inside the Guest OS by Hypervisor.
Wherein, the Hypervisor unit, specifically for being pre-configured with the Guest of each transmission equipment in Hypervisor The mapping table of OS interrupt vector and Hypervisor interrupt vector;According to the Guest OS interrupt vector of the transmission equipment The Hypervisor interrupt vector that the transmission equipment is found from the mapping table, recycles in the Hypervisor The disconnected corresponding interrupt processing function of vector injects the interruption inside the Guest OS.
Wherein, further includes: binding module, for the virtual cpu for being configured with the virtual machine of the transmission equipment to be tied to On physical cpu, while it is " not being withdrawn into root from non-root automatically when hardware interrupts " that the physical cpu, which is arranged, and by institute The interruption for stating transmission equipment is tied on the physical cpu.
A kind of calculating equipment, comprising:
It is stored with the memory of the interruption transparent transmission program based on KVM virtualization;
Processor, be configured to execute the interruption transparent transmission program based on KVM virtualization to execute operations described below: configuration is saturating The MSI register for passing equipment, the client behaviour for the MSI interrupt vector information transmission equipment for issuing the MSI register Make system Guest OS interrupt vector;When transmission equipment interrupts, the physical cpu that the Guest OS is run is in non- Root mode non-root, then Guest OS receives the interruption, and directly using the Guest OS interrupt vector it is corresponding in Disconnected processing function responds this interruption.
A kind of computer readable storage medium is stored with based on KVM virtualization on the computer readable storage medium Transparent transmission program is interrupted, is realized when the interruption transparent transmission program based on KVM virtualization is executed by processor as empty based on KVM in above-mentioned The step of interruption transmitting method of quasi-ization.
The embodiment of the present invention, when transmission equipment interrupts, as long as the physical cpu that the Guest OS is run is in Non-root, so that it may directly be received the interruption by Guest OS and be handled, in this manner it is possible in most cases Directly interrupted by Guest OS processing VFIO transmission equipment, so that the switching of Guest OS to Hypervisor is effectively reduced, The time for interrupting transparent transmission can not only be saved, and the performance of transmission equipment can be improved.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the transparent transmission schematic diagram of device interrupt in the related technology;
Fig. 2 is interruption transmitting method flow diagram of the embodiment of the present invention based on KVM virtualization;
Fig. 3 is the exemplary flow diagram of interruption transmitting method of the embodiment of the present invention based on KVM virtualization;
Fig. 4 is the signal that the embodiment of the present invention interrupts that the PCI Passthrough transmission equipment that transmitting method is realized interrupts Figure.
Fig. 5 is interruption transparent transmission device structural schematic diagram of the embodiment of the present invention based on KVM virtualization.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
As shown in Fig. 2, the application provides a kind of interruption transmitting method based on KVM virtualization, comprising:
Step 201, the message signale notice for configuring transmission equipment interrupts (MSI, Message Signaled Interrupt)) register, the Guest OS interrupt vector for the MSI interrupt vector information transmission equipment for issuing it;
Step 202, when transmission equipment interrupts, the physical cpu that the Guest OS is run is in non-root mode Non-root (is in Guest state), then Guest OS receives the interruption, and directly utilizes the Guest OS interrupt vector Corresponding interrupt processing function responds this interruption.
The application, when transmission equipment interrupts, as long as the physical cpu that the Guest OS is run is in non- Root, so that it may directly be received the interruption by Guest OS and be handled, in this manner it is possible in most cases directly By the interruption of Guest OS processing VFIO transmission equipment, reduces Hypervisor injection and interrupt, to reduce since transparent transmission is set For interrupting and the switching of Guest OS to the Hypervisor of introducing, to be set by PCI Passthrough technology transparent transmission On the basis of standby, the performance of transmission equipment is further improved, shortens the duration for interrupting transparent transmission.
In the application, the above method can also include: when transmission equipment interrupts, what the Guest OS was run Physical cpu is in root (i.e. in Host state), then Hypervisor receives the interruption, by Hypervisor will be described in It is disconnected to be injected into inside the Guest OS.
In the application, due to MSI register default configuration Hypervisor interrupt vector, in order to guarantee that VFIO is saturating Passing the interrupt vector information for including in the MSI interrupt of equipment triggering is that Guest OS can be used directly, in the application, is needed The MSI register of transmission equipment is first configured, the MSI interrupt vector information for issuing it is the transmission equipment in Guest OS The interrupt vector used, even if the MSI interrupt vector information that the MSI register issues is the Guest OS of the transmission equipment Interrupt vector.
In the application, after configuration MSI register, the interrupt vector in MSI interrupt information that transmission equipment issues is The interrupt vector that Guest OS can be handled directly i.e. Guest OS interrupt vector, such Hypervisor can not just be handled.Therefore, The Guest OS interrupt vector and Hypervisor interrupt vector of each transmission equipment can also be pre-configured in Hypervisor Mapping table.In this way, can safeguard transmission equipment Guest OS interrupt vector and Hypervisor in Hypervisor The mapping table of interrupt vector, when Hypervisor receives interruption at that time, Hypervisor can pass through the corresponding pass Being table converts Hypervisor interrupt vector for Guest OS interrupt vector, such Hypervisor response interrupt after just according to Original process injection, which is interrupted, arrives Guest OS.It is, Hypervisor can be according to the Guest OS of current transmission equipment Interrupt vector finds the Hypervisor interrupt vector of current transmission equipment from the mapping table, and recycling should The corresponding interrupt processing function of Hypervisor interrupt vector injects the interruption inside the Guest OS.
It should be noted that the application is before executing the above method, it is also necessary to the void of the transmission equipment will be configured with The virtual cpu of quasi- machine is tied on physical cpu, and it is " not move back automatically from non-root when hardware interrupts that the physical cpu, which is arranged, Root is arrived out, and the interruption of the transmission equipment is tied on the physical cpu.Wherein, the transmission equipment is driven using VFIO It is dynamic.That is, transmission equipment is the transmission equipment of VFIO mode.
In practical application, the virtual cpu (vCPU) of the affiliated virtual machine of transmission equipment needs to be tied to fixed physical cpu On, while " not being withdrawn into root from non-root automatically when hardware interrupts " is set by this physical cpu.Transmission equipment uses VFIO general driving is interrupted and is tied on the physical cpu of above-mentioned fixation to realize equipment transparent transmission.In this way, working as the physical cpu When in non-root (being in Guest state), the interruption of transmission equipment is just passed directly to inside Guest OS.Work as transmission equipment When down trigger, if the physical cpu that Guest OS is run is in root mode (i.e. in Host state), interrupt by Hypervisor processing.
Fig. 3 is the exemplary flow of the application above method, it is ensured that interruption can correctly be transferred to virtual machine internal.Such as figure Shown in 3, which be may include steps of:
Step 301, it is " not to be withdrawn into automatically from non-root mode when hardware interrupts that a physical cpu (CPU_A), which is arranged, Root mode ".
Step 302, starting is configured with the virtual machine of transmission equipment, and transmission equipment is driven using VFIO, by the virtual machine One virtual cpu (vCPU_B) is tied on physical cpu _ A.
Step 303, the MSI register for modifying transmission equipment, make transmission equipment issue MSI interrupt in include interruption to Amount information is the Guest OS interrupt vector of transmission equipment.Transmission equipment Guest OS interruption is established in Hypervisor simultaneously The mapping table of vector and Hypervisor interrupt vector.
Step 304, the interruption of transmission equipment is tied to vCPU_B in virtual machine internal.
Step 305, transmission equipment MSI interrupt is tied to CPU_A in Hypervisor.
Step 306, virtual machine internal normal use transmission equipment at this time.When CPU_A is in root mode (in Guest State), the MSI interrupt of transmission equipment can directly trigger the interrupt processing function of Guest OS transmission equipment;When CPU_A is in Non-root mode (be in Host state), the MSI interrupt of transmission equipment is handled by Hypervisor, according to original process by Hypervisor injection, which is interrupted, arrives Guest OS.
Fig. 4 is that PCI Passthrough device interrupt is injected by the application above method to the exemplary of Guest OS Process schematic.In practical application, the interruption injection process of the application above method is without being limited thereto.
It is directly used as shown in figure 4, PCI transmission equipment C is passed through Guest OS.Physical cpu (CPU_A) is preparatory Be set as " hardware interrupts when be not withdrawn into root " from non-root automatically.After Guest OS starting, wherein by virtual machine One virtual cpu (vCPU_B) is tied to physical cpu (CPU_A).In Guest OS, PCI transmission equipment C it is corresponding it is virtual in It is disconnected to be tied on vCPU_B.On host Hypervisor, carry out PCI transmission equipment C using VFIO driving, and will be corresponding VFIO-MSI interruption is tied to CPU_A.
When PCI transmission equipment C generates interruption, if CPU_A is in root mode (i.e. in Guest state) at this time, It, can be using such as Fig. 4 institute since CPU_A has been set to " not being withdrawn into root from non-root automatically when hardware interrupts " in advance The path shown is 2.: Guest OS directly receives the interruption of PCI transmission equipment C, and Guest OS is using being pre-configured in MSI deposit The Guest OS interrupt vector G_Vec of the PCI transmission equipment C in device, directly finds in the interrupt vector table of Guest OS The interrupt processing function MSI (G_Vec) of PCI transmission equipment C, and utilize the interrupt processing function MSI (G_ of PCI transmission equipment C Vec) interruption is injected inside Guest OS.
If CPU_A is not in Guest state at this time, in non-root mode (being in Host state) then using in Fig. 4 Path 1.: Hypervisor receives the interruption of PCI transmission equipment C, according to Hypervisor safeguard transmission equipment Guest The mapping table of OS interrupt vector and Hypervisor interrupt vector, can be based on the Guest OS of the PCI transmission equipment C Interrupt vector G_Vec finds the Hypervisor interrupt vector H_Vec of PCI transmission equipment C, then by corresponding Hypervisor Disconnected processing function MSI (H_Vec) injects interrupts into Guest OS, i.e., using the Hypervisor of PCI transmission equipment C interrupt to Amount H_Vec finds the interrupt processing function MSI (H_Vec) of PCI transmission equipment C, and benefit in the interrupt vector table of Hypervisor The interruption is injected inside Guest OS with the interrupt processing function MSI (H_Vec) of PCI transmission equipment C.
Correspondingly, the application also provides a kind of interruption transparent transmission device based on KVM virtualization, as shown in Figure 5, comprising:
Configuration unit 51, for configuring the MSI register of transmission equipment, the MSI interrupt that issues the MSI register to Measure the client operating system Guest OS interrupt vector that information is the transmission equipment;
Guest OS unit 52, for when transmission equipment interrupts, at the physical cpu that the Guest OS is run In non-root mode non-root, then Guest OS receives the interruption, and directly corresponding using the Guest OS interrupt vector Interrupt processing function respond this interruption.
In the application, above-mentioned apparatus may also include that Hypervisor unit 53, for working as in transmission equipment generation described When disconnected, the physical cpu that the Guest OS is run is in root mode root, then receives the interruption, will by Hypervisor The interruption is injected into inside the Guest OS.
In a kind of implementation, the Hypervisor unit 53 is particularly used in and is pre-configured with respectively in Hypervisor The Guest OS interrupt vector of transmission equipment and the mapping table of Hypervisor interrupt vector;According to the transmission equipment Guest OS interrupt vector finds the Hypervisor interrupt vector of the transmission equipment from the mapping table, recycles The corresponding interrupt processing function of the Hypervisor interrupt vector injects the interruption inside the Guest OS.
In the application, above-mentioned apparatus may also include that binding module 54, for that will be configured with the virtual machine of the transmission equipment Virtual cpu be tied on physical cpu, while be arranged the physical cpu be " do not exited automatically from non-root when hardware interrupts It is tied on the physical cpu to root ", and by the interruption of the transmission equipment.
Interruption transparent transmission device in the application based on KVM virtualization can realize all details of the above method.Practical application In, the above-mentioned interruption transparent transmission device based on KVM virtualization can be implemented as calculating equipment, particularly, should be based on KVM virtualization Interrupting transparent transmission device can be by software realization, and the hardware entities relied on can be the processor for calculating equipment.
Correspondingly, the application also provides a kind of calculating equipment, comprising:
It is stored with the memory of the interruption transparent transmission program based on KVM virtualization;
Processor, be configured to execute the interruption transparent transmission program based on KVM virtualization to execute operations described below: configuration is saturating The MSI register for passing equipment, the client behaviour for the MSI interrupt vector information transmission equipment for issuing the MSI register Make system Guest OS interrupt vector;When transmission equipment interrupts, the physical cpu that the Guest OS is run is in non- Root mode non-root, then Guest OS receives the interruption, and directly using the Guest OS interrupt vector it is corresponding in Disconnected processing function responds this interruption.
In practical application, above-mentioned calculating equipment can be implemented as server or veneer.
Calculating equipment in the application can realize all details of the above method, repeat no more.
In addition, the application also provides a kind of computer readable storage medium, stored on the computer readable storage medium There is the interruption transparent transmission program based on KVM virtualization, it is real when the interruption transparent transmission program based on KVM virtualization is executed by processor The step of existing above-mentioned interruption transmitting method based on KVM virtualization.
In a kind of implementation, which can be computer-readable Jie in above-mentioned calculating equipment Matter.All steps of the above method may be implemented in the code stored in the computer readable storage medium when being read by the processor Suddenly.
In practical application, the computer-readable medium includes permanent and non-permanent, removable and non-move is deposited Storage media can be accomplished by any method or technique information storage.Information can be computer readable instructions, data structure, The module of program or other data.The example of the storage medium of computer include, but are not limited to phase change memory (PRAM), it is static with Machine access memory (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), only Read memory (ROM), electrically erasable programmable read-only memory (EEPROM), it is flash memory or other memory techniques, read-only Compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage Or other magnetic storage devices or any other non-transmission medium, it can be used for storing and can be accessed by a computing device information.It presses It is defined according to herein, computer-readable medium does not include non-temporary computer readable media (transitory media), is such as adjusted The data-signal and carrier wave of system.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program Related hardware (such as processor) is completed, and described program can store in computer readable storage medium, as read-only memory, Disk or CD etc..Optionally, one or more integrated circuits also can be used in all or part of the steps of above-described embodiment It realizes.Correspondingly, each module/unit in above-described embodiment can take the form of hardware realization, such as pass through integrated circuit It realizes its corresponding function, can also be realized in the form of software function module, such as be stored in and deposited by processor execution Program/instruction in reservoir realizes its corresponding function.The application is not limited to the knot of the hardware and software of any particular form It closes.
The advantages of basic principles and main features and the application of the application have been shown and described above.The application is not by upper The limitation for stating embodiment, the above embodiments and description only describe the principles of the application, are not departing from the application Under the premise of spirit and scope, the application be will also have various changes and improvements, these changes and improvements both fall within claimed Within the scope of the application.

Claims (11)

1. a kind of interruption transmitting method based on KVM virtualization characterized by comprising
The MSI register for configuring transmission equipment, the MSI interrupt vector information transparent transmission for issuing the MSI register are set Standby client operating system Guest OS interrupt vector;
When transmission equipment interrupts, the physical cpu that the Guest OS is run is in non-root mode non-root, then Guest OS receives the interruption, and is directly responded in this using the corresponding interrupt processing function of the Guest OS interrupt vector It is disconnected.
2. interruption transmitting method according to claim 1, which is characterized in that
It is described when transmission equipment interrupts, further includes: the physical cpu that the Guest OS is run is in root mode Root, then real-time embedded virtualization component Hypervisor receives the interruption, is injected the interruption by Hypervisor To inside the Guest OS.
3. interruption transmitting method according to claim 2, which is characterized in that
Before the interruption is injected into inside the Guest OS by Hypervisor, further includes: preparatory in Hypervisor Configure the Guest OS interrupt vector of each transmission equipment and the mapping table of Hypervisor interrupt vector;
The interruption is injected into inside the Guest OS by Hypervisor, comprising: Hypervisor is according to the transparent transmission The Guest OS interrupt vector of equipment finds the Hypervisor interrupt vector of the transmission equipment from the mapping table, The corresponding interrupt processing function of the Hypervisor interrupt vector is recycled to inject the interruption inside the Guest OS.
4. interruption transmitting method according to claim 1, which is characterized in that the MSI register of the configuration transmission equipment Before, further includes:
The virtual cpu of virtual machine configured with the transmission equipment is tied on physical cpu, while the physical cpu is set For " not being withdrawn into root from non-root automatically when hardware interrupts ", and the interruption of the transmission equipment is tied to the physics On CPU.
5. interruption transmitting method according to claim 1 or 4, which is characterized in that the MSI deposit of the configuration transmission equipment Before device, further includes:
The transmission equipment is driven using VFIO.
6. a kind of interruption transparent transmission device based on KVM virtualization characterized by comprising
Configuration unit, for configuring the MSI register of transmission equipment, the MSI interrupt vector information for issuing the MSI register For the client operating system Guest OS interrupt vector of the transmission equipment;
Guest OS unit is in non-root for the physical cpu that when transmission equipment interrupts, the Guest OS is run Mode non-root, then Guest OS receives the interruption, and directly utilizes the corresponding interruption of the Guest OS interrupt vector Processing function responds this interruption.
7. interruption transparent transmission device according to claim 6, which is characterized in that
Further include: real-time embedded virtualization component Hypervisor unit, for described when transmission equipment interrupts, The physical cpu that the Guest OS is run is in root mode root, then receives the interruption, by Hypervisor will be described in It is disconnected to be injected into inside the Guest OS.
8. interruption transparent transmission device according to claim 7, which is characterized in that
The Hypervisor unit, the Guest OS specifically for being pre-configured with each transmission equipment in Hypervisor interrupt to The mapping table of amount and Hypervisor interrupt vector;According to the Guest OS interrupt vector of the transmission equipment from described right The Hypervisor interrupt vector for finding the transmission equipment in relation table is answered, the Hypervisor interrupt vector pair is recycled The interrupt processing function answered injects the interruption inside the Guest OS.
9. interruption transparent transmission device according to claim 6, which is characterized in that
Further include: binding module, for the virtual cpu for being configured with the virtual machine of the transmission equipment to be tied to physical cpu, It is " not being withdrawn into root from non-root automatically when hardware interrupts " that the physical cpu is arranged simultaneously, and by the transmission equipment Interruption be tied on the physical cpu.
10. a kind of calculating equipment characterized by comprising
It is stored with the memory of the interruption transparent transmission program based on KVM virtualization;
Processor, be configured to execute the interruption transparent transmission program based on KVM virtualization to execute operations described below: configuration transparent transmission is set Standby MSI register, the guest operation system for the MSI interrupt vector information transmission equipment for issuing the MSI register System Guest OS interrupt vector;When transmission equipment interrupts, the physical cpu that the Guest OS is run is in non-root mould Formula non-root, then Guest OS receives the interruption, and directly using at the corresponding interruption of the Guest OS interrupt vector Reason function responds this interruption.
11. a kind of computer readable storage medium, which is characterized in that be stored with and be based on the computer readable storage medium The interruption transparent transmission program of KVM virtualization is realized when the interruption transparent transmission program based on KVM virtualization is executed by processor as weighed Benefit require any one of 1 to 5 described in interruption transmitting method based on KVM virtualization the step of.
CN201710602307.2A 2017-07-21 2017-07-21 A kind of interruption transmitting method and device based on KVM virtualization Withdrawn CN109284178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710602307.2A CN109284178A (en) 2017-07-21 2017-07-21 A kind of interruption transmitting method and device based on KVM virtualization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710602307.2A CN109284178A (en) 2017-07-21 2017-07-21 A kind of interruption transmitting method and device based on KVM virtualization

Publications (1)

Publication Number Publication Date
CN109284178A true CN109284178A (en) 2019-01-29

Family

ID=65185721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710602307.2A Withdrawn CN109284178A (en) 2017-07-21 2017-07-21 A kind of interruption transmitting method and device based on KVM virtualization

Country Status (1)

Country Link
CN (1) CN109284178A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240898A (en) * 2020-01-09 2020-06-05 中瓴智行(成都)科技有限公司 Hypervisor-based black box implementation method and system
CN113157624A (en) * 2021-04-21 2021-07-23 科东(广州)软件科技有限公司 Serial port communication method, device, equipment and storage medium
CN115793949A (en) * 2023-02-09 2023-03-14 蔚来汽车科技(安徽)有限公司 Vehicle machine system, method for sharing touch equipment, vehicle and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382923A (en) * 2007-09-06 2009-03-11 联想(北京)有限公司 Virtual machine system and interrupt handling method for customer operating system of the virtual machine system
CN102906705A (en) * 2010-06-23 2013-01-30 国际商业机器公司 Converting a message signaled interruption into an I/O adapter event notification to a guest operating system
CN104321749A (en) * 2012-03-29 2015-01-28 英特尔公司 Architecture and method for managing interrupts in a virtualized environment
US9086906B2 (en) * 2010-09-27 2015-07-21 Mips Technologies, Inc. Apparatus and method for guest and root register sharing in a virtual machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382923A (en) * 2007-09-06 2009-03-11 联想(北京)有限公司 Virtual machine system and interrupt handling method for customer operating system of the virtual machine system
CN102906705A (en) * 2010-06-23 2013-01-30 国际商业机器公司 Converting a message signaled interruption into an I/O adapter event notification to a guest operating system
US9086906B2 (en) * 2010-09-27 2015-07-21 Mips Technologies, Inc. Apparatus and method for guest and root register sharing in a virtual machine
CN104321749A (en) * 2012-03-29 2015-01-28 英特尔公司 Architecture and method for managing interrupts in a virtualized environment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240898A (en) * 2020-01-09 2020-06-05 中瓴智行(成都)科技有限公司 Hypervisor-based black box implementation method and system
CN111240898B (en) * 2020-01-09 2023-08-15 中瓴智行(成都)科技有限公司 Method and system for realizing black box based on Hypervisor
CN113157624A (en) * 2021-04-21 2021-07-23 科东(广州)软件科技有限公司 Serial port communication method, device, equipment and storage medium
CN113157624B (en) * 2021-04-21 2021-12-07 科东(广州)软件科技有限公司 Serial port communication method, device, equipment and storage medium
CN115793949A (en) * 2023-02-09 2023-03-14 蔚来汽车科技(安徽)有限公司 Vehicle machine system, method for sharing touch equipment, vehicle and storage medium

Similar Documents

Publication Publication Date Title
US10169269B2 (en) Architecture and method for managing interrupts in a virtualized environment
US10768960B2 (en) Method for affinity binding of interrupt of virtual network interface card, and computer device
US11360803B2 (en) Method and apparatus for executing non-maskable interrupt
US10176007B2 (en) Guest code emulation by virtual machine function
US9720712B2 (en) Physical/virtual device failover with a shared backend
US11294735B2 (en) Method and apparatus for accessing desktop cloud virtual machine, and desktop cloud controller
JP2011100431A (en) Device and method for controlling virtual machine
US20160085568A1 (en) Hybrid virtualization method for interrupt controller in nested virtualization environment
US20150242229A1 (en) Idle processor management by guest in virtualized systems
US11494215B2 (en) Techniques to decrease a live migration time for a virtual machine
US9715403B2 (en) Optimized extended context management for virtual machines
US10467106B2 (en) Data processing method, data processing system, and non-transitory computer program product for controlling a workload delay time
US20150347169A1 (en) Scheduler limited virtual device polling
CN108292233B (en) Application processor for starting virtual machine
CN109284178A (en) A kind of interruption transmitting method and device based on KVM virtualization
US20190377612A1 (en) VCPU Thread Scheduling Method and Apparatus
CN114499945A (en) Intrusion detection method and device for virtual machine
US9524189B2 (en) Information processing device, information processing method, and computer program product
KR101387986B1 (en) Virtualiztion apparatus
CN111666036B (en) Method, device and system for migrating data
CN115292000A (en) Method and device for dynamic migration of virtual machine and electronic equipment
KR100928866B1 (en) Apparatus and method for running an application in a virtual environment
US10203977B2 (en) Lazy timer programming for virtual machines
US20240118914A1 (en) Accelerated virtual passthrough i/o device performance
KR102500223B1 (en) Network function virtual apparatus and method for syncronizing time the same

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20190129