[go: up one dir, main page]

CN102193816B - A device allocation method and system - Google Patents

A device allocation method and system Download PDF

Info

Publication number
CN102193816B
CN102193816B CN201010123525.6A CN201010123525A CN102193816B CN 102193816 B CN102193816 B CN 102193816B CN 201010123525 A CN201010123525 A CN 201010123525A CN 102193816 B CN102193816 B CN 102193816B
Authority
CN
China
Prior art keywords
client
virtual
access
bios
control
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.)
Expired - Fee Related
Application number
CN201010123525.6A
Other languages
Chinese (zh)
Other versions
CN102193816A (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.)
China Great Wall Technology Group Co ltd
Original Assignee
China Great Wall Computer Shenzhen Co Ltd
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 China Great Wall Computer Shenzhen Co Ltd filed Critical China Great Wall Computer Shenzhen Co Ltd
Priority to CN201010123525.6A priority Critical patent/CN102193816B/en
Publication of CN102193816A publication Critical patent/CN102193816A/en
Application granted granted Critical
Publication of CN102193816B publication Critical patent/CN102193816B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明适用于计算机技术领域,提供了一种设备分配方法及系统,所述方法包括下述步骤:系统上电,在物理BIOS中启动双显卡,完成初始化操作;控制对虚拟系统BIOS进行I/O访问的初始化设置;通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,控制设备的DMA操作直接访问到客户机的内存空间;在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,所述MMIO操作可直接访问硬件,实现设备的高效虚拟化和分配。

The present invention is applicable to the technical field of computers, and provides a device allocation method and system, said method comprising the steps of: powering on the system, starting dual graphics cards in the physical BIOS, and completing the initialization operation; controlling the I/O of the virtual system BIOS O access initialization settings; intercept the DMA transmission of the device through DMA remapping hardware, and control the address conversion, and control the DMA operation of the device to directly access the memory space of the client; when the device with BIOS is allocated, by setting the client The machine shadow page table directly maps the I/O device to the MMIO space of the client, and the MMIO operation can directly access the hardware to realize efficient virtualization and allocation of the device.

Description

一种设备分配方法及系统A device allocation method and system

技术领域technical field

本发明属于计算机技术领域,尤其涉及一种设备分配方法及系统。The invention belongs to the technical field of computers, and in particular relates to a device allocation method and system.

背景技术Background technique

在计算机领域,虚拟机对物理资源的虚拟可以归结为三个主要任务:处理器虚拟化、内存虚拟化和I/O虚拟化,其中,I/O访问密集型系统对整个虚拟化系统造成的影响远大于计算机密集型,I/O虚拟化是制约系统性能的瓶颈,将影响整个系统的稳定性和性能。In the computer field, the virtualization of physical resources by virtual machines can be attributed to three main tasks: processor virtualization, memory virtualization, and I/O virtualization. The impact is far greater than computer-intensive, and I/O virtualization is the bottleneck restricting system performance, which will affect the stability and performance of the entire system.

在现有技术中,I/O设备虚拟化可以归纳为类虚拟化、设备虚拟化和直接分配虚拟化。In the prior art, I/O device virtualization can be classified into class virtualization, device virtualization and direct allocation virtualization.

类虚拟化系统中客户机操作系统不使用任何现有的硬件设备驱动,而是使用一种前后端交互的设备驱动来发送I/O请求和接收I/O反馈。处于客户机操作系统内的一端成为前端设备驱动,处于Domain0一端成为后端设备驱动。类虚拟化设备驱动区分设备型号,而使每个设备类型使用一种设备驱动,前端驱动和后端驱动问通过事件通道机制进行异步通信,这种方式通过修改客户机操作系统的驱动程序,使得设备驱动可以通过虚拟机监控器提供的接口直接与硬件设备交互,但是缺乏通用性、不利于推广。In the quasi-virtualization system, the guest operating system does not use any existing hardware device driver, but uses a front-end and back-end interactive device driver to send I/O requests and receive I/O feedback. The end in the client operating system becomes the front-end device driver, and the end in Domain0 becomes the back-end device driver. The class virtualization device driver distinguishes the device model, and each device type uses a device driver. The front-end driver and the back-end driver communicate asynchronously through the event channel mechanism. In this way, the driver of the guest operating system is modified to make The device driver can directly interact with the hardware device through the interface provided by the virtual machine monitor, but it lacks versatility and is not conducive to promotion.

在设备虚拟化系统中,虚拟机监控器需要对某一目标设备进行模拟,为客户机提供一个虚拟的设备,使其可以透明地对这个虚拟设备进行操作,客户机操作系统发现虚拟的目标设备后,会使目标设备的驱动程序来驱动该设备,客户机中的驱动程序会发出一些请求并等待设备的响应,虚拟机监控器拦截并处理所有的设备请求,并将响应返回给客户机操作系统,客户机的原有驱动程序无需修改就能驱动虚拟设备,但是频繁的切换和复杂的软件设计带来客户机性能损失。In the device virtualization system, the virtual machine monitor needs to simulate a certain target device, provide a virtual device for the client, so that it can transparently operate on the virtual device, and the guest operating system discovers the virtual target device Finally, the driver of the target device will drive the device, the driver in the client will issue some requests and wait for the response of the device, the virtual machine monitor intercepts and processes all device requests, and returns the response to the client operation The system and the original driver of the client can drive the virtual device without modification, but frequent switching and complex software design will cause performance loss of the client.

因此,现有技术提供的包括类虚拟化和设备虚拟化技术方案对I/O设备的虚拟,影响系统的稳定性和性能,存在较大的缺陷。Therefore, the virtualization of I/O devices in the technical solutions including class virtualization and device virtualization provided by the prior art affects the stability and performance of the system, and has relatively large defects.

发明内容Contents of the invention

本发明实施例的目的在于提供一种设备分配方法,旨在解决现有技术提供的包括类虚拟化和设备虚拟化技术方案对I/O设备的虚拟,影响系统的稳定性和性能,存在较大的缺陷的问题。The purpose of the embodiments of the present invention is to provide a method for device allocation, which aims to solve the problem of virtualization of I/O devices in the technical solutions including class virtualization and device virtualization provided by the prior art, which affects the stability and performance of the system. Big flaw problem.

本发明实施例是这样实现的,一种设备分配方法,所述方法包括下述步骤:The embodiment of the present invention is achieved in this way, a device allocation method, the method includes the following steps:

系统上电,在物理BIOS中启动双显卡,完成初始化操作;Power on the system, start the dual graphics card in the physical BIOS, and complete the initialization operation;

控制对虚拟系统BIOS进行I/O访问的初始化设置;Control the initialization settings for I/O access to the virtual system BIOS;

通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,通过在系统内存的低端划出一块区域,将其分配给客户系统,使客户系统中的客户机页面号与机器页面号相等,控制设备的DMA操作直接访问到客户机的内存空间;The DMA transmission of the device is intercepted by the DMA remapping hardware, and the address translation is controlled, and an area is allocated at the low end of the system memory to allocate it to the client system, so that the client page number and the machine page number in the client system Equal, the DMA operation of the control device directly accesses the memory space of the client;

在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,对于没有页对齐的设备,控制虚拟机监控器扫描PCI总线,控制将所述没有页对齐的MMIO地址改为页对齐,所述MMIO操作可直接访问硬件。When the device with BIOS is allocated, the I/O device is directly mapped to the MMIO space of the client by setting the client shadow page table. For devices without page alignment, control the virtual machine monitor to scan the PCI bus, and the control will The MMIO address without page alignment is changed to page alignment, and the MMIO operation can directly access hardware.

本发明实施例的另一目的在于提供一种设备分配系统,所述设备分配系统内置于计算机,所述系统包括:Another object of the embodiments of the present invention is to provide an equipment allocation system, the equipment allocation system is built into a computer, and the system includes:

初始化操作模决,用于系统上电,在物理BIOS中启动双显卡,完成初始化操作;The initialization operation mode is used to power on the system, start the dual graphics card in the physical BIOS, and complete the initialization operation;

设置模块,用于控制对虚拟系统BIOS进行I/O访问的初始化设置;A setting module is used to control the initial setting of I/O access to the virtual system BIOS;

DMA重映射控制模块,用于通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,通过在系统内存的低端划出一块区域,将其分配给客户系统,使客户系统中的客户机页面号与机器页面号相等,控制设备的DMA操作直接访问到客户机的内存空间;以及The DMA remapping control module is used to intercept the DMA transmission of the device through the DMA remapping hardware, and control the address translation, and allocate a low-end area of the system memory to the client system, so that the client system The client page number is equal to the machine page number, and the DMA operation of the control device directly accesses the memory space of the client; and

BIOS设备分配控制模块,用于在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,对于没有页对齐的设备,控制虚拟机监控器扫描PCI总线,控制将所述没有页对齐的MMIO地址改为页对齐,所述MMIO操作可直接访问硬件。The BIOS device allocation control module is used to directly map the I/O device to the MMIO space of the client by setting the shadow page table of the client when the device with the BIOS is allocated, and to control the virtual machine for the device without page alignment The monitor scans the PCI bus, controls to change the MMIO address without page alignment into page alignment, and the MMIO operation can directly access hardware.

在本发明实施例中,系统上电,在物理BIOS中启动双显卡,完成初始化操作;控制对虚拟系统BIOS进行I/O访问的初始化设置;通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,控制设备的DMA操作直接访问到客户机的内存空间;在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,所述MMIO操作可直接访问硬件,实现设备的高效虚拟化和分配。In the embodiment of the present invention, the system is powered on, the dual graphics cards are started in the physical BIOS, and the initialization operation is completed; the initialization setting of I/O access is controlled to the virtual system BIOS; the transmission of the DMA of the device is intercepted by the DMA remapping hardware, and Control the address conversion, and control the DMA operation of the device to directly access the memory space of the client; when the device with BIOS is allocated, the I/O device is directly mapped to the MMIO space of the client by setting the client shadow page table , the MMIO operation can directly access the hardware, realizing efficient virtualization and allocation of devices.

附图说明Description of drawings

图1是本发明实施例提供的设备分配方法的实现流程图;FIG. 1 is a flow chart of an implementation of a device allocation method provided by an embodiment of the present invention;

图2是本发明实施例提供的DMA重映射机制的示意图;FIG. 2 is a schematic diagram of a DMA remapping mechanism provided by an embodiment of the present invention;

图3是本发明实施例提供的设备直接分配模型示意图;Fig. 3 is a schematic diagram of a device direct allocation model provided by an embodiment of the present invention;

图4是本发明实施例提供的设备分配系统的结构框图。Fig. 4 is a structural block diagram of an equipment allocation system provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

在本发明实施例中,系统上电,控制物理基本输入输出系统(BasicInput-output System,BIOS)和显卡BIOS启动,完成初始化操作;控制对虚拟系统BIOS进行I/O访问的初始化设置;通过直接存储访问(Direct MemoryAccess,DMA)重映射硬件截获设备的DMA的传输,并控制进行地址转换,控制设备的DMA操作直接访问到客户机的内存空间;在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,所述MMIO操作可直接访问硬件。In the embodiment of the present invention, the system is powered on, and the physical basic input-output system (BasicInput-output System, BIOS) and graphics card BIOS are controlled to start, and the initialization operation is completed; the initialization setting of I/O access is controlled to the virtual system BIOS; through direct Storage access (Direct Memory Access, DMA) remapping hardware intercepts the transmission of the DMA of the device, and controls the address conversion, and the DMA operation of the control device directly accesses the memory space of the client; when the device with BIOS is allocated, by setting the client The machine shadow page table directly maps the I/O device to the MMIO space of the client, and the MMIO operation can directly access the hardware.

图1示出了本发明实施例提供的设备分配方法的实现流程,其具体的步骤如下所述:Figure 1 shows the implementation process of the device allocation method provided by the embodiment of the present invention, and its specific steps are as follows:

在步骤S101中,系统上电,在物理BIOS中启动双显卡,完成初始化操作。In step S101, the system is powered on, and the dual graphics cards are started in the physical BIOS to complete the initialization operation.

在步骤S102中,控制对虚拟系统BIOS进行I/O访问的初始化设置。In step S102, the initialization setting of I/O access to the BIOS of the virtual system is controlled.

在本发明实施例中,控制对虚拟系统BIOS进行I/O访问的初始化设置的方式有多种,下述实施例给出了三种,但不用以限制本发明:In the embodiment of the present invention, there are multiple ways to control the initial setting of I/O access to the virtual system BIOS, and the following embodiments provide three, but not to limit the present invention:

1.对目标客户机之外的其他客户机隐藏需要分配的设备,隐藏的方式是在拥有硬件设备的客户机/宿主机家在驱动程序前,先给药分配出去的设备加载一个伪驱动作为占位符,由于没有真正的驱动程序,该设备就不会被目标客户机之外的其他客户机访问。1. Hide the devices that need to be allocated from other clients other than the target client. The hidden method is to load a pseudo-driver on the allocated device before the driver program is installed on the client/host with the hardware device Placeholder, since there is no real driver, the device cannot be accessed by clients other than the intended client.

2.控制虚拟件监控器截获客户机访问的虚拟I/O地址空间,根据预先建立客户机访问的虚拟I/O地址与设备的真实I/O地址的转换表,把I/O请求转发到设备的真实I/O地址空间。2. Control the virtual part monitor to intercept the virtual I/O address space accessed by the client, and forward the I/O request to the The real I/O address space of the device.

预先建立客户机访问的虚拟I/O地址与设备的真实I/O地址的转换表,报告虚拟的周边元件扩展接口(Peripheral Component Interconnection,PCI)BAR给客户机。当客户机访问到虚拟的I/O地址空间时,虚拟机监控器控制截获访问操作,并通过上述转换表把I/O请求转发到设备的真实I/O地址空间。Pre-establish the conversion table between the virtual I/O address accessed by the client and the real I/O address of the device, and report the virtual Peripheral Component Interconnection (PCI) BAR to the client. When the client computer accesses the virtual I/O address space, the virtual machine monitor controls and intercepts the access operation, and forwards the I/O request to the real I/O address space of the device through the above translation table.

3.将为设备生成的虚拟的PCI配置空间挂接在虚拟PCI总线上。3. The virtual PCI configuration space generated for the device is attached to the virtual PCI bus.

为设备生成虚拟的PCI配置空间,将生成的虚拟PCI配置空间以一个虚拟设备的形式挂接在虚拟PCI总线上,当客户操作系统枚举总线时,即可发现设备并加载正确的驱动程序。Generate a virtual PCI configuration space for the device, attach the generated virtual PCI configuration space to the virtual PCI bus in the form of a virtual device, and when the guest operating system enumerates the bus, it can discover the device and load the correct driver.

在步骤S103中,通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,控制设备的DMA操作直接访问到客户机的内存空间。In step S103, the DMA transmission of the device is intercepted by the DMA remapping hardware, and the address conversion is controlled to control the DMA operation of the device to directly access the memory space of the client computer.

在本发明实施例中,上述步骤的执行是在VT-d技术平台下完成,如图2所示,VT-d技术在北桥引入DMA重映射硬件。In the embodiment of the present invention, the execution of the above steps is completed under the VT-d technology platform. As shown in FIG. 2 , the VT-d technology introduces DMA remapping hardware into the north bridge.

在启动VT-d的平台上,设备所有的DMA传输都被DMA重映射硬件截获,根据设备对应的I/O页表,硬件可以对DMA的地址进行转换,使设备只能访问到规定的内存。On the platform that starts VT-d, all DMA transfers of the device are intercepted by the DMA remapping hardware. According to the I/O page table corresponding to the device, the hardware can convert the DMA address so that the device can only access the specified memory .

在步骤S104中,在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,所述MMIO操作可直接访问硬件。在本发明实施例中,由于设备的多样性,无法提供一套同类设备的通用BIOS,因此,对于具有BIOS的设备,将设备BIOS区域直接映射到客户地址空间的相同区域,然后在客户影子页表中,根据P2M表写入正确的页表项,客户操作系统可直接进行BIOS调用,控制硬件设备。In step S104, when the device with the BIOS is allocated, the I/O device is directly mapped to the MMIO space of the client by setting the shadow page table of the client, and the MMIO operation can directly access the hardware. In the embodiment of the present invention, due to the diversity of devices, it is impossible to provide a set of common BIOS for similar devices. Therefore, for devices with BIOS, the device BIOS area is directly mapped to the same area of the client address space, and then the client shadow page In the table, according to the correct page table entry written in the P2M table, the guest operating system can directly call the BIOS to control the hardware device.

作为本发明的一个实施例,如图3所示:客户操作系统所有的PCI配置空间的访问及数据访问操作均会被虚拟机监控器截获后,转发给设备模拟器,然后对虚拟化设备通过虚拟机监控器访问硬件设备;对于直接分配设备通过MMIO(Memory Mapped I/O)和DMA直接访问硬件数据;具有BIOS的设备在直接分配时,通过客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,客户机的MMIO操作可直接访问硬件,无需虚拟机监控器转发;设备的DMA操作可以通过IOMMU(I/O Memory Management Unit)及逆行地址转换,直接客户地址空间交互;设备的BIOS需要对等映射到客户地址空间的相同区域,客户操作系统才可调用设备BIOS访问设备。As an embodiment of the present invention, as shown in Figure 3: all PCI configuration space access and data access operations of the guest operating system will be intercepted by the virtual machine monitor, forwarded to the device emulator, and then passed to the virtualized device The virtual machine monitor accesses hardware devices; for direct allocation devices, it directly accesses hardware data through MMIO (Memory Mapped I/O) and DMA; when a device with BIOS is directly allocated, the I/O device is directly allocated through the client shadow page table. Mapped to the MMIO space of the client, the MMIO operation of the client can directly access the hardware without forwarding by the virtual machine monitor; the DMA operation of the device can directly access the client address space through IOMMU (I/O Memory Management Unit) and reverse address translation Interaction; the BIOS of the device needs to be peer-to-peer mapped to the same area of the client address space, so that the guest operating system can call the device BIOS to access the device.

为了解决不支持VT-d平台上硬件设备直接分配问题,可以在系统内存的低端划出一块区域,该区域拒绝虚拟机监控器的使用,将其分配给某个客户系统,使客户系统中的客户机页面号与机器页面号相等,以解决客户操作系统中硬件访问的DMA问题,使客户操作系统可以直接访问物理设备。In order to solve the problem of direct allocation of hardware devices on the platform that does not support VT-d, an area can be set aside at the low end of the system memory. The guest machine page number is equal to the machine page number to solve the DMA problem of hardware access in the guest operating system, so that the guest operating system can directly access the physical device.

在本发明实施例中,虚拟机监控器不能直接分配那些MMIO没有页对齐的设备,而对于没有页对齐的设备,控制虚拟机监控器扫描PCI总线,控制将所述没有页对齐的MMIO地址改为页对齐。In the embodiment of the present invention, the virtual machine monitor cannot directly allocate those MMIO devices without page alignment, and for devices without page alignment, the virtual machine monitor is controlled to scan the PCI bus, and the address of the MMIO without page alignment is changed to Align the page.

在虚拟机监控器中,程序代码和堆栈所使用的内存位于物理内存1MB~12MB的位置,然而,在1∶1每寸映射后,此段内存有可能被客户操作系统访问到,为了避免客户操作系统访问到此段内存,造成系统崩溃,将虚拟机监控器的程序代码和堆栈移到了1∶1内存上。In the virtual machine monitor, the memory used by the program code and the stack is located in the position of 1MB to 12MB of the physical memory. However, after the 1:1 per inch mapping, this section of memory may be accessed by the guest operating system. The operating system accesses this segment of memory, causing the system to crash, and moving the program code and stack of the virtual machine monitor to the 1:1 memory.

图4示出了本发明实施例提供的设备分配系统的结构框图,为了便于说明,图中仅给出了与本发明实施例相关的部分,其中,设备分配系统可以内置于计算机的软件单元、硬件单元或软硬件结合单元。Fig. 4 shows the structural block diagram of the equipment distribution system provided by the embodiment of the present invention, for the convenience of explanation, only the part related to the embodiment of the present invention is shown in the figure, wherein, the equipment distribution system can be built in the software unit of the computer, A hardware unit or a combination of hardware and software.

系统上电,初始化操作模块11在物理BIOS中启动双显卡,完成初始化操作;设置模块12控制对虚拟系统BIOS进行I/O访问的初始化设置;DMA重映射控制模块13通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,控制设备的DMA操作直接访问到客户机的内存空间;BIOS设备分配控制模块14在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,所述MMIO操作可直接访问硬件。Power on the system, the initialization operation module 11 starts the dual graphics card in the physical BIOS, and completes the initialization operation; the setting module 12 controls the initialization setting that the virtual system BIOS is carried out to I/O access; the DMA remapping control module 13 intercepts the device by the DMA remapping hardware The transmission of the DMA, and control address translation, the DMA operation of the control device directly accesses the memory space of the client computer; when the BIOS device allocation control module 14 allocates the device with the BIOS, by setting the client computer shadow page table, the I The /O device is directly mapped into the guest's MMIO space, which MMIO operations can directly access the hardware.

在本发明实施例中,修改模块15对于没有页对齐的设备,控制虚拟机监控器扫描PCI总线,控制将所述没有页对齐的MMIO地址修改为页对齐。In the embodiment of the present invention, the modification module 15 controls the virtual machine monitor to scan the PCI bus for devices without page alignment, and controls to modify the MMIO addresses without page alignment to page alignment.

在本发明实施例中,隐藏控制模块121对目标客户机之外的其他客户机隐藏需要分配的设备;地址空间转换控制模块122控制虚拟件监控器截获客户机访问的虚拟I/O地址空间,根据预先建立客户机访问的虚拟I/O地址与设备的真实I/O地址的转换表,把I/O请求转发到设备的真实I/O地址空间;挂接模块123将为设备生成的虚拟的PCI配置空间挂接在虚拟PCI总线上。In the embodiment of the present invention, the hidden control module 121 hides the equipment that needs to be allocated from other clients except the target client; the address space conversion control module 122 controls the virtual component monitor to intercept the virtual I/O address space accessed by the client, According to the pre-established conversion table of the virtual I/O address accessed by the client and the real I/O address of the device, the I/O request is forwarded to the real I/O address space of the device; The PCI configuration space is attached to the virtual PCI bus.

上述仅为本发明系统实施例的描述,其具体的实施如上述流程所述,在此不再赘述,但不用以限制本发明。The above is only a description of the system embodiment of the present invention, and its specific implementation is as described in the above process, which will not be repeated here, but it is not used to limit the present invention.

在本发明实施例中,系统上电,在物理BIOS中启动双显卡,完成初始化操作;控制对虚拟系统BIOS进行I/O访问的初始化设置;通过DMA重映射硬件截获设备的DMA的传输,并控制进行地址转换,控制设备的DMA操作直接访问到客户机的内存空间;在具有BIOS的设备进行分配时,通过设置客户机影子页表,将I/O设备直接映射到客户机的MMIO空间中,所述MMIO操作可直接访问硬件,实现设备的高效虚拟化和分配。In the embodiment of the present invention, the system is powered on, the dual graphics cards are started in the physical BIOS, and the initialization operation is completed; the initialization setting of I/O access is controlled to the virtual system BIOS; the transmission of the DMA of the device is intercepted by the DMA remapping hardware, and Control the address conversion, and control the DMA operation of the device to directly access the memory space of the client; when the device with BIOS is allocated, the I/O device is directly mapped to the MMIO space of the client by setting the client shadow page table , the MMIO operations can directly access the hardware, realizing efficient virtualization and allocation of devices.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (8)

1. a device allocation method, is characterized in that, described method comprises the steps:
System powers on, and starts two video cards in physics BIOS, completes initialization operation;
The initialization setting of I/O access is carried out in control to virtual system BIOS;
Remap the transmission of the DMA of hardware capture device by DMA, and control and carry out address translation, mark a zone by the low side at Installed System Memory, it is distributed to client, client computer page number in client is equated with the machine page number, and the dma operation of opertaing device directly has access to the memory headroom of client computer;
Divide timing at the equipment with BIOS, by the client computer shadow page table is set, I/O equipment is mapped directly in the MMIO space of client computer, for the equipment that there is no page alignment, control monitor of virtual machine scanning pci bus, control and do not have the MMIO address of page alignment to change page alignment into by described, described MMIO operation is access hardware directly.
2. the method for claim 1, is characterized in that, the step that described control is carried out the initialization setting of I/O access to virtual system BIOS specifically comprises the steps:
Other client computer outside Destination client are hidden and needed the equipment distributed.
3. the method for claim 1, is characterized in that, the step that described control is carried out the initialization setting of I/O access to virtual system BIOS specifically comprises the steps:
Control virtual watch-dog and intercept and capture the virtual i/o address space of client access, according to the conversion table of the true I/O address of the virtual i/o address of setting up in advance client access and equipment, I/O is asked to the true I/O address space of the equipment that is forwarded to.
4. the method for claim 1, is characterized in that, the step that described control is carried out the initialization setting of I/O access to virtual system BIOS specifically comprises the steps:
To be articulated on virtual pci bus for the virtual pci configuration space that equipment generates.
5. a devices allocation system, is characterized in that, described devices allocation system is built in computing machine, and described system comprises:
The initialization operation module, power on for system, starts two video cards in physics BIOS, completes initialization operation;
Module is set, for controlling the initialization setting of virtual system BIOS being carried out to the I/O access;
DMA remaps control module, for remap the transmission of the DMA of hardware capture device by DMA, and control and carry out address translation, mark a zone by the low side at Installed System Memory, it is distributed to client, client computer page number in client is equated with the machine page number, and the dma operation of opertaing device directly has access to the memory headroom of client computer; And
BIOS devices allocation control module, for at the equipment with BIOS, dividing timing, by the client computer shadow page table is set, I/O equipment is mapped directly in the MMIO space of client computer, for the equipment that there is no page alignment, control monitor of virtual machine scanning pci bus, control and do not have the MMIO address of page alignment to change page alignment into by described, described MMIO operation is access hardware directly.
6. system as claimed in claim 5, is characterized in that, the described module that arranges specifically comprises:
Hide control module, for other client computer to outside Destination client, hide and need the equipment distributed.
7. system as claimed in claim 5, is characterized in that, the described module that arranges specifically comprises:
Address space conversion and control module, intercept and capture the virtual i/o address space of client access for controlling virtual watch-dog, according to the conversion table of the true I/O address of the virtual i/o address of setting up in advance client access and equipment, the I/O request is forwarded to the true I/O address space of equipment.
8. system as claimed in claim 5, is characterized in that, the described module that arranges specifically comprises:
The on-hook module, for being articulated in virtual pci bus for the virtual pci configuration space that equipment generates.
CN201010123525.6A 2010-03-12 2010-03-12 A device allocation method and system Expired - Fee Related CN102193816B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010123525.6A CN102193816B (en) 2010-03-12 2010-03-12 A device allocation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010123525.6A CN102193816B (en) 2010-03-12 2010-03-12 A device allocation method and system

Publications (2)

Publication Number Publication Date
CN102193816A CN102193816A (en) 2011-09-21
CN102193816B true CN102193816B (en) 2014-01-08

Family

ID=44601930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010123525.6A Expired - Fee Related CN102193816B (en) 2010-03-12 2010-03-12 A device allocation method and system

Country Status (1)

Country Link
CN (1) CN102193816B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521054B (en) * 2011-12-15 2013-07-17 中国人民解放军国防科学技术大学 DMA (direct memory access) resource allocation method for virtual machine under sun4v architecture
CN105159742A (en) * 2015-07-06 2015-12-16 北京星网锐捷网络技术有限公司 Unvarnished transmission method and system for PCI device of virtual machine
CN105912936B (en) * 2016-04-11 2018-09-21 浪潮集团有限公司 A method of improving SDN switch performance and safety
CN108984427B (en) * 2018-07-12 2020-07-07 北京中科网威信息技术有限公司 A method and device for processing memory in equipment based on Shenwei architecture
CN113111025B (en) * 2021-06-10 2021-09-24 深圳市科力锐科技有限公司 PCI equipment mapping method, device, equipment and storage medium
CN120872626B (en) * 2025-09-29 2025-12-05 苏州元脑智能科技有限公司 A method and apparatus for allocating memory-mapped input/output resources for an interface device.

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6681346B2 (en) * 2000-05-11 2004-01-20 Goodrich Corporation Digital processing system including a DMA controller operating in the virtual address domain and a method for operating the same
CN101031893A (en) * 2004-09-30 2007-09-05 英特尔公司 Address translation for input/output devices using hierarchical translation tables
CN101059761A (en) * 2006-04-20 2007-10-24 联想(北京)有限公司 Dummy machine system and its hardware access method
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6681346B2 (en) * 2000-05-11 2004-01-20 Goodrich Corporation Digital processing system including a DMA controller operating in the virtual address domain and a method for operating the same
CN101031893A (en) * 2004-09-30 2007-09-05 英特尔公司 Address translation for input/output devices using hierarchical translation tables
CN101059761A (en) * 2006-04-20 2007-10-24 联想(北京)有限公司 Dummy machine system and its hardware access method
CN101398768A (en) * 2008-10-28 2009-04-01 北京航空航天大学 Construct method of distributed virtual machine monitor system

Also Published As

Publication number Publication date
CN102193816A (en) 2011-09-21

Similar Documents

Publication Publication Date Title
US10970104B2 (en) Resource access method applied to computer and computer
US9672583B2 (en) GPU accelerated address translation for graphics virtualization
US10191759B2 (en) Apparatus and method for scheduling graphics processing unit workloads from virtual machines
US7739417B2 (en) Method, apparatus and system for seamlessly sharing a graphics card amongst virtual machines
US7941812B2 (en) Input/output virtualization through offload techniques
CN102110196B (en) Method and system for safely transmitting data among parallel-running multiple user operating systems
CN100472451C (en) A virtual machine system and its hardware device access method
CN102193816B (en) A device allocation method and system
US20130174151A1 (en) Information processing apparatus and method of controlling virtual machine
CN102110023B (en) Control method, system and computer for parallel running of multi-user operating system
CN102779074B (en) Internal memory resource distribution method based on internal memory hole mechanism
CN101876954B (en) Virtual machine control system and working method thereof
CN104503825B (en) One kind is based on KVM hybrid apparatus virtual methods
CN105159742A (en) Unvarnished transmission method and system for PCI device of virtual machine
WO2017143718A1 (en) Cloud rendering system, server, and method
CN103995733B (en) Lightweight nested virtualization implementation method based on physical resource penetration mechanism
CN103262034B (en) Partition data to virtual machines
JP2015022553A (en) Computer control method and computer
CN105389199A (en) Xen-based FPGA accelerator virtualization platform and application
US20220318040A1 (en) System and method for providing page migration
CN117609115A (en) A method and system for lightweight virtualization based on RDMA technology
CN104750623A (en) Memory virtualization method and memory virtualization device
CN106815067A (en) The online moving method of virtual machine, device with I/O virtualizations
US7370137B2 (en) Inter-domain data mover for a memory-to-memory copy engine
CN100570562C (en) Graphics card, virtual machine system using the graphics card, and display processing method

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
CP01 Change in the name or title of a patent holder

Address after: 518057 computer building of the Great Wall, Nanshan District science and Technology Park, Shenzhen, Guangdong

Patentee after: CHINA GREAT WALL TECHNOLOGY GROUP Co.,Ltd.

Address before: 518057 computer building of the Great Wall, Nanshan District science and Technology Park, Shenzhen, Guangdong

Patentee before: CHINA GREATWALL COMPUTER SHENZHEN Co.,Ltd.

CP01 Change in the name or title of a patent holder
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140108

CF01 Termination of patent right due to non-payment of annual fee