CN100472451C - Dummy machine system and its hardware access method - Google Patents
Dummy machine system and its hardware access method Download PDFInfo
- Publication number
- CN100472451C CN100472451C CNB2006100763906A CN200610076390A CN100472451C CN 100472451 C CN100472451 C CN 100472451C CN B2006100763906 A CNB2006100763906 A CN B2006100763906A CN 200610076390 A CN200610076390 A CN 200610076390A CN 100472451 C CN100472451 C CN 100472451C
- Authority
- CN
- China
- Prior art keywords
- operating system
- client operating
- hardware device
- transformational relation
- hardware
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention provides a virtual machine system and a hardware access method, wherein the virtual machine comprises a service operation system, a client operation system, a virtual machine detector and hardware, the service operation system comprises a device module and a drive module, the client operation system comprises a scan module and a drive module, the virtual machine detector comprises a resource convert module for storing the conversion relationship between the resource of the hardware distributed by the service operation system and the resource of the hardware provided by the service operation system, distributed by the client operation system, when the client operation system sends out a request for accessing the hardware, the resource convert module can convert the access address of the client operation system into the real physical address of relative hardware, via the conversion relationship. The invention can improve access efficiency of hardware of virtual machine system, when user can watch and use real hardware.
Description
Technical field
The present invention relates to a kind of virtual machine technique, particularly relate to a kind of dummy machine system and hardware access method thereof.
Background technology
In existing virtualization process, a general virtual unit platform is all arranged, comprise virtual sound card, virtual video card etc., (Virtual Machine Monitor VMM) has access to the visit of client operating system (Guest OS) to the virtual unit in the virtual unit platform on the real hardware by service operations system (Service OS) or host operating system (Host OS) by virtual machine monitor.
Fig. 1 is the synoptic diagram of existing Xen dummy machine system.As shown in Figure 1, the Xen dummy machine system comprises client operating system, service operations system, virtual machine monitor and hardware.Wherein, provide in the client operating system and use and driver module, the service operations system have EM equipment module (DeviceModel, DM) and driver module.
Illustrate that hereinafter with reference to Fig. 2 client operating system is to the access hardware process in above-mentioned Xen dummy machine system.
Before client operating system carried out hardware access, at first, the service operations system was when starting, the scanning pci bus, being the hardware Resources allocation, comprising IRQ, IO and MMIO etc., is that client operating system generates the virtual hardware platform by EM equipment module when creating client operating system;
Client operating system scans virtual pci bus when starting, be the virtual hardware Resources allocation.After client operating system is the virtual hardware Resources allocation, can conduct interviews to equipment I O.
Process when the specific descriptions client operating system carries out equipment I O visit below:
Client operating system sends corresponding IO request by the virtual hardware driver module when needs access hardware IO space;
Virtual machine monitor is intercepted and captured the IO request that the driver module of client operating system sends, and the IO request is sent to EM equipment module in the service operations system;
EM equipment module converts thereof into corresponding call instruction after analyzing the IO request, calls relevant hardware after converting call instruction to the IO instruction by the driver module of service operations system;
After obtaining Hardware Response Delay, the service operations system should respond and pass to client operating system by virtual machine monitor, thereby finished client operating system to access hardware.
Be the access process of example explanation client operating system just more than to hardware device with the Xen dummy machine system, for other dummy machine systems, as the VMware dummy machine system, also carry out similar access process, just the work that the service operations system of Xen dummy machine system is done is finished by host operating system.
Because existing dummy machine system can't solve the sharing problem of a plurality of client operating systems to real hardware, therefore, in above-mentioned general virtual platform, no matter what real hardware platform is, the virtual equipment that comes out is all consistent, all be suitable for for each client operating system although it is so, but following problem can occur:
1) hardware device of dummy machine system demonstration is inconsistent with real hardware device, and the user can't see real hardware;
2) in addition, some characteristics of real hardware can't be used, as the hardware-accelerated characteristic of video card, and the new standard of USB, the advanced feature of sound card etc.;
3) because therefore client operating system need increase corresponding pilot process by just having access to hardware after virtual machine monitor and the service operations system, will have influence on the performance of hardware access like this.
Summary of the invention
The objective of the invention is, a kind of dummy machine system is provided.
Another object of the present invention is that a kind of dummy machine system hardware access method is provided.
A kind of dummy machine system, comprise service operations system, client operating system, virtual machine monitor and hardware device, the service operations system comprises EM equipment module and driver module, and client operating system comprises scan module and driver module, and virtual machine monitor comprises the resource modular converter.Described resource modular converter is used for the transformational relation of resource between the two of the hardware device distribution that resource that stores service operating system distributes for hardware device and client operating system provide for described client operating system the service operations system; And when client operating system sent the request of access hardware devices, described resource modular converter was used for according to above-mentioned transformational relation the reference address of client operating system being changed into the actual physical address of corresponding hardware device.
A kind of dummy machine system hardware access method comprises step:
Step 600 during the client operating system access hardware devices, produces corresponding request of access;
Step 610, virtual machine monitor are intercepted and captured described request of access, and the reference address of client operating system are changed into the actual physical address of corresponding hardware device according to the transformational relation of storing in advance in the resource modular converter of virtual machine monitor;
Step 620, after access hardware devices, virtual machine monitor will be visited the result and will be given to client operating system.
Compared with prior art, the invention has the beneficial effects as follows:
1) hardware device of dummy machine system demonstration is consistent with real hardware device, and the user can see and use real hardware;
2) because client operating system can directly or by virtual machine monitor have access to real hardware, improved the efficient of dummy machine system hardware access like this.
Description of drawings
Fig. 1 is the synoptic diagram of existing Xen dummy machine system;
Fig. 2 is the process flow diagram of client operating system access hardware devices in the dummy machine system shown in Figure 1;
Fig. 3 is the structural representation of dummy machine system of the present invention;
Fig. 4 is the process flow diagram of dummy machine system resources allocation of the present invention;
Fig. 5 is the process flow diagram of hardware access method in the dummy machine system of the present invention.
Embodiment
Below in conjunction with description of drawings dummy machine system of the present invention and hardware access method thereof.
Fig. 3 is the structural representation of dummy machine system of the present invention.As shown in Figure 3, dummy machine system of the present invention comprises service operations system, client operating system, virtual machine monitor and hardware.Wherein, the service operations system comprises EM equipment module and driver module, client operating system comprises scan module and driver module, in order to realize the direct access hardware of client operating system, virtual machine monitor comprises the resource modular converter, for example, IRQ modular converter, IO modular converter and MMIO mapping block.
With a client operating system is example, in the present invention, for resolution system internal memory and hardware are made DMA (Direct Memory Access, the direct memory visit) problem of operation, originally the address that operated in the virtual machine monitor of low memory is moved on to high memory from the low memory, that is, make the physical memory addresses of client operating system consistent with the memory address of machine.
Before the client operating system access hardware, need service operations system and client operating system that resources such as IRQ, the IO of hardware and MMIO are distributed, Fig. 4 is the process flow diagram of dummy machine system resources allocation of the present invention.
As shown in Figure 4, the service operations system is when starting, and the scanning pci bus is that hardware device distributes resources such as IRQ, IO and MMIO, the IRQ, the IO that distribute, MMIO etc. is write the pci configuration space of each hardware device.
EM equipment module provides hardware device according to the client operating system that is set to of configuration file, the hardware device of directly visiting for needs, obtain the real information of equipment from the service operations system, and these equipment are suspended on the virtual pci bus, when client operating system starts the virtual pci bus of back scanning, real information notice client operating system with hardware device allows client operating system see real hardware device.
Client operating system distributes resources such as IRQ, IO, MMIO to the service operations system for its hardware device that provides when the virtual pci bus of scanning.
Because each client operating system all can distribute resources such as IRQ, IO, MMIO to the hardware device that the service operations system provides, the service operations system distributes resources such as IRQ, IO, MMIO to all hardware devices, like this, when client operating system carries out resources allocation with service operating system to same hardware device, may produce conflict.
Under the situation that has conflict, in order to avoid a conflict, in the present invention, scanning virtual pci bus at client operating system is that hardware device is when distributing IRQ, IO, MMIO resource, EM equipment module is intercepted and captured assignment information by virtual machine monitor, resources allocation to client operating system is resolved, client operating system and service operating system are set up mapping relations to the resources allocation of hardware device, just, will set up corresponding relation between resources allocation and service operations system the resources allocation of client operating system to hardware device to hardware device.
Then, EM equipment module is issued to resource modular converter in the virtual machine monitor with the mapping relations of setting up, promptly, IO that EM equipment module is distributed client operating system and the transformational relation of IRQ are issued to the IO modular converter and the IRQ modular converter of virtual machine monitor respectively, and the MMIO mapping relations are issued to the MMIO mapping block of virtual machine monitor, the MMIO map addresses that client operating system is distributed is given on the MMIO address of hardware device to the service operations system assignment.
Followingly hardware access method in the dummy machine system of the present invention is described with reference to Fig. 5.
When client operating system needed access hardware devices, its driver module produced corresponding IO request;
Virtual machine monitor is intercepted and captured this IO request, and after the IO request changed into the true IO address (real physical address) of corresponding hardware device by the IO modular converter with the IO address (reference address) of client operating system, direct access hardware devices;
After the virtual machine monitor access hardware devices, will visit the result and be given to client operating system.
In addition, when the client operating system access hardware, also can the MMIO that client operating system distributes be mapped to physics MMIO (the MMIO address of service operations system assignment) by the MMIO mapping block.When page table error (Page Fault) took place, virtual machine monitor write shadow page table (Shadow Page Tables) with the true address of MMIO correspondence.Customer service system can directly have access to the MMIO address of equipment by the shadow page table of VMM foundation like this.
When hardware device produced interruption, the interruption that virtual machine monitor produces hardware device according to transformational relation by the IRQ modular converter changed into the interrupt number of client operating system and issues client operating system again.
Like this, by EM equipment module and virtual machine monitor, client operating system can directly have access to real hardware device.
When client operating system carries out resources allocation with service operating system to same hardware device, if the IO resource of the two distribution is not conflicted, so can be by revising VMCS (Virtual-Machine ControlStructure, virtual machine control structure) data in, VM exit (virtual machine withdraws from) does not take place when making the client operating system access hardware devices, just replace above-mentioned IO modular converter, just can directly have access to the IO address of hardware by revising VMCS.
From foregoing description as can be seen, with respect to existing dummy machine system and hardware access method, the present invention has the following advantages:
1) hardware device of dummy machine system demonstration is consistent with real hardware device, and the user can see and use real hardware;
2) because client operating system can directly or by virtual machine monitor have access to real hardware, improved the efficient of dummy machine system hardware access like this.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.
Claims (14)
1. dummy machine system, comprise service operations system, client operating system, virtual machine monitor and hardware device, the service operations system comprises EM equipment module and driver module, client operating system comprises scan module and driver module, it is characterized in that, virtual machine monitor comprises the resource modular converter
Described resource modular converter is used for the transformational relation of resource between the two of the hardware device distribution that resource that stores service operating system distributes for hardware device and client operating system provide for described client operating system the service operations system, and,
When client operating system sent the request of access hardware devices, described resource modular converter was used for according to above-mentioned transformational relation the reference address of client operating system being changed into the actual physical address of corresponding hardware device.
2. dummy machine system as claimed in claim 1, it is characterized in that, described resource modular converter comprises the input and output modular converter, be used for storing the input and output transformational relation of described transformational relation, and when client operating system sends the input and output request, the reference address of client operating system is changed into the actual physical address of corresponding hardware device according to the input and output transformational relation.
3. dummy machine system as claimed in claim 1 or 2, it is characterized in that, described resource modular converter comprises memory-mapped input and output mapping block, be used for storing the memory-mapped input and output mapping transformational relation of described transformational relation, when the client operating system access hardware devices, the memory-mapped input and output that client operating system is distributed are mapped to physical memory mapping input and output.
4. dummy machine system as claimed in claim 1 or 2, it is characterized in that, described resource modular converter further comprises the interrupt request modular converter, be used for storing the interrupt request transformational relation of described transformational relation, and when hardware device produce to interrupt, the interruption that hardware device is produced according to the interrupt request transformational relation was issued client operating system after changing into the interrupt number of client operating system.
5. dummy machine system as claimed in claim 3, it is characterized in that, described resource modular converter further comprises the interrupt request modular converter, be used for storing the interrupt request transformational relation of described transformational relation, and when hardware device produce to interrupt, the interruption that hardware device is produced according to the interrupt request transformational relation was issued client operating system after changing into the interrupt number of client operating system.
6. dummy machine system as claimed in claim 1 or 2 is characterized in that the physical memory addresses of client operating system is consistent with the memory address of machine.
7. dummy machine system as claimed in claim 3 is characterized in that the physical memory addresses of client operating system is consistent with the memory address of machine.
8. dummy machine system as claimed in claim 4 is characterized in that the physical memory addresses of client operating system is consistent with the memory address of machine.
9. a dummy machine system hardware access method is characterized in that, comprises step:
Step 600 during the client operating system access hardware devices, produces corresponding request of access;
Step 610, virtual machine monitor are intercepted and captured described request of access, and the reference address of client operating system are changed into the actual physical address of corresponding hardware device according to the transformational relation of storing in advance in the resource modular converter of virtual machine monitor;
Step 620, after access hardware devices, virtual machine monitor will be visited the result and will be given to client operating system.
10. method as claimed in claim 9 is characterized in that, generates the described step of the transformational relation of storage in advance and comprises:
Step 700, service operations system are when starting, and the scanning pci bus is the hardware device Resources allocation, the resource of distributing is write the pci configuration space of each hardware device;
Step 710, EM equipment module provides hardware device according to the client operating system that is set to of configuration file, and when client operating system starts the virtual pci bus of back scanning, with the real information notice client operating system of hardware device;
Step 720 when client operating system scans virtual pci bus, is its hardware device Resources allocation that provides to EM equipment module in the service operations system;
Step 730, EM equipment module is intercepted and captured resource allocation information by virtual machine monitor, client operating system and service operating system are set up transformational relation to the resources allocation of hardware device, and the transformational relation of setting up is issued to resource modular converter in the virtual machine monitor.
11. method as claimed in claim 10 is characterized in that, described transformational relation comprises input and output transformational relation and/or memory-mapped input and output mapping relations.
12. method as claimed in claim 11, it is characterized in that, described transformational relation further comprises the interrupt request transformational relation, and when hardware device produce to interrupt, the interruption that virtual machine monitor produces hardware device according to the interrupt request transformational relation was issued client operating system after changing into the interrupt number of client operating system.
13., it is characterized in that the physical memory addresses of client operating system is consistent with the memory address of machine as each described method of claim 9 to 12.
14. as each described method of claim 9 to 12, it is characterized in that,
Virtual machine does not take place when making the client operating system access hardware devices and withdraws from the data by in the modification virtual machine control structure, thereby directly has access to the I/O Address of hardware device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100763906A CN100472451C (en) | 2006-04-20 | 2006-04-20 | Dummy machine system and its hardware access method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100763906A CN100472451C (en) | 2006-04-20 | 2006-04-20 | Dummy machine system and its hardware access method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101059761A CN101059761A (en) | 2007-10-24 |
CN100472451C true CN100472451C (en) | 2009-03-25 |
Family
ID=38865878
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100763906A Active CN100472451C (en) | 2006-04-20 | 2006-04-20 | Dummy machine system and its hardware access method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100472451C (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106797388A (en) * | 2016-12-29 | 2017-05-31 | 深圳前海达闼云端智能科技有限公司 | Cross-system multi-medium data decoding method, device, electronic equipment and computer program product |
Families Citing this family (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101464843B (en) * | 2007-12-17 | 2011-05-25 | 联想(北京)有限公司 | Method for sharing display card in multiple operating systems and computer system thereof |
CN101685404B (en) * | 2008-09-28 | 2013-06-05 | 联想(北京)有限公司 | Device and method for dynamically switching equipment in virtual environment |
CN101739283B (en) * | 2008-11-20 | 2013-12-25 | 联想(北京)有限公司 | Computer and method for virtual system to directly access computer hardware |
CN101751283B (en) * | 2008-12-18 | 2016-06-01 | 联想(北京)有限公司 | Virtual machine monitor, dummy machine system and client operation system state acquiring method |
CN101847105B (en) * | 2009-03-26 | 2013-09-04 | 联想(北京)有限公司 | Computer and internal memory sharing method of a plurality of operation systems |
CN102096594B (en) * | 2009-12-14 | 2014-04-23 | 联想(北京)有限公司 | Method and device for using system resources in memory |
US8489789B2 (en) * | 2010-02-05 | 2013-07-16 | Advanced Micro Devices, Inc. | Interrupt virtualization |
CN102193816B (en) * | 2010-03-12 | 2014-01-08 | 中国长城计算机深圳股份有限公司 | Equipment distribution method and system |
US8966477B2 (en) * | 2011-04-18 | 2015-02-24 | Intel Corporation | Combined virtual graphics device |
CN102325178A (en) * | 2011-09-07 | 2012-01-18 | 西安交通大学 | Virtual non-volatile flash storage device equipment designing method based on hypervisor framework |
CN103246544B (en) * | 2013-04-09 | 2016-02-24 | 何钦淋 | virtual hardware driving method |
CN105874764B (en) * | 2014-12-10 | 2019-03-19 | 华为技术有限公司 | Computer and device access method |
CN106293925A (en) * | 2015-05-25 | 2017-01-04 | 宇龙计算机通信科技(深圳)有限公司 | A kind of method and device of multiple Application share hardware device |
CN106055389A (en) * | 2016-08-18 | 2016-10-26 | 中国联合网络通信集团有限公司 | Virtual machine mapping method and virtual machine mapping system |
CN107783913B (en) * | 2016-08-31 | 2021-12-03 | 华为技术有限公司 | Resource access method applied to computer and computer |
CN110119637B (en) * | 2018-02-07 | 2023-04-14 | 联发科技股份有限公司 | Hardware control method and hardware control system |
CN110399174B (en) * | 2019-07-29 | 2023-05-02 | 普华基础软件股份有限公司 | Equipment management system and method |
CN113111025B (en) * | 2021-06-10 | 2021-09-24 | 深圳市科力锐科技有限公司 | PCI equipment mapping method, device, equipment and storage medium |
CN114880658A (en) * | 2022-04-21 | 2022-08-09 | 华为技术有限公司 | Method for processing data in vehicle and related equipment |
-
2006
- 2006-04-20 CN CNB2006100763906A patent/CN100472451C/en active Active
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106797388A (en) * | 2016-12-29 | 2017-05-31 | 深圳前海达闼云端智能科技有限公司 | Cross-system multi-medium data decoding method, device, electronic equipment and computer program product |
CN106797388B (en) * | 2016-12-29 | 2020-11-10 | 深圳前海达闼云端智能科技有限公司 | Cross-system multimedia data encoding and decoding method and device, electronic equipment and computer program product |
Also Published As
Publication number | Publication date |
---|---|
CN101059761A (en) | 2007-10-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100472451C (en) | Dummy machine system and its hardware access method | |
CN100472452C (en) | Method for switching a system of virtual machine and hardware devices | |
CN101751284B (en) | I/O resource scheduling method for distributed virtual machine monitor | |
US10970104B2 (en) | Resource access method applied to computer and computer | |
CN101088078B (en) | One step address translation method and system for graphics addresses in virtualization | |
US7739417B2 (en) | Method, apparatus and system for seamlessly sharing a graphics card amongst virtual machines | |
CN100570562C (en) | Video card, the dummy machine system of using this video card and display processing method | |
CN106445628A (en) | Virtualization method, apparatus and system | |
CN103034524A (en) | Paravirtualized virtual GPU | |
KR20070100367A (en) | Method, apparatus and system for dynamically reassigning memory from one virtual machine to another | |
CN104123233A (en) | Virtual machine high-capacity memory sharing method | |
CN101697134A (en) | Method for supporting quick start of similar virtual machine | |
CN101739283A (en) | Computer and method for virtual system to directly access computer hardware | |
CN104503825A (en) | Mixed type equipment virtualization method based on KVM (Kernel-based Virtual Machine) | |
US10318460B2 (en) | UMA-aware root bus selection | |
CN103995733A (en) | Lightweight nested virtualization implementation method based on physical resource penetration mechanism | |
CN111090531B (en) | Method for realizing distributed virtualization of graphic processor and distributed system | |
CN103782273A (en) | Memory allocation method, program, and system | |
CN102096594B (en) | Method and device for using system resources in memory | |
CN113626148B (en) | Terminal virtual machine generation system and method based on hybrid virtualization | |
US10140218B2 (en) | Non-uniform memory access support in a virtual environment | |
CN102622245A (en) | Virtual machine automatic-starting control method under sun4v architecture | |
CN117453352B (en) | Equipment straight-through method under Xen | |
CN117592039B (en) | Flexibly managed hardware virtualization system and method | |
CN114978589B (en) | Lightweight cloud operating system and construction method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |