Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those skilled in the art obtained belongs to the scope that the present invention protects.
Seeing also accompanying drawing 1, is the method flow synoptic diagram of closing interruption in the virtualization system that provides of the embodiment of the invention, mainly comprises step S101, step S102 and step S103:
S101; To virtualizing operating systems Guest OS interface is provided so that said Guest OS call said interface with shared drive in the interrupt identification bit register corresponding with said Guest OS interrupt identification is set, said shared drive is the physical memory that real-time embedded virtual member Hypervisor and at least one Guest OS share and be used to write down interrupt identification.
In embodiments of the present invention; Guest OS is a kind of virtualizing operating systems; This type operating system and general operation system difference are; Not only to move such virtualizing operating systems or such virtualizing operating systems on the single physical CPU only to operate on the single physical CPU, promptly be not directly to run on the hardware layer (Hardware), but run on the real-time embedded virtual member Hypervisor on the hardware layer; Shown in accompanying drawing 2, be that single physical CPU goes up a plurality of Guest OS of operation and single Guest OS runs on the scene synoptic diagram on a plurality of physical cpus.For example, Guest OS
0With Guest OS
1Run on physical cpu through Hypervisor
0(Core
0) on, and Guest OS
nRun on physical cpu through Hypervisor
1(Core
1), physical cpu
2(Core
2) and physical cpu
n(Core
n) on.
Close through the communication modes of interrupt notification (Hyper Call) with prior art and to interrupt differently, in embodiments of the present invention, real-time embedded virtual member Hypervisor provides one deck intermediate address, and this intermediate address is managed with shadow page table; Set up the mapping that Guest OS sets up intermediate address to physical memory addresses to the mapping and the Hypervisor of intermediate address by Guest OS; Here Guest OS is called the ground floor map addresses to the mapping of intermediate address, the mapping of intermediate address to physical memory addresses is called second layer map addresses.The effect of ground floor map addresses be real-time embedded virtual member Hypervisor can the real-time embedded virtual member Hypervisor of perception on all Guest OS to the demand and the unified management of physical memory; The effect of second layer map addresses is that real-time embedded virtual member Hypervisor can have planning property ground to divide the physical memory resource according to the demand of Guest OS to physical memory.
Set up after ground floor map addresses and the second layer map addresses, can set up the physical memory that real-time embedded virtual member Hypervisor and at least one Guest OS share and be used to write down interrupt identification.In following explanation; For the convenience of describing; Real-time embedded virtual member Hypervisor and at least one Guest OS are shared and the physical memory that is used to write down interrupt identification abbreviates " shared drive " as, and obviously, shared drive is the part of physical memory.Shown in accompanying drawing 3, be the synoptic diagram of having set up shared drive in the method that provides of the embodiment of the invention at physical memory.Shared drive can be by Hypervisor and at least one Guest OS common access; And; Guest OS and the shared memory headrooms of said Hypervisor different in the said shared drive are isolated mutually, and the memory headroom that promptly any Guest OS and Hypervisor share in the shared drive is isolation mutually with another Guest OS and the shared memory headroom of Hypervisor.For example, in accompanying drawing 3, Guest OS
0The physical memory of sharing with Hypervisor and being used for writing down interrupt identification is the " VM of shared drive
0The interrupt identification bit space ", Guest OS
1The physical memory of sharing with Hypervisor and being used for writing down interrupt identification is the " VM of shared drive
1The interrupt identification bit space " and Guest OS
2The physical memory of sharing with Hypervisor and being used for writing down interrupt identification is the " VM of shared drive
2The interrupt identification bit space " be to isolate mutually.
As one embodiment of the invention; To virtualizing operating systems Guest OS interface is provided so that said Guest OS call said interface with shared drive in the interrupt identification bit register corresponding with said Guest OS interrupt identification is set can be: real-time embedded virtual member Hypervisor provides interface so that said Guest OS calls said interface to Guest OS; The intermediate address information that provides according to said interface; Through ground floor map addresses visit intermediate address; Visit said shared drive according to said intermediate address and through second layer map addresses, the interrupt identification bit register corresponding with said Guest OS is provided with interrupt identification, for example; Use logical zero to represent to close interruption, use logical one to represent to open interruption.Need to prove, because real-time embedded virtual member Hypervisor has set up ground floor map addresses and second layer map addresses, therefore; Guest OS when interrupt identification is set, though be the interface accessing intermediate address that provides through aforementioned ground floor map addresses and real-time embedded virtual member Hypervisor, then; Finally have access to shared drive through second layer map addresses; But it is not in system's operational process,, different with direct visit shared drive as far as Guest OS; Be that Guest OS thinks directly to visit shared drive, interrupt identification bit register that will be corresponding with this Guest OS is provided with interrupt identification.
S102 checks said interrupt identification bit register.
As one embodiment of the invention, when checking said interrupt identification bit register, the abnormality processing function that can be the appointment of execute exception vector is to check said interrupt identification bit register.Particularly; The physical discontinuity that hardware produces, for example, general physical discontinuity or rapid physical interruption etc. at first are routed to physics nuclear through GIC; Physics nuclear is gone up operation Hypervisor program; Enter into the exception vector table of Hypervisor then, and jump to the abnormality processing function of the exception vector appointment of Hypervisor, the content of inspection interrupt identification bit register in the Interrupt Process process of Hypervisor.
In the embodiment of above-mentioned inspection interrupt identification bit register; It can be the clock that provides according to real-time embedded virtual member Hypervisor; Periodically the said interrupt identification bit register of poll is promptly initiatively checked said interrupt identification bit register, also can be under the triggering of the physical discontinuity that hardware produces; Check said interrupt identification bit register, the said interrupt identification bit register of promptly passive inspection.
S103 if said interrupt flag bit register shows that said Guest OS need close interruption, then forbids sending virtual interruption to said Guest OS.
For example, if use logical zero to represent to close interruption, use logical one to represent to open interruption, the content that then is checked through the interrupt identification bit register is a logical zero, then forbids sending the physical discontinuity that hardware produces to said Guest OS.
From the virtualization system that the invention described above embodiment provides, closing the method for interruption can know; Because real-time embedded virtual member Hypervisor provides interface to virtualizing operating systems Guest OS, said Guest OS physical memory that is can be with Hypervisor shared with at least one Guest OS and that be used for writing down interrupt identification is that shared drive is provided with interrupt identification with the corresponding interrupt identification bit register of said Guest OS.Compare with the method that prior art is closed interruption through the communication modes that interrupt notification is provided, the method that the embodiment of the invention provides does not rely on Hypervisor and Guest OS compiles jointly, and Hypervisor does not need to share code segment with Guest OS; Because virtualization layer separates with Guest OS reflection, and the visit of shared drive is carried out through virtual address, therefore, speed is fast when close is interrupted, and running efficiency of system is high.
Seeing also accompanying drawing 4, is the apparatus structure synoptic diagram of closing interruption in the virtualization system that provides of the embodiment of the invention.For the ease of explanation, only show the part relevant with the embodiment of the invention.The device of closing interruption in the virtualization system of accompanying drawing 4 examples comprises that interface provides module 401, zone bit inspection module 402 and interrupt holdoff sending module 403, wherein:
Interface provides module 401; Be used for interface being provided and interrupt identification be set so that said Guest OS calls the said interface interrupt identification bit register that shared drive is corresponding with said Guest OS to virtualizing operating systems Guest OS; Said shared drive is the physical memory that real-time embedded virtual member Hypervisor and at least one Guest OS share and be used to write down interrupt identification; Wherein, different Guest OS and the shared memory headrooms of said Hypervisor isolated mutually in the said shared drive.
Zone bit inspection module 402 is with the said interrupt identification bit register of inspection.
Interrupt holdoff sending module 403 is used for then forbidding sending virtual interruption to said Guest OS if the said interrupt flag bit register of said zone bit inspection module 402 inspections shows that said Guest OS need close interruption.
Need to prove; Close in the above virtualization system in the embodiment of device of interruption, the division of each functional module only illustrates, can be as required in the practical application; For example the facility of the realization of the configuration requirement of corresponding hardware or software is considered; And above-mentioned functions is distributed by the different functional completion, the inner structure that is about to said cable modem eedle threader is divided into different functional, to accomplish all or part of function of above description.And; In the practical application; Corresponding functional modules in the present embodiment can be to be realized by relevant hardware, also can carry out corresponding software by relevant hardware and accomplish, for example; Aforesaid interface provides module; Can be have carry out aforementioned to virtualizing operating systems Guest OS interface is provided so that said Guest OS call said interface with shared drive in the interrupt identification bit register corresponding with said Guest OS the hardware of interrupt identification is set, for example interface provides device, thereby also can be to carry out perhaps other hardware devices of general processor that the corresponding computer program accomplishes aforementioned functional; Aforesaid for another example zone bit inspection module; Can be to have the hardware of carrying out the said interrupt flag bit register functions of aforementioned inspection; Zone bit detector for example, thus also can be to carry out general processor or other hardware devices (each embodiment that this instructions provides can use the foregoing description principle) that the corresponding computer program is accomplished aforementioned functional.
The interface of accompanying drawing 4 examples provides module 401 can comprise that interface interchange unit 501 and interrupt identification are provided with unit 502, closes the device of interruption in the virtualization system that another embodiment of the present invention provides shown in accompanying drawing 5, wherein:
Interface interchange unit 501 is used for interface being provided so that said Guest OS calls said interface to virtualizing operating systems Guest OS;
Interrupt identification is provided with unit 502; Be used for the intermediate address information that provides according to said interface; Through ground floor map addresses visit intermediate address; According to said intermediate address and through second layer map addresses, the interrupt identification bit register corresponding with said Guest OS is provided with interrupt identification, said ground floor map addresses is the mapping of said Guest OS to intermediate address; Said second layer map addresses is the mapping of said intermediate address to physical memory addresses, and said physical memory comprises said shared drive.
The device of closing interruption in the virtualization system of accompanying drawing 4 or accompanying drawing 5 examples can also comprise that module 601 is set up in mapping and shared drive is set up module 602; Close the device of interruption in the virtualization system that another embodiment of the present invention provides shown in accompanying drawing 6a or accompanying drawing 6b, wherein:
Module 601 is set up in mapping, is used to set up Guest OS to the mapping of intermediate address and the mapping of said intermediate address to physical memory addresses.
Shared drive is set up module 602, is used to set up said shared drive, and Guest OS and the shared memory headrooms of said Hypervisor different in the said shared drive are isolated mutually.
The clock that the zone bit of accompanying drawing 4 examples inspection module 402 can provide according to real-time embedded virtual member Hypervisor; The said interrupt identification bit register of poll periodically; Also can under the triggering of the physical discontinuity that hardware produces, check said interrupt identification bit register.Zone bit inspection module 402 can comprise first performance element 701, closes the device of interruption in the virtualization system that another embodiment of the present invention provides shown in accompanying drawing 7,
Performance element 701, the abnormality processing function that is used for the appointment of execute exception vector is to check said interrupt identification bit register.Particularly; The physical discontinuity that hardware produces; For example; General physical discontinuity or rapid physical interruption etc. at first are routed to physics nuclear through GIC, and physics nuclear is gone up operation Hypervisor program, enter into the exception vector table of Hypervisor then; And jump to the abnormality processing function of the exception vector appointment of Hypervisor, in the Interrupt Process process of Hypervisor in the performance element 701 execute exception vector tables abnormality processing function of exception vector appointment with the content of inspection interrupt identification bit register.
Need to prove; Contents such as the information interaction between each module/unit of said apparatus, implementation; Since with the inventive method embodiment based on same design; Its technique effect that brings is identical with the inventive method embodiment, and particular content can repeat no more referring to the narration among the inventive method embodiment here.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to accomplish through program, such as following the whole bag of tricks one or more or all:
To virtualizing operating systems Guest OS interface is provided so that said Guest OS call said interface with shared drive in the interrupt identification bit register corresponding with said Guest OS interrupt identification is set, said shared drive is the physical memory that real-time embedded virtual member Hypervisor and at least one Guest OS share and be used to write down interrupt identification;
Check said interrupt identification bit register;
If said interrupt flag bit register shows that said Guest OS need close interruption, then forbid sending virtual interruption to said Guest OS.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to accomplish through program; This program can be stored in the computer-readable recording medium; Storage medium can comprise: ROM (read-only memory) (ROM; Read Only Memory), RAS (RAM, Random Access Memory), disk or CD etc.
More than close interruption in the virtualization system that the embodiment of the invention is provided method and apparatus carried out detailed introduction; Used concrete example among this paper principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.