CN104598294A - Efficient and safe virtualization method for mobile equipment and equipment thereof - Google Patents

Efficient and safe virtualization method for mobile equipment and equipment thereof Download PDF

Info

Publication number
CN104598294A
CN104598294A CN201510008023.1A CN201510008023A CN104598294A CN 104598294 A CN104598294 A CN 104598294A CN 201510008023 A CN201510008023 A CN 201510008023A CN 104598294 A CN104598294 A CN 104598294A
Authority
CN
China
Prior art keywords
virtual machine
foreground
background
equipment
driver
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.)
Granted
Application number
CN201510008023.1A
Other languages
Chinese (zh)
Other versions
CN104598294B (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.)
Shandong Guoshu Development Co ltd
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201510008023.1A priority Critical patent/CN104598294B/en
Publication of CN104598294A publication Critical patent/CN104598294A/en
Application granted granted Critical
Publication of CN104598294B publication Critical patent/CN104598294B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention relates to a method and a system for operating a plurality of virtual machines on a acomputing device and the computing device. According to the method, the system and the computing device provided by the invention, same mobile equipment can be allowed to be available to a plurality of mutually isolatedseparated operating systems or a plurality of safety operating environments; furthermore, each virtual machine can provide exclusive user experience, and the virtualization performance can be improved greatly.

Description

For virtual method and the equipment thereof of the highly effective and safe of mobile device
Technical field
Present invention relates in general to computer operating system field, more specifically relate to virtual method for the highly effective and safe of mobile device and equipment thereof.
Background technology
In recent years, along with the rise of the mobile device of such as flat computer and so on, the demand running multiple operating system is growing.Such as, user may expect that the flat computer running Android operation system also can run Windows Office, and vice versa; Or user may expect that same mobile device can generate multiple virtual machine environment to run multiple operation system example, such as private environment, corporate environment or secure payment environment etc.Different virtual machine environments can have different objects, and as private environment needs to run various individual's application in situation as far as possible easily, and corporate environment needs under higher safety requirements, run the application of various enterprise.
Intel Virtualization Technology provides the ability generating multiple virtual machine environment and run multiple operation system example, but the performance of device virtualization is crucial.But traditional device virtualization technology, namely half virtual (paravirtualization) are lost by larger performance loss and power-efficient on the mobile apparatus.
Summary of the invention
Based on prior art, task of the present invention is the method, system and the equipment that propose for running virtual machine, described method, system and equipment not only allow same mobile device to support the operating system of multiple mutual isolation or multiple secure operating environment, each virtual machine can provide exclusive Consumer's Experience, but also greatly can improve virtualizing performance.
In a first aspect of the present invention, this task is solved by a kind of method for running multiple virtual machine on the computing device, and the method comprises the following steps:
The first virtual machine and the second virtual machine is generated by the supersystem manager operated on physical machine (Hypervisor or Virtual Machine Monitor is called for short VMM – possibility cross-reference VMM and Hypervisor wording herein, and they refer to same thing);
Run the first virtual machine as foreground virtual machine (FVM), wherein foreground virtual machine has nearly all primary (Native) platform device;
The second virtual machine is run as background virtual machine (BVM);
The first platform device context is preserved by the first virtual machine;
The first virtual machine is hung up by supersystem manager;
Second virtual machine is switched to foreground virtual machine from background virtual machine, and the first virtual machine switches to background virtual machine from foreground virtual machine;
First virtual machine is switched to foreground virtual machine from background virtual machine, and the second virtual machine switches to background virtual machine from foreground virtual machine; And
Recover the first platform device context.
In the present invention, " foreground virtual machine has nearly all hardware platform equipment " refers to, foreground virtual machine directly " can see " nearly all hardware platform equipment, and accesses these platform devices with direct-passing mode (pass-through).Allow foreground virtual machine directly have hardware platform equipment such as to be realized by " PCI leads directly to " well known in the prior art (PCI pass-through) technology.And the AM/BAM switching virtual machine switch (VM Switcher) that can pass through in virtual machine monitor (VMM) between two virtual machines realizes.Contextual preservation/the recovery of described platform device can use the existing hang-up/restore funcitons of device driver in guest operating systems (Guest OS) to realize.These processes will be described in detail in a particular embodiment.Should be understood that, " almost " in this " foreground virtual machine has nearly all hardware platform equipment " refers to that the equipment that foreground virtual machine is seen is basically identical with this physical platform, except the equipment processed especially because of other reason (as virtual machine isolation), as internal memory and memory device etc., wherein internal memory or memory device (as hard disk) may be partitioned and remap (from client devices address to physical device address) and access for each virtual machine, and therefore foreground virtual machine might not see whole internal memory or memory device.In addition, background virtual machine can not have activity, therefore can not present actual equipment to it or only present the specific equipment of a small amount of indication.
In the present invention, pass through the method, at least can realize following advantage: (1) is by using the existing hang-up/restore funcitons of device driver in guest operating systems (Guest OS), preservation/the recovery of implementation platform device context, the switching between virtual machine can be realized simply and fastly, and not be used in supersystem manager complicated equipment platform device context preservation/recovery operation (the various different equipment of this action need process that realizes, need extremely complicated equipment knowledge, be equivalent to again realize a device driver at supersystem manager), (2) because foreground virtual machine has nearly all Raw device, therefore, it is possible to access nearly all platform device with primary (Native) performance, thus greatly reduce the virtual performance loss brought, improve the overall performance of system.
Although the present invention is described to run two virtual machine instances, the present invention also can be used for running plural virtual machine, i.e. a foreground virtual machine and multiple background virtual machine.
In a preferred version according to the present invention, foreground virtual machine uses primary (Native) driver, to play the performance advantage of straight-through equipment.In the present invention, use primary driver and direct mode operation by foreground virtual machine, foreground virtual machine can be contributed to and access each platform device, such as video card, internal memory, CPU etc. with primary (Native) performance, thus improve system performance on the whole.
In another preferred version of the present invention, background virtual machine installs primary driver, but background virtual machine inertia.
In an expansion scheme of the present invention, supersystem manager interception guest operating systems to the access of memory device, and carries out subregion to memory device and remaps (from client devices address virtualLBA or vLBA to physical device address physical LBA or pLBA) and provide virtual storage device access to guest operating systems.
In a preferred version, background virtual machine piecemeal activity, supersystem manager only distributes a small amount of cpu resource to perform background virtual machine.In this scenario, supersystem manager only represents the equipment of minute quantity as network interface card and memory device to background virtual machine, other I/O access of background virtual machine is simply ignored: namely supersystem manager does not initiatively inject I/O event, and the I/O of background virtual machine access obtains sky result.In this case, the driver of background virtual machine or device software stack may be modified to support " simply ignoring " operation, namely realize the null device driver of this equipment.Or use associating driver, and by the access of this equipment guiding null device.
In another preferred version of the present invention, the first virtual machine and the second virtual machine use associating driver (Teaming Driver), such as network interface card associating driver.Such as, described associating NIC driver comprises primary (Native) NIC driver and half virtual (Paravirtualization) NIC driver, wherein the first and second virtual machines as during the virtual machine of foreground use network interface card associating driver in primary NIC driver; As during background virtual machine use network interface card associating driver in half virtual NIC driver.Should be understood that in network interface card associating driver at this and also can use other driver, if the NIC driver of emulation is as NE2000 driver.In the present invention, by this preferred version, the equipment that background virtual machine can be facilitated to use specify, the such as network equipment to perform desired operation, such as to receive packet, thus promote that background virtual machine still can perform some operation, such as remind the instant process of communication and consequent prompting such as QQ when backstage.
Should be understood that at this, associating driver is only for supporting the piecemeal activity of background system (or part activate), such as enabling background system access data specified by specified platform device or process and type of message, and in other cases, may not need to use associating driver in the inactive situation of such as background system, primary driver is still installed but inertia at this such as background system.
In another preferred version of the present invention, background virtual machine can be waken up in some cases, and it can be simulated or be provided by the back-end services program of FVM simulation and service by supersystem manager to the access of the equipment such as specified by disk and network and so on.But to the access (as graphics device) of the equipment except specified equipment be directed into null device and I/O access simply ignored, with make background system program keep run.Under null device pattern, system does not have device events input initiatively, exports and is then left in the basket.This is ignored for the rear end equipment not having input and output is acceptable.In the present invention, by this preferred version, effectively background virtual machine can be limited to and only access specified equipment, reduce the complicacy that system realizes.
In an expansion scheme of the present invention, above-mentioned specified equipment (i.e. background devices can access designated equipment) comprises network interface card.Network interface card is the equipment that background virtual machine needs to access usually, virtual machine can be facilitated thus still can to receive when running as background virtual machine and import message into.According to user and system needs, can also specify: background virtual machine can also access designated equipment beyond network interface card, if video card, keyboard, bluetooth etc. are to perform desired operation.
Except the specific hardware that definition background virtual machine can be accessed; the event type (as calendar reminding) that background virtual machine can receive and process can also be defined; that is, the event type except specified event type is not directed into background virtual machine; Even if or physical equipment have received such event, supersystem manager does not also distribute such event type to background virtual machine.Such as in another preferred version of the present invention, background virtual machine is not scheduled when not having network packet arrive and do not have the external events such as timer, and in the network packet of existence arrival or when there is the external events such as timer, background operating system is scheduled and performs with the timer event of the network packet or scheduling that process described arrival.After these event handlings are complete, supersystem manager no longer dispatches background virtual machine, until next particular event occurs.In the present invention, by this preferred version, can reduce background virtual machine on the impact of system overall performance and energy consumption while, make background operating system still can process certain event where necessary, thus better Consumer's Experience be provided.Certainly, other data and type of message, such as notifications, blue-teeth data etc. can also be defined.
In one implementation, after background operating system is scheduled and performs, supersystem manager is by judging that the behavior of client virtual CPU (VCPU) judges whether this client computer has completed the process to the particular event previously occurred.Such as can judge that preceding events completes in the case where there: all VCPU enter idle condition as (Intel CPU) C1 or more state, or all VCPU wait for event a period of time (as 5 seconds or 10 seconds), have comprised the state of the wait internal memory change that execution (Intel CPU) MWAIT instruction causes.
In an expansion scheme of the present invention, first virtual machine run the first operating system and run the second operating system on the second virtual machine, and in the first operating system and the second operating system, wherein run corresponding working environment and/or private environment respectively and/or pay environment.In this application, by this expansion scheme, various operating system and various operating environment can be user-friendly to.But should be noted that at this, first operating system and the second operating system can be the same or different, such as user can run identical operating system on the first and second virtual machines, but builds the different operating environment of operation respectively in described operating system.
In an expansion scheme of the present invention, described switching by user by pressing hot button or hot button is initiated.In invention, by this expansion scheme, user can be facilitated to switch between each virtual machine, thus good Consumer's Experience is provided.Described hot button or hot button can be physical button or button (such as reset key, volume +/-key, HOME key etc.), also can be soft key that display screen shows or button (button on such as soft keyboard or keypad).
In another expansion scheme of the present invention, described switching is initiated with (hypercall) by overshoot by the application program in virtual machine.In the present invention, by this expansion scheme, enable application program certainly advocate peace safely according to circumstances switching virtual machine, avoid interrupting or seizing the critical processes/function of (Pre-emption) client computer.And then be switched to desired operating system or operating environment, such as, to perform specific operation, operation specific program etc. under this operating system or environment.
In a preferred version of the present invention, foreground virtual machine reuses Client OS electric power management mechanism.In the present invention, foreground virtual machine has nearly all platform device, by this preferred version, foreground virtual machine can be enable directly to utilize local power supply administrative mechanism, thus effectively improve power-efficient.
In another preferred version of the present invention, foreground virtual machine is preserving after platform device context while or reset to corresponding hardware device immediately.Wherein said reset can be resetted by the functional level of PCI equipment (Function Level Reset, FLR) realize; Or by resetting to pci bus and then the realization that automatically resets to the equipment under this pci bus; Or the reseting interface carried by equipment is realized (as particular register write); Or the equipment in the specific reset mode of other bus, reset bus and bus realizes.In the present invention, by this preferred version, the content of hardware can be made all to be reset after each preservation, make when new foreground virtual machine performs, guarantee can not see the equipment content of the sensitivity of previous operation virtual machine, thus improves security of system.
In a second aspect of the present invention, provide a kind of system for running multiple virtual machine on the computing device, this system comprises:
For being generated the device of the first virtual machine and the second virtual machine by the supersystem manager operated on physical machine;
For running the device of the first virtual machine as foreground virtual machine (FVM), wherein foreground virtual machine has nearly all primary platform device;
For running the device of the second virtual machine as background virtual machine (BVM);
For being preserved the contextual device of the first platform device by the first virtual machine;
For being hung up the device of the first virtual machine by supersystem manager;
For the second virtual machine is switched to foreground virtual machine from background virtual machine, and the first virtual machine switches to the device of background virtual machine from foreground virtual machine;
For the first virtual machine is switched to foreground virtual machine from background virtual machine, and the second virtual machine switches to the device of background virtual machine from foreground virtual machine; And
For recovering the contextual device of the first platform device.
In a third aspect of the present invention, provide a kind of computing equipment, this computing equipment comprises:
Storer, it stores executable instruction;
Processor, it is configured to perform executable instruction to perform following steps:
The first virtual machine and the second virtual machine is generated by the supersystem manager operated on physical machine;
Run the first virtual machine as foreground virtual machine (FVM), wherein foreground virtual machine has nearly all primary platform device;
The second virtual machine is run as background virtual machine (BVM);
By the first virtual machine first platform device context;
The first virtual machine is hung up by supersystem manager;
Second virtual machine is switched to foreground virtual machine from background virtual machine, and the first virtual machine switches to background virtual machine from foreground virtual machine;
First virtual machine is switched to foreground virtual machine from background virtual machine, and the second virtual machine switches to background virtual machine from foreground virtual machine; And
Recover the first platform device context.
Accompanying drawing explanation
Below with reference to the accompanying drawings the present invention is set forth further according to multiple embodiment.Accompanying drawing:
Figure 1A and 1B show use according to the mobile device of method of the present invention perform virtual machine switch before and later schematic diagram;
Fig. 2 shows according to system architecture of the present invention;
Fig. 3 shows the system architecture that support sector according to the present invention divides activation; And
Fig. 4 shows the process flow diagram according to the method for running multiple virtual machine of the present invention.
Embodiment
Although reference accompanying drawing is in the description of embodiments of the invention below, principle of the present invention has been set forth for the flat computer running the Linux based on virtual machine and the Windows operating system based on virtual machine, but be to be understood that, the present invention is not limited to this, but the present invention can also be applied to such as smart mobile phone, PDA(Personal Digital Assistant), net book, other portable computing device of laptop computer and so on, such as desktop computer, server, other computing equipment of workstation and so on, and such as Android, Tizen, other operating system of IOS and so on.And, although in the following embodiments, running package is containing the virtual machine of two OSs on the same device, but the present invention is not limited thereto, but the present invention can also run multiple virtual machine comprising isomorphism (such as identical) operating system on the same device, such as in the present invention, identical operating system, such as Android can be run on each virtual machine, but support different operating environments respectively in these operating systems.
In addition, although the present invention is described to run two virtual machine instances, the present invention also can be used for running plural virtual machine, i.e. a foreground virtual machine and multiple background virtual machine.Should also be noted that said half virtual driver contains the driver of tradition half virtual driver and software emulation herein.
Figure 1A and Figure 1B respectively illustrates the state of system architecture according to the present invention before virtual machine switches and the state after this switching.Figure 1A show flat computer 100 with the virtual machine running (SuSE) Linux OS for the snapshot during virtual machine of foreground, Figure 1B shows this flat computer 100 and the virtual machine running Windows operating system is being switched to the snapshot after the virtual machine of foreground.
As can be seen from Figure 1A, flat computer 100 is just at front stage operation (SuSE) Linux OS 104, and wherein this (SuSE) Linux OS runs on the first virtual machine.Due to the first virtual machine (in other words on it run operating system or operating environment) foreground display and there is all primary platform hardwares, be therefore now foreground virtual machine.In addition, in figure ia, also have the second virtual machine (not shown) on backstage as background virtual machine, the second virtual machine runs Windows operating system (not shown) simultaneously.
On (SuSE) Linux OS on the virtual machine of foreground, user can realize various working environments, such as, click control desk icon 106, realize programmed environment with the capable prompt window 107 of display command.User can also realize other working environment on this linux system, such as, simulate, the linux system such as emulation is suitable for the working environment that realizes.
As shown in the figure, to show on foreground as the first virtual machine of foreground virtual machine and there is nearly all primary platform hardware, making the (SuSE) Linux OS that it runs can provide the Consumer's Experience of exclusive operating system.And this Linux can access all platform hardwares with primary (Native) performance, make user can realize on Linux respective environment with high-performance.
Show flat computer 100 in fig. ib and the second virtual machine running Windows operating system is being switched to the state after the virtual machine of foreground.As can be seen from Figure 1B, flat computer 100 is just in front stage operation Windows operating system 105, and wherein this Windows operating system is on the second virtual machine.Due to the second virtual machine (in other words on it run operating system or operating environment) foreground display and there is all primary platform hardwares, be therefore now foreground virtual machine.In addition, in fig. ib, also have aforementioned first virtual machine (not shown) on backstage as background virtual machine simultaneously.
In Windows operating system on the virtual machine of foreground, user can realize entertainment environment, pay environment, text editing environment etc.Such as, user can click game icon 109, to enter game environment; Click paid icon 107 to enter payment environment; Or click Office icon 108 to enter text editing environment.
As shown in the figure, to show on foreground as the second virtual machine of foreground virtual machine and there is all primary platform hardwares, making the Windows operating system that it runs can provide the Consumer's Experience of exclusive operating system.And this Windows can access all platform hardwares with primary (Native) performance, make user can realize on Windows respective environment with high-performance.
One of first virtual machine and the second virtual machine can be switched to foreground virtual machine so that the operating environment of realizing ideal by various mode by user, and such as user can press the specific physical button physical button of the such as flat computer 100 (, as volume+key 101 and volume-key 102, Home key 103 etc.), phonetic entry etc.
In the present invention, foreground virtual machine directly has platform hardware equipment and can lead directly to technology to realize by straight-through " PCI Pass-through " technology of so-called PCI equipment and miscellaneous equipment, (present) Raw device is shown to client computer by hypervisor, this technology is that prior art is known, in order to not fuzzy the present invention, not in this to go forth.And the contextual preservation/recovery of platform device can realize by using the hang-up/recovering process of the device driver in guest operating systems (Guest OS).Hang-up/recovering process in driver is as known in the art equally, is not launched in detail at this.
Fig. 2 shows according to system architecture 200 of the present invention.System architecture 200 comprises two virtual machines, i.e. the first virtual machine 201(VM1 that operate in supersystem manager (Hypervisor) on physical machine or VMM 207 and generate) and the second virtual machine (VM2) 202, described virtual machine is managed by virtual machine monitor (VMM) 207.Although it should be pointed out that at this and show two virtual machines at this, the present invention is equally applicable to plural virtual machine.
First virtual machine 201 comprises driver 203.Driver 203 can be primary (Native) driver, also can be the associating driver (said half virtual driver contains the driver of tradition half virtual driver and software emulation herein) combined together with driver by primary driver and half virtual driver or software emulation.Associating driver is for supporting that the part of background system activates, and this will be described in more detail in figure 3.
First virtual machine 201 also comprises handoff manager 204.This handoff manager 204, for the switching of managing virtual machines, is initiatively initiated AM/BAM virtual machine in any case and is switched.Such as, handoff manager 204 can preserve various switching law, switching hot key that user is arranged etc.
First virtual machine 201 also comprises context preservation/recovering process 205.This context preservation/recovering process 205 for before the handover for preserve platform device context as the virtual machine of foreground virtual machine and this virtual machine is again switched back after the virtual machine of foreground the platform device context preserved by the recovery of this virtual machine.Context preservation/recovering process 205 can use hang-up/recovering process well known in the prior art.Such as, the equipment that context preservation/recovering process 205 reuses operating system hangs up characteristic to ask Raw device driver that equipment state is saved in storer and then homing device makes this equipment enter original state (likely stateless).Rejuvenation is a contrary process.
In addition, as shown in Figure 2, the first virtual machine 201 has virtual machine CPU, virutal machine memory and other virtual unit.First virtual machine 201 can access these equipment by known Intel Virtualization Technology.Such as, supersystem manager, when intercepting the access of passenger plane OS to memory device, carries out subregion to memory device and provides virtual storage device access to passenger plane OS.Should be understood that at this, because physical memory and physical storage device (not shown) are used for multiple virtual machine by supersystem manager virtual (i.e. subregion and remap), therefore the first virtual machine only can see a part for physical memory and physical storage device, the part physical memory distributing to the first virtual machine and physical storage device when running as foreground virtual machine.In like manner, the second virtual machine also has corresponding internal memory and memory device.
Second virtual machine 202 has driver 203 ', handoff manager 204 ' and context preservation/recovering process 205 ' equally, and the function class of the corresponding assembly of these assemblies and the first virtual machine 201 seemingly, is not just repeated at this.For the second virtual machine, but driver 203 ' can be primary driver inertia when the second virtual machine is background virtual machine, but also can be the associating driver of primary driver and half virtual driver composition and select half virtual driver to support some particular device to access or operation (will further describe in figure 3 about associating driver and part activation).Note, these assemblies are with " ' " illustrate, to represent that they may because of different in different virtual machine, that is, the version of certain assembly in the first virtual machine may be different from its version in the second virtual machine.In addition, the second virtual machine 202 also has corresponding virtual cpu, virtual memory and other virtual unit.
System architecture 200 comprises virtual machine monitor VMM(in the present invention, used interchangeably by virtual machine VMM and supersystem manager Hypervisor, they all refer to the higher level's program for managing virtual machines run directly on physical machine) virtual machine switch 206 in 207.Because the context preservation/recovering process in each virtual machine can self-supporting platform device context Save and restore, the virtual machine switch 206 primary responsibility CPU switching state therefore in supersystem manager.During virtual machine switches, the CPU state of foreground virtual machine is saved to internal memory, and the state of new foreground virtual machine (a upper background virtual machine) is resumed.
As shown in Figure 2, current second virtual machine 202 is switched to foreground virtual machine, its virtual cpu, virtual memory and other virtual unit are mapped to physical cpu, physical memory and other physical equipment (this mapping illustrates with solid line in fig. 2) by PCI is straight-through, therefore the second virtual machine 202 with primary performance access platform hardware device, can make the performance improving foreground virtual machine.And the first virtual machine 201 current be background virtual machine, its virtual cpu, virtual memory and other virtual unit are not mapped to corresponding physical equipment (this mapping is shown in broken lines in fig. 2).In addition, virtual machine switch 206 calls instruction context preservation/recovering process 205 to preserve the platform device context of respective virtual machine each switching, and after this virtual machine be switched back to foreground virtual machine again, call instruction context preservations/recovering process 205 think that this virtual machine recovers the corresponding platform device context of preserving, realize thus simply, virtual machine switching fast.
At this, platform device context preservation/rejuvenation is as follows:
(1) hereafter preservation/recovering process 205 that handoff manager 204 notifies in the virtual machine of foreground preserve device context state and alternatively by device reset to its original state (such as security, after making each switching, other virtual machine all can not see the equipment content of the sensitivity of previous operation virtual machine);
(2) hereafter preservation/recovering process 205 notifies that each device driver enters suspended state by reusing equipment suspend process.Then device context is saved in storer by driver; And
(3) after preservation device context, the hereafter preservation/recovering process 205 in the virtual machine of foreground uses overshoot to notify that supersystem manager performs virtual machine and switches with (Hypercall).This will preserve the state (comprising CPU state) of last virtual machine and recover the state (comprising CPU state) of background virtual machine.
The rejuvenation of platform context is similar to preservation process, and just order is contrary, is not just repeated at this.
In addition, foreground virtual machine can utilize primary power management policy, because foreground virtual machine has the exclusive access to all hardware equipment as in primary platform.Such as, the Android operation system in virtual machine adopts dynamic power management mechanism, and this mechanism makes driver automatically enter low power consumpting state at one's leisure.
In addition, background virtual machine can not have action, saves system resource with this.But in some cases it is expected that virtual machine still can receive and process some particular event during being in backstage.For this reason, virtual machine may use part primary (Native) driver with access portion visual plant, such as network driver and memory device driver when running as background virtual machine, make virtual machine only can accesses network or memory device when running as background virtual machine, and other operates, such as will be directed into null device to the access of miscellaneous equipment, and be directed to null device background virtual machine will be stoped to access respective physical equipment, effectively background virtual machine is limited to thus and only accesses specified equipment, reduce system complexity thus.The above-mentioned part activation of background virtual machine will be described in more detail by composition graphs 3 below.
Fig. 3 shows the system architecture 300 that the above-mentioned part for realizing background virtual machine activates.Although it should be pointed out that this embodiment illustrates for the access of background virtual machine to network interface card at this, the present invention is not limited thereto, but the present invention also allows equipment, such as memory device, video card, keyboard etc. beyond background virtual machine access network interface card.
As can be seen from system architecture 300, foreground virtual machine 301 comprises network interface card back-end services 303, and network interface card back-end services 303 runs to be allowed background virtual machine 302 to access network interface card (in figure shown in four-headed arrow) by software simulation in foreground virtual machine 301.Background virtual machine 302 also comprises corresponding network interface card back-end services 303 ', but now inertia, be therefore indicated by the dashed box.
Foreground virtual machine 301 also comprises associating driver 312, if associating driver 312 comprises primary NIC driver 304 and half virtual NIC driver 306(is miscellaneous equipment, is the native drivers for relevant device and half virtual driver; At this only for network interface card).Foreground virtual machine 301 uses primary NIC driver 304(to represent with dash box owing to being in foreground) directly to access network interface card with primary performance, background virtual machine 302 then use half virtual NIC driver 306 ' (representing with dash box) in case such as there being corresponding network data, as network interface card can be visited by the network interface card back-end services 303 operated in foreground virtual machine 301 when network packet arrives.Foreground virtual machine 301 also comprises primary/hardware abstraction layer driver 307 and accesses other platform device, such as video card, sound card etc. for primary performance.
Handoff manager 305 and 305 ' in foreground virtual machine 301 and background virtual machine 302 carries out virtual machine switching for coordinating switch 309, and detail is see the description of composition graphs 2.
The part activation process of background virtual machine 302 is as follows: when the network packet not for background virtual machine 302 arrives, background virtual machine 302 keeps idle to save system resource, and the CPU scheduler 308 in VMM 311 will not dispatch the virtual cpu (not shown) in background virtual machine 302.And when there is the network packet for background virtual machine 302, first the NIC driver 304 in foreground virtual machine 301 receives this network packet, is then delivered to back-end services 303.Then back-end services 303 receives this event, and these network packet are delivered to background virtual machine 302; Then, the CPU scheduler 308 in VMM 311 dispatches virtual cpu in background virtual machine 302 to process described network packet; Once the virtual cpu of background virtual machine 302 is scheduled, then this virtual cpu just performs part scheduling thread (partial_activation thread) and dispatches other operating system thread (OS thread) to process the network packet imported into by network interface card back-end services 303.
In like manner, back-end services 301 can also support the access to memory device (such as embedded multi-media card eMMC), seemingly, just VMM 311 uses intercepting and capturing the access of memory device and carrying out subregion by simulation to memory device for each virtual machine with remapping for this and the aforementioned access classes to network interface card.
In addition, in this embodiment, back-end services access network interface card and memory device is only allowed.If back-end services attempts the equipment beyond access network interface card and memory device, then for the sake of security, guest operating systems and VMM 311 will realize empty hardware mode (NULL-HW) to walk around described accessing operation, that is, sky hardware will be directed into the access of the equipment beyond network interface card and memory device.Such as, this can be realized by the hook (Hook) in hardware abstraction layer HAL or device driver layer.
In addition, except the specific hardware that definition background devices can be accessed, additionally can also define data or event type that backstage hardware can receive and process, that is, the data except specified data or event type or event type are not directed into background virtual machine; Even if or physical equipment have received such event, supersystem manager does not also distribute such event type to background virtual machine.This such as also can arrange message or data type and filter and realize by being additional to above-mentioned part activation in the present invention.
In the present invention, activate scheme by above-mentioned part, can reduce background virtual machine on the impact of system overall performance and energy consumption while, make background operating system still can process certain event where necessary, thus better Consumer's Experience be provided.
Fig. 4 shows the process flow diagram 400 according to the method for running multiple virtual machine of the present invention.
In step 402, generate the first virtual machine and the second virtual machine by the supersystem manager operated on physical machine.Supersystem manager also can generate more virtual machine.
In step 404, run the first virtual machine as foreground virtual machine (FVM) in host operating system, wherein foreground virtual machine has nearly all primary platform device.Foreground virtual machine, owing to having primary platform device, therefore can be accessed these platform devices with primary performance, system performance is greatly improved.At this, " nearly all " refers to, except the equipment be virtualized because of virtual machine isolation, the equipment that foreground virtual machine is seen is basically identical with this physical platform.
In step 406, run the second virtual machine as background virtual machine (BVM).Background virtual machine can not have operation, saves system resource with this.But background system also partly can be activated conduct interviews to particular device or operate specific data type or type of message, to exchange the Consumer's Experience of raising for certain system overhead.
In step 408, be that the first virtual machine preserves the first platform device context.This such as can be performed by the corresponding operating system on the first virtual machine, and such as, the first platform device context can by the hereafter preservation/recovering process 205(in described operating system see Fig. 2) be kept at correct position sentence be provided with after recover.
In step 410, hang up the first virtual machine by supersystem manager.
In step 412, the second virtual machine is switched to foreground virtual machine from background virtual machine, and the first virtual machine switches to background virtual machine from foreground virtual machine.Second virtual machine has nearly all primary platform device equally after switching to foreground virtual machine, therefore also can access these platform devices with primary performance.
In step 414, the first virtual machine is switched to foreground virtual machine from background virtual machine, and the second virtual machine switches to background virtual machine from foreground virtual machine.Equally, this step impliedly comprises: preserve the second platform device context by the second virtual machine and after being switched back to foreground virtual machine, recover the second platform device context at the second virtual machine; And hang up the second virtual machine by supersystem manager.
In step 416, recover the first platform device context.First platform device context can by hereafter preservation/recovering process 205(see Fig. 2) recover.After recovery, the first virtual machine can have most native platform equipment immediately, and can access these primary platform devices with primary performance.
In like manner, also again the second virtual machine can be switched to foreground virtual machine from background virtual machine, and be used in the second platform device context preserved above and come to be that the second virtual machine recovers the second platform device context.By that analogy, no matter be which systematic evaluation is returned foreground virtual machine, corresponding platform device context can be recovered.
Although some embodiments of the present invention have given description in present specification, it will be apparent for a person skilled in the art that these embodiments only exemplarily illustrate.It may occur to persons skilled in the art that numerous flexible programs, replacement scheme and improvement project and do not exceed scope of the present invention.Appended claims is intended to limit scope of the present invention, and contains the method and structure in the scope of these claims itself and equivalents thereof by this.

Claims (14)

1., for running a method for multiple virtual machine on the computing device, comprise the following steps:
The first virtual machine and the second virtual machine (402) is generated by the supersystem manager operated on physical machine;
Run the first virtual machine as foreground virtual machine (FVM), wherein foreground virtual machine has nearly all primary platform device (404);
The second virtual machine (406) is run as background virtual machine (BVM);
The first platform device context (408) is preserved by the first virtual machine;
The first virtual machine (410) is hung up by supersystem manager;
Second virtual machine is switched to foreground virtual machine from background virtual machine, and the first virtual machine switches to background virtual machine (412) from foreground virtual machine;
First virtual machine is switched to foreground virtual machine from background virtual machine, and the second virtual machine switches to background virtual machine (414) from foreground virtual machine; And
Recover the first platform device context (416).
2. method according to claim 1, wherein foreground virtual machine uses primary driver.
3. method according to claim 1, wherein background virtual machine installs primary driver, but background virtual machine inertia.
4. method according to claim 1, supersystem manager interception guest operating systems to the access of memory device, and carries out subregion to memory device and provides virtual storage device access to guest operating systems.
5. method according to claim 1, first virtual machine and the second virtual machine use associating driver, described associating driver comprises the primary driver for designated equipment and the half virtual driver for designated equipment, wherein the first and second virtual machines are as the primary driver for designated equipment used during the virtual machine of foreground in associating driver and as the half virtual driver for designated equipment in use associating driver during background virtual machine, and the access of background virtual machine to the equipment beyond described designated equipment is directed into null device.
6. method according to claim 5, wherein said designated equipment comprises network interface card.
7. method according to claim 6, wherein background virtual machine keeps idle when not importing packet into and do not have the timer event dispatched, and when there is the timer event importing packet into or there is scheduling, background virtual machine imports packet or timer event into described in partly activating to process.
8. method according to claim 1, wherein on the first virtual machine, run the first operating system and run the second operating system on the second virtual machine, and in the first operating system and the second operating system, wherein run corresponding working environment and/or private environment respectively and/or pay environment.
9., according to the method one of claim 1 to 8 Suo Shu, wherein said switching presses hot button by user or hot button is initiated.
10., according to the method one of claim 1 to 8 Suo Shu, wherein said switching is initiated by overshoot by the application program in virtual machine.
11. methods according to claim 2, wherein foreground virtual machine reuses primary operating system electric power management mechanism.
12. methods according to claim 1, wherein foreground virtual machine resets to corresponding hardware device after preservation platform device context simultaneously.
13. methods as claimed in claim 12, wherein said reset is resetted by the functional level of PCI equipment and realizes, or realize by resetting to pci bus and then automatically reset to the equipment under this pci bus, or realized by the reseting interface that equipment carries.
14. 1 kinds of computing equipments, this computing equipment has:
Storer, it stores executable instruction;
Processor, it is configured to perform executable instruction to perform the step of method according to claim 1.
CN201510008023.1A 2015-01-07 2015-01-07 Efficient and safe virtualization method for mobile equipment and equipment thereof Active CN104598294B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510008023.1A CN104598294B (en) 2015-01-07 2015-01-07 Efficient and safe virtualization method for mobile equipment and equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510008023.1A CN104598294B (en) 2015-01-07 2015-01-07 Efficient and safe virtualization method for mobile equipment and equipment thereof

Publications (2)

Publication Number Publication Date
CN104598294A true CN104598294A (en) 2015-05-06
CN104598294B CN104598294B (en) 2021-11-26

Family

ID=53124112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510008023.1A Active CN104598294B (en) 2015-01-07 2015-01-07 Efficient and safe virtualization method for mobile equipment and equipment thereof

Country Status (1)

Country Link
CN (1) CN104598294B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068859A (en) * 2015-07-29 2015-11-18 上海谐桐信息技术有限公司 Cross-virtual-machine multi-service calling method and system
CN106254312A (en) * 2016-07-15 2016-12-21 浙江宇视科技有限公司 A kind of method and device being realized server attack protection by virtual machine isomery
WO2017005143A1 (en) * 2015-07-03 2017-01-12 Huawei Technologies Co., Ltd. Method and apparatus for managing virtual execution environments using contextual information fragments
CN106406974A (en) * 2015-07-30 2017-02-15 中兴通讯股份有限公司 High-performance timer implementation method used for virtual machine, and virtual machine
CN106445658A (en) * 2015-07-29 2017-02-22 罗伯特·博世有限公司 Method and device for operating changing guest systems under a hypervisor
CN107229452A (en) * 2016-03-23 2017-10-03 单正建 A kind of mobile intelligent terminal operating system
WO2018039967A1 (en) * 2016-08-31 2018-03-08 深圳前海达闼云端智能科技有限公司 Virtual machine switching method and apparatus, electronic device, and computer program product
WO2018119811A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Method, device, and electronic apparatus for simultaneous operation of multiple virtual machines
WO2018119810A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Context processing method, device, and electronic apparatus for switching process between multiple virtual machines
CN109074275A (en) * 2018-03-15 2018-12-21 深圳前海达闼云端智能科技有限公司 Hardware controlling method, device, electronic equipment and computer-readable medium
CN109189523A (en) * 2018-08-08 2019-01-11 广东微云科技股份有限公司 A kind of method, system and the method for closing virtual machine of judgement idle virtual machine
CN111290837A (en) * 2020-05-07 2020-06-16 翱捷科技(上海)有限公司 Method for constructing lightweight virtualization system
CN113626148A (en) * 2021-08-03 2021-11-09 浙江中电远为科技有限公司 Terminal virtual machine generation system and method based on hybrid virtualization

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101187880A (en) * 2006-11-15 2008-05-28 联想(北京)有限公司 Dummy machine system and its video card usage method
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN101788926A (en) * 2009-12-28 2010-07-28 中兴通讯股份有限公司 Resource allocation method and device for switching J2ME (Java 2 Micro Edition) application platform
CN102291428A (en) * 2010-06-21 2011-12-21 英特尔公司 Method for network interface sharing among multiple virtual machines
US20130263130A1 (en) * 2012-03-30 2013-10-03 Nec Corporation Virtualization system, switch controller, fiber-channel switch, migration method and migration program
CN103744851A (en) * 2013-10-25 2014-04-23 中国科学院计算技术研究所 Process information monitoring system and method in virtual environment
CN103927227A (en) * 2014-04-16 2014-07-16 乐视致新电子科技(天津)有限公司 Method and device for switching multiple operating systems and smart television
CN104025050A (en) * 2011-12-28 2014-09-03 Ati科技无限责任公司 Changing between virtual machines on a graphics processing unit
US20140359619A1 (en) * 2012-01-30 2014-12-04 Lg Electronics Inc. Method for managing virtual machine and device therefor

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101187880A (en) * 2006-11-15 2008-05-28 联想(北京)有限公司 Dummy machine system and its video card usage method
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN101788926A (en) * 2009-12-28 2010-07-28 中兴通讯股份有限公司 Resource allocation method and device for switching J2ME (Java 2 Micro Edition) application platform
US20120258722A1 (en) * 2009-12-28 2012-10-11 Gang Liu Resource Allocation Method and Device for Foreground Switch of J2ME Application
CN102291428A (en) * 2010-06-21 2011-12-21 英特尔公司 Method for network interface sharing among multiple virtual machines
CN104025050A (en) * 2011-12-28 2014-09-03 Ati科技无限责任公司 Changing between virtual machines on a graphics processing unit
US20140359619A1 (en) * 2012-01-30 2014-12-04 Lg Electronics Inc. Method for managing virtual machine and device therefor
US20130263130A1 (en) * 2012-03-30 2013-10-03 Nec Corporation Virtualization system, switch controller, fiber-channel switch, migration method and migration program
CN103744851A (en) * 2013-10-25 2014-04-23 中国科学院计算技术研究所 Process information monitoring system and method in virtual environment
CN103927227A (en) * 2014-04-16 2014-07-16 乐视致新电子科技(天津)有限公司 Method and device for switching multiple operating systems and smart television

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
XIAORUI WANG等: "Design_of_communications_model_in_double_systems_based_on_multi-core_platform", 《2010 2ND INTERNATIONAL CONFERENCE ON FUTURE COMPUTER AND COMMUNICATION》 *
YAOZU DONG等: "HYVI_A_HYbrid_VIrtualization_Solution_Balancing_Performance_and_Manageability", 《IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS ( VOLUME: 25, ISSUE: 9, SEPT. 2014)》 *
张文涛: "基于I/O性能的虚拟机资源调度算法研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *
杨洪波: "高性能网络虚拟化技术研究", 《中国博士学位论文全文数据库 信息科技辑》 *

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017005143A1 (en) * 2015-07-03 2017-01-12 Huawei Technologies Co., Ltd. Method and apparatus for managing virtual execution environments using contextual information fragments
US20170371700A1 (en) * 2015-07-03 2017-12-28 Huawei Technologies Co., Ltd. Method and Apparatus for Managing Virtual Execution Environments Using Contextual Information Fragments
CN107615245A (en) * 2015-07-03 2018-01-19 华为技术有限公司 Utilize the method and apparatus of contextual information fragment management virtual execution environment
CN105068859A (en) * 2015-07-29 2015-11-18 上海谐桐信息技术有限公司 Cross-virtual-machine multi-service calling method and system
CN106445658A (en) * 2015-07-29 2017-02-22 罗伯特·博世有限公司 Method and device for operating changing guest systems under a hypervisor
CN105068859B (en) * 2015-07-29 2017-12-15 上海谐桐信息技术有限公司 A kind of more service calling methods and system across virtual machine
CN106406974B (en) * 2015-07-30 2020-07-17 中兴通讯股份有限公司 High-performance timer implementation method for virtual machine and virtual machine
CN106406974A (en) * 2015-07-30 2017-02-15 中兴通讯股份有限公司 High-performance timer implementation method used for virtual machine, and virtual machine
CN107229452A (en) * 2016-03-23 2017-10-03 单正建 A kind of mobile intelligent terminal operating system
CN106254312B (en) * 2016-07-15 2019-12-13 浙江宇视科技有限公司 method and device for achieving server attack prevention through virtual machine heterogeneous
CN106254312A (en) * 2016-07-15 2016-12-21 浙江宇视科技有限公司 A kind of method and device being realized server attack protection by virtual machine isomery
WO2018039967A1 (en) * 2016-08-31 2018-03-08 深圳前海达闼云端智能科技有限公司 Virtual machine switching method and apparatus, electronic device, and computer program product
US10901766B2 (en) 2016-12-29 2021-01-26 Cloudminds (Shenzhen) Robotics Systems Co., Ltd. Method and apparatus for simultaneously running multiple virtual machines, and electronic device
CN111052081A (en) * 2016-12-29 2020-04-21 深圳前海达闼云端智能科技有限公司 Context processing method and device in multi-virtual machine switching process and electronic equipment
WO2018119810A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Context processing method, device, and electronic apparatus for switching process between multiple virtual machines
WO2018119811A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Method, device, and electronic apparatus for simultaneous operation of multiple virtual machines
US10922126B2 (en) 2016-12-29 2021-02-16 Cloudminds (Shenzhen) Robotics Systems Co., Ltd. Context processing method and apparatus in switching process of multiple virtual machines, and electronic device
WO2019174010A1 (en) * 2018-03-15 2019-09-19 深圳前海达闼云端智能科技有限公司 Hardware control method and apparatus, electronic device, and computer-readable medium
CN109074275A (en) * 2018-03-15 2018-12-21 深圳前海达闼云端智能科技有限公司 Hardware controlling method, device, electronic equipment and computer-readable medium
CN109189523A (en) * 2018-08-08 2019-01-11 广东微云科技股份有限公司 A kind of method, system and the method for closing virtual machine of judgement idle virtual machine
CN111290837A (en) * 2020-05-07 2020-06-16 翱捷科技(上海)有限公司 Method for constructing lightweight virtualization system
CN113626148A (en) * 2021-08-03 2021-11-09 浙江中电远为科技有限公司 Terminal virtual machine generation system and method based on hybrid virtualization
CN113626148B (en) * 2021-08-03 2024-02-09 浙江中电远为科技有限公司 Terminal virtual machine generation system and method based on hybrid virtualization

Also Published As

Publication number Publication date
CN104598294B (en) 2021-11-26

Similar Documents

Publication Publication Date Title
CN104598294A (en) Efficient and safe virtualization method for mobile equipment and equipment thereof
Cadden et al. SEUSS: skip redundant paths to make serverless fast
Hong et al. GPU virtualization and scheduling methods: A comprehensive survey
US7421533B2 (en) Method to manage memory in a platform with virtual machines
US8966477B2 (en) Combined virtual graphics device
CN109522087B (en) Virtual mechanism building method and system based on domestic Shenwei processor
US8312195B2 (en) Managing interrupts using a preferred binding between a device generating interrupts and a CPU
WO2016095383A1 (en) Method for implementing application call and virtual machine
CN101714091B (en) Methods and systems to display platform graphics during operating system initialization
EP3120238B1 (en) Access isolation for multi-operating system devices
US9164784B2 (en) Signalizing an external event using a dedicated virtual central processing unit
Semnanian et al. Virtualization technology and its impact on computer hardware architecture
KR20070100367A (en) Method, apparatus and system for dynamically reassigning memory from one virtual machine to another
US10002016B2 (en) Configuration of virtual machines in view of response time constraints
US20130227556A1 (en) Guest-driven host execution
WO2018040845A1 (en) Method and apparatus for scheduling computing resource
CN106462451A (en) Interruption handling method and relevant device of virtual platform
US20150347169A1 (en) Scheduler limited virtual device polling
CN115988217A (en) Virtualized video coding and decoding system, electronic equipment and storage medium
CN103064724A (en) Virtual mechanism constructing method and device
US9557980B2 (en) Seamless application integration apparatus and method
CN111213127A (en) Virtualization operation for directly assigned devices
US20160124763A1 (en) Limited virtual device polling based on virtual cpu pre-emption
US9569241B2 (en) Sharing devices assigned to virtual machines using runtime exclusion
US11237859B2 (en) Securing virtual machines in computer systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20161123

Address after: 100193 Beijing, Haidian District, northeast Wang West Road, building 8, floor 2A, room, room two, room 5

Applicant after: MASSCLOUDS INNOVATION Research Institute (BEIJING) OF INFORMATION TECHNOLOGY

Address before: Spring Street 315000 Zhejiang city in Ningbo Province, 38 Lane 11, room 304

Applicant before: Yang Xueshi

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: Room 901, No. 28-1, Jingqi Road, Shizhong District, Jinan City, Shandong Province

Applicant after: Qian Yun Shuchuang (Shandong) Information Technology Research Institute Co.,Ltd.

Address before: 100193 Room 204, Area 2A, Second Floor, Building 5, 8 Wangxi Road, Haidian District, Beijing

Applicant before: MASSCLOUDS INNOVATION Research Institute (BEIJING) OF INFORMATION TECHNOLOGY

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230420

Address after: Room 201-2, Building 1-2, Zhongke New Economy Science and Technology Innovation Center, Cuizhai Street, Xianxian District, Jinan City, Shandong Province, 251401

Patentee after: Shandong Guoshu Development Co.,Ltd.

Address before: Room 901, No. 28-1, Jingqi Road, Shizhong District, Jinan City, Shandong Province

Patentee before: Qian Yun Shuchuang (Shandong) Information Technology Research Institute Co.,Ltd.

TR01 Transfer of patent right