针对目前虚拟环境下各种I/O设备访问模型普遍存在的性能与共享互为矛盾的问题,以虚拟化技术为基础,结合Linux设备热插拔技术,提出并实现了一种基于KVM的物理资源动态分配与管理技术。该技术基于共享内存及信号机制实现物理资源管理器与虚拟机管理进程之间的通信,利用hypercall机制实现客户操作系统与宿主操作系统之间的通信,通过向虚拟中断控制器注入虚拟中断的方式通知客户操作系统有关设备的添加与删除,最后基于PCI-Passthrough实现客户操作系统对物理设备的直接访问。测试证明这种技术在提高设备共享能力的同时,又保证了设备的访问性能。
At present various I/O devices' accessing models in virtual environment have ubiquitous problem that their performance and sharing mechanism are in contradiction each other.To solve the problem,this article introduces a novel dynamic assignment and management strategy for physical resource based on KVM,which uses virtualization technology and combines with Linux devices' hot-swapping technology.With the help of shared memory and signal mechanism,the strategy enables the communication between physical resource manager and management process of virtual machine,and enables the communication between guest and host operating systems with the help of hypercall mechanism as well.Moreover,by injecting virtual interrupt into virtual interrupt controller,it allows the notification of adding and removing of relative devices to guest operating system.As a result,it eventually accomplishes the direct access to the physical devices from guest operating system with the PCI-Passthrough technology.Tests prove that the strategy can improve the devices sharing ability whilst balance their access performance.