WO2014000437A1 - Virtual interrupt management method and apparatus in distributed virtual system - Google Patents

Virtual interrupt management method and apparatus in distributed virtual system Download PDF

Info

Publication number
WO2014000437A1
WO2014000437A1 PCT/CN2013/070591 CN2013070591W WO2014000437A1 WO 2014000437 A1 WO2014000437 A1 WO 2014000437A1 CN 2013070591 W CN2013070591 W CN 2013070591W WO 2014000437 A1 WO2014000437 A1 WO 2014000437A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
interrupt pin
interrupt
local
physical node
Prior art date
Application number
PCT/CN2013/070591
Other languages
French (fr)
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 WO2014000437A1 publication Critical patent/WO2014000437A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • Embodiments of the present invention relate to computer technologies, and in particular, to a virtual interrupt management method and apparatus for a distributed virtualization system. Background technique
  • each peripheral is interconnected (Peripheral)
  • PCI devices Devi, Dev2... .Devn need to send an interrupt to inform the operating system after completing one of their own work, this is achieved by connecting the PCI device to the interrupt pin of the interrupt controller. For example, connect to the interrupt pin of the 10 Advanced Programmable Interrupt Controller (IO-APIC).
  • IO-APIC Advanced Programmable Interrupt Controller
  • BIO S Basic Input/Output System
  • Advanced configuration and power management interfaces to the internal memory (Advanced).
  • the Configuration and Power Interface (ACPI) table method informs the operating system of all PCI device information, including the connection relationship between the interrupt pins of all PCI devices and the interrupt pins of the interrupt controller. After the operating system is booted, the interrupt pin of the PCI device is set, and the interrupt of the PCI device is transferred to a specified physical CPU for processing.
  • the ACPI table may be a Differentiated System Description Table (DSDT) table.
  • DSDT Differentiated System Description Table
  • D VMM Distributed Virtual Machine Monitor
  • D VMM also needs to simulate the interrupted connection relationship of virtual PCI devices.
  • a device model (DM) of each physical node in a distributed virtualization environment allocates a bus number Bus and a device number Device to the virtual PCI device when the virtual PCI device is created, and determines the virtual PCI.
  • the device's own interrupt pin number, Intx is used to notify the virtual PCI device of the operating system device number as Device through the ACPI table in the memory.
  • the Intx interrupt pin is connected to which global virtual interrupt pin of the Virtual I/O Advanced Programmable Interrupt Controller (vIO-APIC).
  • DVMM simulates the interrupt pin number of the virtual PCI device to which the global virtual interrupt pin in the global vIO-APIC is connected.
  • a global virtual interrupt pin of a virtual machine may be connected to an interrupt pin of a virtual PCI device in a plurality of physical nodes, as shown in FIG. 1B, in a physical node.
  • the interrupt pin of the virtual PCI device with the device number and interrupt pin number (0, 1) is connected to the interrupt pin of the virtual PCI device with the device number and interrupt pin number (8, 0) in the other physical node.
  • the DVMM running the setting command intercepts the setting operation of the global virtual interrupt pin of the 17th, and needs to send to multiple physical nodes.
  • the data packet is used to synchronize the interrupt pins of all virtual PCI devices connected to the 17th global virtual interrupt pin, for example, (0, 1) and (8, 0), and send the synchronously set data packets.
  • a virtual machine's set instruction is intercepted, its next instruction will be executed after the previous instruction has been simulated, so the longer it takes to simulate the setup instruction, the slower the virtual machine will run. Simulating a setup command requires simultaneous setup between multiple nodes, which takes longer, and the synchronization between different physical nodes can have a significant impact on virtual machine performance.
  • Embodiments of the present invention provide a virtual interrupt management method and apparatus for a distributed virtualization system, which are used to solve a problem in that a virtual PCI device in a plurality of physical nodes is connected to the same global virtual The interrupt pin causes a defect in performance degradation.
  • an embodiment of the present invention provides a virtual interrupt management method for a distributed virtualization system, including:
  • the virtual BIOS module of the virtual machine establishes a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual peripheral device interconnect PCI device in the ACPI table of the advanced configuration and the power management interface, wherein the global virtual interrupt pin is a virtual interrupt One or more interrupt pins on the foot controller, any one of the global virtual interrupt pins corresponding to one or more of the same physical node An interrupt pin of the virtual PCI device; the virtual interrupt pin controller is provided for an operating system of the virtual machine;
  • the operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, runs an instruction to set a target virtual central processing unit vCPU for the global virtual interrupt pin in the ACPI table; intercepting the distributed instruction a virtual machine monitor, configured to determine, according to the distributed interrupt pin information, a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, where the local virtual interrupt pin is located on the physical node and used to simulate the global virtual An interrupt pin, the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of the virtual PCI device, and a virtual PCI device and a local virtual interrupt pin included in each physical node;
  • an embodiment of the present invention provides a virtual interrupt management device of a distributed virtualization system, including a virtual machine and a plurality of distributed virtual machine monitors deployed on different physical nodes.
  • the virtual machine includes: a virtual BIOS module and an operating system;
  • the virtual BIOS module is configured to establish, in an ACPI table, a connection relationship between a global virtual interrupt pin on the virtual machine and an interrupt pin of the virtual PCI device, where any one of the global virtual interrupt pins corresponds to An interrupt pin of one or more of the virtual PCI devices of the same physical node;
  • the operating system is configured to obtain the ACPI table, and run according to the ACPI table.
  • the global virtual interrupt pin in the ACPI table sets an instruction of the target vCPU; the first distributed virtual machine monitor of the plurality of distributed virtual machine monitors is configured to intercept an instruction of the operating system to set a target vCPU, according to
  • the distributed interrupt pin information determines a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, and the local virtual interrupt pin is located on the physical node and is used to simulate the global virtual interrupt pin.
  • the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of the virtual PCI device, and each physical node includes a virtual PCI device and a local virtual interrupt pin for which the respective physical node is responsible; a second distributed virtual machine monitor of the plurality of distributed virtual machine monitors for saving the Corresponding relationship between the local virtual interrupt pin and the target vCPU, the second distributed virtual machine monitor being a distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located.
  • a virtual virtual interrupt pin written by a virtual BIOS module in an ACPI table corresponds to a local virtual interrupt pin on the same physical node, that is, a global
  • the virtual interrupt pin is simulated by a local virtual interrupt pin on the same physical node. Therefore, when the global virtual interrupt pin is set, the operating system does not need to send synchronously set data packets to different nodes, which improves the distribution. The performance of a virtualized system.
  • FIG. 1A is a schematic diagram of a PCI device interrupt connection architecture in a non-virtualized environment provided by the prior art
  • FIG. 1B is a schematic diagram of a virtual PCI device interrupt connection architecture in a distributed virtualization environment provided by the prior art
  • FIG. 3 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a virtual PCI device interrupt connection according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a virtual interrupt pin management method of another distributed virtualization system according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a virtual interrupt pin management structure of a distributed virtualization system according to an embodiment of the present invention. detailed description
  • Virtualization technology is a decoupling method that separates the underlying hardware devices from the upper operating system and applications. It introduces the Virtual Machine Monitor (VMM) layer to directly manage the underlying hardware resources and create and underlying hardware.
  • VMM Virtual Machine Monitor
  • An unrelated virtual machine (VM) is used by upper operating systems and applications. Virtual machines do not have real physical devices, and software interrupt controllers and physical devices are required to form virtual interrupt controllers and virtual devices.
  • the virtual BIOS writes an ACPI table in the memory allocated to the owning virtual machine.
  • the virtual device can be set and used by commands.
  • the VMM sets the virtual device or simulates the physical device according to the instructions of the operating system, and returns the simulation result to the virtual machine.
  • FIG. 2 is a schematic diagram of a distributed virtualization structure according to an embodiment of the present invention.
  • the distributed virtualization architecture shown in Figure 2 includes a VM layer, a DVMM layer, and a physical node layer.
  • Each physical node includes hardware resources such as processors, memory, disks, network cards, and peripherals.
  • Each physical node is deployed with a DVMM. When a virtual machine is created, the DVMM deployed on each physical node creates the required virtual hardware devices for the virtual machines at the physical nodes to which they belong.
  • the virtual machine runs on a physical node in the same time period.
  • DVMM mainly includes three modules: CPU virtualization, memory virtualization and I/O virtualization. It achieves the aggregation of physical resources based on virtual resource aggregation.
  • I/O virtualization simulates PCI devices and their interrupted connections in a non-virtualized environment.
  • DVMM does not allow all of these actions to operate directly on the physical hardware when the operating system is installed and running on the virtual machine, and the hardware resources are initialized and used. Instead, the access behavior is simulated and the access behavior is simulated.
  • the access to the virtual hardware ultimately uses the virtual hardware as a proxy to operate the real physical hardware, ensuring the isolation between different virtual machines and the correct use of the virtual machine for hardware resources.
  • the DVMM layer directly manages the local underlying hardware resources and cooperates with the DVMM on other nodes through network communication to make the virtual machine have a cross-section.
  • the ability to access resources Specifically, when a distributed virtual machine monitor of a node intercepts an instruction of a virtual machine operating system, first determining which node the virtual hardware (including the pin of the virtual interrupt controller) operated by the instruction is on, and then performing the desired The operation is transmitted to the node through the communication module to simulate, for example, to the virtual hardware that sets the virtual hardware or operates the virtual hardware to simulate.
  • FIG. 3 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a virtual PCI device interrupt connection according to an embodiment of the present invention.
  • the virtual interrupt controller provided by the VM is global vIO-APIC.
  • the interrupt pin on the global vIO-APIC is called the global virtual interrupt pin, and the virtual OS only has the global virtual interrupt controller provided by the VM.
  • the interrupt pin of each virtual PCI device is connected to a global virtual interrupt pin on the global virtual interrupt controller.
  • the virtual interrupt controller provided by the DVMM on each physical node is a local vIO-APIC.
  • the interrupt pin on the local vIO-APIC is called a local virtual interrupt pin, which is simulated by a local virtual interrupt controller on each physical node.
  • Global virtual interrupt pin the interrupt pin of each virtual PCI device is connected to a local virtual interrupt pin on the local virtual interrupt controller.
  • One physical node has multiple virtual PCI devices, one virtual PCI device can have multiple interrupt pins, and one virtual PCI device can also be connected to multiple local virtual interrupt pins on the local vIO-APIC.
  • the DM module registers the PCI bus number and device number of the virtual PCI device created in each physical node, and the device numbers of the virtual PCI devices on all physical nodes are uniformly numbered, and the local vIO-APIC on each physical node is localized.
  • Virtual interrupt pins can be individually numbered.
  • the interrupt structure provided by the VM to the virtual machine operating system is the connection relationship between the virtual interrupt pin of the virtual PCI device included in the VM and the global virtual interrupt pin on the global vIO-APIC.
  • the interrupt structure provided by the DVMM deployed on one physical node is the connection relationship between the interrupt pin of the virtual PCI device included in the physical node and the local virtual interrupt pin on the local vIO-APIC managed by the physical node.
  • the Intx number interrupt pin of the virtual PCI device with the device number Device is connected to the global virtual interrupt pin of the gsi number in the global vIO-APIC;
  • the interrupt structure saved on the physical node where the virtual PCI device of the device resides is the device number.
  • the Intx interrupt pin of the virtual PCI device of Device is connected to the local virtual interrupt pin of the xth in the local vIO-APIC, that is, on the physical node, the part of the Xth in the local vIO-APIC is used.
  • the virtual interrupt pin emulates the global virtual interrupt pin of the gsi in global vIO-APIC.
  • the DVMM intercepts the operation and simulates setting the global virtual interrupt pin in the specified physical node, and the specified physical node is connected to the The physical node of the global virtual interrupt pin of the global virtual interrupt pin.
  • the method provided in this embodiment includes:
  • Step 31 The virtual BIOS module of the virtual machine establishes a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device in the ACPI table, where the global virtual interrupt pin is a virtual interrupt pin controller. Or a plurality of interrupt pins, any one of the global virtual interrupt pins corresponding to an interrupt pin of one or more of the virtual PCI devices belonging to the same physical node; the virtual interrupt pin controller is Provided by the operating system of the virtual machine;
  • the virtual BIOS module of the distributed virtualization system can write the ACPI to the virtual memory of the virtual machine.
  • the virtual machine operating system can obtain the ACPI table from the memory, and according to the ACPI table, it can be known which virtual interrupt pin is connected to which virtual interrupt pin on which virtual PCI device.
  • any global virtual interrupt pin is connected to the interrupt pin of one or more virtual PIC devices on the same physical node. That is, virtual PCI devices on different physical nodes are not connected to the same global virtual interrupt pin. Therefore, the same global virtual interrupt pin is implemented by a local virtual interrupt pin on a physical node.
  • connection relationship in the ACPI table can be expressed as (virtual PCI device number).
  • the global virtual interrupt pin of global vIO-APIC is connected to the Intxl interrupt pin of the virtual PCI device vDEVl on the NODE1 node and the Intx3 interrupt of the virtual PCI device VDEV12 on the NODE1 node.
  • global vIO-APIC No. 20 global virtual The interrupt pin is connected to the Intxl interrupt pin of the virtual PCI device VDEV21 on the NODE2 node and the Intxl interrupt pin of the virtual PCI device VDEV22 on the NODE2 node.
  • the global virtual interrupt pin of the global vIO-APIC is connected to the virtual PCI device on the NODE1 node, and the global virtual interrupt pin of the global vIO-APIC is connected to the virtual node on the NODE2 node. PCI device.
  • the virtual BIOS module divides all global virtual interrupt pins into a plurality of mutually disjoint subsets, and when allocating a local virtual interrupt pin on one physical node, interrupts all PCI devices of the same physical node.
  • the pins are mapped in a subset. Therefore, the interrupt pins of all PCI devices of a physical node in the ACPI table are connected in a subset.
  • the device number of the virtual PCI device on the physical node 0 is between 0 and 10.
  • the device number of the virtual PCI device on the physical node 1 is between 11 and 13.
  • the device number of the virtual PCI device on the physical node 2 is 14 ⁇ : 16, ..., the device number of the virtual PCI device on node 7 is between 29 and 31, and the interrupt pin of PCI device 0 ⁇ 10 (that is, all PCI device interrupt pins of node 0) will Connect directly to the 16 ⁇ 26 vIO-APIC pins; the interrupt pins of the 11 ⁇ 13 PCI devices (ie all PCI device interrupt pins on node 1) will be directly connected to the vIO-APIC pins 27 ⁇ 29; 29 ⁇ 31
  • the interrupt pin of the PCI device (that is, all PCI device interrupt pins on node 7) is directly connected to the vIO-APIC pins 45 ⁇ 47.
  • Pins 0 ⁇ 15 of vIO-APIC are used for special purposes. If all global virtual interrupt pins are divided into multiple disjoint subsets, and the interrupt pins of all PCI devices of one physical node are corresponding to one subset, the operating system can set the subset within the subset at a time. All global virtual interrupt pins do not need to be set up multiple times to set these global virtual interrupt pins because the local virtual interrupt pins that emulate these global virtual interrupt pins are on the same physical node. Thus, the performance of the virtual machine can be improved.
  • the virtual BIOS module can also connect the interrupt pins of all virtual PCI devices on one physical node to the same global virtual interrupt pin, that is, all local virtual interrupt pins on one physical node in the ACPI table. Corresponds to a global virtual interrupt pin.
  • Step 32 The operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, runs an instruction to set a target vCPU for the global virtual interrupt pin in the ACPI table.
  • the virtual machine's operating system determines the target Virtual Central Processing Unit (vCPU) that handles the interrupt on each global virtual interrupt pin based on the virtual PCI device to which the global virtual interrupt pin is connected in the APCI table.
  • a virtual PCI device connected to a global interrupt pin in the APCI table is a virtual mouse, and the virtual machine operating system will handle the interrupt of the virtual PCI device.
  • the target vCPU can be set to multiple vCPUs, while another global in the APCI table.
  • the virtual PCI device connected to the interrupt pin is a virtual hard disk, and the virtual machine operating system will handle the interrupt of the virtual PCI device.
  • the target vCPU can be set to a vCPU.
  • each global virtual interrupt pin in the APCI table needs to be set with a target vCPU, which may be processed one by one or batch processing.
  • vCPU which may be processed one by one or batch processing.
  • a global virtual interrupt pin setting vCPU is taken as an example.
  • Step 33 The distributed virtual machine monitor intercepting the instruction, determining, according to the distributed interrupt pin information, a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, the local virtual interrupt pin Located on a physical node and used to simulate the global virtual interrupt pin, the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of a virtual PCI device, and a virtual PCI device included in each physical node. And local virtual interrupt pins.
  • the distributed interrupt pin information can be recorded in the storage system of the distributed virtualization system: one is the connection relationship between each global virtual interrupt pin and the interrupt pin of the virtual PCI device on the physical node, and the connection relationship is The connection relationship is the same in the ACPI table.
  • the other is a virtual PCI device and a local virtual interrupt pin included in each physical node.
  • the distributed interrupt pin information may not be stored in the physical node to which the DVMM that intercepts the virtual machine operating system setting instruction belongs, intercepting the virtual The DVMM of the operating system setting command can cooperate with the DVMM to obtain distributed interrupt pin information from other physical nodes.
  • the local virtual interrupt pin connected to the interrupt pin of the virtual PCI device emulates the global virtual interrupt pin connected to the interrupt pin of the virtual PCI device on the physical node.
  • the Intxl interrupt pin of the virtual PCI device vDEV1 on the NODE1 node is connected to the local virtual interrupt of the local vIO-APIC on the NODE1 node.
  • the Intx3 interrupt pin of the virtual PCI device VDEV12 on the NODE1 node is connected to the local virtual interrupt pin No. 6 of the local vIO-APIC on the NODE1 node.
  • the Intxl interrupt pin of the virtual PCI device vDEV21 on the NODE2 node is connected to the local virtual interrupt of the local vIO-APIC on the NODE2 node.
  • the Intxl interrupt pin of the virtual PCI device VDEV22 on the NODE2 node is connected to the local virtual interrupt pin No. 10 of the local vIO-APIC on the NODE2 node.
  • the DVMM deployed on the physical node running the virtual machine operating system intercepts the setting command of the global interrupt virtual pin of the virtual machine operating system.
  • the interrupt pin of the virtual PCI device corresponding to the global virtual interrupt pin is determined according to the connection relationship between each global virtual interrupt pin and the interrupt pin of the virtual PCI device on the physical node.
  • the physical node where the analog local virtual interrupt pin is located can be determined by recording the virtual PCI device included in each physical node and the local virtual interrupt pin responsible for each physical node.
  • Step 34 The DVMM on the physical node where the local virtual interrupt pin is located saves the correspondence between the local virtual interrupt pin and the target vCPU according to the instruction, where the target vCPU is used to process the local part. An interrupt on the virtual interrupt pin.
  • the DVMM that intercepts the operating system setting instruction saves the local virtual interrupt pin and processes the local virtual Interrupt target on interrupt pin
  • the vCPU correspondence is stored, for example, in the interrupt processing vCPU table, and the target vCPU that handles the interrupt on the local virtual interrupt pin is the target vCPU set in the instruction of the operating system.
  • an interrupt on this local virtual interrupt pin When the physical node where the local virtual interrupt pin is located is not the same physical node as the local physical node where the DVMM that intercepts the operating system setting instruction is located, the DVMM that intercepts the operating system setting instruction sends a setting instruction to the local virtual interrupt pin.
  • a remote physical node where the DVMM of the remote physical node saves the correspondence between the local virtual interrupt pin and the target vCPU, for example, stored in an interrupt processing vCPU table, thereby being connected to the local virtual interrupt pin.
  • the DVMM of the remote physical node processes the vCPU table according to the saved interrupt to determine which vCPU is to handle the interrupt on the local virtual interrupt pin.
  • the virtual BIOS module writes a global virtual interrupt pin in the ACPI table to the interrupt pin of one or more virtual PIC devices on the same physical node, that is, a global virtual interrupt pin is configured.
  • the local virtual interrupt pin on the same physical node is simulated. Since the interrupt pins of the virtual PCI device of different physical nodes are not connected to the same global virtual interrupt pin, the virtual machine operating system sets the global virtual interrupt. When pins are used, there is no need to send packets for synchronization settings to different physical nodes, which improves the performance of the distributed virtualization system.
  • the DVMM of the physical node where the local virtual interrupt pin is located in step 35 determining, according to an instruction of the operating system, that the target vCPU that is interrupted on the local virtual interrupt pin is a vCPU on the remote physical node, the local virtual After the DVMM of the physical node where the interrupt pin is located receives the interrupt on the local virtual interrupt pin, the vCPU table is processed according to the saved interrupt, and the interrupt is transferred to the target vCPU of the remote physical node for processing, resulting in a longer processing time.
  • This non-localized way of handling interrupts can have a large impact on the performance of the virtual machine.
  • step 34 may include: Step 340: The DVMM of the physical node where the local virtual interrupt pin is located determines whether the physical node where the target vCPU is located is a local physical node according to the instruction. If the step 341 is performed, otherwise step 342 is performed.
  • Step 341 Save the correspondence between the local virtual interrupt pin and the target vCPU in the instruction.
  • the physical node of the target vCPU where the interrupt generated on the global interrupt pin is set to be processed according to the setting instruction is not the local physical node, and the local physical node includes multiple vCPUs, according to The load status of the local vCPU changes the target vCPU in the set instruction that handles the interrupt generated on the global interrupt pin that is set to the vCPU on the local physical node.
  • the local DVMM After the interrupt is generated on the local virtual interrupt pin that simulates the global virtual interrupt pin, the local DVMM passes the interrupt to the vCPU on the local physical node for processing, and does not need to pass the interrupt to the remote physical node for processing, reducing the The communication pressure between nodes reduces the impact of interrupts on virtual machine performance and improves the performance of virtual machines during the interruption process.
  • FIG. 6 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention. This embodiment is an embodiment which is further refined in the corresponding embodiment of FIG. As shown in FIG. 6, the method provided in this embodiment includes:
  • Step 60 The virtual BIOS module of the virtual machine establishes a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device in the ACPI table, where the global virtual interrupt pin is a virtual interrupt pin controller. Or a plurality of interrupt pins, any one of the global virtual interrupt pins corresponding to an interrupt pin of one or more of the virtual PCI devices belonging to the same physical node; the virtual interrupt pin controller is Provided by the operating system of the virtual machine;
  • Step 61 The operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, sets a global virtual interrupt pin in the ACPI table to set an instruction of the target vCPU.
  • Step 62 The DVMM intercepting the instruction determines the according to the distributed virtual interrupt information. Simulates the local virtual interrupt pin of the global virtual interrupt pin that is set.
  • Step 63 The DVMM that intercepts the instruction determines, according to the distributed virtual interrupt information, whether the physical node where the local virtual interrupt pin is located is a local physical node where the DVMM is located.
  • the DVMM that intercepts the operating system command performs step 641, step 642, and step 643, otherwise the DVMM that intercepts the operating system command performs step 65.
  • Step 641 Determine, according to the instruction, whether the physical node where the vCPU is located in the global interrupt pin that is set to be set is a local physical node. If the step is performed, otherwise step 643 is performed.
  • Step 642 Processing the target of the interrupt generated on the global interrupt pin that is set.
  • the physical node where the vCPU is located is a local physical node, and the corresponding relationship between the local virtual interrupt pin and the target vCPU is saved according to the setting instruction.
  • Step 643 Handling the interrupt generated on the global interrupt pin that is set is the physical node of the vCPU that is not the local physical node and the local physical node includes more than one vCPU, which will handle the interrupt generated on the global interrupt pin that is set.
  • the target vCPU is modified to be the target vCPU on the local physical node, and the corresponding relationship between the local virtual interrupt pin and the modified target vCPU is saved.
  • Step 65 The DVMM intercepting the instruction sends the instruction to the remote physical node where the local virtual interrupt pin is located.
  • the remote physical node that receives the instruction performs step 641, step
  • FIG. 7 is a schematic structural diagram of a virtual interrupt management apparatus of a distributed virtualization system according to an embodiment of the present invention.
  • the apparatus includes: a virtual machine and a plurality of distributed virtual machine monitors deployed on different physical nodes.
  • the virtual machine includes a virtual BIOS module 70 and an operating system 71.
  • the distributed virtual machine monitor can be a first distributed virtual machine monitor 72 and a second distributed virtual machine monitor 73.
  • the virtual BIOS module 70 is configured to establish, in an ACPI table, a connection relationship between a global virtual interrupt pin on a virtual machine and an interrupt pin of the virtual PCI device, where the global virtual interrupt pin is in the Any one of the corresponding ones corresponds to an interrupt pin of one or more of the virtual PCI devices belonging to the same physical node.
  • the virtual BIOS module 70 can write the ACPI table to the virtual memory of the virtual machine.
  • the virtual BIOS module is specifically configured to divide the global virtual interrupt pin into a plurality of mutually disjoint subsets, and establish a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device.
  • the interrupt pins of all virtual PCI devices belonging to the same physical node are connected in the same subset.
  • the virtual BIOS module is specifically configured to establish a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device, where all virtual PCI device interrupt pins on the same physical node are in the same global virtual Interrupt pin.
  • the operating system 71 is configured to obtain the ACPI table, and execute an instruction to set a target vCPU for the global virtual interrupt pin in the ACPI table according to the ACPI table.
  • the first distributed virtual machine monitor 72 of the plurality of distributed virtual machine monitors is configured to intercept an instruction of the operating system to set a target vCPU, and determine the global virtual interrupt pin according to the distributed interrupt pin information.
  • a physical node where the corresponding local virtual interrupt pin is located the local virtual interrupt pin is located on the physical node and used to simulate the global virtual interrupt pin
  • the distributed interrupt pin information includes the virtual machine The connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device on the physical node, and the virtual PCI device included in each physical node and the local virtual interrupt pin responsible for each physical node.
  • the first distributed virtual machine monitor 72 is further configured to: when determining that the physical node where the local virtual interrupt pin is located is not a local physical node, send the instruction to the physical node where the local virtual interrupt pin is located Distributed virtual machine monitor.
  • a second distributed virtual machine monitor 73 of the plurality of distributed virtual machine monitors configured to save a correspondence between the local virtual interrupt pin and the target vCPU according to the instruction, the second distribution
  • the virtual machine monitor is a distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located.
  • the second distributed virtual machine monitor 73 is further configured to connect to an interrupt on the interrupt pin of the virtual PCI device on the local virtual interrupt pin, and then save according to the physical node where the physical node is located.
  • the local virtual interrupt pin is associated with the target vCPU that processes the interrupt on the local virtual interrupt pin, and the interrupt on the local virtual interrupt pin is transmitted to the target vCPU.
  • the same global virtual interrupt pin in the ACPI table of the virtual BIOS module is written to the local virtual interrupt pin on the same physical node, that is, a global virtual interrupt pin is the same.
  • the local virtual interrupt pin on a physical node is simulated. Therefore, when the global virtual interrupt pin is set, the operating system does not need to send synchronously set data packets to different nodes, which improves the performance of the distributed virtualization system.
  • the second distributed virtual machine monitor has the following functions:
  • the second distributed virtual machine monitor 73 is further configured to save the local virtual interrupt pin and the local virtual interrupt pin when determining that the physical node where the target vCPU is located is a local physical node according to the instruction The corresponding relationship of the target vCPU on the interrupt.
  • the target vCPU that handles the interrupt on the local virtual interrupt pin is the vCPU in the instruction of the operating system.
  • the second distributed virtual machine monitor 73 is further configured to: when determining, according to the instruction, that the physical node where the target vCPU is located is not a local physical node and the local physical node includes more than one vCPU, The target vCPU is modified to be a vCPU on the local physical node, and the corresponding relationship between the local virtual interrupt pin and the modified target vCPU is saved.

Abstract

The present invention provides a virtual interrupt management method and apparatus in a distributed virtual system. The method comprises: a virtual BIOS module establishing in an ACPI table a connection relationship between global virtual interrupt pins and interrupt pins of virtual PCI devices, any one of the global virtual interrupt pins corresponding to an interrupt pin of one or more virtual PCI devices belonging to the same physical node; an operating system of a virtual machine acquiring the ACPI table, and running, according to the ACPI table, an instruction of setting a target vCPU for the global virtual interrupt pins in the ACPI table; a distributed virtual machine monitor that intercepts the instruction determining, according to distributed interrupt pin information, a physical node where a local virtual interrupt pin corresponding to the global virtual interrupt pin is located, and saving a relationship between the local virtual interrupt pin and the target vCPU according to the instruction, the target vCPU being used for processing an interrupt on the local virtual interrupt pin.

Description

分布式虚拟化系统的虚拟中断管理方法及装置  Virtual interrupt management method and device for distributed virtualization system
技术领域 本发明实施例涉及计算机技术, 尤其涉及一种分布式虚拟化系统的虚 拟中断管理方法及装置。 背景技术 TECHNICAL FIELD Embodiments of the present invention relate to computer technologies, and in particular, to a virtual interrupt management method and apparatus for a distributed virtualization system. Background technique
如图 1A所示, 在非虚拟化环境下, 每个外围设备互联(Peripheral As shown in Figure 1A, in a non-virtualized environment, each peripheral is interconnected (Peripheral)
Component Interconnect, 简称 PCI)设备 Devi、 Dev2... .Devn, 在完成自己 的一次工作后需要传送一次中断去告知操作系统, 这是通过将该 PCI设备 连接到中断控制器的中断引脚来实现的, 例如, 连接到 10高级可编程中 断控制器( I/O Advanced Programmable Interrupt Controller, 简称 IO-APIC ) 的中断引脚。在系统启动时,基本输入输出系统 (Basic input/output System , 简称 BIO S)通过向内存中写入高级配置和电源管理接口 ( Advanced Component Interconnect (PCI) devices Devi, Dev2... .Devn, need to send an interrupt to inform the operating system after completing one of their own work, this is achieved by connecting the PCI device to the interrupt pin of the interrupt controller. For example, connect to the interrupt pin of the 10 Advanced Programmable Interrupt Controller (IO-APIC). At the time of system startup, the Basic Input/Output System (BIO S) writes advanced configuration and power management interfaces to the internal memory (Advanced).
Configuration and Power Interface , 简称 ACPI )表的方式, 向操作系统告 知所有 PCI设备的信息, 包括所有 PCI设备自身的中断引脚与中断控制器 的中断引脚的连接关系。 操作系统启动后, 设置该 PCI设备的中断引脚, 使该 PCI设备的中断传递到一个指定的物理 CPU上处理。 其中, ACPI表 可以是差异化系统描述表( Differentiated System Description Table , 简称 DSDT )表。 在分布式虚拟化环境下, 分布式虚拟机监控器 (Distributed Virtual Machine Monitor,简称 D VMM)也需要模拟虚拟 PCI设备的中断连接关系。 首先, 分布式虚拟化环境下每个物理节点的设备模型 (Device Model, 简称 DM)在创建一个虚拟 PCI设备时,会为该虚拟 PCI设备分配总线号 Bus和 设备号 Device , 并确定该虚拟 PCI设备自身的中断引脚号 Intx。 其次, 当 启动虚拟机时, 虚拟 BIOS(Virtual Basic Input/Output System, 简称 vBIOS) 会通过内存中的 ACPI表告知操作系统设备号为 Device的虚拟 PCI设备的 第 Intx号中断引脚,连接在全局虚拟 10高级可编程中断控制器( Virtual I/O Advanced Programmable Interrupt Controller, 简称 vIO-APIC ) 的哪一个全 局虚拟中断引脚上。 最后, DVMM为虚拟机模拟全局 vIO-APIC中的全局 虚拟中断引脚所连接的虚拟 PCI设备的中断引脚号。 现有的分布式虚拟化系统中, 一台虚拟机的一个全局虚拟中断引脚可 能会连接到若干个物理节点中的虚拟 PCI设备的中断引脚上, 如图 1B所 示, 某物理节点中设备号和中断引脚号为 (0, 1 ) 的虚拟 PCI设备的中断 引脚与另一物理节点中设备号和中断引脚号为 (8 , 0 ) 的虚拟 PCI设备的 中断引脚同时连接在某虚拟机的第 17号全局虚拟中断引脚上。 那么当操 作系统对该第 17号全局虚拟中断引脚的进行设置时, 运行设置命令的 DVMM截获到操作系统对该第 17号全局虚拟中断引脚的设置操作后, 需 要向多个物理节点发送数据包, 以对连接到该第 17号全局虚拟中断引脚 的所有的虚拟 PCI设备的中断引脚, 例如(0 , 1 )和(8 , 0 )进行同步设 置, 发送同步设置的数据包。 当虚拟机的一条设置指令被截获之后, 它的 下一条指令会在上一条指令被模拟完后才会被执行, 所以模拟该设置指令 的所用时间越长, 虚拟机的运行速度更慢。 而模拟一条设置指令需要在多 个节点间进行同步设置, 花费的时间更长, 这种不同物理节点间的同步操 作会对虚拟机性能造成很大影响。 发明内容 本发明实施例提供一种分布式虚拟化系统的虚拟中断管理方法及装置, 用以解决现有分布式虚拟化系统中, 由于若干个物理节点中的虚拟 PCI设备 连接到同一个全局虚拟中断引脚导致性能降低的缺陷。 The Configuration and Power Interface (ACPI) table method informs the operating system of all PCI device information, including the connection relationship between the interrupt pins of all PCI devices and the interrupt pins of the interrupt controller. After the operating system is booted, the interrupt pin of the PCI device is set, and the interrupt of the PCI device is transferred to a specified physical CPU for processing. The ACPI table may be a Differentiated System Description Table (DSDT) table. In a distributed virtualization environment, the Distributed Virtual Machine Monitor (D VMM) also needs to simulate the interrupted connection relationship of virtual PCI devices. First, a device model (DM) of each physical node in a distributed virtualization environment allocates a bus number Bus and a device number Device to the virtual PCI device when the virtual PCI device is created, and determines the virtual PCI. The device's own interrupt pin number, Intx. Secondly, when the virtual machine is started, the virtual BIOS (Virtual Basic Input/Output System, vBIOS for short) will notify the virtual PCI device of the operating system device number as Device through the ACPI table in the memory. The Intx interrupt pin is connected to which global virtual interrupt pin of the Virtual I/O Advanced Programmable Interrupt Controller (vIO-APIC). Finally, DVMM simulates the interrupt pin number of the virtual PCI device to which the global virtual interrupt pin in the global vIO-APIC is connected. In an existing distributed virtualization system, a global virtual interrupt pin of a virtual machine may be connected to an interrupt pin of a virtual PCI device in a plurality of physical nodes, as shown in FIG. 1B, in a physical node. The interrupt pin of the virtual PCI device with the device number and interrupt pin number (0, 1) is connected to the interrupt pin of the virtual PCI device with the device number and interrupt pin number (8, 0) in the other physical node. On the 17th global virtual interrupt pin of a virtual machine. Then, when the operating system sets the global virtual interrupt pin of the 17th, the DVMM running the setting command intercepts the setting operation of the global virtual interrupt pin of the 17th, and needs to send to multiple physical nodes. The data packet is used to synchronize the interrupt pins of all virtual PCI devices connected to the 17th global virtual interrupt pin, for example, (0, 1) and (8, 0), and send the synchronously set data packets. When a virtual machine's set instruction is intercepted, its next instruction will be executed after the previous instruction has been simulated, so the longer it takes to simulate the setup instruction, the slower the virtual machine will run. Simulating a setup command requires simultaneous setup between multiple nodes, which takes longer, and the synchronization between different physical nodes can have a significant impact on virtual machine performance. SUMMARY OF THE INVENTION Embodiments of the present invention provide a virtual interrupt management method and apparatus for a distributed virtualization system, which are used to solve a problem in that a virtual PCI device in a plurality of physical nodes is connected to the same global virtual The interrupt pin causes a defect in performance degradation.
一方面,本发明实施例提供一种分布式虚拟化系统的虚拟中断管理方法, 包括:  In one aspect, an embodiment of the present invention provides a virtual interrupt management method for a distributed virtualization system, including:
虚拟机的虚拟 BIOS模块在高级配置和电源管理接口 ACPI表中建立全局 虚拟中断引脚与虚拟外围设备互联 PCI设备的中断引脚的连接关系, 其中, 所述全局虚拟中断引脚为虚拟中断引脚控制器上的一个或多个中断引脚, 所 述全局虚拟中断引脚中的任意一个对应于属于同一个物理节点的一个或多个 所述虚拟 PCI设备的中断引脚; 所述虚拟中断引脚控制器是为所述虚拟机的 操作系统提供的; The virtual BIOS module of the virtual machine establishes a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual peripheral device interconnect PCI device in the ACPI table of the advanced configuration and the power management interface, wherein the global virtual interrupt pin is a virtual interrupt One or more interrupt pins on the foot controller, any one of the global virtual interrupt pins corresponding to one or more of the same physical node An interrupt pin of the virtual PCI device; the virtual interrupt pin controller is provided for an operating system of the virtual machine;
所述虚拟机的操作系统获取所述 ACPI表,根据所述 ACPI表,运行为所 述 ACPI表中的全局虚拟中断引脚设置目标虚拟中央处理单元 vCPU的指令; 截获到所述指令的分布式虚拟机监控器, 根据分布式中断引脚信息确定 所述全局虚拟中断引脚对应的局部虚拟中断引脚所在的物理节点, 所述局部 虚拟中断引脚位于物理节点上并用于模拟所述全局虚拟中断引脚, 所述分布 式中断引脚信息包括全局虚拟中断引脚与虚拟 PCI设备的中断引脚的连接关 系, 以及各个物理节点包括的虚拟 PCI设备和局部虚拟中断引脚;  The operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, runs an instruction to set a target virtual central processing unit vCPU for the global virtual interrupt pin in the ACPI table; intercepting the distributed instruction a virtual machine monitor, configured to determine, according to the distributed interrupt pin information, a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, where the local virtual interrupt pin is located on the physical node and used to simulate the global virtual An interrupt pin, the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of the virtual PCI device, and a virtual PCI device and a local virtual interrupt pin included in each physical node;
所述局部虚拟中断引脚所在的物理节点上的分布式虚拟机监控器, 才艮据 所述指令保存所述局部虚拟中断引脚与所述目标 vCPU的对应关系, 其中, 所述目标 vCPU用于处理所述局部虚拟中断引脚上的中断。  The distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located, according to the instruction, the correspondence between the local virtual interrupt pin and the target vCPU is saved, where the target vCPU is used. Interrupting the interrupt on the local virtual interrupt pin.
另一方面, 本发明实施例提供一种分布式虚拟化系统的虚拟中断管理装 置, 包括虚拟机和多个部署在不同物理节点上的分布式虚拟机监控器。  In another aspect, an embodiment of the present invention provides a virtual interrupt management device of a distributed virtualization system, including a virtual machine and a plurality of distributed virtual machine monitors deployed on different physical nodes.
所述虚拟机, 包括: 虚拟 BIOS模块和操作系统;  The virtual machine includes: a virtual BIOS module and an operating system;
所述虚拟 BIOS模块,用于在 ACPI表中建立所述虚拟机上全局虚拟中断 引脚与虚拟 PCI设备的中断引脚的连接关系, 其中所述全局虚拟中断引脚中 的任意一个对应于属于同一个所述物理节点的一个或多个所述虚拟 PCI设备 的中断引脚;  The virtual BIOS module is configured to establish, in an ACPI table, a connection relationship between a global virtual interrupt pin on the virtual machine and an interrupt pin of the virtual PCI device, where any one of the global virtual interrupt pins corresponds to An interrupt pin of one or more of the virtual PCI devices of the same physical node;
所述操作系统, 用于获取所述 ACPI表, 根据所述 ACPI表, 运行为所述 The operating system is configured to obtain the ACPI table, and run according to the ACPI table.
ACPI表中的全局虚拟中断引脚设置目标 vCPU的指令; 所述多个分布式虚拟 机监控器中的第一分布式虚拟机监控器, 用于截获所述操作系统设置目标 vCPU的指令,根据分布式中断引脚信息确定所述全局虚拟中断引脚对应的局 部虚拟中断引脚所在的物理节点, 所述局部虚拟中断引脚位于所述物理节点 上并用于模拟所述全局虚拟中断引脚, 所述分布式中断引脚信息包括全局虚 拟中断引脚与虚拟 PCI设备的中断引脚的连接关系, 以及各个物理节点包括 的虚拟 PCI设备以及所述各个物理节点负责的局部虚拟中断引脚; 所述多个分布式虚拟机监控器中的第二分布式虚拟机监控器, 用于才艮据 所述指令保存所述局部虚拟中断引脚与所述目标 vCPU的对应关系, 所述第 二分布式虚拟机监控器为所述局部虚拟中断引脚所在的物理节点上的分布式 虚拟机监控器。 本发明实施例提供的分布式虚拟化系统的虚拟中断管理方法及装置, 虚 拟 BIOS模块写入 ACPI表中的一个全局虚拟中断引脚对应同一个物理节点上 的局部虚拟中断引脚, 即一个全局虚拟中断引脚由在同一个物理节点上的局 部虚拟中断引脚去模拟, 因而, 操作系统在设置该全局虚拟中断引脚时, 不 需要向不同的节点发送同步设置的数据包,提高了分布式虚拟化系统的性能。 The global virtual interrupt pin in the ACPI table sets an instruction of the target vCPU; the first distributed virtual machine monitor of the plurality of distributed virtual machine monitors is configured to intercept an instruction of the operating system to set a target vCPU, according to The distributed interrupt pin information determines a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, and the local virtual interrupt pin is located on the physical node and is used to simulate the global virtual interrupt pin. The distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of the virtual PCI device, and each physical node includes a virtual PCI device and a local virtual interrupt pin for which the respective physical node is responsible; a second distributed virtual machine monitor of the plurality of distributed virtual machine monitors for saving the Corresponding relationship between the local virtual interrupt pin and the target vCPU, the second distributed virtual machine monitor being a distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located. A virtual interrupt management method and device for a distributed virtualization system provided by an embodiment of the present invention, a virtual virtual interrupt pin written by a virtual BIOS module in an ACPI table corresponds to a local virtual interrupt pin on the same physical node, that is, a global The virtual interrupt pin is simulated by a local virtual interrupt pin on the same physical node. Therefore, when the global virtual interrupt pin is set, the operating system does not need to send synchronously set data packets to different nodes, which improves the distribution. The performance of a virtualized system.
附图说明 DRAWINGS
图 1A为现有技术提供的在非虚拟化环境下的 PCI设备中断连接架构图; 图 1B为现有技术提供的在分布式虚拟化环境下的虚拟 PCI设备中断连 接架构图;  1A is a schematic diagram of a PCI device interrupt connection architecture in a non-virtualized environment provided by the prior art; FIG. 1B is a schematic diagram of a virtual PCI device interrupt connection architecture in a distributed virtualization environment provided by the prior art;
图 2为本发明实施例提供的一种分布式虚拟化结构;  2 is a distributed virtualization structure according to an embodiment of the present invention;
图 3为本发明实施例提供的一种分布式虚拟化系统的虚拟中断引脚管理 方法流程图;  3 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention;
图 4为本发明实施例提供的虚拟 PCI设备中断连接架构图;  4 is a schematic structural diagram of a virtual PCI device interrupt connection according to an embodiment of the present invention;
图 5为本发明实施例提供的另一种分布式虚拟化系统的虚拟中断引脚管 理方法流程图;  5 is a flowchart of a virtual interrupt pin management method of another distributed virtualization system according to an embodiment of the present invention;
图 6为本发明实施例提供的又一种分布式虚拟化系统的虚拟中断引脚管 理方法流程图;  6 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention;
图 7为本发明实施例提供的一种分布式虚拟化系统的虚拟中断引脚管理 结构示意图。 具体实施方式 FIG. 7 is a schematic diagram of a virtual interrupt pin management structure of a distributed virtualization system according to an embodiment of the present invention. detailed description
虚拟化技术是一种将底层硬件设备与上层操作系统、 应用程序分离的去 耦合方法, 其引入虚拟机监控器 (Virtual Machine Monitor, 简称 VMM)层来直 接管理底层硬件资源, 并创建与底层硬件无关的虚拟机(Virtual Machine, 简 称 VM )供上层操作系统和应用程序使用。 虚拟机没有真正的物理设备, 需 要用软件模拟中断控制器和物理设备, 形成虚拟中断控制器和虚拟设备。 操 作系统启动之前,虚拟 BIOS在分配给所属虚拟机的内存中写入 ACPI表。操 作系统启动后, 可以通过指令设置和使用虚拟设备。 VMM在截获到操作系 统的这些指令后,按照操作系统的指令设置虚拟设备或模拟地操作物理设备, 并 4巴模拟结果返回给虚拟机。  Virtualization technology is a decoupling method that separates the underlying hardware devices from the upper operating system and applications. It introduces the Virtual Machine Monitor (VMM) layer to directly manage the underlying hardware resources and create and underlying hardware. An unrelated virtual machine (VM) is used by upper operating systems and applications. Virtual machines do not have real physical devices, and software interrupt controllers and physical devices are required to form virtual interrupt controllers and virtual devices. Before the operating system starts, the virtual BIOS writes an ACPI table in the memory allocated to the owning virtual machine. After the operating system is started, the virtual device can be set and used by commands. After intercepting these instructions of the operating system, the VMM sets the virtual device or simulates the physical device according to the instructions of the operating system, and returns the simulation result to the virtual machine.
分布式虚拟化技术是一种将来自多台物理机器的资源, 以虚拟的方式重 新组合成一台虚拟机的技术, 也就是分布式虚拟机的虚拟硬件分布在不同节 点, 为的是使用不同节点上的硬件设备。 图 2为本发明实施例提供的一种分 布式虚拟化结构。如图 2所示的分布式虚拟化架构包括 VM层、 DVMM层和 物理节点层。 每个物理节点包括处理器、 内存、 磁盘、 网卡和外设等硬件资 源。 每个物理节点均部署有一个 DVMM, 创建一个虚拟机时, 部署在每个物 理节点上的 DVMM会在各自所属的物理节点为虚拟机创建所需的虚拟硬件 设备。 虚拟机在同一个时间段, 基于一个物理节点进行运行。 DVMM主要包 括 CPU虚拟化、 内存虚拟化和 I/O虚拟化等三大模块, 达成了以虚拟资源聚 合为途径的物理资源聚合。 其中 I/O虚拟化会模拟非虚拟化环境下的 PCI设 备及其中断连接结构。 安装在虚拟机上的操作系统启动和运行时初始化和使 用硬件资源时, DVMM不会允许所有这些动作直接操作在物理硬件上, 而是 会截获敏感的访问行为, 并把这种访问行为模拟成对虚拟硬件的访问, 最终 以虚拟硬件为代理去操作真正的物理硬件, 保证了不同虚拟机间的隔离性和 虚拟机对硬件资源使用的正确性。 DVMM层直接管理本地底层硬件资源, 并 通过网络通信的方式与其他节点上的 DVMM相互协作, 使虚拟机具有跨节 点访问资源的能力。 具体地, 当一个节点的分布式虚拟机监控器截获虚拟机 操作系统的指令后, 首先要判断该指令所操作的虚拟硬件(包括虚拟中断控 制器的引脚)在哪个节点, 然后把所要进行的操作通过通讯模块传送到该节 点去模拟, 例如, 传送给设置虚拟硬件或者操作虚拟硬件对应的真正物理设 备去模拟。 Distributed virtualization technology is a technology that reassembles resources from multiple physical machines into a virtual machine in a virtual way. That is, the virtual hardware of distributed virtual machines is distributed at different nodes in order to use different nodes. Hardware device on. FIG. 2 is a schematic diagram of a distributed virtualization structure according to an embodiment of the present invention. The distributed virtualization architecture shown in Figure 2 includes a VM layer, a DVMM layer, and a physical node layer. Each physical node includes hardware resources such as processors, memory, disks, network cards, and peripherals. Each physical node is deployed with a DVMM. When a virtual machine is created, the DVMM deployed on each physical node creates the required virtual hardware devices for the virtual machines at the physical nodes to which they belong. The virtual machine runs on a physical node in the same time period. DVMM mainly includes three modules: CPU virtualization, memory virtualization and I/O virtualization. It achieves the aggregation of physical resources based on virtual resource aggregation. I/O virtualization simulates PCI devices and their interrupted connections in a non-virtualized environment. DVMM does not allow all of these actions to operate directly on the physical hardware when the operating system is installed and running on the virtual machine, and the hardware resources are initialized and used. Instead, the access behavior is simulated and the access behavior is simulated. The access to the virtual hardware ultimately uses the virtual hardware as a proxy to operate the real physical hardware, ensuring the isolation between different virtual machines and the correct use of the virtual machine for hardware resources. The DVMM layer directly manages the local underlying hardware resources and cooperates with the DVMM on other nodes through network communication to make the virtual machine have a cross-section. The ability to access resources. Specifically, when a distributed virtual machine monitor of a node intercepts an instruction of a virtual machine operating system, first determining which node the virtual hardware (including the pin of the virtual interrupt controller) operated by the instruction is on, and then performing the desired The operation is transmitted to the node through the communication module to simulate, for example, to the virtual hardware that sets the virtual hardware or operates the virtual hardware to simulate.
图 3为本发明实施例提供的一种分布式虚拟化系统的虚拟中断引脚管理 方法流程图。 图 4为本发明实施例提供的虚拟 PCI设备中断连接架构图。 如 图 4所示, VM提供的虚拟中断控制器为全局 vIO-APIC, 全局 vIO-APIC上 的中断引脚称为全局虚拟中断引脚, 虚拟 OS只有 VM给它提供的全局虚拟 中断控制器, 每个虚拟 PCI设备的中断引脚连接在全局虚拟中断控制器上的 一个全局虚拟中断引脚上。 每个物理节点上的 DVMM提供的虚拟中断控制 器为局部 vIO-APIC, 局部 vIO-APIC上的中断引脚称为局部虚拟中断引脚, 由每个物理节点上的局部虚拟中断控制器来模拟全局虚拟中断引脚, 每个虚 拟 PCI设备的中断引脚连接在局部虚拟中断控制器上的一个局部虚拟中断引 脚。 一个物理节点有多个虚拟 PCI设备, 一个虚拟 PCI设备可有多个中断引 脚, 一个虚拟 PCI设备也可连接到局部 vIO-APIC上的多个局部虚拟中断引 脚。 DM模块在为每个物理节点中创建的虚拟 PCI设备注册所属 PCI总线号 和设备号, 所有物理节点上的虚拟 PCI设备的设备号统一编号, 每个物理节 点上的局部 vIO-APIC上的局部虚拟中断引脚可单独编号。 VM向虚拟机操作 系统提供的中断结构为, 该 VM包括的虚拟 PCI设备的虚拟中断引脚与全局 vIO-APIC 上的全局虚拟中断引脚的连接关系。 而部署在一个物理节点上的 DVMM提供的中断结构为,该物理节点包括的虚拟 PCI设备的中断引脚与本 物理节点管理的局部 vIO-APIC上的局部虚拟中断引脚的连接关系。例如,虚 拟化操作系统获知的中断结构中, 设备号为 Device的虚拟 PCI设备的第 Intx 号中断引脚连接到全局 vIO-APIC中第 gsi号的全局虚拟中断引脚上; 而在设 备号为 Device的虚拟 PCI设备所在的物理节点上保存的中断结构为,设备号 为 Device的虚拟 PCI设备的第 Intx号中断引脚连接到局部 vIO-APIC中第 x 号的局部虚拟中断引脚上, 也就是, 在物理节点上, 用局部 vIO-APIC中第 X 号的局部虚拟中断引脚模拟全局 vIO-APIC中第 gsi号的全局虚拟中断引脚。 当虚拟机操作系统要去设置某个全局虚拟中断引脚时, DVMM会截获这个操 作, 并模拟成在指定的物理节点内设置该全局虚拟中断引脚, 所述指定的物 理节点为连接到该全局虚拟中断引脚的局部虚拟中断引脚所在物理节点。 FIG. 3 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention. FIG. 4 is a schematic structural diagram of a virtual PCI device interrupt connection according to an embodiment of the present invention. As shown in Figure 4, the virtual interrupt controller provided by the VM is global vIO-APIC. The interrupt pin on the global vIO-APIC is called the global virtual interrupt pin, and the virtual OS only has the global virtual interrupt controller provided by the VM. The interrupt pin of each virtual PCI device is connected to a global virtual interrupt pin on the global virtual interrupt controller. The virtual interrupt controller provided by the DVMM on each physical node is a local vIO-APIC. The interrupt pin on the local vIO-APIC is called a local virtual interrupt pin, which is simulated by a local virtual interrupt controller on each physical node. Global virtual interrupt pin, the interrupt pin of each virtual PCI device is connected to a local virtual interrupt pin on the local virtual interrupt controller. One physical node has multiple virtual PCI devices, one virtual PCI device can have multiple interrupt pins, and one virtual PCI device can also be connected to multiple local virtual interrupt pins on the local vIO-APIC. The DM module registers the PCI bus number and device number of the virtual PCI device created in each physical node, and the device numbers of the virtual PCI devices on all physical nodes are uniformly numbered, and the local vIO-APIC on each physical node is localized. Virtual interrupt pins can be individually numbered. The interrupt structure provided by the VM to the virtual machine operating system is the connection relationship between the virtual interrupt pin of the virtual PCI device included in the VM and the global virtual interrupt pin on the global vIO-APIC. The interrupt structure provided by the DVMM deployed on one physical node is the connection relationship between the interrupt pin of the virtual PCI device included in the physical node and the local virtual interrupt pin on the local vIO-APIC managed by the physical node. For example, in the interrupt structure learned by the virtualization operating system, the Intx number interrupt pin of the virtual PCI device with the device number Device is connected to the global virtual interrupt pin of the gsi number in the global vIO-APIC; The interrupt structure saved on the physical node where the virtual PCI device of the device resides is the device number. The Intx interrupt pin of the virtual PCI device of Device is connected to the local virtual interrupt pin of the xth in the local vIO-APIC, that is, on the physical node, the part of the Xth in the local vIO-APIC is used. The virtual interrupt pin emulates the global virtual interrupt pin of the gsi in global vIO-APIC. When the virtual machine operating system is going to set a global virtual interrupt pin, the DVMM intercepts the operation and simulates setting the global virtual interrupt pin in the specified physical node, and the specified physical node is connected to the The physical node of the global virtual interrupt pin of the global virtual interrupt pin.
如图 3所示, 本实施例提供的方法包括:  As shown in FIG. 3, the method provided in this embodiment includes:
步骤 31 : 虚拟机的虚拟 BIOS模块在 ACPI表中建立全局虚拟中断引脚 与虚拟 PCI设备的中断引脚的连接关系, 其中, 所述全局虚拟中断引脚为虚 拟中断引脚控制器上的一个或多个中断引脚, 所述全局虚拟中断引脚中的任 意一个对应于属于同一个物理节点的一个或多个所述虚拟 PCI设备的中断引 脚; 所述虚拟中断引脚控制器是为所述虚拟机的操作系统提供的;  Step 31: The virtual BIOS module of the virtual machine establishes a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device in the ACPI table, where the global virtual interrupt pin is a virtual interrupt pin controller. Or a plurality of interrupt pins, any one of the global virtual interrupt pins corresponding to an interrupt pin of one or more of the virtual PCI devices belonging to the same physical node; the virtual interrupt pin controller is Provided by the operating system of the virtual machine;
分布式虚拟化系统的虚拟 BIOS模块可以将所述 ACPI写入虚拟机的虚拟 内存。 将 ACPI表写入虚拟内存后, 虚拟机操作系统可从内存中获取 ACPI 表, 根据 ACPI表可获知哪个全局虚拟中断引脚被连接到哪个虚拟 PCI设备 上的哪个虚拟中断引脚上。 在 ACPI表记录的所有连接关系中, 任意一个全 局虚拟中断引脚连接到同一个物理节点上的一个或多个虚拟 PIC设备的中断 引脚。 也就是说, 不同物理节点上的虚拟 PCI设备不会连接到一个相同的全 局虚拟中断引脚上。 因此, 实现了同一个全局虚拟中断引脚由一个物理节点 上的局部虚拟中断引脚去模拟。 例如, 将设备号为 Device的虚拟 PCI设备的 第 Intx号中断引脚连接到全局 vIO-APIC中第 gsi号的全局虚拟中断引脚上, 在 ACPI表上述连接关系可表述为(虚拟 PCI设备号 Device,中断引脚号 Intx、 全局虚拟中断引脚号 gsi ) 。  The virtual BIOS module of the distributed virtualization system can write the ACPI to the virtual memory of the virtual machine. After the ACPI table is written to virtual memory, the virtual machine operating system can obtain the ACPI table from the memory, and according to the ACPI table, it can be known which virtual interrupt pin is connected to which virtual interrupt pin on which virtual PCI device. In all connections recorded in the ACPI table, any global virtual interrupt pin is connected to the interrupt pin of one or more virtual PIC devices on the same physical node. That is, virtual PCI devices on different physical nodes are not connected to the same global virtual interrupt pin. Therefore, the same global virtual interrupt pin is implemented by a local virtual interrupt pin on a physical node. For example, connect the Intx interrupt pin of the virtual PCI device with the device number Device to the global virtual interrupt pin of the gsi-number in the global vIO-APIC. The connection relationship in the ACPI table can be expressed as (virtual PCI device number). Device, interrupt pin number Intx, global virtual interrupt pin number gsi).
如图 4所示,全局 vIO-APIC的第 10号全局虚拟中断引脚连接到 NODE1 节点上虚拟 PCI设备 vDEVl l的第 Intxl号中断引脚和 NODE1节点上虚拟 PCI设备 VDEV12的第 Intx3号中断引脚,全局 vIO-APIC的第 20号全局虚拟 中断引脚连接到 NODE2节点上虚拟 PCI设备 VDEV21的第 Intxl号中断引脚 和 NODE2节点上虚拟 PCI设备 VDEV22的第 Intxl号中断引脚。从上述连接 关系可获知, 全局 vIO-APIC的第 10号全局虚拟中断引脚连接到 NODE1节 点上的虚拟 PCI设备, 全局 vIO-APIC的第 20号全局虚拟中断引脚连接到 NODE2节点上的虚拟 PCI设备。 As shown in Figure 4, the global virtual interrupt pin of global vIO-APIC is connected to the Intxl interrupt pin of the virtual PCI device vDEVl on the NODE1 node and the Intx3 interrupt of the virtual PCI device VDEV12 on the NODE1 node. Foot, global vIO-APIC No. 20 global virtual The interrupt pin is connected to the Intxl interrupt pin of the virtual PCI device VDEV21 on the NODE2 node and the Intxl interrupt pin of the virtual PCI device VDEV22 on the NODE2 node. From the above connection relationship, it can be known that the global virtual interrupt pin of the global vIO-APIC is connected to the virtual PCI device on the NODE1 node, and the global virtual interrupt pin of the global vIO-APIC is connected to the virtual node on the NODE2 node. PCI device.
使一个全局虚拟中断引脚连接在同一个物理节点上的虚拟 PCI设备上的 中断引脚的方法有多种。 优选地, 虚拟 BIOS模块将所有的全局虚拟中断引 脚划分为多个互不相交的子集, 在映射一个物理节点上的局部虚拟中断引脚 时, 将同一个物理节点的所有 PCI设备的中断引脚映射在一个子集内。 因此, 在 ACPI表中一个物理节点的所有 PCI设备的中断引脚连接在一个子集内。 例如, 0号物理节点上虚拟 PCI设备的设备号在 0~10之间, 1号物理节点上 虚拟 PCI设备的设备号在 11~13之间, 2号物理节点上虚拟 PCI设备的设备 号在 14〜: 16之间, ..., 7号节点上虚拟 PCI设备的设备号为 29~31之间, 0~10 号 PCI设备的中断针脚(即 0号节点的所有 PCI设备中断针脚)会直连到 16~26 号 vIO-APIC针脚; 11~13号 PCI设备的中断针脚 (即 1号节点的所有 PCI 设备中断针脚 )会直连到 27~29号 vIO-APIC针脚; 29~31号 PCI设备的中断 针脚 (即 7号节点的所有 PCI设备中断针脚)会直连到 45~47号 vIO-APIC 针脚。 vIO-APIC的 0~15号针脚作为特殊用途。 如果将所有的全局虚拟中断 引脚划分为多个互不相交的子集, 将一个物理节点的所有 PCI设备的中断引 脚对应在一个子集内后, 操作系统可一次设置该子集内的所有全局虚拟中断 引脚, 而不需要分多次设置这些全局虚拟中断引脚, 因为模拟这些全局虚拟 中断引脚的局部虚拟中断引脚在同一个物理节点上。 因而, 可提高虚拟机的 性能。  There are several ways to connect a global virtual interrupt pin to an interrupt pin on a virtual PCI device on the same physical node. Preferably, the virtual BIOS module divides all global virtual interrupt pins into a plurality of mutually disjoint subsets, and when allocating a local virtual interrupt pin on one physical node, interrupts all PCI devices of the same physical node. The pins are mapped in a subset. Therefore, the interrupt pins of all PCI devices of a physical node in the ACPI table are connected in a subset. For example, the device number of the virtual PCI device on the physical node 0 is between 0 and 10. The device number of the virtual PCI device on the physical node 1 is between 11 and 13. The device number of the virtual PCI device on the physical node 2 is 14~: 16, ..., the device number of the virtual PCI device on node 7 is between 29 and 31, and the interrupt pin of PCI device 0~10 (that is, all PCI device interrupt pins of node 0) will Connect directly to the 16~26 vIO-APIC pins; the interrupt pins of the 11~13 PCI devices (ie all PCI device interrupt pins on node 1) will be directly connected to the vIO-APIC pins 27~29; 29~31 The interrupt pin of the PCI device (that is, all PCI device interrupt pins on node 7) is directly connected to the vIO-APIC pins 45~47. Pins 0~15 of vIO-APIC are used for special purposes. If all global virtual interrupt pins are divided into multiple disjoint subsets, and the interrupt pins of all PCI devices of one physical node are corresponding to one subset, the operating system can set the subset within the subset at a time. All global virtual interrupt pins do not need to be set up multiple times to set these global virtual interrupt pins because the local virtual interrupt pins that emulate these global virtual interrupt pins are on the same physical node. Thus, the performance of the virtual machine can be improved.
可选地, 虚拟 BIOS模块也可以将一个物理节点上的所有虚拟 PCI设备 的中断引脚都连接到同一个全局虚拟中断引脚, 即在 ACPI表中一个物理节 点上的所有局部虚拟中断引脚对应一个全局虚拟中断引脚。 步骤 32: 虚拟机的操作系统获取所述 ACPI表, 根据所述 ACPI表, 运 行为所述 ACPI表中的全局虚拟中断引脚设置目标 vCPU的指令。 Optionally, the virtual BIOS module can also connect the interrupt pins of all virtual PCI devices on one physical node to the same global virtual interrupt pin, that is, all local virtual interrupt pins on one physical node in the ACPI table. Corresponds to a global virtual interrupt pin. Step 32: The operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, runs an instruction to set a target vCPU for the global virtual interrupt pin in the ACPI table.
虚拟机的操作系统根据 APCI表中全局虚拟中断引脚所连接的虚拟 PCI 设备,确定处理每个全局虚拟中断引脚上中断的目标虚拟中央处理器( Virtual Central Processing Unit, 简称 vCPU ) 。 例如, APCI表中的一个全局中断引 脚连接的虚拟 PCI设备为虚拟鼠标, 虚拟机操作系统将处理该虚拟 PCI设备 的中断的目标 vCPU可以设置为多个 vCPU, 而 APCI表中的另一个全局中断 引脚连接的虚拟 PCI设备为虚拟硬盘, 虚拟机操作系统将处理该虚拟 PCI设 备的中断的目标 vCPU可以设置为一个 vCPU。虚拟机操作系统设置处理一个 全局虚拟中断引脚上中断的 vCPU时, 向全局虚拟中断控制器发送设置指令, 该设置指令用于设置全局虚拟中断引脚上产生的中断由哪个 vCPU来处理。  The virtual machine's operating system determines the target Virtual Central Processing Unit (vCPU) that handles the interrupt on each global virtual interrupt pin based on the virtual PCI device to which the global virtual interrupt pin is connected in the APCI table. For example, a virtual PCI device connected to a global interrupt pin in the APCI table is a virtual mouse, and the virtual machine operating system will handle the interrupt of the virtual PCI device. The target vCPU can be set to multiple vCPUs, while another global in the APCI table. The virtual PCI device connected to the interrupt pin is a virtual hard disk, and the virtual machine operating system will handle the interrupt of the virtual PCI device. The target vCPU can be set to a vCPU. When the virtual machine operating system setting processes a vCPU interrupted on the global virtual interrupt pin, it sends a set command to the global virtual interrupt controller, which is used to set which vCPU to handle the interrupt generated on the global virtual interrupt pin.
需要说明的是, APCI表中的每一个全局虚拟中断引脚都需要设置目标 vCPU, 可以是一个个处理, 也可以是批处理, 以下实施例中, 为了便于理解, 具体以单次为其中的一个全局虚拟中断引脚设置 vCPU为例来说明的, 本领 域技术人员完全可以理解, 以下实施例的每个步骤中, 也可以针对 APCI表 中的全部全局虚拟中断引脚同时进行相同的处理。  It should be noted that each global virtual interrupt pin in the APCI table needs to be set with a target vCPU, which may be processed one by one or batch processing. In the following embodiments, for the sake of easy understanding, the specific one is A global virtual interrupt pin setting vCPU is taken as an example. Those skilled in the art can fully understand that in each step of the following embodiments, the same processing can be simultaneously performed for all global virtual interrupt pins in the APCI table.
步骤 33: 截获到所述指令的分布式虚拟机监控器, 根据分布式中断引脚 信息确定所述全局虚拟中断引脚对应的局部虚拟中断引脚所在的物理节点, 所述局部虚拟中断引脚位于物理节点上并用于模拟所述全局虚拟中断引脚, 所述分布式中断引脚信息包括全局虚拟中断引脚与虚拟 PCI设备的中断引脚 的连接关系, 以及各个物理节点包括的虚拟 PCI设备和局部虚拟中断引脚。  Step 33: The distributed virtual machine monitor intercepting the instruction, determining, according to the distributed interrupt pin information, a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, the local virtual interrupt pin Located on a physical node and used to simulate the global virtual interrupt pin, the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of a virtual PCI device, and a virtual PCI device included in each physical node. And local virtual interrupt pins.
分布式虚拟化系统的存储系统中可以记录有以下分布式中断引脚信息: 一种是, 每个全局虚拟中断引脚与物理节点上虚拟 PCI设备的中断引脚的连 接关系, 该连接关系与 ACPI表中连接关系相同。 另一种是, 各个物理节点 包括的虚拟 PCI设备和局部虚拟中断引脚。 分布式中断引脚信息有可能没有 存储在截获虚拟机操作系统设置指令的 DVMM所属的物理节点, 截获虚拟 机操作系统设置指令的 DVMM可通过 DVMM之间相互协作,从其它物理节 点获取分布式中断引脚信息。 The distributed interrupt pin information can be recorded in the storage system of the distributed virtualization system: one is the connection relationship between each global virtual interrupt pin and the interrupt pin of the virtual PCI device on the physical node, and the connection relationship is The connection relationship is the same in the ACPI table. The other is a virtual PCI device and a local virtual interrupt pin included in each physical node. The distributed interrupt pin information may not be stored in the physical node to which the DVMM that intercepts the virtual machine operating system setting instruction belongs, intercepting the virtual The DVMM of the operating system setting command can cooperate with the DVMM to obtain distributed interrupt pin information from other physical nodes.
在物理节点中, 虚拟 PCI设备的中断引脚所连接的局部虚拟中断引脚, 在物理节点上模拟该虚拟 PCI设备的中断引脚所连接的全局虚拟中断引脚。 如图 4所示, 部署在 NODE1节点上 DVMM提供的中断结构中, NODE1节 点上虚拟 PCI设备 vDEVl l的第 Intxl号中断引脚连接在 NODE1节点上的局 部 vIO-APIC 的第 5 号局部虚拟中断引脚, NODE1 节点上虚拟 PCI设备 VDEV12的第 Intx3号中断引脚连接在 NODE1节点上的局部 vIO-APIC的第 6 号局部虚拟中断引脚。 如图 4所示, 部署在 NODE2节点上 DVMM提供的中 断结构中,在 NODE2节点上虚拟 PCI设备 vDEV21的第 Intxl号中断引脚连 接在 NODE2节点上的局部 vIO-APIC的第 9号局部虚拟中断引脚,在 NODE2 节点上虚拟 PCI设备 VDEV22的第 Intxl号中断引脚连接在 NODE2节点上的 局部 vIO-APIC的第 10号局部虚拟中断引脚。  In the physical node, the local virtual interrupt pin connected to the interrupt pin of the virtual PCI device emulates the global virtual interrupt pin connected to the interrupt pin of the virtual PCI device on the physical node. As shown in Figure 4, deployed in the interrupt structure provided by DVMM on the NODE1 node, the Intxl interrupt pin of the virtual PCI device vDEV1 on the NODE1 node is connected to the local virtual interrupt of the local vIO-APIC on the NODE1 node. Pin, the Intx3 interrupt pin of the virtual PCI device VDEV12 on the NODE1 node is connected to the local virtual interrupt pin No. 6 of the local vIO-APIC on the NODE1 node. As shown in Figure 4, deployed in the interrupt structure provided by DVMM on the NODE2 node, the Intxl interrupt pin of the virtual PCI device vDEV21 on the NODE2 node is connected to the local virtual interrupt of the local vIO-APIC on the NODE2 node. Pin, the Intxl interrupt pin of the virtual PCI device VDEV22 on the NODE2 node is connected to the local virtual interrupt pin No. 10 of the local vIO-APIC on the NODE2 node.
虚拟机操作系统为一个全局虚拟中断引脚设置处理其上产生的中断的目 标 vCPU时,运行虚拟机操作系统的物理节点上部署的 DVMM截获虚拟机操 作系统设置全局中断虚拟引脚的设置指令后, 根据记录的每个全局虚拟中断 引脚与物理节点上虚拟 PCI设备的中断引脚的连接关系, 确定被设置的全局 虚拟中断引脚所对应的虚拟 PCI设备的中断引脚。 通过记录的每个物理节点 包括的虚拟 PCI设备和每个物理节点负责的局部虚拟中断引脚, 可确定模拟 的局部虚拟中断引脚所在的物理节点。  When the virtual machine operating system sets a global virtual interrupt pin to the target vCPU that processes the interrupt generated on it, the DVMM deployed on the physical node running the virtual machine operating system intercepts the setting command of the global interrupt virtual pin of the virtual machine operating system. The interrupt pin of the virtual PCI device corresponding to the global virtual interrupt pin is determined according to the connection relationship between each global virtual interrupt pin and the interrupt pin of the virtual PCI device on the physical node. The physical node where the analog local virtual interrupt pin is located can be determined by recording the virtual PCI device included in each physical node and the local virtual interrupt pin responsible for each physical node.
步骤 34: 所述局部虚拟中断引脚所在的物理节点上的 DVMM才艮据所述 指令保存所述局部虚拟中断引脚与所述目标 vCPU 的对应关系, 所述目标 vCPU用于处理所述局部虚拟中断引脚上的中断。  Step 34: The DVMM on the physical node where the local virtual interrupt pin is located saves the correspondence between the local virtual interrupt pin and the target vCPU according to the instruction, where the target vCPU is used to process the local part. An interrupt on the virtual interrupt pin.
所述局部虚拟中断引脚所在的物理节点与截获操作系统设置指令的 DVMM的本地物理节点为同一物理节点时,截获操作系统设置指令的 DVMM 保存所述局部虚拟中断引脚与处理所述局部虚拟中断引脚上中断的目标 vCPU的对应关系 ,例如保存在中断处理 vCPU表中 ,处理所述局部虚拟中断 引脚上中断的目标 vCPU为操作系统的指令中设置的目标 vCPU。当连接在所 述局部虚拟中断引脚上的虚拟 PCI设备的中断引脚上产生中断后, 该局部虚 拟中断引脚所在物理节点上的 DVMM按照保存的中断处理 vCPU表可确定由 哪个 vCPU来处理该局部虚拟中断引脚上的中断。 所述局部虚拟中断引脚所 在的物理节点与截获操作系统设置指令的 DVMM所在的本地物理节点不是 同一物理节点时, 截获操作系统设置指令的 DVMM将设置指令发送给所述 局部虚拟中断引脚所在的远端物理节点, 由远端物理节点的 DVMM保存所 述局部虚拟中断引脚与目标 vCPU的对应关系, 例如保存在中断处理 vCPU 表中, 从而在连接在所述局部虚拟中断引脚上的虚拟 PCI设备产生中断后, 远端物理节点的 DVMM按照保存的中断处理 vCPU表可确定由哪个 vCPU来 处理所述局部虚拟中断引脚上的中断。 When the physical node where the local virtual interrupt pin is located and the local physical node of the DVMM that intercepts the operating system setting instruction are the same physical node, the DVMM that intercepts the operating system setting instruction saves the local virtual interrupt pin and processes the local virtual Interrupt target on interrupt pin The vCPU correspondence is stored, for example, in the interrupt processing vCPU table, and the target vCPU that handles the interrupt on the local virtual interrupt pin is the target vCPU set in the instruction of the operating system. After an interrupt is generated on the interrupt pin of the virtual PCI device connected to the local virtual interrupt pin, the DVMM on the physical node where the local virtual interrupt pin is located can process the vCPU table according to the saved interrupt to determine which vCPU to process. An interrupt on this local virtual interrupt pin. When the physical node where the local virtual interrupt pin is located is not the same physical node as the local physical node where the DVMM that intercepts the operating system setting instruction is located, the DVMM that intercepts the operating system setting instruction sends a setting instruction to the local virtual interrupt pin. a remote physical node, where the DVMM of the remote physical node saves the correspondence between the local virtual interrupt pin and the target vCPU, for example, stored in an interrupt processing vCPU table, thereby being connected to the local virtual interrupt pin. After the virtual PCI device generates an interrupt, the DVMM of the remote physical node processes the vCPU table according to the saved interrupt to determine which vCPU is to handle the interrupt on the local virtual interrupt pin.
本实施例提供的方法,虚拟 BIOS模块写入 ACPI表中的一个全局虚拟中 断引脚连接到同一个物理节点上一个或多个虚拟 PIC设备的中断引脚上, 即 一个全局虚拟中断引脚由同一个物理节点上的局部虚拟中断引脚去模拟, 由 于不同的物理节点的虚拟 PCI设备的中断引脚不会连接在同一个全局虚拟中 断引脚上, 虚拟机操作系统在设置该全局虚拟中断引脚时, 不需要向不同的 物理节点发送用于同步设置的数据包, 提高了分布式虚拟化系统的性能。  In the method provided by the embodiment, the virtual BIOS module writes a global virtual interrupt pin in the ACPI table to the interrupt pin of one or more virtual PIC devices on the same physical node, that is, a global virtual interrupt pin is configured. The local virtual interrupt pin on the same physical node is simulated. Since the interrupt pins of the virtual PCI device of different physical nodes are not connected to the same global virtual interrupt pin, the virtual machine operating system sets the global virtual interrupt. When pins are used, there is no need to send packets for synchronization settings to different physical nodes, which improves the performance of the distributed virtualization system.
进一步,如果步骤 35中所述局部虚拟中断引脚所在物理节点的 DVMM, 根据操作系统的指令确定处理所述局部虚拟中断引脚上中断的目标 vCPU是 远端物理节点上的 vCPU,该局部虚拟中断引脚所在物理节点的 DVMM接收 到该局部虚拟中断引脚上的中断后, 根据保存的中断处理 vCPU表, 要将该 中断传递到远端物理节点的目标 vCPU来处理, 导致处理时间较长, 这种非 本地化处理中断的方式会对虚拟机的性能产生较大的影响。 为避免中断由非 本地 vCPU处理的现象, 本发明实施例还提供了以下方法实现中断本地化处 理: 如图 5所示, 步骤 34可以包括: 步骤 340: 局部虚拟中断引脚所在物理节点的 DVMM, 根据所述指令确 定目标 vCPU所在物理节点是否为本地物理节点。若是执行步骤 341 ,否则执 行步骤 342。 Further, if the DVMM of the physical node where the local virtual interrupt pin is located in step 35, determining, according to an instruction of the operating system, that the target vCPU that is interrupted on the local virtual interrupt pin is a vCPU on the remote physical node, the local virtual After the DVMM of the physical node where the interrupt pin is located receives the interrupt on the local virtual interrupt pin, the vCPU table is processed according to the saved interrupt, and the interrupt is transferred to the target vCPU of the remote physical node for processing, resulting in a longer processing time. This non-localized way of handling interrupts can have a large impact on the performance of the virtual machine. In order to avoid the interruption of the processing by the non-local vCPU, the embodiment of the present invention further provides the following method to implement the interrupt localization processing: As shown in FIG. 5, step 34 may include: Step 340: The DVMM of the physical node where the local virtual interrupt pin is located determines whether the physical node where the target vCPU is located is a local physical node according to the instruction. If the step 341 is performed, otherwise step 342 is performed.
步骤 341 : 保存局部虚拟中断引脚与所述指令中目标 vCPU的对应关系。 步骤 342: 如果本地物理节点上包括一个以上的 vCPU,将设置指令中的 目标 vCPU修改为本地物理节点上的 vCPU ,保存局部虚拟中断引脚与修改后 目标 vCPU的对应关系。  Step 341: Save the correspondence between the local virtual interrupt pin and the target vCPU in the instruction. Step 342: If more than one vCPU is included on the local physical node, modify the target vCPU in the set instruction to the vCPU on the local physical node, and save the correspondence between the local virtual interrupt pin and the modified target vCPU.
如果局部虚拟中断引脚所在物理节点的 DVMM,根据设置指令判断处理 被设置的全局中断引脚上产生的中断的目标 vCPU所在物理节点不是本地物 理节点, 而且本地物理节点包括多个 vCPU, 可根据本地 vCPU的负载状况, 将设置指令中处理被设置的全局中断引脚上产生的中断的目标 vCPU修改为 本地物理节点上的 vCPU。模拟该全局虚拟中断引脚的局部虚拟中断引脚上产 生中断后, 本地 DVMM将该中断传递给本地物理节点上的 vCPU来处理, 不需要将该中断传递到远端物理节点来处理, 减轻了节点间的通讯压力, 降 低了中断对虚拟机性能的影响, 提高了中断过程中虚拟机的性能。  If the DVMM of the physical node where the local virtual interrupt pin is located, the physical node of the target vCPU where the interrupt generated on the global interrupt pin is set to be processed according to the setting instruction is not the local physical node, and the local physical node includes multiple vCPUs, according to The load status of the local vCPU changes the target vCPU in the set instruction that handles the interrupt generated on the global interrupt pin that is set to the vCPU on the local physical node. After the interrupt is generated on the local virtual interrupt pin that simulates the global virtual interrupt pin, the local DVMM passes the interrupt to the vCPU on the local physical node for processing, and does not need to pass the interrupt to the remote physical node for processing, reducing the The communication pressure between nodes reduces the impact of interrupts on virtual machine performance and improves the performance of virtual machines during the interruption process.
图 6为本发明实施例提供的又一种分布式虚拟化系统的虚拟中断引脚管 理方法流程图。 本实施例为对图 5对应实施例进一步细化后的实施例。 如图 6所示, 本实施例提供的方法包括:  FIG. 6 is a flowchart of a method for managing a virtual interrupt pin of a distributed virtualization system according to an embodiment of the present invention. This embodiment is an embodiment which is further refined in the corresponding embodiment of FIG. As shown in FIG. 6, the method provided in this embodiment includes:
步骤 60: 虚拟机的虚拟 BIOS模块在 ACPI表中建立全局虚拟中断引脚 与虚拟 PCI设备的中断引脚的连接关系, 其中, 所述全局虚拟中断引脚为虚 拟中断引脚控制器上的一个或多个中断引脚, 所述全局虚拟中断引脚中的任 意一个对应于属于同一个物理节点的一个或多个所述虚拟 PCI设备的中断引 脚; 所述虚拟中断引脚控制器是为所述虚拟机的操作系统提供的;  Step 60: The virtual BIOS module of the virtual machine establishes a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device in the ACPI table, where the global virtual interrupt pin is a virtual interrupt pin controller. Or a plurality of interrupt pins, any one of the global virtual interrupt pins corresponding to an interrupt pin of one or more of the virtual PCI devices belonging to the same physical node; the virtual interrupt pin controller is Provided by the operating system of the virtual machine;
步骤 61 : 虚拟机的操作系统获取所述 ACPI表, 根据所述 ACPI表, 运 行为所述 ACPI表中的全局虚拟中断引脚设置目标 vCPU的指令。  Step 61: The operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, sets a global virtual interrupt pin in the ACPI table to set an instruction of the target vCPU.
步骤 62: 截获所述指令的 DVMM根据分布式虚拟中断信息, 确定所述 模拟被设置的全局虚拟中断引脚的局部虚拟中断引脚。 Step 62: The DVMM intercepting the instruction determines the according to the distributed virtual interrupt information. Simulates the local virtual interrupt pin of the global virtual interrupt pin that is set.
步骤 63: 截获所述指令的 DVMM根据分布式虚拟中断信息, 确定所述 局部虚拟中断引脚所在的物理节点是否为该 DVMM所在的本地物理节点。  Step 63: The DVMM that intercepts the instruction determines, according to the distributed virtual interrupt information, whether the physical node where the local virtual interrupt pin is located is a local physical node where the DVMM is located.
若所述局部虚拟中断引脚所在的物理节点为本地物理节点, 截获操作系 统指令的 DVMM执行步骤 641、 步骤 642和步骤 643 , 否则截获操作系统指 令的 DVMM执行步骤 65。  If the physical node where the local virtual interrupt pin is located is a local physical node, the DVMM that intercepts the operating system command performs step 641, step 642, and step 643, otherwise the DVMM that intercepts the operating system command performs step 65.
步骤 641 : 根据所述指令判断处理被设置的全局中断引脚上产生的中断 的目标 vCPU所在物理节点是否为本地物理节点。若是执行步骤 642,否则执 行步骤 643。  Step 641: Determine, according to the instruction, whether the physical node where the vCPU is located in the global interrupt pin that is set to be set is a local physical node. If the step is performed, otherwise step 643 is performed.
步骤 642: 处理被设置的全局中断引脚上产生的中断的目标 vCPU所在 物理节点是本地物理节点, 根据设置指令保存所述局部虚拟中断引脚与目标 vCPU的对应关系。  Step 642: Processing the target of the interrupt generated on the global interrupt pin that is set. The physical node where the vCPU is located is a local physical node, and the corresponding relationship between the local virtual interrupt pin and the target vCPU is saved according to the setting instruction.
步骤 643: 处理被设置的全局中断引脚上产生的中断的目标 vCPU所在 物理节点不是本地物理节点且本地物理节点上包括一个以上的 vCPU,将处理 被设置的全局中断引脚上产生的中断的目标 vCPU修改为本地物理节点上的 目标 vCPU, 保存所述局部虚拟中断引脚与修改后目标 vCPU的对应关系。  Step 643: Handling the interrupt generated on the global interrupt pin that is set is the physical node of the vCPU that is not the local physical node and the local physical node includes more than one vCPU, which will handle the interrupt generated on the global interrupt pin that is set. The target vCPU is modified to be the target vCPU on the local physical node, and the corresponding relationship between the local virtual interrupt pin and the modified target vCPU is saved.
步骤 65: 截获所述指令的 DVMM将所述指令发送给所述局部虚拟中断 引脚所在的远端物理节点。 接收到指令的远端物理节点执行步骤 641、 步骤 Step 65: The DVMM intercepting the instruction sends the instruction to the remote physical node where the local virtual interrupt pin is located. The remote physical node that receives the instruction performs step 641, step
642和步骤 643。 642 and step 643.
图 7为本发明实施例提供的一种分布式虚拟化系统的虚拟中断管理装置 结构示意图。 如图 7所示, 该装置包括: 虚拟机和多个部署在不同物理节点 上的分布式虚拟机监控器。 其中, 虚拟机包括虚拟 BIOS模块 70和操作系统 71 ,分布式虚拟机监控器可以是第一分布式虚拟机监控器 72和第二分布式虚 拟机监控器 73。  FIG. 7 is a schematic structural diagram of a virtual interrupt management apparatus of a distributed virtualization system according to an embodiment of the present invention. As shown in FIG. 7, the apparatus includes: a virtual machine and a plurality of distributed virtual machine monitors deployed on different physical nodes. The virtual machine includes a virtual BIOS module 70 and an operating system 71. The distributed virtual machine monitor can be a first distributed virtual machine monitor 72 and a second distributed virtual machine monitor 73.
所述虚拟 BIOS模块 70, 用于在 ACPI表中建立虚拟机上全局虚拟中断 引脚与虚拟 PCI设备的中断引脚的连接关系, 其中所述全局虚拟中断引脚中 的任意一个对应于属于同一个所述物理节点的一个或多个所述虚拟 PCI设备 的中断引脚。虚拟 BIOS模块 70可以将所述 ACPI表写入虚拟机的虚拟内存。 优选地, 所述虚拟 BIOS模块具体用于将所述全局虚拟中断引脚划分为多个 互不相交的子集, 建立所述全局虚拟中断引脚与虚拟 PCI设备的中断引脚的 连接关系, 其中, 属于同一个所述物理节点的所有虚拟 PCI设备的中断引脚 连接在同一个所述子集内。 或者, 所述虚拟 BIOS模块具体用于建立所述全 局虚拟中断引脚与虚拟 PCI设备的中断引脚的连接关系, 其中同一个物理节 点上的所有虚拟 PCI设备中断引脚对应在同一个全局虚拟中断引脚。 The virtual BIOS module 70 is configured to establish, in an ACPI table, a connection relationship between a global virtual interrupt pin on a virtual machine and an interrupt pin of the virtual PCI device, where the global virtual interrupt pin is in the Any one of the corresponding ones corresponds to an interrupt pin of one or more of the virtual PCI devices belonging to the same physical node. The virtual BIOS module 70 can write the ACPI table to the virtual memory of the virtual machine. Preferably, the virtual BIOS module is specifically configured to divide the global virtual interrupt pin into a plurality of mutually disjoint subsets, and establish a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device. The interrupt pins of all virtual PCI devices belonging to the same physical node are connected in the same subset. Or the virtual BIOS module is specifically configured to establish a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device, where all virtual PCI device interrupt pins on the same physical node are in the same global virtual Interrupt pin.
操作系统 71 , 用于获取所述 ACPI表, 根据所述 ACPI表, 运行为所述 ACPI表中的全局虚拟中断引脚设置目标 vCPU的指令。  The operating system 71 is configured to obtain the ACPI table, and execute an instruction to set a target vCPU for the global virtual interrupt pin in the ACPI table according to the ACPI table.
所述多个分布式虚拟机监控器中的第一分布式虚拟机监控器 72, 用于截 获所述操作系统设置目标 vCPU的指令, 根据分布式中断引脚信息确定所述 全局虚拟中断引脚对应的局部虚拟中断引脚所在的物理节点, 所述局部虚拟 中断引脚位于所述物理节点上并用于模拟所述全局虚拟中断引脚, 所述分布 式中断引脚信息包括所述虚拟机上全局虚拟中断引脚与物理节点上虚拟 PCI 设备的中断引脚的连接关系, 以及各个物理节点包括的虚拟 PCI设备以及所 述各个物理节点负责的局部虚拟中断引脚。  The first distributed virtual machine monitor 72 of the plurality of distributed virtual machine monitors is configured to intercept an instruction of the operating system to set a target vCPU, and determine the global virtual interrupt pin according to the distributed interrupt pin information. a physical node where the corresponding local virtual interrupt pin is located, the local virtual interrupt pin is located on the physical node and used to simulate the global virtual interrupt pin, and the distributed interrupt pin information includes the virtual machine The connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device on the physical node, and the virtual PCI device included in each physical node and the local virtual interrupt pin responsible for each physical node.
进一步, 第一分布式虚拟机监控器 72, 还用于确定所述局部虚拟中断引 脚所在的物理节点不是本地物理节点时 , 将所述指令发送给所述局部虚拟中 断引脚所在物理节点上的分布式虚拟机监控器。  Further, the first distributed virtual machine monitor 72 is further configured to: when determining that the physical node where the local virtual interrupt pin is located is not a local physical node, send the instruction to the physical node where the local virtual interrupt pin is located Distributed virtual machine monitor.
所述多个分布式虚拟机监控器中的第二分布式虚拟机监控器 73 , 用于根 据所述指令保存所述局部虚拟中断引脚与所述目标 vCPU的对应关系, 所述 第二分布式虚拟机监控器为所述局部虚拟中断引脚所在的物理节点上的分布 式虚拟机监控器。  a second distributed virtual machine monitor 73 of the plurality of distributed virtual machine monitors, configured to save a correspondence between the local virtual interrupt pin and the target vCPU according to the instruction, the second distribution The virtual machine monitor is a distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located.
进一步, 第二分布式虚拟机监控器 73 , 还用于连接在所述局部虚拟中断 引脚上的虚拟 PCI设备的中断引脚上产生中断后, 根据所在物理节点保存的 所述局部虚拟中断引脚与处理所述局部虚拟中断引脚上中断的目标 vCPU的 对应关系, 将所述局部虚拟中断引脚上中断传递到目标 vCPU。 Further, the second distributed virtual machine monitor 73 is further configured to connect to an interrupt on the interrupt pin of the virtual PCI device on the local virtual interrupt pin, and then save according to the physical node where the physical node is located. The local virtual interrupt pin is associated with the target vCPU that processes the interrupt on the local virtual interrupt pin, and the interrupt on the local virtual interrupt pin is transmitted to the target vCPU.
本实施例提供的装置中,虚拟 BIOS模块写入虚拟内存的 ACPI表中的同 一个全局虚拟中断引脚对应到同一个物理节点上的局部虚拟中断引脚, 即一 个全局虚拟中断引脚由同一个物理节点上的局部虚拟中断引脚去模拟, 因而, 操作系统在设置该全局虚拟中断引脚时, 不需要向不同的节点发送同步设置 的数据包, 提高了分布式虚拟化系统的性能。  In the device provided in this embodiment, the same global virtual interrupt pin in the ACPI table of the virtual BIOS module is written to the local virtual interrupt pin on the same physical node, that is, a global virtual interrupt pin is the same. The local virtual interrupt pin on a physical node is simulated. Therefore, when the global virtual interrupt pin is set, the operating system does not need to send synchronously set data packets to different nodes, which improves the performance of the distributed virtualization system.
为避免中断非本地处理的现象, 即避免本地中断引脚上产生的中断由远 端的物理节点上的 vCPU来处理的现象, 第二分布式虚拟机监控器还具有以 下功能:  To avoid the phenomenon of non-local processing interruption, that is, to avoid the interruption generated on the local interrupt pin by the vCPU on the remote physical node, the second distributed virtual machine monitor has the following functions:
所述第二分布式虚拟机监控器 73 ,还用于当根据所述指令确定所述目标 vCPU所在物理节点是本地物理节点时,保存所述局部虚拟中断引脚与所述局 部虚拟中断引脚上中断的目标 vCPU的对应关系。 其中, 处理所述局部虚拟 中断引脚上中断的目标 vCPU为操作系统的指令中的 vCPU。  The second distributed virtual machine monitor 73 is further configured to save the local virtual interrupt pin and the local virtual interrupt pin when determining that the physical node where the target vCPU is located is a local physical node according to the instruction The corresponding relationship of the target vCPU on the interrupt. The target vCPU that handles the interrupt on the local virtual interrupt pin is the vCPU in the instruction of the operating system.
所述第二分布式虚拟机监控器 73 ,还用于当根据所述指令确定所述目标 vCPU 所在物理节点不是本地物理节点且所述本地物理节点包括一个以上的 vCPU时, 将所述指令中所述目标 vCPU修改为所述本地物理节点上的一个 vCPU, 保存局部虚拟中断引脚与修改后所述目标 vCPU的对应关系。  The second distributed virtual machine monitor 73 is further configured to: when determining, according to the instruction, that the physical node where the target vCPU is located is not a local physical node and the local physical node includes more than one vCPU, The target vCPU is modified to be a vCPU on the local physical node, and the corresponding relationship between the local virtual interrupt pin and the modified target vCPU is saved.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述 的存储介质包括: ROM, RAM, 磁碟或者光盘等各种可以存储程序代码的介 最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的范围。 A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing storage medium includes: ROM, RAM, magnetic disk or optical disk, and the like, which can store various program codes. Finally, the above embodiments are only used to illustrate the technical solution of the present invention. The invention is not limited thereto; although the invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions described in the foregoing embodiments may still be modified, or Equivalent replacement of some of the technical features of the present invention is not included in the scope of the technical solutions of the embodiments of the present invention.

Claims

权 利 要 求 书 Claim
1、 一种分布式虚拟化系统的虚拟中断管理方法, 其特征在于, 包括: 虚拟机的虚拟 BIOS模块在高级配置和电源管理接口 ACPI表中建立 全局虚拟中断引脚与虚拟外围设备互联 PCI设备的中断引脚的连接关系, 其中, 所述全局虚拟中断引脚为虚拟中断引脚控制器上的一个或多个中断 引脚, 所述全局虚拟中断引脚中的任意一个对应于属于同一个物理节点的 一个或多个所述虚拟 PCI设备的中断引脚; 所述虚拟中断引脚控制器是为 所述虚拟机的操作系统提供的;  A virtual interrupt management method for a distributed virtualization system, comprising: a virtual BIOS module of a virtual machine establishing a global virtual interrupt pin and a virtual peripheral device interconnect PCI device in an advanced configuration and a power management interface ACPI table; The connection relationship of the interrupt pins, wherein the global virtual interrupt pin is one or more interrupt pins on the virtual interrupt pin controller, and any one of the global virtual interrupt pins corresponds to the same one An interrupt pin of one or more of the virtual PCI devices of the physical node; the virtual interrupt pin controller is provided for an operating system of the virtual machine;
所述虚拟机的操作系统获取所述 ACPI表, 根据所述 ACPI表, 运行 为所述 ACPI表中的全局虚拟中断引脚设置目标虚拟中央处理单元 vCPU 的指令;  The operating system of the virtual machine acquires the ACPI table, and according to the ACPI table, runs an instruction to set a target virtual central processing unit vCPU for the global virtual interrupt pin in the ACPI table;
截获到所述指令的分布式虚拟机监控器, 根据分布式中断引脚信息确 定所述全局虚拟中断引脚对应的局部虚拟中断引脚所在的物理节点, 所述 局部虚拟中断引脚位于物理节点上并用于模拟所述全局虚拟中断引脚, 所 述分布式中断引脚信息包括全局虚拟中断引脚与虚拟 PCI设备的中断引脚 的连接关系,以及各个物理节点包括的虚拟 PCI设备和局部虚拟中断引脚; 所述局部虚拟中断引脚所在的物理节点上的分布式虚拟机监控器, 根 据所述指令保存所述局部虚拟中断引脚与所述目标 vCPU的对应关系, 其 中, 所述目标 vCPU用于处理所述局部虚拟中断引脚上的中断。  a distributed virtual machine monitor intercepting the instruction, determining, according to the distributed interrupt pin information, a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, where the local virtual interrupt pin is located at a physical node And used to simulate the global virtual interrupt pin, the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of a virtual PCI device, and a virtual PCI device and a partial virtual virtual machine included in each physical node. An interrupt virtual machine monitor, wherein the distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located stores a correspondence between the local virtual interrupt pin and the target vCPU according to the instruction, where the target The vCPU is used to handle interrupts on the local virtual interrupt pin.
2、 根据权利要求 1 所述的方法, 其特征在于, 所述局部虚拟中断引 脚所在的物理节点上的分布式虚拟机监控器, 根据所述指令保存所述局部 虚拟中断引脚与所述目标 vCPU的对应关系包括:  2. The method according to claim 1, wherein the distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located saves the local virtual interrupt pin and the The corresponding relationship of the target vCPU includes:
若所述截获到所述指令的分布式虚拟机监控器确定所述全局虚拟中 断引脚对应的局部虚拟中断引脚所在的物理节点为自身所在的物理节点, 则所述截获到所述指令的分布式虚拟机监控器, 根据所述指令确定所述目 标 vCPU所在物理节点是本地物理节点时, 保存所述局部虚拟中断引脚与 所述目标 vCPU的对应关系。 If the distributed virtual machine monitor that intercepts the instruction determines that the physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located is the physical node where the virtual virtual interrupt pin is located, the intercepting the instruction a distributed virtual machine monitor, configured to save the local virtual interrupt pin when the physical node where the target vCPU is located is a local physical node according to the instruction Correspondence relationship of the target vCPU.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述局部虚拟中 断引脚所在的物理节点上的分布式虚拟机监控器, 根据所述指令保存所述 局部虚拟中断引脚与所述目标 vCPU的对应关系包括:  The method according to claim 1 or 2, wherein the distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located saves the local virtual interrupt pin according to the instruction The corresponding relationship of the target vCPU includes:
若所述截获到所述指令的分布式虚拟机监控器确定所述全局虚拟中 断引脚对应的局部虚拟中断引脚所在的物理节点不是自身所在的物理节 点, 则所述截获到所述指令的分布式虚拟机监控器通知所述局部虚拟中断 引脚所在的物理节点上的分布式虚拟机监控器设置所述指令, 所述局部虚 拟中断引脚所在的物理节点的分布式虚拟机监控器, 根据所述指令确定所 述目标 vCPU所在物理节点不是本地物理节点且所述本地物理节点包括一 个以上的 vCPU时, 将所述指令中的所述目标 vCPU修改为所述本地物理 节点上的一个 vCPU,保存所述局部虚拟中断引脚与修改后所述目标 vCPU 的对应关系。  If the distributed virtual machine monitor that intercepts the instruction determines that the physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located is not the physical node where the virtual virtual interrupt pin is located, the intercepting the instruction The distributed virtual machine monitor notifies the distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located to set the instruction, and the distributed virtual machine monitor of the physical node where the local virtual interrupt pin is located, Determining, according to the instruction, that the target vCPU is not a local physical node and the local physical node includes more than one vCPU, modifying the target vCPU in the instruction to a vCPU on the local physical node And storing a correspondence between the local virtual interrupt pin and the modified target vCPU.
4、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述建立全局 虚拟中断引脚与虚拟 PCI设备的中断引脚的连接关系, 具体为:  The method according to claim 1, 2 or 3, wherein the establishing a connection relationship between the global virtual interrupt pin and the interrupt pin of the virtual PCI device is specifically:
将所述全局虚拟中断引脚划分为多个互不相交的子集, 建立所述全局 虚拟中断引脚与虚拟 PCI设备的中断引脚的连接关系, 其中, 属于同一个 物理机的所述虚拟 PCI设备的中断引脚连接在同一个所述子集内。  Dividing the global virtual interrupt pin into a plurality of mutually disjoint subsets, establishing a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device, where the virtual device belongs to the same physical machine The interrupt pins of the PCI device are connected in the same subset.
5、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述 ACPI表 中, 同一个物理节点上的所述所有虚拟 PCI设备的中断引脚连接到一个所 述全局虚拟中断引脚。  The method according to claim 1, 2 or 3, wherein in the ACPI table, the interrupt pins of all the virtual PCI devices on the same physical node are connected to one of the global virtual interrupt references. foot.
6、 根据权利要求 1至 5任一项所述的方法, 其特征在于, 还包括: 连接在所述局部虚拟中断引脚上的虚拟 PCI设备的中断引脚上产生中 断后, 所述局部虚拟中断引脚所在物理节点上的分布式虚拟机监控器, 根 据所在的物理节点保存的所述局部虚拟中断引脚与处理所述局部虚拟中 断引脚上中断的所述目标 vCPU的对应关系, 将所述局部虚拟中断引脚上 的中断传递到所述目标 vCPU。 The method according to any one of claims 1 to 5, further comprising: after the interrupt is generated on an interrupt pin of the virtual PCI device connected to the local virtual interrupt pin, the partial virtual The distributed virtual machine monitor on the physical node where the interrupt pin is located, according to the corresponding relationship between the local virtual interrupt pin held by the physical node and the target vCPU that is interrupted on the local virtual interrupt pin, The local virtual interrupt pin The interrupt is passed to the target vCPU.
7、 一种分布式虚拟化系统的虚拟中断管理装置, 包括虚拟机和多个 部署在不同物理节点上的分布式虚拟机监控器。 其特征在于:  7. A virtual interrupt management device for a distributed virtualization system, comprising a virtual machine and a plurality of distributed virtual machine monitors deployed on different physical nodes. It is characterized by:
所述虚拟机, 包括: 虚拟 BIOS模块和操作系统;  The virtual machine includes: a virtual BIOS module and an operating system;
所述虚拟 BIOS模块, 用于在 ACPI表中建立所述虚拟机上全局虚拟 中断引脚与虚拟 PCI设备的中断引脚的连接关系, 其中所述全局虚拟中断 引脚中的任意一个对应于属于同一个所述物理节点的一个或多个所述虚 拟 PCI设备的中断引脚;  The virtual BIOS module is configured to establish, in an ACPI table, a connection relationship between a global virtual interrupt pin on the virtual machine and an interrupt pin of the virtual PCI device, where any one of the global virtual interrupt pins corresponds to An interrupt pin of one or more of the virtual PCI devices of the same physical node;
所述操作系统, 用于获取所述 ACPI表, 根据所述 ACPI表, 运行为 所述 ACPI表中的全局虚拟中断引脚设置目标 vCPU的指令; 所述多个分 布式虚拟机监控器中的第一分布式虚拟机监控器, 用于截获所述操作系统 设置目标 vCPU的指令, 根据分布式中断引脚信息确定所述全局虚拟中断 引脚对应的局部虚拟中断引脚所在的物理节点, 所述局部虚拟中断引脚位 于所述物理节点上并用于模拟所述全局虚拟中断引脚, 所述分布式中断引 脚信息包括全局虚拟中断引脚与虚拟 PCI设备的中断引脚的连接关系, 以 及各个物理节点包括的虚拟 PCI设备以及所述各个物理节点负责的局部虚 拟中断引脚;  The operating system is configured to acquire the ACPI table, and execute an instruction to set a target vCPU for a global virtual interrupt pin in the ACPI table according to the ACPI table; in the multiple distributed virtual machine monitors a first distributed virtual machine monitor, configured to intercept an instruction of the operating system to set a target vCPU, and determine, according to the distributed interrupt pin information, a physical node where the local virtual interrupt pin corresponding to the global virtual interrupt pin is located, where The local virtual interrupt pin is located on the physical node and is used to simulate the global virtual interrupt pin, and the distributed interrupt pin information includes a connection relationship between a global virtual interrupt pin and an interrupt pin of the virtual PCI device, and a virtual PCI device included in each physical node and a local virtual interrupt pin responsible for each physical node;
所述多个分布式虚拟机监控器中的第二分布式虚拟机监控器, 用于根 据所述指令保存所述局部虚拟中断引脚与所述目标 vCPU的对应关系, 所 述第二分布式虚拟机监控器为所述局部虚拟中断引脚所在的物理节点上 的分布式虚拟机监控器。  a second distributed virtual machine monitor of the plurality of distributed virtual machine monitors, configured to save a correspondence between the local virtual interrupt pin and the target vCPU according to the instruction, the second distributed The virtual machine monitor is a distributed virtual machine monitor on the physical node where the local virtual interrupt pin is located.
8、 根据权利要求 7所述的装置, 其特征在于:  8. Apparatus according to claim 7 wherein:
所述第二分布式虚拟机监控器, 还用于当根据所述指令确定所述目标 vCPU所在物理节点是本地物理节点时, 保存所述局部虚拟中断引脚与所 述目标 vCPU的对应关系;  The second distributed virtual machine monitor is further configured to: when determining that the physical node where the target vCPU is located is a local physical node according to the instruction, saving a correspondence between the local virtual interrupt pin and the target vCPU;
所述第二分布式虚拟机监控器, 还用于当根据所述指令确定所述目标 vCPU所在物理节点不是本地物理节点且所述本地物理节点包括一个以上 的 vCPU时, 将所述指令中的所述所述目标 vCPU修改为所述本地物理节 点上的一个 vCPU, 保存所述局部虚拟中断引脚与修改后所述目标 vCPU 的对应关系。 The second distributed virtual machine monitor is further configured to determine the target according to the instruction When the physical node where the vCPU is located is not a local physical node and the local physical node includes more than one vCPU, the target vCPU in the instruction is modified to be a vCPU on the local physical node, and the local virtual is saved. The correspondence between the interrupt pin and the modified target CPU.
9、 根据权利要求 8所述的装置, 其特征在于:  9. Apparatus according to claim 8 wherein:
所述第一分布式虚拟机监控器, 还用于当确定所述局部虚拟中断引脚 所在的物理节点不是本地物理节点时, 将所述指令发送给所述局部虚拟中 断引脚所在物理节点上的分布式虚拟机监控器。  The first distributed virtual machine monitor is further configured to: when determining that the physical node where the local virtual interrupt pin is located is not a local physical node, send the instruction to the physical node where the local virtual interrupt pin is located Distributed virtual machine monitor.
10、根据权利要求 7、 8或 9所述的装置,其特征在于,所述虚拟 BIOS 所述全局虚拟中断引脚与虚拟 PCI设备的中断引脚的连接关系, 其中, 属 于同一个所述物理机的所有虚拟 PCI设备的中断引脚连接在同一个所述子 集内。  The device according to claim 7, 8 or 9, wherein the virtual BIOS has a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device, wherein the same physical entity belongs to the same physical The interrupt pins of all virtual PCI devices of the machine are connected in the same subset.
11、根据权利要求 7、 8或 9所述的装置,其特征在于,所述虚拟 BIOS 模块具体用于建立所述全局虚拟中断引脚与虚拟 PCI设备的中断引脚的连 接关系, 其中同一个物理节点上的所有虚拟 PCI设备的中断引脚连接到同 一个所述全局虚拟中断引脚。  The device according to claim 7, 8 or 9, wherein the virtual BIOS module is specifically configured to establish a connection relationship between the global virtual interrupt pin and an interrupt pin of the virtual PCI device, wherein the same one The interrupt pins of all virtual PCI devices on the physical node are connected to the same global virtual interrupt pin.
12、 根据权利要求 7至 11任一项所述的装置, 其特征在于, 所述第 二分布式虚拟机监控器, 用于连接在所述局部虚拟中断引脚上的虚拟 PCI 设备的中断引脚上产生中断后, 根据所在的物理节点保存的所述局部虚拟 中断引脚与处理所述局部虚拟中断引脚上中断的目标 vCPU的对应关系, 将所述局部虚拟中断引脚上的中断传递到目标 vCPU。  The device according to any one of claims 7 to 11, wherein the second distributed virtual machine monitor is configured to connect an interrupt of the virtual PCI device on the local virtual interrupt pin. After an interrupt is generated on the pin, the interrupt on the local virtual interrupt pin is transmitted according to the correspondence between the local virtual interrupt pin held by the physical node and the target vCPU that processes the interrupt on the local virtual interrupt pin. Go to the target vCPU.
PCT/CN2013/070591 2012-06-30 2013-01-17 Virtual interrupt management method and apparatus in distributed virtual system WO2014000437A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210223025.9 2012-06-30
CN201210223025.9A CN102799465B (en) 2012-06-30 2012-06-30 Virtual interrupt management method and device of distributed virtual system

Publications (1)

Publication Number Publication Date
WO2014000437A1 true WO2014000437A1 (en) 2014-01-03

Family

ID=47198580

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/070591 WO2014000437A1 (en) 2012-06-30 2013-01-17 Virtual interrupt management method and apparatus in distributed virtual system

Country Status (2)

Country Link
CN (1) CN102799465B (en)
WO (1) WO2014000437A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113391881A (en) * 2021-06-28 2021-09-14 元心信息科技集团有限公司 Interrupt management method and device, electronic equipment and computer storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102799465B (en) * 2012-06-30 2015-05-27 华为技术有限公司 Virtual interrupt management method and device of distributed virtual system
JP2017518589A (en) * 2014-06-20 2017-07-06 華為技術有限公司Huawei Technologies Co.,Ltd. Method and associated device for handling interrupts by a virtualization platform
CN106445650B (en) * 2015-08-05 2019-10-25 华为技术有限公司 A kind of interruption processing method, IOAPIC and computer system
CN110427427B (en) * 2019-08-02 2022-05-27 北京快立方科技有限公司 Method for realizing global transaction distributed processing through pin bridging
CN112817690B (en) * 2021-01-22 2022-03-18 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Interrupt virtualization processing method and system for ARM architecture virtualization field
CN115576807B (en) * 2022-09-28 2023-09-08 国科础石(重庆)软件有限公司 Virtual ECU implementation method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100570587C (en) * 2007-03-19 2009-12-16 联想(北京)有限公司 The access processing method of dummy machine system and Advanced Programmable Interrupt Controllers APICs thereof
CN101751284A (en) * 2009-12-25 2010-06-23 北京航空航天大学 I/O resource scheduling method for distributed virtual machine monitor
CN101398768B (en) * 2008-10-28 2011-06-15 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN102799465A (en) * 2012-06-30 2012-11-28 华为技术有限公司 Virtual interrupt management method and device of distributed virtual system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8453143B2 (en) * 2007-09-19 2013-05-28 Vmware, Inc. Reducing the latency of virtual interrupt delivery in virtual machines
US8032680B2 (en) * 2008-06-27 2011-10-04 Microsoft Corporation Lazy handling of end of interrupt messages in a virtualized environment
GB2462258B (en) * 2008-07-28 2012-02-08 Advanced Risc Mach Ltd Interrupt control for virtual processing apparatus
CN101430674B (en) * 2008-12-23 2010-10-20 北京航空航天大学 Intraconnection communication method of distributed virtual machine monitoring apparatus
CN101620547B (en) * 2009-07-03 2012-05-30 中国人民解放军国防科学技术大学 Virtual physical interrupt processing method of X86 computer
CN101876954B (en) * 2009-12-23 2012-08-15 中国科学院计算技术研究所 Virtual machine control system and working method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100570587C (en) * 2007-03-19 2009-12-16 联想(北京)有限公司 The access processing method of dummy machine system and Advanced Programmable Interrupt Controllers APICs thereof
CN101398768B (en) * 2008-10-28 2011-06-15 北京航空航天大学 Construct method of distributed virtual machine monitor system
CN101751284A (en) * 2009-12-25 2010-06-23 北京航空航天大学 I/O resource scheduling method for distributed virtual machine monitor
CN102799465A (en) * 2012-06-30 2012-11-28 华为技术有限公司 Virtual interrupt management method and device of distributed virtual system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113391881A (en) * 2021-06-28 2021-09-14 元心信息科技集团有限公司 Interrupt management method and device, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
CN102799465A (en) 2012-11-28
CN102799465B (en) 2015-05-27

Similar Documents

Publication Publication Date Title
WO2014000437A1 (en) Virtual interrupt management method and apparatus in distributed virtual system
JP5018252B2 (en) How to change device allocation
US7971203B2 (en) Method, apparatus and system for dynamically reassigning a physical device from one virtual machine to another
US9798565B2 (en) Data processing system and method having an operating system that communicates with an accelerator independently of a hypervisor
US8762999B2 (en) Guest-initiated resource allocation request based on comparison of host hardware information and projected workload requirement
JP2011100431A (en) Device and method for controlling virtual machine
US9697024B2 (en) Interrupt management method, and computer implementing the interrupt management method
CN106844007A (en) A kind of virtual method and system based on spatial reuse
JP5742387B2 (en) Information processing system and I / O switch device
JP2015503784A (en) Migration between virtual machines in the graphics processor
JP2010033404A (en) Virtual machine system and method for controlling virtual machine system
TW201232410A (en) Managing a workload of a plurality of virtual servers of a computing environment
US9734016B2 (en) Secure live virtual machine guest based snapshot recovery
CN106970821A (en) A kind of method and apparatus that I/O requests are handled under KVM virtualization
KR20160033517A (en) Hybrid virtualization scheme for interrupt controller
US10853259B2 (en) Exitless extended page table switching for nested hypervisors
CN103744716A (en) Dynamic interrupt balanced mapping method based on current virtual central processing unit (VCPU) scheduling state
WO2018201461A1 (en) Method and device for migrating virtual machine and virtualization system
CN113312143A (en) Cloud computing system, command processing method and virtualization simulation device
WO2016106756A1 (en) Disaster recovery method, system and apparatus
Zhang et al. High-performance virtual machine migration framework for MPI applications on SR-IOV enabled InfiniBand clusters
WO2022001808A1 (en) System and interrupt processing method
Behnke et al. Héctor: A framework for testing iot applications across heterogeneous edge and cloud testbeds
US20220050795A1 (en) Data processing method, apparatus, and device
US20190138337A1 (en) Saas based solution- orchestration platform for orchestrating virtual network solutions on public/private cloud infrastructure for learning/development/evaluation/demos/validation/deployment

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: 13809934

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: 13809934

Country of ref document: EP

Kind code of ref document: A1