CN112817690B - Interrupt virtualization processing method and system for ARM architecture virtualization field - Google Patents

Interrupt virtualization processing method and system for ARM architecture virtualization field Download PDF

Info

Publication number
CN112817690B
CN112817690B CN202110088713.8A CN202110088713A CN112817690B CN 112817690 B CN112817690 B CN 112817690B CN 202110088713 A CN202110088713 A CN 202110088713A CN 112817690 B CN112817690 B CN 112817690B
Authority
CN
China
Prior art keywords
interrupt
vmm
vcpu
virtual
irq
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110088713.8A
Other languages
Chinese (zh)
Other versions
CN112817690A (en
Inventor
左龙
王涵
杨沧海
夏卫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 32 Research Institute
Original Assignee
CETC 32 Research Institute
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 CETC 32 Research Institute filed Critical CETC 32 Research Institute
Priority to CN202110088713.8A priority Critical patent/CN112817690B/en
Publication of CN112817690A publication Critical patent/CN112817690A/en
Application granted granted Critical
Publication of CN112817690B publication Critical patent/CN112817690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/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/45575Starting, stopping, suspending or resuming virtual machine instances

Abstract

The invention provides an interrupt virtualization processing method and system for the ARM architecture virtualization field, and relates to the technical field of ARM hardware architecture virtualization, wherein the method comprises the following steps: virtual interrupt acquisition: sending the interrupt request of the virtual machine to a register in a corresponding virtual interrupt controller; a virtual interrupt injection step: the virtual interrupt controller collects the virtual interrupt request, and injects the virtual interrupt into the corresponding vCPU one by one according to the priority scheduled by the VMM. The invention can meet the real-time requirement of the embedded operating system, has good universality and is suitable for the embedded multi-core system.

Description

Interrupt virtualization processing method and system for ARM architecture virtualization field
Technical Field
The invention relates to the technical field of virtualization of an ARM hardware architecture, in particular to an interrupt virtualization processing method and system for the ARM architecture virtualization field.
Background
The interrupt processing flow in the ARM hardware architecture is as follows: the interrupt controller GIC collects the interrupt signal generated by hard interrupt or directly gives the interrupt signal of soft interrupt by the instruction, and then informs the CPU; CPU saves the running environment of the current program, and then calls the interrupt service program to process the interrupt; the interrupt service program identifies the interrupt type by reading the relevant register and then executes corresponding processing; after the interrupt request is executed, the interrupt is cleared through reading and writing the relevant interrupt control register; and finally, recovering the execution environment of the interrupted program and continuing to execute the interrupted program.
In order to support the simultaneous operation of multiple isolated execution environments on the same embedded hardware platform, an intermediate layer of a Virtual Machine Manager (VMM) is added on the basis of the original architecture, the VMM is used as system software to directly manage all hardware equipment, and the multiple isolated execution environments operate on the VMM by calling a service interface provided by the VMM. After the virtual machine manager VMM is added, in order to not affect the interrupt response process of the guest operating system in the application execution environment, the VMM is required to perform virtualization processing on the interrupt, the virtualization processing mainly relates to virtual interrupt acquisition and virtual interrupt injection, and the processing on the interrupt is realized by the guest operating system of the virtual machine.
Due to the uniqueness of the embedded domain, virtualization technology is applied to the embedded domain, and a VMM based on a microkernel design mode is generally adopted. The existing virtualization scheme based on the microkernel design mode is Xen, but in order to reduce the complexity of design, Xen hands most hardware devices over to a Linux root domain for management and control, and the process of interrupting virtualization also needs VMM and the root domain to complete together, so that the process flow is not only complex but also inefficient.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide an interrupt virtualization processing method and system for the ARM architecture virtualization field, which can meet the real-time requirement of an embedded operating system, have good universality and are suitable for an embedded multi-core system.
According to the interrupt virtualization processing method and system for the ARM architecture virtualization field, the scheme is as follows:
in a first aspect, an interrupt virtualization processing method for the ARM architecture virtualization field is provided, where the method includes:
virtual interrupt acquisition: sending the interrupt request of the virtual machine to a register in a corresponding virtual interrupt controller;
a virtual interrupt injection step: the virtual interrupt controller collects the virtual interrupt request, and injects the virtual interrupt into the corresponding vCPU one by one according to the priority scheduled by the VMM.
Preferably, the virtual interrupt collecting step includes:
after receiving the interrupt request, the VMM modifies the interrupt type into HYP _ IRQ, and then the VMM sends the HYP _ IRQ to the corresponding virtual machine;
when the virtual machine receives the HYP _ IRQ, it needs to determine whether the interrupt is owned by the virtual machine:
if yes, then sending the interrupt to the corresponding virtual interrupt controller;
if not, the interrupt owned by the virtual machine does not require any processing.
Preferably, the virtual interrupt injection step includes:
when a vCPU is dispatched to regain the use right of the physical CPU, the interrupt processing is carried out according to the interrupt service processing flow of the guest operating system in the virtual machine.
Preferably, the virtual interrupt injection step includes:
clock IRQ interrupts generated by the virtual clock device vTimer:
step 2-1: the virtual machine executes normally, and at the moment, the virtual clock equipment vTimer sends out clock IRQ interruption;
step 2-2: triggering clock IRQ interruption to enable the virtual machine to exit, handing over an interruption processing function corresponding to vbar _ el2 in a VMM kernel state to perform interruption processing, analyzing the virtual machine exit reason by a vCPU management module in the VMM kernel state according to the interruption processing function, and switching to a vCPU management module in a VMM user state;
step 2-3: returning to the VMM user mode vCPU management module, triggering the clock IRQ interruption again, and enabling the triggered IRQ interruption to enter an interruption processing function corresponding to vbar _ el1 of the host machine for interruption processing;
step 2-4: the interrupt processing function corresponding to vbar _ el1 carries out corresponding interrupt processing according to the interrupt number of the request;
step 2-5: after the interrupt request is finished, sending the HYP _ IRQ interrupt to a VMM user mode vCPU management module for logic processing;
step 2-6: the VMM user mode vCPU management module calls the service provided by the VMM kernel mode according to the HYP _ IRQ interrupt information returned by the VMM kernel mode vCPU management module, obtains a HYP _ IRQ interrupt number and injects the interrupt number into the corresponding vCPU;
step 2-7: after the interrupt injection, the VMM user-state vCPU management module will invoke the VMM kernel-state services to re-run the vCPU of the interrupted virtual machine.
Preferably, the steps 2 to 5 specifically include:
after the interrupt request is finished, the VMM user mode vCPU management module carries out subsequent RERUN processing;
after the RERUN processing is finished, the virtual machine enters a VMM kernel mode vCPU management module, the VMM kernel mode vCPU management module modifies the virtual machine exit reason into that caused by the HYP _ IRQ interruption, and therefore the HYP _ IRQ interruption is sent to a VMM user mode vCPU management module for logic processing.
In a second aspect, an interrupt virtualization processing system for the ARM architecture virtualization domain is provided, the system including:
a virtual interrupt acquisition module: sending the interrupt request of the virtual machine to a register in a corresponding virtual interrupt controller;
a virtual interrupt injection module: the virtual interrupt controller collects the virtual interrupt request, and injects the virtual interrupt into the corresponding vCPU one by one according to the priority scheduled by the VMM.
Preferably, the virtual interrupt collecting module includes:
after receiving the interrupt request, the VMM modifies the interrupt type into HYP _ IRQ, and then the VMM sends the HYP _ IRQ to the corresponding virtual machine;
when the virtual machine receives the HYP _ IRQ, it needs to determine whether the interrupt is owned by the virtual machine:
if yes, then sending the interrupt to the corresponding virtual interrupt controller;
if not, the interrupt owned by the virtual machine does not require any processing.
Preferably, the virtual interrupt injection module includes:
when a vCPU is dispatched to regain the use right of the physical CPU, the interrupt processing is carried out according to the interrupt service processing flow of the guest operating system in the virtual machine.
Preferably, the virtual interrupt injection module includes:
clock IRQ interrupts generated by the virtual clock device vTimer:
module 2-1: the virtual machine executes normally, and at the moment, the virtual clock equipment vTimer sends out clock IRQ interruption;
module 2-2: triggering clock IRQ interruption to enable the virtual machine to exit, handing over an interruption processing function corresponding to vbar _ el2 in a VMM kernel state to perform interruption processing, analyzing the virtual machine exit reason by a vCPU management module in the VMM kernel state according to the interruption processing function, and switching to a vCPU management module in a VMM user state;
module 2-3: returning to the VMM user mode vCPU management module, triggering the clock IRQ interruption again, and enabling the triggered IRQ interruption to enter an interruption processing function corresponding to vbar _ el1 of the host machine for interruption processing;
modules 2 to 4: the interrupt processing function corresponding to vbar _ el1 carries out corresponding interrupt processing according to the interrupt number of the request;
modules 2 to 5: after the interrupt request is finished, sending the HYP _ IRQ interrupt to a VMM user mode vCPU management module for logic processing;
modules 2 to 6: the VMM user mode vCPU management module calls the service provided by the VMM kernel mode according to the HYP _ IRQ interrupt information returned by the VMM kernel mode vCPU management module, obtains a HYP _ IRQ interrupt number and injects the interrupt number into the corresponding vCPU;
modules 2 to 7: after the interrupt injection, the VMM user-state vCPU management module will invoke the VMM kernel-state services to re-run the vCPU of the interrupted virtual machine.
Preferably, the modules 2-5 comprise:
after the interrupt request is finished, the VMM user mode vCPU management module carries out subsequent RERUN processing;
after the RERUN processing is finished, the virtual machine enters a VMM kernel mode vCPU management module, the VMM kernel mode vCPU management module modifies the virtual machine exit reason into that caused by the HYP _ IRQ interruption, and therefore the HYP _ IRQ interruption is sent to a VMM user mode vCPU management module for logic processing.
Compared with the prior art, the invention has the following beneficial effects:
1. has good universality: the interrupt virtualization mechanism related by the invention is suitable for a common ARM hardware architecture, can effectively meet the transplantation requirement of the common ARM architecture in the market, and particularly meets the mechanism of injecting virtual interrupt into an ARM system register aiming at the hardware architectures of the current ARM version-ARMv8.0 and ARMv8.1, so that the interrupt virtualization mechanism can be widely applied;
2. the real-time requirement of the embedded operating system is met: the common embedded operating system in the market has higher requirement on real-time performance, and if a virtual machine manager is added as an intermediate layer, the embedded operating system has more strict requirement on real-time performance; the conventional interruption virtualization operation needs to be switched to a root domain, which is too complex to realize and cannot meet the real-time property of the currently required embedded operating system; the interrupt virtualization processing mechanism is uniformly managed by the VMM, so that the acquisition and injection processes of the interrupt mechanism are simplified, and the real-time requirement of an embedded operating system can be better met;
3. the method is suitable for the embedded multi-core system: the interrupt virtualization mechanism of the present invention adapts the GIC attribute, and thus can provide interrupt virtualization services for multiple CPU cores simultaneously.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a diagram of a virtualization system architecture of the present invention;
FIG. 2 is a flow chart of the interrupt virtualization process of the present invention;
FIG. 3 is a diagram of a scenario in which interrupt virtualization handles virtual clock interrupts.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
The embodiment of the invention provides an interrupt virtualization processing method facing the ARM architecture virtualization field, which is adapted to a GIC interrupt controller, is not only suitable for interrupt virtualization of a single-core system, but also suitable for interrupt virtualization of a multi-core system. The GIC component is composed of two parts, namely an interrupt distributor and a CPU interface, wherein the interrupt distributor mainly collects interrupt lines of all modules to the GIC and then connects the interrupt lines to interrupt pin lines on a CPU core through a CPU interface IRQ or FIQ pin corresponding to an interrupt request, so that the CPU core corresponding to the interrupt can be triggered to perform interrupt processing. After receiving the interrupt sent by the GIC, the CPU can know the source of the interrupt by reading the register of the GIC, thereby carrying out corresponding interrupt processing work. When the CPU finishes processing the interrupt, the GIC is informed that the interrupt processing is finished, the GIC receives the information, and then the interrupt source is cancelled, so that the interrupt is prevented from being sent to the CPU again and the interrupt preemption is allowed.
In a virtualized environment, the GIC is directly administratively controlled by the VMM. The VMM needs to present a virtual interrupt architecture for vcpus in the virtual machine similar to the physical interrupt architecture, i.e., create a corresponding virtual interrupt controller for each vCPU, which is a software entity maintained by the VMM. The VMM may use a virtual interrupt controller to handle interrupts generated by virtual devices in the virtual machine or to inject virtual interrupts into the virtual machine.
The virtual machine can configure whether to support the GIC module in an initialization stage, and if so, the memory area address corresponding to the GIC is mapped to the virtual machine and added into a second stage page table corresponding to the virtual machine. The virtual interrupt controller is really used by the vCPU in the virtual machine, and the vCPU can set whether to use the virtual interrupt controller according to the requirement of the vCPU. If used, the virtual interrupt controller CPU interface needs to be initialized for its use when the vCPU initializes the context, the purpose of the interface being to inject virtual interrupts into the vCPU using the virtual interrupt controller, or to clear virtual interrupts in the vCPU. After the GIC completes the interrupt collection, the virtual interrupt controller may inject a virtual interrupt into the corresponding vCPU. And then the vCPU is rescheduled to execute, and a guest operating system where the vCPU is located can use the interrupt number injected by the virtual interrupt controller to perform corresponding interrupt processing.
Referring to fig. 1 and 2, a main task of interrupt virtualization in the field of ARM architecture virtualization is to implement creation of a virtual interrupt controller, which mainly relates to two aspects of virtual interrupt acquisition and virtual interrupt injection:
virtual interrupt acquisition: the acquisition of the virtual interrupt refers to sending an interrupt request of the virtual machine into a register in a corresponding virtual interrupt controller. There are two possible sources of virtual machine interrupts: a virtual serial interrupt or virtual clock interrupt may be generated from a software-emulated virtual device, such as an emulated serial port or clock. An interrupt from a physical device, such as a physical network card, directly assigned to the virtual machine may generate a true physical interrupt. However, in any type of interrupt, after an interrupt request occurs, the interrupt will be trapped in the kernel mode, and the kernel mode will execute the corresponding interrupt processing task according to the trapping reason stored in the system register ESR and HPFAR.
In the virtualization environment, after receiving an interrupt request, the VMM first modifies the interrupt type to a HYP _ IRQ, and then the VMM sends the HYP _ IRQ to the corresponding virtual machine. When the virtual machine receives the HYP _ IRQ, it needs to determine whether the interrupt is owned by the virtual machine: if so, then sending the interrupt to the corresponding virtual interrupt controller; if not, no processing is required for the interrupt owned by the virtual machine.
A virtual interrupt injection step: the virtual interrupt controller collects the virtual interrupt request, and injects the virtual interrupt into the corresponding vCPU one by one according to the priority scheduled by the VMM. When a vCPU is dispatched to regain the use right of the physical CPU, the interrupt processing can be carried out according to the interrupt service processing flow of the guest operating system in the virtual machine.
Referring to fig. 3, an example of a clock IRQ interrupt generated by the virtual clock device vTimer is described as an interrupt virtualization:
and (4) normally executing the virtual machine, wherein the virtual clock device vTimer sends out clock IRQ interruption.
Triggering clock IRQ interruption to enable the virtual machine to exit, and handing over to an interruption processing function corresponding to vbar _ el2 in a VMM kernel state for interruption processing, wherein according to the interruption processing function, a vCPU management module in the VMM kernel state analyzes the reason of virtual machine exit, and then switching to a vCPU management module in a VMM user state is performed.
Since the current virtual clock device vTimer is still in a valid state, the clock IRQ interrupt will be triggered again when the VMM user state vCPU management module is returned. Since the relevant flag bit of the HCR _ EL2 register has been changed at the time of virtual machine exit in the second step, this time the IRQ interrupt is triggered, the interrupt processing function corresponding to vbar _ EL1 of the host is interrupted.
The interrupt processing function corresponding to vbar _ el1 performs corresponding interrupt processing according to the requested interrupt number, but the result of the interrupt processing at this time is to generate a corresponding HYP _ IRQ interrupt number in the VMM kernel state, which indicates that the virtual machine needs to receive the virtual interrupt.
After the interrupt request is finished, the VMM user mode vCPU management module carries out subsequent RERUN processing. After the RERUN processing is finished, the VMM kernel mode vCPU management module is entered, the VMM kernel mode vCPU management module can modify the virtual machine exit reason into that caused by the HYP _ IRQ interruption, and therefore the HYP _ IRQ interruption is sent to the VMM user mode vCPU management module for logic processing.
And the VMM user mode vCPU management module calls the service provided by the VMM kernel mode according to the HYP _ IRQ interrupt information returned by the VMM kernel mode vCPU management module, acquires a HYP _ IRQ interrupt number and injects the interrupt number into the corresponding vCPU.
After the interrupt injection, the VMM user-state vCPU management module will invoke the VMM kernel-state services to re-run the vCPU of the interrupted virtual machine. When the vCPU begins execution, a virtual interrupt is received, which can then be processed using the interrupt handling mechanism of the guest operating system.
The embodiment of the invention provides an interrupt virtualization processing method facing the ARM architecture virtualization field, wherein (1) the interrupt virtualization processing mechanism related to the invention is completely realized in a VMM layer, the VMM layer virtualizes the interrupt of external equipment or internal virtual equipment, and finally transfers the interrupt to a guest operating system in a virtual machine corresponding to an interrupt request to perform a final interrupt service processing flow, and the interrupt virtualization processing uniformly completed by the VMM is more efficient than the original interrupt virtualization processing. (2) The interrupt virtualization mechanism related by the invention is adaptive to the GIC hardware characteristic of ARM, and is still applicable to interrupt virtualization processing of a multi-core system. (3) The interrupt virtualization of the invention aims at the vCPU object in the virtual machine, if the vCPU supports the GIC, the interrupt injection can be carried out by setting the virtual interrupt controller, otherwise, the interrupt injection is carried out by using the system register HCR _ EL2. vi. Therefore, the invention can flexibly carry out interrupt injection processing according to the context of the vCPU in the virtual machine.
Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, units provided by the present invention as pure computer readable program code, the system and its various devices, modules, units provided by the present invention can be fully implemented by logically programming method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices, modules and units thereof provided by the invention can be regarded as a hardware component, and the devices, modules and units included in the system for realizing various functions can also be regarded as structures in the hardware component; means, modules, units for performing the various functions may also be regarded as structures within both software modules and hardware components for performing the method.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (2)

1. An interrupt virtualization processing method facing to the ARM architecture virtualization field is characterized by comprising the following steps:
virtual interrupt acquisition: sending the interrupt request of the virtual machine to a register in a corresponding virtual interrupt controller;
a virtual interrupt injection step: the virtual interrupt controller collects the virtual interrupt request, and injects the virtual interrupt into the corresponding vCPU one by one according to the priority scheduled by the VMM;
the virtual interrupt collection step includes:
step 1-1: after receiving the interrupt request, the VMM modifies the interrupt type into HYP _ IRQ, and then the VMM sends the HYP _ IRQ to the corresponding virtual machine;
step 1-2: when the virtual machine receives the HYP _ IRQ, it needs to determine whether the interrupt is owned by the virtual machine:
if yes, then sending the interrupt to the corresponding virtual interrupt controller;
if the interrupt is not the interrupt owned by the virtual machine, no processing is required;
the virtual interrupt injection step includes:
clock IRQ interrupts generated by the virtual clock device vTimer:
step 2-1: the virtual machine executes normally, and at the moment, the virtual clock equipment vTimer sends out clock IRQ interruption;
step 2-2: triggering clock IRQ interruption to enable the virtual machine to exit, handing over an interruption processing function corresponding to vbar _ el2 in a VMM kernel state to perform interruption processing, analyzing the virtual machine exit reason by a vCPU management module in the VMM kernel state according to the interruption processing function, and switching to a vCPU management module in a VMM user state;
step 2-3: returning to the VMM user mode vCPU management module, triggering the clock IRQ interruption again, and enabling the triggered IRQ interruption to enter an interruption processing function corresponding to vbar _ el1 of the host machine for interruption processing;
step 2-4: the interrupt processing function corresponding to vbar _ el1 carries out corresponding interrupt processing according to the interrupt number of the request;
step 2-5: after the interrupt request is finished, sending the HYP _ IRQ interrupt to a VMM user mode vCPU management module for logic processing;
step 2-6: the VMM user mode vCPU management module calls the service provided by the VMM kernel mode according to the HYP _ IRQ interrupt information returned by the VMM kernel mode vCPU management module, obtains a HYP _ IRQ interrupt number and injects the interrupt number into the corresponding vCPU;
step 2-7: after the interruption is injected, a VMM user mode vCPU management module calls VMM kernel mode service to re-run the vCPU of the interrupted virtual machine;
when a vCPU is dispatched to obtain the right of use of the physical CPU again, carrying out interrupt processing according to the interrupt service processing flow of the guest operating system in the virtual machine;
the steps 2-5 specifically include:
step 2-5-1: after the interrupt request is finished, the VMM user mode vCPU management module carries out subsequent RERUN processing;
step 2-5-2: after the RERUN processing is finished, the virtual machine enters a VMM kernel mode vCPU management module, the VMM kernel mode vCPU management module modifies the virtual machine exit reason into that caused by the HYP _ IRQ interruption, and therefore the HYP _ IRQ interruption is sent to a VMM user mode vCPU management module for logic processing.
2. An interrupt virtualization processing system for the ARM architecture virtualization domain, the system comprising:
a virtual interrupt acquisition module: sending the interrupt request of the virtual machine to a register in a corresponding virtual interrupt controller;
a virtual interrupt injection module: the virtual interrupt controller collects the virtual interrupt request, and injects the virtual interrupt into the corresponding vCPU one by one according to the priority scheduled by the VMM;
the virtual interrupt collection module includes:
after receiving the interrupt request, the VMM modifies the interrupt type into HYP _ IRQ, and then the VMM sends the HYP _ IRQ to the corresponding virtual machine;
when the virtual machine receives the HYP _ IRQ, it needs to determine whether the interrupt is owned by the virtual machine:
if yes, then sending the interrupt to the corresponding virtual interrupt controller;
if the interrupt is not the interrupt owned by the virtual machine, no processing is required;
the virtual interrupt injection module includes:
clock IRQ interrupts generated by the virtual clock device vTimer:
module 2-1: the virtual machine executes normally, and at the moment, the virtual clock equipment vTimer sends out clock IRQ interruption;
module 2-2: triggering clock IRQ interruption to enable the virtual machine to exit, handing over an interruption processing function corresponding to vbar _ el2 in a VMM kernel state to perform interruption processing, analyzing the virtual machine exit reason by a vCPU management module in the VMM kernel state according to the interruption processing function, and switching to a vCPU management module in a VMM user state;
module 2-3: returning to the VMM user mode vCPU management module, triggering the clock IRQ interruption again, and enabling the triggered IRQ interruption to enter an interruption processing function corresponding to vbar _ el1 of the host machine for interruption processing;
modules 2 to 4: the interrupt processing function corresponding to vbar _ el1 carries out corresponding interrupt processing according to the interrupt number of the request;
modules 2 to 5: after the interrupt request is finished, sending the HYP _ IRQ interrupt to a VMM user mode vCPU management module for logic processing;
modules 2 to 6: the VMM user mode vCPU management module calls the service provided by the VMM kernel mode according to the HYP _ IRQ interrupt information returned by the VMM kernel mode vCPU management module, obtains a HYP _ IRQ interrupt number and injects the interrupt number into the corresponding vCPU;
modules 2 to 7: after the interruption is injected, a VMM user mode vCPU management module calls VMM kernel mode service to re-run the vCPU of the interrupted virtual machine;
when a vCPU is dispatched to obtain the right of use of the physical CPU again, carrying out interrupt processing according to the interrupt service processing flow of the guest operating system in the virtual machine;
the modules 2-5 include:
after the interrupt request is finished, the VMM user mode vCPU management module carries out subsequent RERUN processing;
after the RERUN processing is finished, the virtual machine enters a VMM kernel mode vCPU management module, the VMM kernel mode vCPU management module modifies the virtual machine exit reason into that caused by the HYP _ IRQ interruption, and therefore the HYP _ IRQ interruption is sent to a VMM user mode vCPU management module for logic processing.
CN202110088713.8A 2021-01-22 2021-01-22 Interrupt virtualization processing method and system for ARM architecture virtualization field Active CN112817690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110088713.8A CN112817690B (en) 2021-01-22 2021-01-22 Interrupt virtualization processing method and system for ARM architecture virtualization field

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110088713.8A CN112817690B (en) 2021-01-22 2021-01-22 Interrupt virtualization processing method and system for ARM architecture virtualization field

Publications (2)

Publication Number Publication Date
CN112817690A CN112817690A (en) 2021-05-18
CN112817690B true CN112817690B (en) 2022-03-18

Family

ID=75858827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110088713.8A Active CN112817690B (en) 2021-01-22 2021-01-22 Interrupt virtualization processing method and system for ARM architecture virtualization field

Country Status (1)

Country Link
CN (1) CN112817690B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687909B (en) * 2021-07-28 2024-01-30 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Time-sharing vcpu multi-core scheduling method and system based on microkernel
CN113672342B (en) * 2021-08-02 2024-02-27 上海交通大学 Embedded virtualization system, construction and test methods, terminal and medium
CN114356812B (en) * 2021-12-31 2022-08-26 元心信息科技集团有限公司 Interrupt processing method and device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279769A (en) * 2011-07-08 2011-12-14 西安交通大学 Embedded-Hypervisor-oriented interruption virtualization operation method
CN102799465A (en) * 2012-06-30 2012-11-28 华为技术有限公司 Virtual interrupt management method and device of distributed virtual system
CN103559087A (en) * 2013-10-31 2014-02-05 华为技术有限公司 Interrupt realization method between virtual processors, relevant device and system
CN103744716A (en) * 2014-01-15 2014-04-23 上海交通大学 Dynamic interrupt balanced mapping method based on current virtual central processing unit (VCPU) scheduling state
CN106462451A (en) * 2014-06-20 2017-02-22 华为技术有限公司 Interruption handling method and relevant device of virtual platform
CN109144679A (en) * 2017-06-27 2019-01-04 华为技术有限公司 Processing method, device and the virtual equipment of interrupt requests
CN111190692A (en) * 2019-12-26 2020-05-22 山东乾云启创信息科技股份有限公司 Monitoring method and system based on Roc processor and readable medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9424211B2 (en) * 2008-12-31 2016-08-23 Intel Corporation Providing multiple virtual device controllers by redirecting an interrupt from a physical device controller

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279769A (en) * 2011-07-08 2011-12-14 西安交通大学 Embedded-Hypervisor-oriented interruption virtualization operation method
CN102799465A (en) * 2012-06-30 2012-11-28 华为技术有限公司 Virtual interrupt management method and device of distributed virtual system
CN103559087A (en) * 2013-10-31 2014-02-05 华为技术有限公司 Interrupt realization method between virtual processors, relevant device and system
CN103744716A (en) * 2014-01-15 2014-04-23 上海交通大学 Dynamic interrupt balanced mapping method based on current virtual central processing unit (VCPU) scheduling state
CN106462451A (en) * 2014-06-20 2017-02-22 华为技术有限公司 Interruption handling method and relevant device of virtual platform
CN109144679A (en) * 2017-06-27 2019-01-04 华为技术有限公司 Processing method, device and the virtual equipment of interrupt requests
CN111190692A (en) * 2019-12-26 2020-05-22 山东乾云启创信息科技股份有限公司 Monitoring method and system based on Roc processor and readable medium

Also Published As

Publication number Publication date
CN112817690A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
CN112817690B (en) Interrupt virtualization processing method and system for ARM architecture virtualization field
EP3185128B1 (en) Gpu virtualisation
EP1467282B1 (en) Operating systems
US7757231B2 (en) System and method to deprivilege components of a virtual machine monitor
US10255090B2 (en) Hypervisor context switching using a redirection exception vector in processors having more than two hierarchical privilege levels
US9619279B2 (en) Operating systems sharing supervisor address space with same virtual to physical mapping for supervisor address space using same translation formula with different translation tree
US8612992B2 (en) Operating systems
US20070078891A1 (en) Operating systems
US10019275B2 (en) Hypervisor context switching using a trampoline scheme in processors having more than two hierarchical privilege levels
TW201245975A (en) Apparatus and method for managing hypercalls in a hypervisor and the hypervisor thereof
US9715403B2 (en) Optimized extended context management for virtual machines
WO2015192381A1 (en) Interruption handling method and relevant device of virtual platform
US20190324783A1 (en) Synchronous operation method performance in context of asynchronous event loop
US11169837B2 (en) Fast thread execution transition
US20050251803A1 (en) Method of performing kernel task upon initial execution of process at user level
CN114489941A (en) Virtual machine management method and system running in host mode user mode
CN114237813A (en) Micro-kernel IO virtualization method and system based on ARM architecture
KR100928866B1 (en) Apparatus and method for running an application in a virtual environment
EP1616257A2 (en) Operating systems
CA2540490A1 (en) Operating systems
Ritchie Operating Systems
US20230229473A1 (en) Adaptive idling of virtual central processing unit
EP1673693B1 (en) Operating systems
US20210200904A1 (en) Processor with a configurable distribution of privileged resources and exceptions between protection rings
CN116263691A (en) Cloud service hot migration method and device for bare metal server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant