WO2017024783A1 - Procédé, appareil et système de virtualisation - Google Patents

Procédé, appareil et système de virtualisation Download PDF

Info

Publication number
WO2017024783A1
WO2017024783A1 PCT/CN2016/073860 CN2016073860W WO2017024783A1 WO 2017024783 A1 WO2017024783 A1 WO 2017024783A1 CN 2016073860 W CN2016073860 W CN 2016073860W WO 2017024783 A1 WO2017024783 A1 WO 2017024783A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
data
message
virtual
memory
Prior art date
Application number
PCT/CN2016/073860
Other languages
English (en)
Chinese (zh)
Inventor
江涛
董建波
侯锐
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017024783A1 publication Critical patent/WO2017024783A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems

Definitions

  • the embodiments of the present invention relate to the field of computers, and in particular, to a virtualization method, apparatus, and system.
  • VT Virtualization Technology
  • Virtualization technology refers to the ability to virtualize a set of hardware into multiple sets of hardware on a complete computer hardware platform and provide them to multiple independent software systems (usually operating systems such as Windows, Linux, Unix, Mac, etc.) As a stand-alone environment, these stand-alone environments (operating systems) are often referred to as virtual machines (VMs).
  • VMs virtual machines
  • a computer device with virtualization technology can run multiple independent operating systems in parallel, and these operating systems remain independent of each other except for sharing hardware resources (such as memory, I/O, storage, and processor capabilities) during operation. Can be seen as running on multiple independent computers.
  • computers using virtualization technology are used to run operating systems and application software systems that perform different functions. Virtualization technology requires a management software system for implementing hardware resources and calls to multiple operating systems.
  • VMM Virtual Machine Monitor
  • VMM is the first software system to be called in the VT technology computer platform. It is responsible for the VT function initialization of the VT processor, establishing the virtual machine environment, hardware virtualization, and instruction filtering at runtime, multi-operating system operation scheduling, etc. operating.
  • the virtualization of the processor is implemented by the task scheduling of the VMM, and each virtual machine switching brings a certain performance loss; the virtualization of the memory is realized by the virtual memory technology, thereby bringing a large number of transmission back buffers (Translation) The Lookaside Buffer (TLB) is missing, resulting in system performance loss, and the memory controller cannot sense the virtual machine, making it difficult to optimize the memory access schedule based on the virtual machine. If you can reduce the cumbersome software management and support full virtualization from the hardware, the resource utilization of the data center will be greatly improved.
  • an embodiment of the present invention provides a virtualization method, apparatus, and system, by adding a virtual machine identifier to a communication message between components of a computer device, thereby causing a processor and a memory, and a processor and the I Direct communication between /O devices.
  • an embodiment of the present invention provides a virtualization method, including: a memory controller of a computer system acquires a data access message of a virtual machine, where the data access message carries a virtual machine identifier and virtual address information, The virtual machine identifier is used to identify the virtual machine that sends the data access message, where the virtual address information is a virtual address of the virtual machine to be accessed; the memory controller is configured according to the The virtual machine identifier and the virtual address information determine a physical memory address of the data to be accessed in the memory device.
  • the memory controller determines, according to the virtual machine identifier and the virtual address information, a physicality of the data to be accessed in a memory device.
  • the memory address includes: the memory controller queries a preset correspondence according to the virtual machine identifier and the virtual address information, and determines a physical memory address of the data to be accessed in the memory device, where the The correspondence relationship includes a correspondence between a virtual machine identifier of each virtual machine running by the computer system and a physical memory address allocated by each virtual machine.
  • the memory controller is configured with at least one cache queue, each of the at least one cache queue A cache queue is associated with a virtual machine identifier; after the memory controller obtains the data access message, the memory controller further includes: the memory controller storing the data memory access message in the data access message carrying The virtual machine identifies the cache queue associated with it.
  • the memory controller of the computer system acquires a data access message of the virtual machine, including: The memory controller receives the data access message carrying the virtual machine identifier and the virtual address information through a system bus.
  • the data access message includes a data write message or a data read message in the fourth possible implementation manner of the first aspect;
  • the data fetching message is a data write message, and the memory controller determines, according to the virtual machine identifier and the virtual address information, that the data to be accessed is in a physical memory address in the memory device, and further includes : the memory controller writes the memory area indicated by the physical memory address Data to be stored; if the data access message is a data read message, the memory controller determines, according to the virtual machine identifier and the virtual address information, the data to be accessed in the memory device After the physical memory address, the method further includes: the memory controller reading the data to be accessed from the memory area indicated by the physical memory address.
  • the embodiment of the present invention provides a virtualization method, including: a virtual machine generating a data fetching message, where the data fetching message carries a virtual machine identifier and virtual address information, where the virtual machine identifier is used for Identifying the virtual machine that generates the data fetching message, where the virtual address information is a virtual address of the virtual machine to be accessed; the virtual machine sends the data access report to the memory controller Text.
  • the processor resource of the virtual machine is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine; Before the virtual machine generates the data fetching message, the method further includes: acquiring the virtual machine identifier of the virtual machine from the at least one register.
  • the method further includes: the virtual machine according to the virtual machine identifier and the virtual address information, Querying, by the cache, a cache block that is jointly indicated by the virtual machine identifier and the virtual address information, where the cached cache block identifier bit includes a virtual machine identifier bit and an address information identifier bit.
  • the sending, by the virtual machine, the data accessing message to the memory controller includes: The virtual machine sends the data access message carrying the virtual machine identifier and the virtual address information to the memory controller through a system bus.
  • the data access message includes a data write message or a data read message in the fourth possible implementation manner of the second aspect; And the data write message is used to write the data to be accessed to the memory area indicated by the virtual machine identifier and the virtual address information; the data read message is used to identify from the virtual machine and the The memory area indicated by the virtual address information reads the data to be accessed.
  • an embodiment of the present invention provides a data virtualization method, including: acquiring, by an I/O controller of a computer system, a first I/O access message of a first virtual machine, where the first The I/O access message carries a virtual machine identifier, where the virtual machine identifier is used to identify a first virtual machine that sends the I/O access message; and the I/O controller accesses according to the first I/O A message, the I/O device is allocated to the first virtual machine for use.
  • the I/O control The device allocates the I/O device to the first virtual machine according to the first I/O access message, and includes: the I/O controller according to a preset priority relationship, according to a priority sequence Assigning the I/O device to the first virtual machine for use, wherein the priority relationship is used to indicate a priority size of the first virtual machine and the second virtual machine.
  • the I/O controller further acquires the second I/ of the second virtual machine.
  • the I/O controller allocates the I/O device to the first virtual machine according to the first I/O access message, including: the I/O controller according to the Obtaining the sequence of the first I/O access message and the second I/O access message to allocate the I/O device to the first virtual machine for use.
  • the I/O controller allocates the I/O device to the first virtual machine After use, the method further includes: locking the I/O device such that the I/O device is exclusive to the first virtual machine, and completing the I/ at the first virtual machine using the I/O device After the O operation, the lock on the I/O device is released, so that the I/O device is allocated for use by other virtual machines.
  • the I/O controller is configured with at least one cache queue, the at least one cache queue Each cache queue is associated with a virtual machine identifier;
  • the method further includes: the I/O controller storing the first I/O access message in the I/ The cache queue associated with the virtual machine ID in the O access packet.
  • the I/O controller acquires the first I/O access report of the first virtual machine
  • the method includes: the I/O controller receiving a first I/O access message from the first virtual machine through a system bus.
  • the embodiment of the present invention provides a virtualization method, which includes: a virtual machine generates an I/O access message, where the I/O access message includes a virtual machine identifier, and the virtual machine identifier The virtual machine for generating the I/O access message; the virtual machine sends the I/O access message to an I/O controller, where the I/O controller is used to manage I/O device.
  • the processor resource of the virtual machine is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine; Before the virtual machine generates the I/O access message, the method further includes: acquiring the virtual machine identifier of the virtual machine from the at least one register.
  • the virtual machine sends the I/O access message to an I/O controller,
  • the virtual machine sends the I/O access message carrying the virtual machine identifier to the I/O controller through a system bus.
  • an embodiment of the present invention provides a virtualization device, including: an acquiring unit, configured to acquire a data access message of a virtual machine, where the data access message carries a virtual machine identifier and a virtual Address information, the virtual machine identifier is used to identify the virtual machine that sends the data access message, the virtual address information is a virtual address of the virtual machine in the data to be accessed, and a determining unit is configured to: Determining, according to the virtual machine identifier and the virtual address information, a physical memory address of the data to be accessed in the memory device.
  • the determining unit is configured to determine, according to the virtual machine identifier and the virtual address information, that the data to be accessed is in a memory device
  • the physical memory address includes: the determining unit, configured to query a preset correspondence according to the virtual machine identifier and the virtual address information, and determine a physical memory address of the data to be accessed in the memory device, where
  • the correspondence relationship includes a correspondence between a virtual machine identifier of each virtual machine running by the computer system and a physical memory address allocated by each virtual machine.
  • the device is configured with at least one cache queue, and each of the at least one cache queue is cached The queue is associated with a virtual machine identifier; after the obtaining unit obtains the data access message, the acquiring unit is further configured to store the data cached message in the virtual machine identifier carried in the data access message. Cache queue.
  • the acquiring unit is configured to acquire a data access message of the virtual machine, including: The obtaining unit is configured to receive, by using the system bus, the data access message carrying the virtual machine identifier and the virtual address information.
  • the device further includes a processing unit, where the data access message includes a number Writing a message or a data read message; if the data fetch message is a data write message, the processing unit is configured to write the data to be accessed to the memory area indicated by the physical memory address; The processing unit is configured to read the data to be accessed from a memory area indicated by the physical memory address, if the data fetch message is a data read message.
  • the embodiment of the present invention provides a virtualization device, which includes: a generating unit, configured to generate a data access message, where the data access message carries a virtual machine identifier and virtual address information, The virtual machine identifier is used to identify a virtual machine running on the device, the virtual address information is a virtual address of the virtual machine to be accessed, and a sending unit is configured to send the Data access message.
  • the device is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine; and the generating unit generates data Before the message is fetched, the virtual machine identifier of the virtual machine is also obtained from the at least one register.
  • the device further includes a searching unit, where the searching unit is configured to use the virtual machine identifier and The virtual address information is used to search for a cache block that is jointly indicated by the virtual machine identifier and the virtual address information, and the cached cache block identifier bit includes a virtual machine identifier bit and an address information identifier bit.
  • the sending unit is configured to send the data access message to the memory controller, including
  • the sending unit is configured to send, by using a system bus, the data access message carrying the virtual machine identifier and the virtual address information to the memory controller.
  • the data access message includes a data write message or a data read message in the fourth possible implementation manner of the sixth aspect; And the data write message is used to write the data to be accessed to the memory area indicated by the virtual machine identifier and the virtual address information; the data read message is used to identify from the virtual machine and the The memory area indicated by the virtual address information reads the data to be accessed.
  • an embodiment of the present invention provides a data virtualization device, including: an acquiring unit, configured to acquire a first I/O access message of a first virtual machine, where the first I/O is performed.
  • the access message carries a virtual machine identifier, where the virtual machine identifier is used to identify the first virtual machine that sends the I/O access message, and the allocation unit is configured to: according to the first I/O access message, /O device allocation Used by the first virtual machine.
  • the allocating unit when the acquiring unit further acquires a second I/O access message of the second virtual machine, the allocating unit is configured to use the The first I/O access message is used to allocate the I/O device to the first virtual machine, and the method includes: the allocating unit is configured to use the I/O according to a preset priority relationship according to a priority order.
  • the O device is allocated to the first virtual machine for use, wherein the priority relationship is used to indicate a priority size of the first virtual machine and the second virtual machine.
  • the acquiring unit further acquires the second I/O access report of the second virtual machine
  • the allocation unit is configured to allocate an I/O device to the first virtual machine according to the first I/O access message, where the allocation unit is configured to obtain the The sequence of an I/O access message and the second I/O access message is used to allocate the I/O device to the first virtual machine for use.
  • the third possible implementation manner Also for locking the I/O device such that the I/O device is exclusive to the first virtual machine and after the first virtual machine completes an I/O operation using the I/O device The lock on the I/O device is released, so that the I/O device is allocated for use by other virtual machines.
  • the device is configured with at least one cache queue, each cache of the at least one cache queue The queue is associated with a virtual machine identifier; after the obtaining unit acquires the first I/O access message of the first virtual machine, the acquiring unit is further configured to store the first I/O access message into the I/O access report.
  • the acquiring unit is configured to acquire the first I/O access packet of the first virtual machine, in the fifth possible implementation manner of the seventh aspect, The method includes: the obtaining unit, configured to receive, by using a system bus, a first I/O access message from the first virtual machine.
  • an embodiment of the present invention provides a virtualization device, including: a generating unit, configured to generate an I/O access message, where the I/O access message includes a virtual machine identifier, a virtual machine identifier for identifying a virtual machine running on the device; a sending unit, configured to send the I/O access message to an I/O controller, where the I/O controller is used to manage the I/O device .
  • the device is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine; Before the /O access message, the virtual machine identifier of the virtual machine is also obtained from the at least one register.
  • the sending unit is configured to send the I/O access report to an I/O controller.
  • the sending unit is configured to send, by using a system bus, the I/O access message carrying the virtual machine identifier to the I/O controller.
  • an embodiment of the present invention provides a virtualization system, including a processor cluster, a memory device, and a memory controller, where the processor cluster includes at least one physical processor, and the processor cluster and The memory controllers are connected by a system bus, and the virtualization system runs at least one virtual machine, and each virtual machine is allocated with a virtual machine processor from the processor cluster and virtual machine memory from the memory device.
  • Each of the at least one physical processor is configured with at least one register, the register is configured to store an identifier of a virtual machine running on a corresponding physical processor; the first of the clusters of processors a physical processor, configured to generate a data fetching message, and send the data fetching message to the memory controller by using the system bus, where the data fetching message carries a first virtual machine identifier and a first virtual Address information, the first virtual machine identifier is a virtual machine identifier stored in a first register corresponding to the first physical processor, where the The virtual address information is a virtual address of the data to be accessed in the first virtual machine; the memory controller is configured to receive the data access message, and according to the first virtual machine identifier and the first virtual The address information determines a physical memory address of the data to be accessed in the memory device.
  • the memory controller is configured to determine, according to the first virtual machine identifier and the first virtual address information, the data to be accessed in the The physical memory address in the memory device, the memory controller is configured to query the preset correspondence according to the first virtual machine identifier and the first virtual address information, and determine that the data to be accessed is in the a physical memory address in the memory device, where the correspondence includes a correspondence between a virtual machine identifier of each virtual machine running by the virtualization system and a physical memory address allocated by each virtual machine.
  • the memory controller is configured with at least one cache queue, where the at least one Each of the cache queues is associated with a virtual machine identifier.
  • the memory controller is further configured to store the data cached message in the first virtual machine identifier after receiving the data access message. Cache queue.
  • the data access message includes a data write message or a data read message;
  • the data fetching message is a data write message, and the memory controller is further configured to write the data to be accessed to the memory area indicated by the physical memory address; if the data fetching message is data Reading the message, the memory controller is further configured to read the data to be accessed from the memory area indicated by the physical memory address.
  • the first physical processor is further configured to: according to the first virtual machine identifier and The first virtual address information is used to search for a cache block that is jointly indicated by the first virtual machine identifier and the first virtual address information, and the cached cache block identifier bit includes a virtual machine identifier bit and address information. Flag bit.
  • an embodiment of the present invention provides a virtualization system, including a processor cluster, an I/O device, and an I/O controller, where the processor cluster includes at least one physical processor, a processor cluster is coupled to the I/O controller via a system bus, the virtualization system running at least one virtual machine, each virtual machine being assigned a virtual machine processor from the processor cluster and from the virtual machine a virtual machine I/O device of an I/O device, each of the at least one physical processor configuring at least one register for storing a virtual machine running on a corresponding physical processor a first processor in the processor cluster, configured to generate a first I/O access message, and send the first I/O access message to the I/O controller by using the system bus
  • the first I/O access message carries a first virtual machine identifier, and the first virtual machine identifier is a virtual machine identifier stored in a first register corresponding to the first physical processor; the I/O a controller, configured to receive the first I /O accesses the message, and allocate
  • the I/O controller when the I/O controller further receives the second I/O access message, where the second I/O access report is The second virtual machine identifier is used to identify the second virtual machine, and the I/O controller is configured to allocate the I/O device to the first I/O access message according to the first virtual machine identifier.
  • the first virtual machine is used, and the I/O controller is configured to: according to a preset priority relationship, the I/O according to a priority order
  • the device is allocated for use by the first virtual machine, wherein the priority relationship is used to indicate a priority size of the first virtual machine and the second virtual machine.
  • the I/O controller when the I/O controller further receives the second I/O access message
  • the second I/O access message carries a second virtual machine identifier
  • the second virtual machine identifier is used to identify a second virtual machine
  • the I/O controller is configured to use the first I/O
  • the O access message is used to allocate the I/O device to the first virtual machine, where the I/O controller is configured to receive the first I/O access message and the second I/ The order in which the O access messages are assigned to the I/O device is used by the first virtual machine.
  • the I/O controller allocates the I/O device to the first virtual machine After use, it is also used to lock the I/O device such that the I/O device is exclusive to the first virtual machine, and the I/O device is used to complete I/ at the first virtual machine. After the O operation, the lock on the I/O device is released, so that the I/O device is allocated for use by other virtual machines.
  • the I/O controller is configured with at least one cache queue, the at least one cache queue Each of the cache queues is associated with a virtual machine identifier; the I/O controller is configured to: after receiving the first I/O access message, the first I/O access message is stored in the The first virtual machine identifies the associated cache queue.
  • the processor resource when a processor resource of a virtual machine accesses a memory resource or an I/O resource, the processor resource is added to the memory resource by adding a virtual machine identifier to the packet.
  • the direct access of I/O resources reduces the cumbersome management process of software access to memory resources and I/O resource access in the virtualized system, and further provides a basis for dynamic allocation of virtual machine resources.
  • FIG. 1 is a schematic structural diagram of a virtualization system
  • FIG. 2 is a schematic diagram of a hardware architecture of a virtualization system according to an embodiment of the invention.
  • FIG. 3 is a schematic diagram of a hardware architecture of a virtualization system according to an embodiment of the invention.
  • FIG. 4 is an exemplary flowchart of a virtualization method in accordance with an embodiment of the present invention.
  • FIG. 5 is an exemplary flowchart of a virtualization method according to an embodiment of the invention.
  • FIG. 6 is a schematic diagram showing the logical structure of a virtualization device according to an embodiment of the invention.
  • FIG. 7 is a schematic diagram showing the logical structure of a virtualization device according to an embodiment of the invention.
  • FIG. 8 is a schematic diagram showing the logical structure of a virtualization device according to an embodiment of the invention.
  • FIG. 9 is a schematic diagram showing the logical structure of a virtualization device according to an embodiment of the invention.
  • FIG. 1 is a schematic structural diagram of a virtualization system 100. As shown in FIG. 1, the system 100 includes: physical hardware 106, a virtual machine monitor (VMM), and a plurality of virtual machines running on physical hardware. 102.
  • VMM virtual machine monitor
  • the Virtual Machine Monitor is a layer of software description between the virtual machine operating system and the physical hardware. It is responsible for processor scheduling and memory allocation between virtual machines. VMM not only abstracts the hardware of the virtual machine, but also controls the execution of each virtual machine.
  • VMM is also used to manage the creation, destruction, suspension, recovery, and migration of virtual machines, as well as CPU scheduling, memory allocation, and device access between virtual machines.
  • the VMM provides an abstraction layer to the virtual machine that contains the Application Programming Interface (API) for management and virtual hardware.
  • the VMM provides basic virtual hardware such as a virtual central processing unit (VCPU) and a virtual memory management unit (MMU) to the virtual machine, and provides a corresponding hardware interface to the virtual machine (security). Hardware interface) to ensure that device access is safe.
  • VCPU virtual central processing unit
  • MMU virtual memory management unit
  • the secure hardware interface provides direct memory access (DMA), input/output (I/O), driver, virtual peripheral component interconnect (PCI) address configuration, and virtual hardware. Break the hardware virtual work.
  • DMA direct memory access
  • I/O input/output
  • PCI virtual peripheral component interconnect
  • the system 100 can support paravirtualization and full virtualization.
  • the paravirtualized (PV) virtual machine running on the VMM runs the operating system of the modified kernel, or the upper operating system installs the paravirtualized driver.
  • the system of the program An operating system running a virtualized virtual machine on the VMM runs without modifying the kernel and without installing a paravirtualized driver.
  • FIG. 2 is a schematic structural diagram of a virtualization system 200 according to an embodiment of the present invention.
  • the physical hardware 106 of the system 200 includes computing resources, memory resources, and input/output (I/O) resources.
  • the computing resource, the memory resource and the I/O resource are decoupled and separated from each other, and the computing resource is composed of the computing resource pool 202, the memory resource is composed of the memory resource pool 204, and the I/O resource is composed of the I/O resource pool.
  • the computing resource pool 202 includes a plurality of physical processors, and provides processor resources to the virtual machines running on the virtualization system 200, wherein the physical processors can adopt a common central processing unit (CPU), a microprocessor. An application specific integrated circuit (ASIC), or one or more integrated circuits, is used to execute the related program to implement the technical solution provided by the embodiment of the present invention.
  • the physical processor is exemplarily characterized using a CPU in the embodiment of the present invention, but the embodiment of the present invention does not limit this.
  • the processor resource may be a processor core or a hardware thread, which is not limited by the embodiment of the present invention.
  • a hardware thread is also called a logical core or a logical processor.
  • the system recognizes each hardware thread as a schedulable logical processor.
  • one processor resource below refers to a processor core or a hardware thread.
  • the memory resource pool 204 includes the memory resources of the virtualization system 200, and may be a static random access memory (SRAM), a dynamic random access memory (DRAM), or other non-volatile memory (Non). -Volatile Memory, NVM), etc. It should be understood that the DRAM is used to exemplarily represent the memory resource in the embodiment of the present invention, but the embodiment of the present invention does not limit this.
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • NVM non-volatile Memory
  • the I/O resource pool 206 includes the I/O resources of the virtualization system 200 to meet the general purpose extension of the virtualization system 200, including but not limited to: a graphics processing unit (GPU), a network interface card ( Network Interface Card (NIC), Serial Advanced Technology Attachment (SATA) and storage devices I/O device. It should be understood that the SATA and NIC are used to exemplify the I/O device in the embodiment of the present invention, but the embodiment of the present invention does not limit this.
  • different resource pools have their own cloud controllers, which are used to manage resources of the resource pool.
  • the cloud controller of the computing resource pool 202 is a computing controller 208 and a memory resource pool 204.
  • the cloud controller is the memory controller 210, and the cloud controller of the I/O resource pool is the I/O controller 212.
  • the embodiments of the present invention are merely illustrative of the physical hardware 106 of the virtualization system 200 and are not limited thereto.
  • the computing resource pool 202 may not have the computing controller 208.
  • Different resource pools communicate with one another via system bus 214.
  • FIG. 2 is only a specific implementation manner of the embodiment of the present invention.
  • the present invention does not limit the structure of the virtualization system 200 and the hardware architecture of the physical hardware 106 of the virtualization system 200.
  • the physical hardware 106 Can be partially decoupled or not decoupled.
  • At least one virtual machine 102 is running on the system 200.
  • the VMM assigns each virtual machine a unique virtual machine identification (VMID), which is used to indicate the identity of the virtual machine.
  • VMID virtual machine identification
  • the hardware resources allocated by the VMM to the virtual machine are associated with the VMID of the virtual machine.
  • the VMM may configure a mapping table on the controller of the hardware resource pool, where the mapping table records the correspondence between the hardware resources managed by the controller and the VMID, that is, used for characterization. Which virtual machine the hardware resource is assigned to.
  • the VMM configures a computing resource mapping table on the computing controller 208, the mapping table records the correspondence between the processor resources and the VMID;
  • the VMM configures a memory resource mapping table on the memory controller 210, the mapping table records the memory.
  • the VMM configures an I/O resource mapping table on the I/O controller 212, and the mapping table records the correspondence between the I/O resource and the VMID.
  • the resource mapping table can be written by the VMM when creating a virtual machine and allocating hardware resources for the newly created virtual machine. And each time the virtual machine resource is dynamically adjusted, the VMM adjusts or rewrites the resource mapping table according to the adjusted hardware resource allocation.
  • the VMM by assigning a register to each processor resource of the virtual machine, the VMID of the virtual machine to which the processor resource is allocated is recorded in the registration, as shown in FIG.
  • the VMM allocates a processor resource to a virtual machine
  • the VMM writes the VMID of the virtual machine in a register corresponding to the processor resource, thereby associating the processor resource with the virtual machine through the VMID
  • the register Save the VMID of the latest virtual machine whenever virtual
  • the VMM updates the VMID recorded in the register according to the allocation of the processor resources to ensure that the register holds the VMID of the latest virtual machine.
  • the processor resource or the virtual machine running on the processor resource generates the data fetch message or before the I/O access message
  • the device running on the processor resource is obtained from the register associated with the processor resource.
  • the virtual machine ID of the virtual machine is obtained from the register associated with the processor resource.
  • a data fetching message is generated, where the data fetching message carries a virtual machine identifier and virtual address information, and the virtual machine identifier is used to identify the generated
  • the virtual machine of the data fetching message the virtual address information is a virtual address of the virtual machine in the data to be accessed.
  • the processor resources of the virtual machine send the data fetch message to the memory controller 210 via the system bus 214, the system bus 214 supports the transfer of the virtual machine identifier, and the memory controller 210 is configured to control the access to the memory resource. Save operation.
  • system bus 214 may be extended to add a VMID (such as 8 bits) on the address line, and the memory access request sent by the processor resource needs to carry the VMID.
  • VMID such as 8 bits
  • the processor resource before sending the data access message to the memory controller 210, the processor resource further searches the cache according to the virtual machine identifier and the virtual address information.
  • the cache block Cache line is jointly indicated by the virtual machine identifier and the virtual address information, and the identifier bit of the cached cache block includes a virtual machine identifier bit and an address information identifier bit.
  • the VMID field is added to each cache block, and the VMID field of the Cache line assigned to a certain virtual machine records the VMID of the virtual machine. For example, when the VMID of a certain cache line is 0, it can be indicated that the cache line can be shared by multiple virtual machines. When the VMID is not 0, it indicates that the cache line can only be used by the virtual machine identified by the VMID. When the cache performs a virtual address comparison, it is compared with the VMID and the virtual address.
  • the VMID field in the Cache line can be filled in by the VMM or the processor resource when the cache block is allocated for a virtual machine. When the VMM or the processor resource allocates a Cache line to a virtual machine, the Cache line is virtualized. The VMID of the corresponding virtual machine is filled in the machine identifier to indicate the correspondence between the Cache line and the virtual machine.
  • the memory controller is 210: Send the data access message.
  • the processor resource is further configured according to the virtual machine identifier and the virtual address letter. And searching for a cache block indicated by the virtual machine identifier and the virtual address information from the cache, and performing synchronous update with the memory in the cache block.
  • the data access message includes a data write message or a data read message; the data write message is used to write to the memory area jointly indicated by the virtual machine identifier and the virtual address information. Entering the data to be accessed; the data read message is used to read the data to be accessed from a memory area jointly indicated by the virtual machine identifier and the virtual address information.
  • the memory controller 210 After receiving the data access message, the memory controller 210 determines the physical memory address of the data to be accessed in the memory device according to the virtual machine identifier and the virtual address information.
  • the memory controller 210 supports virtual multi-channel and supports conversion between the VMID and the virtual multi-channel, that is, the memory controller 210 can connect the memory with the plurality of virtual machines.
  • the VMID is in one-to-one correspondence with the virtual channel, and the virtual channel divides the memory capacity and bandwidth according to the VMID.
  • the memory controller 210 is configured with at least one cache queue, and each cache queue in the at least one cache queue is associated with one virtual machine identifier; the memory controller 210 acquires the data visit After the message is stored, the data is also stored in the cache queue associated with the virtual machine identifier carried in the data access message.
  • a cache queue can be associated with a register that records the VMID of the virtual machine corresponding to the cache queue.
  • VMM creates a virtual machine and allocates a memory resource for the virtual machine
  • a cache queue with the virtual machine is created in the memory controller 210, and the VMID of the virtual machine is written into a register corresponding to the virtual machine. In this way, the one-to-one correspondence between the cache queue and the virtual machine is indicated.
  • the memory controller 210 receives the data access message, the memory controller 210 uses the cache queue corresponding to the virtual machine that sends the data access message to buffer the reception. The data fetched message arrived.
  • the memory controller 210 can also store the received data fetching message into the FIFO by using a first input first output (FIFO) manner, and serially access the data fetching message. deal with.
  • FIFO first input first output
  • the memory controller 210 supports the parsing of "VMID + virtual address information", and the "VMID + virtual address information" is converted into the actual physical memory address of the memory by the address translation unit.
  • the internal virtual addresses of different virtual machines can overlap because of the existence of VMID.
  • the mapping relationship between the virtual machine and the memory area allocated by the VMM for the virtual machine is established in the memory controller 210.
  • the mapping table may be used to record the VMM as a virtual machine.
  • the mapping between the memory address range and the VMID of the virtual machine, "VMID + virtual machine virtual address" and the physical memory address are in one-to-one correspondence, when the memory controller 210 is connected
  • the physical address of the data in the memory may be determined according to the virtual address of the virtual machine inside the VMID and the data to be accessed.
  • the memory controller 210 determines, according to the virtual machine identifier and the virtual address information, that the data to be accessed is after the physical memory address in the memory device. And writing, to the memory area indicated by the physical memory address, the data to be accessed;
  • the memory controller 210 determines, according to the virtual machine identifier and the virtual address information, that the data to be accessed is after the physical memory address in the memory device. And for reading the data to be accessed from the memory area indicated by the physical memory address.
  • the memory controller 210 may perform scheduling based on the VMID. For example, if the memory controller 210 receives N memory access requests carrying the same virtual machine identifier, the memory controller 210 may carry the N carriers. Memory access requests for the same virtual machine identity are merged, where N is a positive integer greater than one.
  • the processor resource or the virtual machine running on the processor resource accesses the I/O device, generating an I/O access message, where the I/O access message includes a virtual machine identifier, and the virtual machine identifier is used for Identifying the virtual machine that generates the I/O access message, and transmitting the I/O access message to the I/O controller 212 via a system bus 214, the system bus 214 supporting virtual machine identification Transmission, the I/O controller 212 is used to manage I/O devices.
  • the I/O controller 212 of the computer system After acquiring the first I/O access message of the first virtual machine, the I/O controller 212 of the computer system allocates the I/O device to the first virtual machine according to the first I/O access message. use.
  • the first I/O access message carries a virtual machine identifier, and the virtual machine identifier is used to identify a first virtual machine that sends the I/O access message.
  • the I/O controller 212 when the I/O controller 212 further acquires a second I/O access message of the second virtual machine, the I/O controller 212 is configured according to the I/O controller 212.
  • the first I/O access message is allocated to the first virtual machine by the I/O device, and the I/O controller 212 performs the priority according to a preset priority relationship.
  • the I/O device is allocated to the first virtual machine for use, wherein the priority relationship is used to indicate a priority size of the first virtual machine and the second virtual machine.
  • the I/O controller 212 when the I/O controller 212 further acquires a second I/O access message of the second virtual machine, the I/O controller 212 According to the said Assigning an I/O device to the first virtual machine for use in an I/O access message, comprising: the I/O controller 212 obtaining the first I/O access message according to the first The sequence of the two I/O access messages assigns the I/O device to the first virtual machine for use.
  • the I/O controller 212 is configured with at least one cache queue, and each cache queue in the at least one cache queue is associated with a virtual machine identifier; After acquiring the first I/O access message of the first virtual machine, the O controller 212 is further configured to store the first I/O access message into the virtual machine identifier association in the I/O access message.
  • Cache queue For example, a register can be associated with a cache queue that holds the VMID that marks the cache queue.
  • a cache queue associated with the virtual machine and writing a VMID of the virtual machine to a register corresponding to the virtual machine, thereby indicating a one-to-one correspondence between the cache queue and the virtual machine, when the I/O controller 212 receives
  • a buffer queue corresponding to the virtual machine that sends the data fetch message is used to buffer the received I/O access message.
  • the I/O controller 212 is further configured to lock the I/O device to Making the I/O device exclusive by the first virtual machine, and releasing the locking of the I/O device after the first virtual machine uses the I/O device to complete an I/O operation, So that the I/O device is allocated for use by other virtual machines.
  • each I/O device can be assigned a register.
  • the VMM allocates an I/O device to a virtual machine
  • the VMID of the virtual machine is written into a register corresponding to the I/O device.
  • I/O controller 212 supports parsing and conversion of VMIDs. From the perspective of processor resources, only virtual I/O function blocks can be seen, and multiple virtual I/O function blocks can correspond to one I/O device. That is, one physical I/O device can be shared by multiple virtual machines in a time-sharing manner. Multiple virtual machines can respectively see one I/O device. The I/O device is shared by multiple virtual machines and can be used by multiple virtual machines. Time-division multiplexing. After receiving the I/O access message, the I/O resource controller determines which virtual machine is the virtual machine that requests access to the I/O device based on the VMID carried in the packet, and time-sharing. By assigning I/O devices to different virtual machines, you can meet the requirements of each virtual machine to use I/O devices in a time-sharing manner. This eliminates the need to run drivers in the VMM and avoid inefficient I/O virtualization through software methods.
  • NICs there is only one network card on the hardware, and multiple NICs can be virtualized through the controller. You can see multiple network cards from the perspective of the machine. Multiple virtual machines implement time-sharing multiplexing of a physical I/O device or interface, but in the view of a virtual machine, the virtual machine monopolizes the physical I/O device.
  • a direct memory access (DMA) controller of the I/O device is also configured with a VMID register.
  • DMA direct memory access
  • the fetch request issued by the DMA controller includes the VMID and the virtual machine physical address.
  • multiple processor resources corresponding to the same virtual machine also have their own identifier VCPUID, and the identifiers of the processor resources of the same virtual machine may be consecutively numbered.
  • Each processor resource corresponds to a VCPUID register, which is used to save the number of the processor resource inside the virtual machine.
  • the VMM sets the VCPUID register when the processor resources are allocated for the virtual machine, and numbers the processor resources of the virtual machine. Processor cores seen from the perspective of the virtual machine operating system can be numbered starting from zero.
  • the VCPUID register is filled in by the VMM when allocating processor resources to a virtual machine, and is updated by the VMM after the processor resources are dynamically allocated.
  • the interrupt controller (not shown) of virtualization system 200 has different processing mechanisms for peripheral interrupts and processor core interrupts.
  • the interrupt controller adds a break table IRQ to VMID, a mapping table between the virtual interrupt number (VIRQ) and the CPUID, and the interrupt controller can select the interrupt to the processor based on the CPUID.
  • Table 1 shows the structure of this mapping table.
  • the mapping table can be filled in by the VMM.
  • Each virtual I/O device corresponds to an interrupt number.
  • Each interrupt number corresponds to a VMID and a virtual interrupt number, and points to a CPUID.
  • the processor receives the interrupt request, it reads the virtual interrupt number and the VMID value.
  • the virtual interrupt number read at this time is the physical interrupt number of the virtual machine.
  • the virtual machine operating system running on the processor pointed to by the CPUID does not need to be modified.
  • the interrupt vector table is indexed by the virtual interrupt number.
  • the interrupt controller adds a mapping table of VMID and VCPUID to CPUID, as shown in Table 2.
  • the interrupt controller queries the corresponding CPUID according to the VMID and VCPUID, and then initiates an interrupt request to the processor pointed to by the CPUID.
  • the VMID of each component when the system is started, the VMID of each component is reset, for example, it can be reset to 0.
  • the VMM assigns it a separate VMID and allocates hardware resources to it:
  • Allocating a corresponding virtual memory channel setting a memory controller 210, establishing a correspondence between the VMID and the memory virtual channel, and allocating a memory area for the virtual machine, where the physical memory address of the memory area corresponds to the VMID;
  • the interrupt controller is configured to configure the VMID for the interrupt of the I/O virtual function.
  • the virtual machine is started. After that, without the intervention of the VMM, all the hardware resources of the virtual machine can be directly accessed by the virtual machine.
  • VMM When the virtual machine needs to dynamically adjust resources, it is implemented by VMM, and the VMID of the I/O device, the VMID of the virtual channel of the memory, the VMID of the interrupt controller, and the VMID of the Cache line. Redistribution.
  • VMID register in the processor resource can be modified to indicate which virtual machine the processor core or thread is assigned to.
  • the VMM sets the VCPUID of the processor resource, allowing these processor resources to be sequentially numbered starting from zero.
  • the interrupt controller routes all virtual interrupts to the processor resources specified by the corresponding VMID through the VMID.
  • the Cache line, memory and I/O resources of the same VMID are exclusive to the processor resources corresponding to the VMID.
  • the processor resource when a processor resource of a virtual machine accesses a memory resource or an I/O resource, the processor resource is added to the memory resource by adding a virtual machine identifier to the packet.
  • the direct access of I/O resources reduces the cumbersome management process of software access to memory resources and I/O resource access in the virtualized system, and further provides a basis for dynamic allocation of virtual machine resources.
  • FIG. 4 is an exemplary flowchart of a virtualization method 400 according to an embodiment of the present invention.
  • the virtualization method 400 is a virtual machine data memory access method, and is used for a virtual machine running on a computer system to perform memory resources of a computer system. Access, when the system is initialized, the VMM assigns each virtual machine a virtual machine identifier, which is used to indicate the identity of the virtual machine, and the hardware resources allocated by the VMM for the virtual machine are associated with the VMID of the virtual machine.
  • method 400 includes:
  • the virtual machine generates a data fetching message, where the data fetching message carries a virtual machine identifier and virtual address information, where the virtual machine identifier is used to identify the virtual machine that generates the data fetching message.
  • the virtual address information is the virtual address of the virtual machine in which the data to be accessed is stored.
  • the data access message is generated by the processor resource of the virtual machine, where the virtual machine identifier is used to indicate which virtual machine the processor resource belongs to.
  • each processor resource corresponds to one VMID
  • the VMID indicates which virtual machine the processor resource is allocated to. For example, by assigning a register to each processor resource of the virtual machine, when the VMM allocates a processor resource to a virtual machine, the VMM writes the VMID of the virtual machine in a register corresponding to the processor resource. Therefore, the processor resource is associated with the virtual machine through the VMID.
  • the register holds the VMID of the latest virtual machine.
  • the VMM records the register according to the allocation of the processor resources. The VMID is updated to ensure that this register holds the most The VMID of the new virtual machine.
  • the processor resource of the virtual machine is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine, and when a virtual machine is allocated with multiple processor cores or hardware threads, the virtual machine is The processor resource corresponds to a plurality of registers, and the virtual machine identifier of the virtual machine is saved in each register.
  • the method 400 further includes: acquiring the virtual machine identifier of the virtual machine from the at least one register, before the virtual machine generates the data fetching message.
  • the data access message includes a data write message or a data read message; the data write message is used to write to the memory area jointly indicated by the virtual machine identifier and the virtual address information. Entering the data to be accessed; the data read message is used to read the data to be accessed from a memory area jointly indicated by the virtual machine identifier and the virtual address information.
  • the method 400 further includes: the virtual machine searching, according to the virtual machine identifier and the virtual address information, a cache block that is jointly indicated by the virtual machine identifier and the virtual address information from a cache, where the cached cache block
  • the flag bit contains the virtual machine identification bit and the address information identification bit.
  • Each cache block Cache line adds a VMID field.
  • the VMID field of the Cache line assigned to a virtual machine records the VMID of the virtual machine. When the VMID of a certain cache line is 0, it indicates that the cache line can be shared by multiple virtual machines. When the VMID is not 0, it indicates that the cache line can only be used by the virtual machine identified by the VMID. When the cache performs a virtual address comparison, it is compared with the VMID and the virtual address.
  • the VMID field in the Cache line can be filled in by the VMM or the processor resource when the cache block is allocated for a virtual machine. When the VMM or the processor resource allocates a Cache line to a virtual machine, the Cache line is virtualized. The VMID of the corresponding virtual machine is filled in the machine identifier to indicate the correspondence between the Cache line and the virtual machine.
  • the cache line corresponding to the VMID and the address information is found, the cache line may be directly accessed, or the data in the cache block may be updated synchronously with the memory.
  • S404 The virtual machine sends the data fetching message to a memory controller, where the memory controller is configured to control a memory access operation.
  • the sending, by the virtual machine, the data fetching message to the memory controller includes: sending, by the virtual machine, the virtual machine identifier to the memory controller by using a system bus And the data fetching message of the virtual address information.
  • the system bus supports transmission of virtual machine identification.
  • the system bus can be extended at the address. Add a VMID (such as 8 bits) on the line, and the memory request sent by the processor resource needs to carry the VMID.
  • VMID such as 8 bits
  • the memory controller determines, according to the virtual machine identifier and the virtual address information, a physical memory address of the data to be accessed in the memory device.
  • the memory controller supports virtual multi-channel and supports conversion between VMID and virtual multi-channel, that is, the memory controller can connect the memory with the plurality of virtual machines.
  • the VMID is in one-to-one correspondence with the virtual channel, and the virtual channel divides the memory capacity and bandwidth according to the VMID.
  • the memory controller is configured with at least one cache queue, each cache queue of the at least one cache queue is associated with a virtual machine identifier; and the memory controller acquires the data access report After the file, the memory controller stores the data fetching message in a cache queue associated with the virtual machine identifier carried in the data fetching message.
  • a cache queue can be associated with a register that records the VMID of the virtual machine corresponding to the cache queue.
  • VMM creates a virtual machine and allocates a memory resource for the virtual machine
  • a cache queue with the virtual machine is created in the memory controller, and the VMID of the virtual machine is written into a register corresponding to the virtual machine. In this way, the one-to-one correspondence between the cache queue and the virtual machine is indicated.
  • the memory controller receives the data access message, the memory controller caches the received cache queue corresponding to the virtual machine that sends the data access message. Data access message.
  • the memory controller can also store the received data fetching message into the FIFO by using a first input first output (FIFO) method, and process the data fetched message in a serial manner. .
  • FIFO first input first output
  • the memory controller supports the parsing of "VMID + virtual address information", and the "VMID + virtual address information" is converted into the actual physical memory address of the memory by the address translation component.
  • the internal virtual addresses of different virtual machines can overlap because of the existence of VMID.
  • the mapping relationship between the virtual machine and the memory area allocated by the VMM for the virtual machine is established in the memory controller.
  • the mapping table may be used to record the VMM allocated to a virtual machine.
  • the mapping between the memory address range and the VMID of the virtual machine, "VMID + virtual machine virtual address" and the physical memory address are in one-to-one correspondence.
  • the memory controller receives the data access message, it can be based on the VMID and the data to be accessed.
  • the virtual address inside the virtual machine determines the physical address of the data in memory.
  • the memory controller determines, according to the virtual machine identifier and the virtual address information, physical memory of the data to be accessed in the memory device. After the address, the method further includes: the memory controller writing the data to be accessed to the memory area indicated by the physical memory address;
  • the memory controller determines, according to the virtual machine identifier and the virtual address information, that the data to be accessed is after the physical memory address in the memory device.
  • the method further includes: the memory controller reading the data to be accessed from a memory area indicated by the physical memory address.
  • the memory controller may be scheduled based on the VMID, and the method 400 further includes: if the memory controller receives N memory access requests carrying the same virtual machine identifier, the memory controller may carry the N Memory access requests for the same virtual machine identity are merged, where N is a positive integer greater than one.
  • a virtual machine identifier is added to the packet, thereby realizing direct access of the processor resource to the memory resource, and reducing
  • the cumbersome management process of software access to memory resources in the virtualization system further provides a basis for dynamic allocation of virtual machine resources.
  • FIG. 5 is an exemplary flowchart of a virtualization method 500 according to an embodiment of the present invention.
  • the virtualization method 500 is a virtual machine I/O device access method, and is used for a virtual machine pair computer system running on a computer system.
  • the /O resource is accessed.
  • the VMM assigns each virtual machine a virtual machine identifier, which is used to indicate the identity of the virtual machine, and the hardware resources allocated by the VMM to the virtual machine and the virtual machine.
  • VMID is associated.
  • method 500 includes:
  • the first virtual machine generates a first I/O access message, where the first I/O access message includes a virtual machine identifier, where the virtual machine identifier is used to identify the first I/O access message.
  • the first virtual machine is a virtual machine identifier, where the virtual machine identifier is used to identify the first I/O access message.
  • the I/O access message is generated by the processor resource of the first virtual machine that needs to access the I/O device, where the first virtual machine identifier is used to indicate that the processor resource belongs to the first virtual machine.
  • each processor resource corresponds to one VMID
  • the VMID indicates which virtual machine the processor resource is allocated to. For example, by assigning a register to each processor resource of the virtual machine, when the VMM allocates a processor resource to a virtual machine, the VMM writes the VMID of the virtual machine in a register corresponding to the processor resource. , thereby associating the processor resource with the virtual machine through the VMID, the register holds the latest virtual The virtual machine's VMID, whenever the virtual machine is switched or the processor resources are dynamically adjusted, the VMM updates the VMID recorded in the register according to the allocation of the processor resources to ensure that the register holds the VMID of the latest virtual machine.
  • the processor resource of the virtual machine is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine, and when a virtual machine is allocated with multiple processor cores or hardware threads, the virtual machine is The processor resource corresponds to a plurality of registers, and the virtual machine identifier of the virtual machine is saved in each register.
  • the method 500 further includes: acquiring the virtual machine identifier of the virtual machine from the at least one register.
  • the first virtual machine sends the first I/O access message to an I/O controller, where the I/O controller is used to manage an I/O device.
  • the first virtual machine sends the first I/O access message to an I/O controller, where: the first virtual machine sends the The I/O controller sends the first I/O access message carrying the first virtual machine identifier, and the system bus supports transmission of the virtual machine identifier.
  • the system bus may be extended, and a VMID (such as 8 bits) is added to the address line, and the memory access request sent by the processor resource needs to carry the VMID.
  • VMID such as 8 bits
  • the I/O device includes but is not limited to: a graphics processing unit (GPU), a network interface card (NIC), a serial advanced technology attachment (SATA), a storage device, and the like. .
  • GPU graphics processing unit
  • NIC network interface card
  • SATA serial advanced technology attachment
  • storage device and the like.
  • the I/O controller allocates an I/O device to the first virtual machine according to the first I/O access message.
  • the I/O controller when the I/O controller further acquires the second I/O access message of the second virtual machine, the I/O controller according to the first I/O access message
  • the I/O device is allocated to the first virtual machine, and the I/O controller allocates the I/O device to the first virtual device according to a priority priority relationship according to a priority order.
  • the machine is used, wherein the priority relationship is used to indicate a priority size of the first virtual machine and the second virtual machine.
  • the I/O controller when the I/O controller further acquires the second I/O access message of the second virtual machine, the I/O controller according to the first I/O access message
  • the I/O device is allocated to the first virtual machine, and includes: the I/O controller according to the sequence of obtaining the first I/O access message and the second I/O access message Assigning the I/O device to the first virtual machine for use.
  • the I/O controller supports parsing and conversion of the VMID. From the perspective of processor resources, only virtual I/O function blocks can be seen, and multiple virtual I/O function blocks can correspond to one I/O device. That is, one physical I/O device can be shared by multiple virtual machines in a time-sharing manner. Multiple virtual machines can respectively see one I/O device. The I/O device is shared by multiple virtual machines and can be used by multiple virtual machines. Time-division multiplexing. After receiving the I/O access message, the I/O resource controller determines which virtual machine is the virtual machine that requests access to the I/O device based on the VMID carried in the packet, and time-sharing. By assigning I/O devices to different virtual machines, you can meet the requirements of each virtual machine to use I/O devices in a time-sharing manner. This eliminates the need to run drivers in the VMM and avoid inefficient I/O virtualization through software methods.
  • NICs there is only one network card on the hardware, and multiple NICs can be virtualized through the controller, and multiple NICs can be seen from the perspective of the virtual machine.
  • Multiple virtual machines implement time-sharing multiplexing of a physical I/O device or interface, but in the view of a virtual machine, the virtual machine monopolizes the physical I/O device.
  • the method further includes: locking the I/O device, so that the The I/O device is exclusive to the first virtual machine, and after the first virtual machine uses the I/O device to complete an I/O operation, unlocking the I/O device to make the The I/O devices are assigned to other virtual machines for use.
  • each I/O device can be assigned a register.
  • the VMM allocates an I/O device to a virtual machine
  • the VMID of the virtual machine is written into a register corresponding to the I/O device.
  • the I/O controller is configured with at least one cache queue, and each cache queue in the at least one cache queue is associated with a virtual machine identifier; the I/O After the controller acquires the first I/O access message of the first virtual machine, the method further includes: the I/O controller storing the first I/O access message in the I/O access message The virtual machine identifies the associated cache queue.
  • a register can be associated with a cache queue that holds the VMID that marks the cache queue.
  • the VMM creates a virtual machine and allocates I/O resources to the virtual machine, it creates a I/O controller. a cache queue associated with the virtual machine, and writing a VMID of the virtual machine to a register corresponding to the virtual machine, thereby indicating a one-to-one correspondence between the cache queue and the virtual machine, when the I/O controller receives the I
  • the /O accesses the packet it caches the received I/O access message by using the cache queue corresponding to the virtual machine that sends the data fetch message.
  • a processor of a virtual machine When a resource accesses an I/O resource, the virtual machine identifier is added to the packet, which realizes direct access of the processor resource to the I/O resource, and reduces the cumbersome management process of the software accessing the I/O resource in the virtualized system. Further provides a basis for dynamic allocation of virtual machine resources.
  • FIG. 6 is a schematic diagram of a logical structure of a virtualization device 600 according to an embodiment of the present invention.
  • the virtualization device 600 is a virtual machine data access device. As shown in FIG. 6, the device 600 includes a generating unit 602 and a sending unit 604.
  • the generating unit 602 is configured to generate a data fetching message, where the data fetching message carries a virtual machine identifier and virtual address information, where the virtual machine identifier is used to identify a virtual machine running on the device, the virtual address The information is the virtual address of the virtual machine in the data to be accessed.
  • the sending unit 604 is configured to send the data access message to the memory controller, where the memory controller is configured to control a memory access operation.
  • the device 600 is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine; and the generating unit 602 generates a data access message. Previously, it is further configured to acquire a virtual machine identifier of the virtual machine from the at least one register.
  • the device includes a searching unit, where the searching unit is configured to search for the virtual machine identifier and the cache from the cache according to the virtual machine identifier and the virtual address information.
  • the cache block indicated by the virtual address information, the identifier bit of the buffered cache block includes a virtual machine identifier bit and an address information identifier bit.
  • the sending unit 604 is configured to send the data access message to the memory controller, where the sending unit is configured to send, by using a system bus, the virtual machine identifier and the virtual address information to the memory controller.
  • the data is stored in the message.
  • the data fetching message includes a data write message or a data read message, where the data write message is used to write the memory area indicated by the virtual machine identifier and the virtual address information Data to be stored; the data read message is used to read the data to be accessed from a memory area jointly indicated by the virtual machine identifier and the virtual address information.
  • the embodiment of the present invention corresponds to the method embodiment of FIG. 4, and the feature description of the embodiment of FIG. 4 is applicable to the embodiment of the present invention, and details are not described herein again.
  • a virtual machine identifier is added to the packet, thereby realizing direct access of the processor resource to the memory resource, and reducing The cumbersome management of software access to memory resources in a virtualized system
  • the process further provides a basis for dynamic allocation of virtual machine resources.
  • FIG. 7 is a schematic diagram of a logical structure of a virtualization device 700 according to an embodiment of the present invention.
  • the virtualization device 700 is a virtual machine data access device. As shown in FIG. 7, the device 700 includes an obtaining unit 702 and a determining unit 704.
  • the obtaining unit 702 is configured to obtain a data fetching message of the virtual machine, where the data fetching message carries a virtual machine identifier and virtual address information, where the virtual machine identifier is used to identify the The virtual machine, where the virtual address information is a virtual address of the virtual machine in the data to be accessed.
  • the determining unit 704 is configured to determine, according to the virtual machine identifier and the virtual address information, a physical memory address of the data to be accessed in the memory device.
  • the determining unit 704 is configured to determine, according to the virtual machine identifier and the virtual address information, a physical memory address of the data to be accessed in the memory device, including The determining unit 704 is configured to query a preset corresponding relationship according to the virtual machine identifier and the virtual address information, and determine a physical memory address of the data to be accessed in the memory device, where the corresponding relationship Corresponding relationship between a virtual machine identifier of each virtual machine running by the computer system and a physical memory address allocated by each virtual machine.
  • the device 700 is configured with at least one cache queue, and each cache queue of the at least one cache queue is associated with one virtual machine identifier; after the obtaining unit 702 obtains the data access message, the method is further used for And storing the data fetching message in a cache queue associated with the virtual machine identifier carried in the data fetching message.
  • the obtaining unit 702 is configured to acquire a data access message of the virtual machine, where the acquiring unit 702 is configured to receive, by using a system bus, the data that carries the virtual machine identifier and the virtual address information. Access the message.
  • the device further includes a processing unit, where the data memory access message includes a data write message or a data read message; if the data memory access message is a data write message The processing unit is configured to write the data to be accessed to the memory area indicated by the physical memory address; if the data memory access message is a data read message, the processing unit is used to The memory area indicated by the physical memory address reads the data to be accessed.
  • the embodiment of the present invention corresponds to the method embodiment of FIG. 4, and the feature description of the embodiment of FIG. 4 is applicable to the embodiment of the present invention, and details are not described herein again.
  • a processor of a virtual machine When a resource accesses a memory resource, the virtual machine identifier is added to the packet to implement direct access of the processor resource to the memory resource, which reduces the cumbersome management process of the software accessing the memory resource in the virtualized system, and further is a virtual machine resource. Dynamic allocation provides the foundation.
  • FIG. 8 is a schematic diagram showing the logical structure of a virtualization device 800 according to an embodiment of the present invention.
  • the virtualization device 800 is a virtual machine I/O device access device. As shown in FIG. 8, the device 800 includes a generating unit 802 and a sending unit. 804,
  • the generating unit 802 is configured to generate an I/O access message, where the I/O access message includes a virtual machine identifier, where the virtual machine identifier is used to identify a virtual machine running on the device.
  • the sending unit 804 is configured to send the I/O access message to an I/O controller, where the I/O controller is used to manage the I/O device.
  • the device 800 is configured with at least one register, where the at least one register is used to store a virtual machine identifier of the virtual machine; and the generating unit 802 generates an I/O access report.
  • the file is also used to obtain the virtual machine identifier of the virtual machine from the at least one register.
  • the sending unit 804 is configured to send the I/O access message to the I/O controller, where the sending unit is configured to send, by using the system bus, the I/O controller to carry the The I/O access message identified by the virtual machine.
  • a processor resource of a virtual machine accesses an I/O resource
  • the processor resource is directly added to the I/O resource by adding a virtual machine identifier to the packet.
  • Access reduces the cumbersome management process of software access to I/O resources in the virtualization system, and further provides a basis for dynamic allocation of virtual machine resources.
  • the embodiment of the present invention corresponds to the method embodiment of FIG. 5, and the feature description of the embodiment of FIG. 5 is applicable to the embodiment of the present invention, and details are not described herein again.
  • FIG. 9 is a schematic diagram showing the logical structure of a virtualization device 900 according to an embodiment of the present invention.
  • the virtualization device 900 is a virtual machine I/O device access device. As shown in FIG. 9, the device 900 includes an obtaining unit 902 and an allocating unit. 904,
  • the obtaining unit 902 is configured to acquire a first I/O access message of the first virtual machine, where the first I/O access message carries a virtual machine identifier, where the virtual machine identifier is used to identify that the I/O access is sent.
  • the first virtual machine of the message is configured to acquire a first I/O access message of the first virtual machine, where the first I/O access message carries a virtual machine identifier, where the virtual machine identifier is used to identify that the I/O access is sent.
  • the first virtual machine of the message is configured to acquire a first I/O access message of the first virtual machine, where the first I/O access message carries a virtual machine identifier, where the virtual machine identifier is used to identify that the I/O access is sent. The first virtual machine of the message.
  • the allocating unit 904 is configured to allocate an I/O device to the first virtual machine for use according to the first I/O access message.
  • the allocating unit 904 when the acquiring unit 902 further acquires the second I/O access message of the second virtual machine, the allocating unit 904 is configured to use the first I/ The O access message is used to allocate the I/O device to the first virtual machine, and the: the allocating unit 904 is configured to allocate the I/O device according to a priority order according to a priority order. Used by the first virtual machine, wherein the priority relationship is used to indicate a priority size of the first virtual machine and the second virtual machine.
  • the allocating unit 904 when the acquiring unit 902 further acquires the second I/O access message of the second virtual machine, the allocating unit 904 is configured to use the first I/ The O access message is used to allocate the I/O device to the first virtual machine, and the method includes: the allocating unit 904 is configured to obtain the first I/O access message and the second I/O according to the The order of accessing the messages assigns the I/O device to the first virtual machine for use.
  • the allocation unit 904 is further configured to lock the I/O device, so that the I/ An O device is exclusive to the first virtual machine, and after the first virtual machine completes an I/O operation using the I/O device, unlocking the I/O device to cause the I /O devices are assigned to other virtual machines for use.
  • the device configuration 900 has at least one cache queue, and each cache queue in the at least one cache queue is associated with one virtual machine identifier; the obtaining unit 902 acquires a first I/O access report of the first virtual machine. After the file is further used, the first I/O access message is stored in a cache queue associated with the virtual machine identifier in the I/O access message.
  • the acquiring unit 902 is configured to acquire a first I/O access message of the first virtual machine, where the acquiring unit is configured to receive, by using a system bus, a first I/ from the first virtual machine. O access message.
  • the embodiment of the present invention corresponds to the method embodiment of FIG. 5, and the feature description of the embodiment of FIG. 5 is applicable to the embodiment of the present invention, and details are not described herein again.
  • a processor resource of a virtual machine accesses an I/O resource
  • the processor resource is directly added to the I/O resource by adding a virtual machine identifier to the packet.
  • Access reduces the cumbersome management process of software access to I/O resources in the virtualization system, and further provides a basis for dynamic allocation of virtual machine resources.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative
  • the division of the modules is only a logical function division, and the implementation may have another division manner, for example, multiple modules or components may be combined or integrated into another system, or some features may be ignored. Or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or otherwise.
  • the modules described as separate components may or may not be physically separated.
  • the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.
  • the above-described integrated modules implemented in the form of software function modules can be stored in a computer readable storage medium.
  • the software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform some of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a mobile hard disk, a read-only memory (English: Read-Only Memory, ROM for short), a random access memory (English: Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like. The medium of the code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

L'invention concerne un procédé, un appareil et un système de virtualisation réalisant une de virtualisation matérielle. Le procédé consiste : à générer un message d'accès aux données comportant un identifiant de machine virtuelle ainsi que des informations d'adresse virtuelle (S402), l'identifiant de machine virtuelle étant configuré de sorte à identifier une machine virtuelle générant le message d'accès aux données, et les informations d'adresse virtuelle étant une adresse virtuelle des données accessibles dans la machine virtuelle ; à envoyer le message d'accès aux données à un dispositif de commande de mémoire (S404) ; et à déterminer, au moyen du dispositif de commande de mémoire et en fonction de l'identifiant de machine virtuelle et des informations d'adresse virtuelle, une adresse de mémoire physique des données accessibles dans un dispositif de mémoire (S406). La présente invention réalise un accès direct à une ressource de mémoire par le biais de l'ajout de l'identifiant de machine virtuelle dans le message d'accès aux données, ce qui permet de simplifier la procédure de gestion complexe permettant d'avoir accès à une ressource de mémoire dans un système de virtualisation pour logiciel et, en outre, de faciliter une attribution dynamique des ressources de machine virtuelle.
PCT/CN2016/073860 2015-08-11 2016-02-16 Procédé, appareil et système de virtualisation WO2017024783A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510489246.4A CN106445628A (zh) 2015-08-11 2015-08-11 一种虚拟化方法、装置和系统
CN201510489246.4 2015-08-11

Publications (1)

Publication Number Publication Date
WO2017024783A1 true WO2017024783A1 (fr) 2017-02-16

Family

ID=57982960

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/073860 WO2017024783A1 (fr) 2015-08-11 2016-02-16 Procédé, appareil et système de virtualisation

Country Status (2)

Country Link
CN (1) CN106445628A (fr)
WO (1) WO2017024783A1 (fr)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417683A (zh) * 2019-07-24 2019-11-05 新华三大数据技术有限公司 报文处理方法、装置及服务器
CN113691465A (zh) * 2020-05-19 2021-11-23 阿里巴巴集团控股有限公司 一种数据的传输方法、智能网卡、计算设备及存储介质
CN114741214A (zh) * 2022-04-01 2022-07-12 新华三技术有限公司 一种数据传输方法、装置及设备
CN117492932B (zh) * 2023-12-28 2024-04-09 北京微核芯科技有限公司 虚拟机访问方法和设备

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783913B (zh) * 2016-08-31 2021-12-03 华为技术有限公司 一种应用于计算机的资源访问方法和计算机
CN107085535B (zh) * 2017-03-30 2020-10-27 联想(北京)有限公司 一种信息处理方法及电子设备
CN107562515B (zh) * 2017-08-04 2021-09-07 海光信息技术股份有限公司 一种在虚拟化技术中管理内存的方法
JP6963534B2 (ja) * 2018-05-25 2021-11-10 ルネサスエレクトロニクス株式会社 メモリ保護回路及びメモリ保護方法
CN108920252A (zh) * 2018-06-15 2018-11-30 西安微电子技术研究所 一种基于多队列千兆以太网控制器的io虚拟化装置
CN108920269B (zh) * 2018-07-19 2021-03-19 中国联合网络通信集团有限公司 容器的i/o传输任务的调度方法和装置
CN110851371B (zh) 2018-08-20 2023-09-26 华为技术有限公司 报文处理方法及相关设备
CN109858265B (zh) * 2018-11-22 2022-01-28 海光信息技术股份有限公司 一种加密方法、装置及相关设备
CN111857943B (zh) * 2019-04-30 2024-05-17 华为技术有限公司 数据处理的方法、装置与设备
CN112114738B (zh) * 2019-06-20 2024-02-20 杭州海康威视数字技术股份有限公司 一种存储数据的方法及存储设备
CN110618962A (zh) * 2019-08-16 2019-12-27 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Ft-m6678芯片的多核网络并发访问方法、系统及介质
CN111782268B (zh) * 2020-04-10 2024-05-17 北京京东尚科信息技术有限公司 分配硬件资源的方法、装置、设备和计算机可读介质
CN111666579B (zh) * 2020-06-18 2024-03-08 安谋科技(中国)有限公司 计算机设备及其访问控制方法和计算机可读介质
US20240012771A1 (en) * 2020-11-05 2024-01-11 Google Llc Memory-Request Priority Up-Leveling
CN112416525B (zh) * 2020-11-27 2022-06-03 海光信息技术股份有限公司 设备驱动初始化方法、直接存储访问方法及相关装置
CN112905304A (zh) * 2021-03-08 2021-06-04 深信服科技股份有限公司 一种虚拟机间通信方法、装置、物理主机及介质
CN115442317B (zh) * 2021-12-17 2023-10-10 北京罗克维尔斯科技有限公司 报文处理方法、装置、系统、设备及介质
CN115988218B (zh) * 2023-03-14 2023-06-09 摩尔线程智能科技(北京)有限责任公司 一种虚拟化视频编解码系统、电子设备和存储介质
CN116719606A (zh) * 2023-06-12 2023-09-08 北京芯素科技有限公司 支持硬件虚拟化的加速器及其数据访问方法
CN117707994A (zh) * 2024-02-02 2024-03-15 北京象帝先计算技术有限公司 请求缓冲器、系统、组件、设备及传输方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060224816A1 (en) * 2005-03-31 2006-10-05 Koichi Yamada Method and apparatus for managing virtual addresses
CN102483718A (zh) * 2009-08-25 2012-05-30 国际商业机器公司 虚拟化环境中的高速缓存分区
CN103514043A (zh) * 2012-06-29 2014-01-15 华为技术有限公司 多处理器系统及该系统的数据处理方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN85101171B (zh) * 1985-04-01 1988-08-17 株式会社日立制作所 虚拟机系统及其计算机系统的i/o执行方法
US20130055259A1 (en) * 2009-12-24 2013-02-28 Yaozu Dong Method and apparatus for handling an i/o operation in a virtualization environment
CN102306126B (zh) * 2011-08-24 2014-06-04 华为技术有限公司 内存管理方法、装置和系统
CN104063281B (zh) * 2013-03-21 2018-04-10 华为技术有限公司 一种调控虚拟机物理内存的方法和装置
US9792062B2 (en) * 2013-05-10 2017-10-17 Empire Technology Development Llc Acceleration of memory access
CN103530167B (zh) * 2013-09-30 2017-04-05 华为技术有限公司 一种虚拟机内存数据的迁移方法及相关装置和集群系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060224816A1 (en) * 2005-03-31 2006-10-05 Koichi Yamada Method and apparatus for managing virtual addresses
CN102483718A (zh) * 2009-08-25 2012-05-30 国际商业机器公司 虚拟化环境中的高速缓存分区
CN103514043A (zh) * 2012-06-29 2014-01-15 华为技术有限公司 多处理器系统及该系统的数据处理方法

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417683A (zh) * 2019-07-24 2019-11-05 新华三大数据技术有限公司 报文处理方法、装置及服务器
CN110417683B (zh) * 2019-07-24 2022-07-29 新华三大数据技术有限公司 报文处理方法、装置及服务器
CN113691465A (zh) * 2020-05-19 2021-11-23 阿里巴巴集团控股有限公司 一种数据的传输方法、智能网卡、计算设备及存储介质
CN114741214A (zh) * 2022-04-01 2022-07-12 新华三技术有限公司 一种数据传输方法、装置及设备
CN114741214B (zh) * 2022-04-01 2024-02-27 新华三技术有限公司 一种数据传输方法、装置及设备
CN117492932B (zh) * 2023-12-28 2024-04-09 北京微核芯科技有限公司 虚拟机访问方法和设备

Also Published As

Publication number Publication date
CN106445628A (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
WO2017024783A1 (fr) Procédé, appareil et système de virtualisation
US10970104B2 (en) Resource access method applied to computer and computer
US10191759B2 (en) Apparatus and method for scheduling graphics processing unit workloads from virtual machines
US9697024B2 (en) Interrupt management method, and computer implementing the interrupt management method
JP5608243B2 (ja) 仮想化環境においてi/o処理を行う方法および装置
CN115344521A (zh) 可扩展输入/输出(i/o)虚拟化(s-iov)架构中的虚拟设备构成
US20210216453A1 (en) Systems and methods for input/output computing resource control
US10659534B1 (en) Memory sharing for buffered macro-pipelined data plane processing in multicore embedded systems
US11194735B2 (en) Technologies for flexible virtual function queue assignment
US10540294B2 (en) Secure zero-copy packet forwarding
CN103034524A (zh) 半虚拟化的虚拟gpu
JP2015503784A (ja) グラフィックス処理部における仮想マシン間の移行
US20120284437A1 (en) Pci express sr-iov/mr-iov virtual function clusters
US9910690B2 (en) PCI slot hot-addition deferral for multi-function devices
US11836091B2 (en) Secure memory access in a virtualized computing environment
US20190205259A1 (en) Exitless extended page table switching for nested hypervisors
US20220050795A1 (en) Data processing method, apparatus, and device
US11150928B2 (en) Hypervisor translation bypass
US11314522B2 (en) Fast boot resource allocation for virtual machines

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16834411

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16834411

Country of ref document: EP

Kind code of ref document: A1