A kind of data card virtualization implementation method based on equipment simulating
Technical field
The present invention relates to a kind of data card virtualization implementation method based on equipment simulating.
Background technology
Virtualization, refer to computing element on the basis of virtual rather than real on the basis of run, be one for streamlining management, optimize the solution of resource, the capacity of hardware can be expanded by virtual words technology, simplify the re-configuration process of software, it is allowed to a platform runs multiple operating system simultaneously, and application program can run in separate space and be independent of each other, thus significantly improves the work efficiency of computer.
In computer virtualized, virtual machine manager (VMM) simulation bottom hardware, the interface accessing virtual unit is provided for virtual machine subsystem (Guest OS).VMM can be divided into two kinds of mode of operations substantially: Full-virtualization (Fullvirtualization) and half virtualizes (Paravirtualization).In Full-virtualization, physical equipment is shared between virtual machine subsystem and is used, and the I/O of subsystem accesses and captured by VMM, device model be simulated.In Full-virtualization technology, VMM provides the capture support of sub-system I/O operation.Mapping for I/O internal memory, VMM typically captures by the way of page fault;Then, these I/O operations carry out dissection process by equipment simulating model module;Finally, equipment simulating model module is driven by local device and operates real hardware device.Existing device virtualization is it is generally required to hardware is supported specially, and this is by complicated for the design making data card;The virtual data card number that hardware virtualization is provided that is limited by hardware resource.
Summary of the invention
It is an object of the invention to overcome the deficiencies in the prior art, there is provided a kind of need not hardware to carry out specialized designs, can provide separate between virtual subdata card, each subdata card in virtual subnet module, do not interfere with each other and possess the data card virtualization implementation method based on equipment simulating of shift function.
It is an object of the invention to be achieved through the following technical solutions: a kind of data card virtualization implementation method based on equipment simulating, it includes that an equipment initialization step and an I/O mouth read-write process step, and described equipment initialization step comprises the following steps:
S101: distribution simulator resource distribution object;
S102: by virtual subnet data card information registering to virtual machine submodule;
S103: generate corresponding device node name according to initializing the data card type specified;
S104: I/O mouth read-write operation is processed function and registers;
The application of the I/O mouth read-write scope of S105: virtual subnet data card;
S106: terminate Initialize installation;
Described I/O mouth read-write processes step and includes that I/O mouth reading processes step and I/O mouth writes process step, and described I/O mouth reading processes step and comprises the following steps:
S2011: obtaining I/O mouth read operation instruction, the data being read I/O mouth judge;
S2012: judge whether the data that I/O mouth reads are DMA transfer address register data, if DMA transfer address register data, then performs step S2013, otherwise performs step S2014;
Data in S2013: reading DMA transmission address register, and return the data processing costs in DMA transfer address register, complete I/O mouth digital independent and process;
S2014: judge whether the data that I/O mouth reads are controlled state register data, if controlled state register data, then performs step S2015, otherwise performs step S2016;
S2015: read the data in controlled state depositor, returns the data processing costs in controlled state depositor, completes I/O mouth digital independent and processes;
S2016: return 0, completes I/O mouth digital independent and processes;
Described I/O mouth is write process step and is comprised the following steps:
S2021: obtaining the instruction of I/O mouth write operation, the data being read I/O mouth judge;
S2022: judge whether the data that I/O mouth is read are DMA address flag register data, if DMA address flag register data, then performs step S2023, otherwise jumps to step S2026;
S2023: the data in the DMA address flag register that will read are transmitted to truthful data card apparatus;
S2024: read the data in truthful data card apparatus, as in the DMA address depositor in return value write virtual machine submodule;
S2025: complete I/O mouth and write process step;
S2026: judge whether the data that I/O mouth is read are DMA transfer address register data, if DMA transfer address register data, then performs step S2027, otherwise performs step S2028;
S2027: the data read are write the DMA transfer address register specified, completes I/O mouth and write process;
S2028: judge whether the data that I/O mouth is read are controlled state register data, if controlled state register data, then performs step S2029, otherwise performs step S2030;
S2029: the interrupt identification of the specific bit in controlled state depositor and virtual subnet data card is reset, completes I/O mouth and write process;
S2030: be not responding to operation, complete I/O mouth and write process.
Described a kind of based on equipment simulating data card virtualization implementation method, it also includes that an equipment moves into step and equipment is moved out step, and described equipment step of moving into comprises the following steps:
S3011: read data, the data in DMA address depositor and controlled state depositor are recovered;
S3012: read data, recovers the communication session context environment that Virtualization Subsystems is relevant;
S3013: the equipment of completing is moved into;
Described equipment step of moving out comprises the following steps:
S3021: preserve the data message in DMA address depositor and controlled state depositor;
S3022: obtain the context environmental of the relevant communication session of Virtualization Subsystems, and preserve;
S3023: the equipment of completing is moved out.
The invention has the beneficial effects as follows: need not carrying out specialized designs, thus improve the virtualized range of data card;Can arrange between multiple subdata card, and each subdata card separate, complementary interference;And there is equipment transportation function.
Accompanying drawing explanation
Fig. 1 is the block system diagram overview of the present invention;
Fig. 2 is the equipment initialization flowchart of the present invention;
Fig. 3 is that the I/O mouth of the present invention reads process chart;
Fig. 4 is that the I/O mouth of the present invention writes process chart;
Fig. 5 is that the equipment of the present invention is moved into flow chart;
Fig. 6 is that the equipment of the present invention is moved out flow chart.
Detailed description of the invention
Technical scheme is described in further detail below in conjunction with the accompanying drawings, but protection scope of the present invention is not limited to the following stated.
The block system diagram overview of the present invention is as shown in Figure 1, it includes that virtual machine submodule, data card virtualization modules, data card drive module and data card equipment, data card virtualization modules includes equipment simulating model unit, rm-cell and migration management unit, equipment simulating model unit drives module and virtual machine submodule to be connected with rm-cell, data card respectively, and rm-cell is connected with migration management unit;Described digital card equipment includes migrating support module, migrates support module and is connected with migration management unit, and migration management unit also drives module to be connected with data card.
In FIG, equipment simulating model unit is for producing the object instance of virtual subnet data card, and initialize its configuration space parameter, then object instance is registered to the pci bus (being similar to insert the action of PCI encrypted card) of virtual machine submodule, finally the processing method that I/O reads and writes is registered to VMM;Rm-cell is for preserving the facility information of virtual subnet encrypted card, controlled state depositor and transmission address;Data card drives module to be used for processing the access of other depositor, and result is sent to data card equipment;Migration management unit is for responding the migration order of VMM, and it will access rm-cell during moving out/moving into, and drive the migration of module accesses data card equipment to support function by data card;Migrate support module for responding the migration order of migration management unit, import/derive in data card equipment the context environmental of communication session involved by virtual subnet data card.
Described controlled state depositor is for simulating the interrupt control state of virtual subnet data card, and it represents interruption source with binary digit, equipment simulating model unit carry out set according to equipment response, and reset by I/O request by virtual subnet module;Described transmission address distribution in the virtual subnet modular system preserving virtual subnet data card obtains DMA transfer address, and its value is by virtual subnet module by I/O request write, and equipment simulating model unit carries out data interaction by DMA transfer address and Virtualization Subsystems;The context environmental of described communication session includes the data resource that the logging status of communication session, communication session use, such as: mode of operation, key etc..
As shown in Fig. 2,3,4,5 and 6, a kind of data card virtualization implementation method based on equipment simulating, it includes that an equipment initialization step and I/O mouth read-write process step, and described equipment initialization step comprises the following steps:
S101: distribution simulator resource distribution object;
S102: by virtual subnet data card information registering to virtual machine submodule;
S103: generate corresponding device node name according to initializing the data card type specified;
S104: I/O mouth read-write operation is processed function and registers;
The application of the I/O mouth read-write scope of S105: virtual subnet data card;
S106: terminate Initialize installation;
Described I/O mouth read-write processes step and includes that I/O mouth reading processes step and I/O mouth writes process step, and described I/O mouth reading processes step and comprises the following steps:
S2011: obtaining I/O mouth read operation instruction, the data being read I/O mouth judge;
S2012: judge whether the data that I/O mouth reads are DMA transfer address register data, if DMA transfer address register data, then performs step S2013, otherwise performs step S2014;
Data in S2013: reading DMA transmission address register, and return the data processing costs in DMA transfer address register, complete I/O mouth digital independent and process;
S2014: judge whether the data that I/O mouth reads are controlled state register data, if controlled state register data, then performs step S2015, otherwise performs step S2016;
S2015: read the data in controlled state depositor, returns the data processing costs in controlled state depositor, completes I/O mouth digital independent and processes;
S2016: return 0, completes I/O mouth digital independent and processes;
Described I/O mouth is write process step and is comprised the following steps:
S2021: obtaining the instruction of I/O mouth write operation, the data being read I/O mouth judge;
S2022: judge whether the data that I/O mouth is read are DMA address flag register data, if DMA address flag register data, then performs step S2023, otherwise jumps to step S2026;
S2023: the data in the DMA address flag register that will read are transmitted to truthful data card apparatus;
S2024: read the data in truthful data card apparatus, as in the DMA address depositor in return value write virtual machine submodule;
S2025: complete I/O mouth and write process step;
S2026: judge whether the data that I/O mouth is read are DMA transfer address register data, if DMA transfer address register data, then performs step S2027, otherwise performs step S2028;
S2027: the data read are write the DMA transfer address register specified, completes I/O mouth and write process;
S2028: judge whether the data that I/O mouth is read are controlled state register data, if controlled state register data, then performs step S2029, otherwise performs step S2030;
S2029: the interrupt identification of the specific bit in controlled state depositor and virtual subnet data card is reset, completes I/O mouth and write process;
S2030: be not responding to operation, complete I/O mouth and write process.
Described a kind of based on equipment simulating data card virtualization implementation method, it also includes that an equipment moves into step and equipment is moved out step, and described equipment step of moving into comprises the following steps:
S3011: read data, the data in DMA address depositor and controlled state depositor are recovered;
S3012: read data, recovers the communication session context environment that Virtualization Subsystems is relevant;
S3013: the equipment of completing is moved into;
Described equipment step of moving out comprises the following steps:
S3021: preserve the data message in DMA address depositor and controlled state depositor;
S3022: obtain the context environmental of the relevant communication session of Virtualization Subsystems, and preserve;
S3023: the equipment of completing is moved out.
The method can make data card equipment present at least one virtual subnet data card in virtual machine submodule, for virtual machine submodule.