Virtual machine monitor scheduling method and device, electronic equipment and vehicle

By subscribing to the software to entrust exception interface events during the power-on process of virtual machine monitor and controlling the virtual machine to fall into the virtual machine monitor, the problem of long interrupt processing and response time in the virtualized environment is solved, and VCPU scheduling in interrupt pass-through mode is realized, which improves system performance and reliability.

CN120216089APending Publication Date: 2025-06-27BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311824235.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The prior art has long interrupt processing and response times in virtualized environments, resulting in degradation in system performance, especially when switching across core contexts.

Method used

By subscribing to the software delegation exception interface event during the power-on process of the virtual machine monitor, the virtual machine is trapped in the virtual machine monitor, and canceling virtualized access to physical memory, reset the virtualized access memory control in response to the instruction execution error, and switch to the idle state execution of the virtual machine monitor, thereby realizing VCPU scheduling in interrupted pass-through mode.

Benefits of technology

It reduces the processing and response time of interrupts by virtualization, improves system performance and reliability, prevents mutual interference between virtual machines, supports multiple virtual machine operating systems to run on the same chip, and achieves secure isolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216089A_ABST
    Figure CN120216089A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine monitor scheduling method and device, electronic equipment and a vehicle. The method comprises the following steps: subscribing a software entrusted abnormal interface event in a power-on process of a virtual machine monitor; the software delegation exception interface event is used for registering a processing program with firmware to receive notifications of related system events; the virtual machine monitor is used for being responsible for scheduling a virtual machine central processing unit, and resources of a physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit; based on a virtual machine management program of the software entrustment abnormal interface event, controlling a virtual machine to fall into a virtual machine monitor, canceling virtual access to a physical memory, and returning an instruction execution error when the client virtual machine executes; and in response to the instruction execution error, virtual access memory control is reset, a rescheduling event occurs, and the virtual machine monitor is switched to the idle state for execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of operating systems, and in particular, to a virtual machine monitor scheduling method, apparatus, electronic device, and vehicle. Background Art

[0002] Interrupt remapping means intercepting an interruption from an external device and then finding the true interruption routing information by querying an interruption mapping table and sending it to the true CPU. The process of interrupt remapping is as follows: An external device triggers an interruption to reach the interruption controller, and the interruption controller sends the interruption to the physical central processing unit. The virtual machine monitor reads the terminal information from the physical central processing unit interface. The virtual machine monitor discovers that this interruption is triggered by a passthrough device of a certain virtual machine (a passthrough device means that a physical device on a physical computer is directly allocated for use by the virtual machine), and reinserts a virtual interruption into the interruption controller by writing a register; the interruption controller generates a virtual interruption and sends it to the virtual machine central processing unit; the system immediately enters the entry of the interruption vector table processing function at the EL1 level (EL1 is mainly used to run the operating system kernel) set by the client virtual machine and processes the interruption task.

[0003] In the related art, the scheduling of the virtual machine central processing unit is satisfied by the interrupt remapping method. In the virtual machine, after the interrupt controller participates in the interrupt remapping of the passthrough device, the virtual machine has significantly improved in interrupt processing efficiency. However, compared with ordinary physical interrupts on the host, there is always an additional action participated by the software virtual machine monitor, and the throughput of the software has a certain loss relative to the host. In particular, cross-core context switching will generate time delay. Since the virtual machine central processing unit cannot process inter-processor interruptions, it needs to exit the host machine and enter the virtual machine monitor for processing, thus increasing the time consumption of context switching. Therefore, how to reduce the processing and response time of virtualization for interruptions and improve system performance is an urgent problem to be solved currently. Summary of the Invention

[0004] To solve the above technical problems, the present disclosure provides a virtual machine monitor scheduling method, apparatus, electronic device, and vehicle.

[0005] In a first aspect, the present disclosure provides a virtual machine monitor scheduling method, including:

[0006] During the power-on process of the virtual machine monitor, subscribe to software delegate exception interface events; the software delegate exception interface events are used to register a handler with the firmware to receive notifications of relevant system events; the virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit, and the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit;

[0007] The hypervisor based on the software commissioning exception interface event controls the virtual machine to enter the virtual machine monitor, cancels the virtualized access to the physical memory, and returns an instruction execution error that occurs when the client virtual machine is executing.

[0008] In response to the instruction execution error, reset the virtualized access memory control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution.

[0009] As an optional implementation manner of an embodiment of the present disclosure, the generating a rescheduling event in response to the instruction execution error and switching to the idle state of the virtual machine monitor for execution includes:

[0010] Control the virtual machine to run, and in response to the instruction execution error, suspend the virtual machine's virtual central processing unit.

[0011] Set the rescheduling flag of the virtual machine central processing unit to the first flag bit, and send a rescheduling event to the virtual machine central processing unit, so that in response to the rescheduling event, the virtual machine central processing unit cancels the virtualized access to the physical memory, returns an instruction execution error that occurs when the virtual machine is running, and enters the virtual machine monitor to process the instruction execution error.

[0012] Reset the virtualized memory access control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution.

[0013] As an optional implementation manner of an embodiment of the present disclosure, during the power-on process of the virtual machine monitor, it further includes:

[0014] Run the virtual machine monitor and start the first physical central processing unit, so that the first physical central processing unit starts the second physical central processing unit through the power state cooperation interface PSCI, and run the idle process of the virtual machine monitor to enter the waiting interrupt wake-up state; the first physical central processing unit is the physical central processing unit of the host, and the second physical central processing unit is a non-started physical central processing unit.

[0015] Load the image of the virtual machine and start the virtual machine.

[0016] During the startup process of the virtual machine, in response to a power state cooperation interface request for starting the second physical central processing unit, create and bind the virtual machine central processing unit to the corresponding second physical central processing unit.

[0017] As an optional implementation manner of an embodiment of the present disclosure, after generating a rescheduling event in response to the instruction execution error and switching to the idle state of the virtual machine monitor for execution, it further includes:

[0018] Receive an interrupt request, where the types of the interrupt request include: physical interrupt request, virtual interrupt request, and inter-processor interrupt request; the physical interrupt request is an interrupt request generated by a physical peripheral, the virtual interrupt request is an interrupt request generated by a virtual peripheral, and the inter-processor interrupt request is an interrupt request generated between processors inside a virtual machine;

[0019] In response to the interrupt request, process the interrupt request in a preset manner.

[0020] As an optional implementation manner of the embodiments of the present disclosure, when the interrupt request is the physical interrupt request, the step of in response to the interrupt request and processing the interrupt request in a preset manner includes:

[0021] Process the physical interrupt through a physical central processing unit so that the virtual machine directly responds to the interrupt request.

[0022] As an optional implementation manner of the embodiments of the present disclosure, when the interrupt request is the virtual interrupt request, the step of in response to the interrupt request and processing the interrupt request in a preset manner includes:

[0023] Trigger the virtual machine monitor to set a register to trigger a virtual interrupt by calling an instruction of the virtual machine monitor;

[0024] Send the virtual interrupt request to the virtual machine central processing unit through the virtual machine central processing unit interface so that the virtual machine central processing unit processes the virtual interrupt.

[0025] As an optional implementation manner of the embodiments of the present disclosure, when the interrupt request is the inter-processor interrupt request, the step of in response to the interrupt request and processing the interrupt request in a preset manner includes:

[0026] Update the number of the virtual machine central processing unit to the number of the corresponding physical central processing unit;

[0027] Write the triggered inter-core interrupt number and the physical number of the receiving interrupt core into a register through the virtual machine so that the virtual machine receives the inter-processor interrupt request and processes the inter-processor interrupt request.

[0028] In a second aspect, an embodiment of the present disclosure provides a virtual machine monitor scheduling device, including:

[0029] A subscription module, configured to subscribe to software delegated exception interface events during the power-on process of a virtual machine monitor; the software delegated exception interface events are used to register a handler with the firmware to receive notifications of relevant system events; the virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit, and the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit;

[0030] A control module, configured to, based on a hypervisor of the software delegated exception interface events, control the virtual machine to enter the virtual machine monitor, cancel virtualized access to physical memory, and return an instruction execution error that occurs when the client virtual machine is executing;

[0031] A scheduling module, configured to, in response to the instruction execution error, reset the virtualized access memory control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution.

[0032] As an optional implementation manner of an embodiment of the present disclosure, the scheduling module is specifically configured to:

[0033] Control the operation of the virtual machine, and in response to the instruction execution error, suspend the virtual machine central processing unit of the virtual machine;

[0034] Set the rescheduling flag of the virtual machine central processing unit to a first flag bit, and send a rescheduling event to the virtual machine central processing unit, so that in response to the rescheduling event, the virtual machine central processing unit cancels virtualized access to physical memory, returns an instruction execution error that occurs when the virtual machine is running, and enters the virtual machine monitor to process the instruction execution error;

[0035] Reset the virtualized memory access control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution.

[0036] As an optional implementation manner of an embodiment of the present disclosure, the apparatus further includes: a power-on module, and the power-on module is specifically configured to:

[0037] Run the virtual machine monitor, start a first physical central processing unit, so that the first physical central processing unit starts a second physical central processing unit through a power state cooperation interface PSCI, and run the idle process of the virtual machine monitor to enter a waiting interrupt wake-up state; the first physical central processing unit is the physical central processing unit of the host, and the second physical central processing unit is a non-started physical central processing unit;

[0038] Load the image of the virtual machine and start the virtual machine;

[0039] During the startup process of the virtual machine, in response to a power state cooperation interface request for starting the second physical central processing unit, create and bind the virtual machine central processing unit to the corresponding second physical central processing unit.

[0040] As an optional implementation manner of an embodiment of the present disclosure, the device further includes:

[0041] A receiving module, configured to receive an interrupt request, where the types of the interrupt request include: a physical interrupt request, a virtual interrupt request, and an inter-processor interrupt request; the physical interrupt request is an interrupt request generated by a physical peripheral, the virtual interrupt request is an interrupt request generated by a virtual peripheral, and the inter-processor interrupt request is an interrupt request generated between processors inside the virtual machine;

[0042] A response module, configured to process the interrupt request in a preset manner in response to the interrupt request.

[0043] As an optional implementation manner of an embodiment of the present disclosure, when the interrupt request is the physical interrupt request, the response module is specifically configured to:

[0044] Process the physical interrupt through the physical central processing unit, so that the virtual machine directly responds to the interrupt request.

[0045] As an optional implementation manner of an embodiment of the present disclosure, when the interrupt request is the virtual interrupt request, the response module is specifically configured to:

[0046] Trigger the virtual machine monitor to set a register to trigger a virtual interrupt by calling an instruction of the virtual machine monitor;

[0047] Send the virtual interrupt request to the virtual machine central processing unit through the virtual machine central processing unit interface, so that the virtual machine central processing unit processes the virtual interrupt.

[0048] As an optional implementation manner of an embodiment of the present disclosure, when the interrupt request is the inter-processor interrupt request, the response module is specifically configured to:

[0049] Update the number of the virtual machine central processing unit to the number of the corresponding physical central processing unit;

[0050] Write the triggered inter-core interrupt number and the physical number of the receiving interrupt core into a register through the virtual machine, so that the virtual machine receives the inter-processor interrupt request and processes the inter-processor interrupt request.

[0051] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors;

[0052] A storage device for storing one or more programs,

[0053] When the one or more programs are executed by the one or more processors, the one or more processors implement the virtual machine monitor scheduling method according to any one of the embodiments in the first aspect.

[0054] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the virtual machine monitor scheduling method according to any one of the embodiments in the first aspect is implemented.

[0055] In a fifth aspect, an embodiment of the disclosure provides a vehicle, including: the electronic device according to the third aspect.

[0056] The technical solution provided by the embodiment of the present disclosure has the following advantages compared with the prior art: During the power-on process of the virtual machine monitor, subscribe to the software delegated exception interface event; wherein, the software delegated exception interface event is used to register a handler with the firmware to receive notifications of relevant system events; Based on the virtual machine monitor of the software delegated exception interface event, control the virtual machine to enter the virtual machine monitor, cancel the virtualized access to the physical memory, return an instruction execution error when the virtual machine is executing, in response to the instruction execution error, reset the virtualized access memory control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution. Since the virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit, and the virtual machine central processing unit runs on the physical central processing unit, the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit. Based on this, it is possible to prevent interference between virtual machines to support multiple virtual machine operating systems running on the same system-on-chip, and achieve secure isolation of each virtual machine operating system on the system-on-chip. The virtual machine monitor VMM completes the VCPU scheduling in the interrupt direct pass mode of the virtual machine VM by subscribing to SDEI events and using the memory access control of the VM, and directly delivers the interrupt to the guest operating system running in the virtual machine without going through the virtualization layer, so as to reduce the processing and response time of the virtualization to the interrupt and improve the system performance and reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0059] Figure 1 It is a schematic flowchart of a virtual machine monitor scheduling method provided by an embodiment of the present disclosure;

[0060] Figure 2 It is a schematic structural diagram of a virtual machine monitor scheduling device provided by an embodiment of the present disclosure;

[0061] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0062] In order to more clearly understand the above objects, features, and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.

[0063] Many specific details are set forth in the following description in order to fully understand the present disclosure, but the present disclosure may be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.

[0064] The relational terms such as "first" and "second" in the description and claims of the present disclosure are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0065] In the embodiments of the present disclosure, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present disclosure should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner. In addition, in the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "a plurality" refers to two or more.

[0066] Glossary:

[0067] CPU: central processing unit, the central processing unit.

[0068] VCPU: virtual central processing unit, the virtual central processing unit.

[0069] PCPU: physical central processing unit, the physical central processing unit.

[0070] VM: virtual machine, which means virtual machine.

[0071] Guest VM: guest virtual machine, which means client virtual machine.

[0072] Host VM: host virtual machine, which means host virtual machine.

[0073] VMM: virtual machine monitor, which means virtual machine monitor.

[0074] SDEI: software delegated exception interface, which means software delegated exception interface.

[0075] PSCI: power state coordination interface, which means power state coordination interface.

[0076] PE: Portable Executable, which means portable executable file.

[0077] WFI: wait for interrupt, which means wait for interrupt to wake up.

[0078] IPI: Inter-Processor Interrupt, which means inter-processor interrupt.

[0079] GIC: Generic Interrupt Controller. The interrupt controller is equivalent to an agent. Interrupts generated by peripherals will be sent to the interrupt controller first. The interrupt controller manages and controls maskable interrupts, and judges the priority of interrupts, and transfers high-priority interrupts to the CPU. In this way, the CPU can not only focus on computing, but also respond to interrupt events in a timely manner and execute the corresponding interrupt service program. Currently, there are 4 versions of GIC, GICv1 - GICv4. V1 is an older version and has been abandoned. GICv2 - GICv4 are currently used more frequently. GICv2 is for the ARMv7-A architecture, such as Cortex-A7 / A9 / A15, etc. GICv3 / GICv4 are for the ARMv8-A / R architecture.

[0080] ATF: ARM Trusted Firmware, which is a low-level open-source firmware code for ARM chips.

[0081] Pass-through device: A virtual machine can access the physical PCI functions on the platform using the I / O Memory Management Unit, which is commonly known as virtualization pass-through. Simply put, it allows the host machine to directly transfer the jurisdiction of certain hardware resources to the virtual machine. The virtual machine will use the hardware in an exclusive pass-through manner, and the host machine can no longer use this hardware. The utilization efficiency is almost the same as if the hardware were plugged into the motherboard expansion slot of the virtual machine. The most practical purpose is to avoid the performance degradation caused by the software layer conversion of the virtualization platform itself.

[0082] The Virtual Machine Monitor (Hypervisor) is a software layer installed on the physical hardware that can divide a physical machine into many virtual machines through virtualization. In this way, multiple operating systems can run simultaneously on a single physical hardware. The operating system installed on the virtual machine is called the virtual operating system, also known as an instance. The hardware on which the Virtual Machine Monitor runs is called the host. The Virtual Machine Monitor is a computer software program that provides an abstraction layer, handles the conversion between physical and virtual resources (such as physical and virtual CPUs or memory), and manages the creation and support of virtual machines.

[0083] There are two types of Virtual Machine Monitors: Type-1 Virtual Machine Monitor and Type-2 Virtual Machine Monitor. Among them, the Type-1 Virtual Machine Monitor is also known as the bare-metal Virtual Machine Monitor or native Virtual Machine Monitor. It does not need to pre-load the underlying operating system and can be directly installed on the hardware by directly accessing the underlying hardware without other software (such as the operating system and device drivers), splitting the hardware into multiple virtual machines and installing the virtual machine operating systems on each virtual machine. The Type 2 hypervisor is usually installed on top of an existing operating system and is called a hosted hypervisor because it relies on the host's pre-installed operating system to manage calls to CPU, memory, storage, and network resources. For the Type 2 hypervisor, the presence of the underlying operating system will introduce inevitable latency because all activities of this hypervisor and the work of each VM must pass through the host operating system.

[0084] The Hypervisor can support the switching between virtual machines, and virtual machines are mainly included in the non-secure states of EL1 and EL0. Some Guest OS can run in the EL1 state, and each Guest OS can run on a virtual machine. Applications run in the non-secure state of EL0 and also run on the Guest OS.

[0085] ARMv8-A has four exception levels, from EL0 to EL3. For the exception level ELn, an increase in the integer n indicates that the privilege level of software execution becomes higher.

[0086] Execution at the EL0 level is called unprivileged execution.

[0087] EL1 is mainly used to run the operating system kernel.

[0088] EL2 can support the virtualization of non-secure operations.

[0089] EL3 supports the transition between secure and non-secure states.

[0090] The secure state is related to the ARM TrustZone technology. The secure state can run the Trusted Execution Environment (TEE) and secure applications to ensure the security of private data and the program running environment.

[0091] In some embodiments, such as Figure 1 shown, a virtual machine monitor scheduling method is provided, which is applied to a virtual machine monitor. The virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit. The resources of the physical central processing unit corresponding to the virtual machine central processing unit are the exclusive resources of the virtual machine central processing unit. The method includes the following steps S11 - S13:

[0092] S11. During the power-on process of the virtual machine monitor, subscribe to software delegated exception interface events.

[0093] Among them, the software delegated exception interface event is used to register a handler with the firmware to receive notifications of relevant system events. The virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit. The resources of the physical central processing unit corresponding to the virtual machine central processing unit are the exclusive resources of the virtual machine central processing unit.

[0094] It should be noted that the physical hardware on which the virtual machine monitor runs is usually called the host, and the virtual machines created and supported by the hypervisor are collectively called guest machines. In the embodiments of the present disclosure, the virtual machine monitor runs on the host, and the virtual machine central processing unit runs on the guest machine (client). That is, the virtual machine monitor of the host is responsible for the scheduling of the virtual machine central processing unit of the client. On the virtualization platform, to prevent interference between virtual machines, the virtual machine central processing units used by client virtual machines exclusively occupy different physical central processing units to support multiple virtual machine operating systems running on the same system-on-chip, realizing the secure isolation of each virtual machine operating system on the system-on-chip. When a virtual machine central processing unit is scheduled to obtain the use right of the physical central processing unit, the client virtual machine running based on the virtual machine central processing unit can schedule each thread or process in the virtual machine. That is, each thread / process in the client virtual machine time-division multiplexes the virtual machine central processing unit, and each virtual machine central processing unit exclusively uses the corresponding physical central processing unit.

[0095] Specifically, during the power-on process of the VMM, it is necessary to subscribe to SDEI events. The firmware first receives system events through asynchronous exceptions. In response to receiving system events through asynchronous exceptions, it controls the registered handlers to execute at the non-secure exception level; during the initialization process of the virtual machine monitor, the client virtual machine monitor registers a handler for the rescheduling event, enables the rescheduling event, and un-masks the memory mapping of the current portable executable file.

[0096] Exemplarily, the firmware first receives system events through asynchronous exceptions and, in response, arranges for the registered handlers to execute in the non-secure EL. During the VMM initialization process, the SDEI client VMM registers a handler for the platform event handler (rescheduling, un-mapping the EL2 space), enables the event, and un-masks the memory mapping of the current PE.

[0097] S12. The hypervisor based on the software delegated exception interface event controls the virtual machine to trap into the virtual machine monitor, cancels the virtualized access to the physical memory, and returns an instruction execution error that occurs when the virtual machine is executing.

[0098] Specifically, the hypervisor based on the software delegated exception interface event controls the client virtual machine to trap into the virtual machine monitor and cancels the virtualized access to the physical memory of the virtual machine. Since the virtualized access to the physical memory of the virtual machine is cancelled, an instruction execution error that occurs when the virtual machine is executing is returned.

[0099] In some embodiments, the above step S12 (the hypervisor based on the software delegated exception interface event controls the client virtual machine to trap into the virtual machine monitor, cancels the virtualized access to the physical memory, and returns an instruction execution error that occurs when the virtual machine is executing) can be implemented in the following manner:

[0100] Control the operation of the virtual machine. In response to the instruction execution error, suspend the virtual machine's virtual machine central processing unit.

[0101] Specifically, the hypervisor controls the operation of the client virtual machine. In response to the instruction execution error, suspend the client virtual machine's virtual machine central processing unit.

[0102] Set the rescheduling flag of the virtual machine central processing unit to the first flag bit, and send a rescheduling event to the virtual machine central processing unit, so that in response to the rescheduling event, the virtual machine central processing unit cancels the virtualized access to the physical memory, returns an instruction execution error that occurs when the virtual machine is running, and traps into the virtual machine monitor to process the instruction execution error.

[0103] The first flag bit may be set to "1", indicating that the central processing unit of the virtual machine is currently occupied and cannot be used.

[0104] The virtualized memory access control is reset, a rescheduling event occurs, and the virtual machine monitor is switched to an idle state for execution.

[0105] Specifically, if a new virtual machine central processor VCPU needs to be scheduled, the initiator sends an SDEI event signal. When the new VCPU is bound to an interrupt and triggered, it will fall from VM operation to EL3. The interrupt is handed over to the SDEI scheduler, which then arranges to execute the registered handler. The EL2 handler cancels the way the virtual machine accesses physical memory, which will cause an instruction error when the VCPU accesses memory. The virtual machine monitor VMM uses SDEI_EVENT_COMPLETE to terminate its execution, and then the scheduler resumes the original EL1 execution. Since the VMM changes the way the VM accesses memory, an instruction error will occur, and the VMM will be trapped in a scheduling. The new VCPU will fall into the VMM, thereby restoring the way the virtual machine accesses memory. The VMM can control the VCPU to run, suspend, and exit.

[0106] Exemplarily, the host virtual machine controls the operation of the client virtual machine, the host virtual machine suspends the virtual machine CPU of the client virtual machine, sets the rescheduling flag of the virtual machine CPU of the client virtual machine, and sends a rescheduling event to the virtual machine CPU of the client virtual machine; the client virtual machine runs, and the virtual machine CPU of the client virtual machine responds to the rescheduling event; the open source firmware code ATF is run to respond to the rescheduling event; the call is made to the virtual machine monitor layer for processing, and virtualization access to physical memory is canceled; the client virtual machine is returned to operation, and an instruction error occurs; at this time, it falls into the virtual machine monitor mode, handles the instruction error, resets the access control of the virtualized memory, and schedules the idle thread that switches to the virtual machine monitor to run.

[0107] In addition, in the power management of virtual machines, when the host virtual machine controls the shutdown, restart, hibernation and wakeup of the client virtual machine, it is necessary to use the SDEI mechanism to control the virtual central controller of the client virtual machine to enter the virtual machine monitor mode to respond during its operation.

[0108] In some implementations, the above steps (virtual machine monitor power-on process) include the following steps:

[0109] The virtual machine monitor is run, and the first physical central processor is started, so that the first physical central processor starts the second physical central processor through the power state cooperation interface PSCI, and the idle process of the virtual machine monitor is run to enter the waiting interrupt wake-up state.

[0110] Among them, the first physical central processing unit is the physical central processing unit of the host, and the second physical central processing unit is a non-boot physical central processing unit. It can be understood that the second physical central processing unit is the non-boot physical central processing unit of the host other than the first physical central processing unit.

[0111] Load the image of the virtual machine and start the virtual machine.

[0112] During the startup process of the virtual machine, in response to a request for the power state cooperation interface of the first physical central processing unit, create and bind the virtual machine central processing unit to the corresponding second physical central processing unit.

[0113] Specifically, before executing the above step S11, that is, before subscribing to the software delegation exception interface event, the power-on scheduling step of the VMM is also executed. That is, first start the preset chip, U-BOOT jumps to and runs the virtual machine monitor, start the "non-boot CPU" through the power state cooperation interface PSCI, and then run the idle process of the virtual machine monitor to enter the waiting interrupt wake-up state for subsequent virtual machine central processing unit scheduling. Among them, BOOT: originally meaning startup, is a bootloader widely used in embedded systems for booting the operating system to activate. The virtual machine monitor loads the host virtual machine image and starts the host virtual machine. During the startup process of the host virtual machine, in response to a request sent by the power state cooperation interface for starting the "non-boot central processing unit" of the host virtual machine, create and bind the virtual machine central processing unit to the corresponding non-boot physical CPU, add the second virtual machine central processing unit to the ready queue by the startup CPU, set the rescheduling flag for the second virtual machine central processing unit, send a rescheduling event to the second CPU, the CPU wakes up from the WFI state, continues to execute after responding to the rescheduling event, and after judging the rescheduling flag, switches to the second virtual CPU to run through scheduling, so that the host virtual machine can recognize the power-on of the second CPU.

[0114] The virtual machine monitor scheduling method provided by the present disclosure enables the virtual machine monitor VMM to complete the VCPU scheduling in the interrupt direct pass-through mode of the virtual machine VM by subscribing to SDEI events and using the memory access control of the VM, directly passing the interrupt to the guest operating system running in the virtual machine, so as to reduce the processing and response time of the virtualization for the interrupt and improve the system performance and reliability.

[0115] In an embodiment of the present disclosure, a Type-1 virtual machine monitor is taken as an example for illustration. By adopting the Type-1 virtual machine monitor, a method for binding a cloud host VCPU to a physical CPU of a host is provided to support the operation of multiple virtual machine operating systems on the same system-on-chip, and to achieve secure isolation of systems on the system-on-chip. To improve the performance of the system, all peripherals and virtual interrupts do not enter the virtual machine monitor mode but are directly passed through to the virtual machine. In the EL2 layer (EL2 can support the virtualization of non-secure operations), the virtual machine monitor will implement an SDEI (software delegated exception interface) scheduler to support the needs of the guest operating system executing in the non-secure EL1 layer to enter the virtual machine monitor. The 8th interrupt in the inter-processor must be configured as Group 0, customize the virtual machine monitor system rescheduling event, control the client virtual machine to enter the virtual machine monitor, and complete the scheduling of the virtual machine monitor. Among them, for Group 0 interrupts, the GIC forwards the interrupt to the target core using the exception request of IRQ or FIQ. For Group 1 interrupts, the GIC can only use the IRQ exception request. For the handling of interrupt priorities, the GIC uses the same scheme for Group 0 and Group 1. For some Group 0 interrupts, their configuration can be locked.

[0116] The virtual machine monitor scheduling method provided by the embodiment of the present disclosure subscribes to software delegated exception interface events during the power-on process of the virtual machine monitor; wherein, the software delegated exception interface events are used to register a handler with the firmware to receive notifications of relevant system events; the virtual machine manager based on the software delegated exception interface events controls the virtual machine to enter the virtual machine monitor, cancels the virtualized access to physical memory, returns an instruction execution error when the virtual machine is executing, in response to the instruction execution error, resets the virtualized access memory control, generates a rescheduling event, and switches to the idle state of the virtual machine monitor for execution. Since the virtual machine monitor is responsible for the scheduling of the virtual machine central processor, and the virtual machine central processor runs on the physical central processor, the resources of the physical central processor corresponding to the virtual machine central processor are exclusive resources of the virtual machine central processor. Based on this, it is possible to prevent interference between virtual machines to support the operation of multiple virtual machine operating systems on the same system-on-chip and achieve secure isolation of each virtual machine operating system on the system-on-chip. The virtual machine monitor VMM completes the VCPU scheduling in the interrupt direct pass-through mode of the virtual machine VM by subscribing to SDEI events and using the memory access control of the VM, directly passing the interrupt to the guest operating system running in the virtual machine without going through the virtualization layer, so as to reduce the processing and response time of virtualization for interrupts and improve the system performance and reliability.

[0117] In some embodiments, after a rescheduling event occurs in response to an error in executing the instruction and switching to the idle state of the virtual machine monitor, the following steps are further included:

[0118] Receive an interrupt request.

[0119] In response to the interrupt request, process the interrupt request in a preset manner.

[0120] Among them, the types of the interrupt request include: physical interrupt request, virtual interrupt request, and inter-processor interrupt request; the physical interrupt request is an interrupt request generated by a physical peripheral, the virtual interrupt request is an interrupt request generated by a virtual peripheral, and the inter-processor interrupt request is an interrupt request generated between processors inside the virtual machine.

[0121] Optionally, when the interrupt request is the physical interrupt request, the above step (In response to the interrupt request, process the interrupt request in a preset manner) can be implemented in the following manner:

[0122] Process the physical interrupt through the physical central processing unit so that the virtual machine directly responds to the interrupt request.

[0123] Specifically, when mapping the physical peripheral interrupt, the physical interrupt will be directly responded to without being forwarded by the VMM and directly routed to the VM, that is, the VM driver responds to the peripheral interrupt signal.

[0124] When the interrupt request is a physical interrupt request, the physical interrupt will be directly responded to without being forwarded by the VMM and directly routed to the VM, without the need for additional interrupt response and VM trap handling operations, reducing the virtualization's processing and response time for interrupts and improving system performance and reliability.

[0125] Optionally, when the interrupt request is the virtual interrupt request, the above step (In response to the interrupt request, process the interrupt request in a preset manner) can be implemented in the following manner:

[0126] Call an instruction through the virtual machine monitor to trigger the virtual machine monitor to set a register to trigger a virtual interrupt;

[0127] Send the virtual interrupt request to the virtual machine central processing unit through the virtual machine central processing unit interface so that the virtual machine central processing unit processes the virtual interrupt.

[0128] Specifically, for virtual device interrupt injection, first, the virtual machine that sends the virtual interrupt performs driver processing, triggers the virtual machine monitor to enter interrupt injection through the VMHVC instruction, the VMM writes the virtual interrupt to the List Register, and calls the virtual CPU interface function to send the virtual interrupt signal to the virtual CPU; for the virtual machine that receives the virtual interrupt, it directly receives the virtual interrupt at EL0 / EL1, the virtual CPU processes the virtual interrupt, reads the interrupt status through the virtual CPU interface function for response. At this time, the sending end needs to enter the virtual machine monitor mode; the receiving end directly responds and does not need to enter the virtual machine monitor mode.

[0129] Among them, in the ARM architecture, the HVC (Hypervisor Call) instruction is a privileged instruction used to initiate a service request from the virtual machine to the host. When EL1 attempts to access EL2, it will enter the virtualization layer through the HVC instruction. That is, it can be understood that the communication between the virtual machine monitor (Hypervisor) and the virtual machine is carried out in the virtualization mode (EL2).

[0130] When the interrupt request is a virtual interrupt request, it can be seen that the sending end needs to enter the VMM, and the receiving end directly responds without entering the VMM. Therefore, when the receiving end does not need to enter the VMM, the virtualization's processing and response time for interrupts can be reduced, improving the system performance and reliability.

[0131] Optionally, when the interrupt request is the inter-processor interrupt request, the above step (responding to the interrupt request and processing the interrupt request in a preset manner) can be implemented in the following way:

[0132] Update the number of the virtual machine central processor to the number of the corresponding physical central processor;

[0133] Write the triggered inter-core interrupt number and the physical number of the receiving interrupt core into the register through the virtual machine, so that the virtual machine receives the inter-processor interrupt request and processes the inter-processor interrupt request.

[0134] Specifically, the inter-processor interrupt inside the virtual machine no longer performs interrupt scheduling through the virtual machine monitor mode, and there is already a performance improvement. The role of the ICC_SGI1R_EL1 register is to send an SGI request to the interrupt controller, which can be initiated by software and can be used to implement functions such as communication and synchronization between processes.

[0135] Among them, SGI (software generated interrupt): Interrupts generated by software, with interrupt numbers (0 - 15), generally used for inter-core communication, and are generated by software writing to a certain register of the GIC. This type of interrupt does not have actual physical connections, but is triggered by software writing to registers, and it only supports edge triggering. It is usually used for communication between processors. For example, the ipi interrupt called in the linux kernel power management module is implemented through SGI. Among them, the function of the ICC_SGI1R_EL1 register is to send SGI requests to the interrupt controller, initiated by software, and can be used to implement functions such as communication and synchronization between processes. The interrupt type corresponding to the ICC_SGI1R_EL1 register is: group 1 interrupt in the current security state; virtual group 1 interrupts use the vIRQ signal to send to vPE of non secure 1.

[0136] In the embodiments of the present disclosure, the SGI number to be triggered and the physical core number of the receiving interrupt are written into the ICC_SGI1R_EL1 register. Due to the virtualization implementation process, in a general virtualization scenario, the device tree DTB will write the physical and encoding considered by the virtual machine. It is necessary to simulate and trap into the virtual machine monitor mode through registers to find the real physical encoding, and inject an interrupt into the core that receives the inter-processor interrupt. Since after interrupt direct pass, accessing this register does not trap into the virtual machine monitor mode, during the initialization process, the CPU node encoding applicable to the virtual machine needs to be modified to the real physical CPU encoding, rather than the physical CPU number considered by the virtual machine itself. In this way, the IPI interrupt inside the Host VM / Guest VM no longer needs to go through the trap and exit of the VMM, thereby achieving the purpose of performance improvement.

[0137] The virtual machine monitor scheduling method proposed in the embodiments of the present disclosure, compared with the interrupt simulation in the traditional virtualization mode, the VMM completes the VCPU scheduling in the interrupt direct pass mode of the VM by subscribing to SDEI events and using the memory access control of the VM, and directly delivers the interrupt to the guest operating system running in the virtual machine, so as to reduce the processing and response time of the virtualization to the interrupt, and improve the system performance and reliability.

[0138] In some embodiments, referring to Figure 2 as shown, a virtual machine monitor scheduling device 200 is provided, including:

[0139] A subscription module 210, configured to subscribe to software delegated exception interface events during the power-on process of a virtual machine monitor; the software delegated exception interface events are used to register a handler with firmware to receive notifications of relevant system events; the virtual machine monitor is responsible for scheduling a virtual machine central processing unit, and the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit;

[0140] A control module 220, configured to, based on a hypervisor of the software delegated exception interface events, control a client virtual machine to enter the virtual machine monitor, cancel virtualized access to physical memory, and return that an instruction execution error occurs when the virtual machine is executing;

[0141] A scheduling module 230, configured to, in response to the instruction execution error, reset virtualized access memory control, generate a rescheduling event, and switch to execute in an idle state of the virtual machine monitor.

[0142] As an optional implementation manner of an embodiment of the present disclosure, the scheduling module 230 is specifically configured to:

[0143] Control the operation of the virtual machine, and in response to the instruction execution error, suspend the virtual machine central processing unit of the virtual machine;

[0144] Set a rescheduling flag of the virtual machine central processing unit to a first flag bit, and send a rescheduling event to the virtual machine central processing unit, so that in response to the rescheduling event, the virtual machine central processing unit cancels virtualized access to physical memory, returns that an instruction execution error occurs when the virtual machine is running, and enters the virtual machine monitor to process the instruction execution error;

[0145] Reset virtualized memory access control, generate a rescheduling event, and switch to execute in an idle state of the virtual machine monitor.

[0146] As an optional implementation manner of an embodiment of the present disclosure, the apparatus further includes: a power-on module, and the power-on module is specifically configured to:

[0147] Run the virtual machine monitor, start a first physical central processing unit, so that the first physical central processing unit starts a second physical central processing unit through a power state coordination interface PSCI, and run an idle process of the virtual machine monitor to enter a waiting interrupt wake-up state; the first physical central processing unit is a physical central processing unit of a host, and the second physical central processing unit is a non-started physical central processing unit;

[0148] Load an image of the virtual machine and start the virtual machine;

[0149] During the startup process of the virtual machine, in response to a power state cooperation interface request for starting the second physical central processing unit, create and bind the virtual machine central processing unit to the corresponding second physical central processing unit.

[0150] As an optional implementation manner of an embodiment of the present disclosure, the device further includes:

[0151] A receiving module, configured to receive an interrupt request, where the types of the interrupt request include: a physical interrupt request, a virtual interrupt request, and an inter-processor interrupt request; the physical interrupt request is an interrupt request generated by a physical peripheral, the virtual interrupt request is an interrupt request generated by a virtual peripheral, and the inter-processor interrupt request is an interrupt request generated between processors inside the virtual machine;

[0152] A response module, configured to process the interrupt request in a preset manner in response to the interrupt request.

[0153] As an optional implementation manner of an embodiment of the present disclosure, when the interrupt request is the physical interrupt request, the response module is specifically configured to:

[0154] Process the physical interrupt through the physical central processing unit, so that the virtual machine directly responds to the interrupt request.

[0155] As an optional implementation manner of an embodiment of the present disclosure, when the interrupt request is the virtual interrupt request, the response module is specifically configured to:

[0156] Trigger the virtual machine monitor to set a register to trigger a virtual interrupt by calling an instruction of the virtual machine monitor;

[0157] Send the virtual interrupt request to the virtual machine central processing unit through the virtual machine central processing unit interface, so that the virtual machine central processing unit processes the virtual interrupt.

[0158] As an optional implementation manner of an embodiment of the present disclosure, when the interrupt request is the inter-processor interrupt request, the response module is specifically configured to:

[0159] Update the number of the virtual machine central processing unit to the number of the corresponding physical central processing unit;

[0160] Write the triggered inter-core interrupt number and the physical number of the receiving interrupt core into the register through the virtual machine, so that the virtual machine receives the inter-processor interrupt request and processes the inter-processor interrupt request.

[0161] The virtual machine monitor scheduling device provided by the present disclosure subscribes to software delegated exception interface events during the power-on process of the virtual machine monitor; wherein, the software delegated exception interface events are used to register a handler with the firmware to receive notifications of relevant system events; the hypervisor based on the software delegated exception interface events controls the virtual machine to enter the virtual machine monitor, cancels the virtualized access to physical memory, returns that an instruction execution error occurs during the execution of the virtual machine, in response to the instruction execution error, resets the virtualized access memory control, generates a rescheduling event, and switches to the idle state of the virtual machine monitor for execution. Since the virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit, and the virtual machine central processing unit runs on the physical central processing unit, the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit. Based on this, it is possible to prevent interference between virtual machines to support the operation of multiple virtual machine operating systems on the same system-on-chip, and achieve the secure isolation of each virtual machine operating system on the system-on-chip. The virtual machine monitor VMM completes the VCPU scheduling in the interrupt direct pass-through mode of the virtual machine VM by subscribing to SDEI events and using the memory access control of the VM, and directly transfers the interrupt to the guest operating system running in the virtual machine without going through the virtualization layer, so as to reduce the virtualization's processing and response time for interrupts, and improve the system performance and reliability.

[0162] For the specific limitations of the virtual machine monitor scheduling device, reference can be made to the limitations of the virtual machine monitor scheduling method in the above text, which will not be elaborated here. Each module in the above virtual machine monitor scheduling device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the electronic device in hardware form or independent of the processor, or stored in the processor of the electronic device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0163] The embodiments of the present disclosure also provide an electronic device, Figure 3 which is a schematic structural diagram of the electronic device provided by the embodiments of the present disclosure. As Figure 3As shown in the figure, the electronic device provided in this embodiment includes: a memory 31 and a processor 32. The memory 31 is used to store computer programs. The processor 32 is used to execute the steps performed in any of the embodiments of the fault identification method of the image acquisition device provided in the above method embodiments when calling the computer program. The electronic device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the computer program is executed by the processor, it realizes a fault identification method of an image acquisition device. The display screen of the electronic device may be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device may be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0164] Those skilled in the art can understand that Figure 3 the structure shown in the figure is only a block diagram of some structures related to the solution of the present disclosure, and does not constitute a limitation on the computer device to which the solution of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0165] In some embodiments, the virtual machine monitor scheduling device provided by the present disclosure may be implemented in the form of a computer, and the computer program may run on an electronic device as shown in Figure 3 the figure. Each program module constituting the virtual machine monitor scheduling device of the electronic device may be stored in the memory of the electronic device. For example, Figure 2 the subscription module 210, the control module 220, and the scheduling module 230 shown in the figure. The computer program composed of each program module enables the processor to execute the steps in the fault identification method of the image acquisition device of the electronic device in each embodiment of the present disclosure described in this specification.

[0166] The present disclosure embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, it realizes the fault identification method of the image acquisition device provided in the above method embodiments.

[0167] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as a method, a system, or a computer program product. Therefore, the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media that contain computer-usable program code.

[0168] The processor can be a Central Processing Unit (CPU), or it can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0169] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0170] Computer-readable media include both permanent and non-permanent, removable and non-removable storage media. The storage media can implement information storage by any method or technology, and the information can be computer-readable instructions, data structures, program modules, or other data. Examples of the computer's storage media include, but are not limited to, Phase Change Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technologies, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassette tapes, disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0171] It should be noted that in this document, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

[0172] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but rather will conform to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. A virtual machine monitor scheduling method, characterized in that, Including: During the power-on process of the virtual machine monitor, subscribe to software delegated exception interface events; The software delegated exception interface event is used to register a handler with the firmware to receive notifications of relevant system events; the virtual machine monitor is responsible for scheduling the virtual machine central processing unit, and the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit; Based on the hypervisor of the software delegated exception interface event, control the virtual machine to enter the virtual machine monitor, cancel the virtualized access to physical memory, and return that an instruction execution error occurs when the virtual machine is executing; In response to the instruction execution error, reset the virtualized access memory control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution.

2. The method according to claim 1, characterized in that, The step of generating a rescheduling event and switching to the idle state of the virtual machine monitor in response to the instruction execution error includes: Control the operation of the virtual machine, and in response to the instruction execution error, suspend the virtual machine central processing unit of the virtual machine; Set the rescheduling flag of the virtual machine central processing unit to the first flag bit, and send a rescheduling event to the virtual machine central processing unit, so that the virtual machine central processing unit, in response to the rescheduling event, cancels the virtualized access to physical memory, returns that an instruction execution error occurs when the virtual machine is running, and enters the virtual machine monitor to process the instruction execution error; Reset the virtualized memory access control, generate a rescheduling event, and switch to the idle state of the virtual machine monitor for execution.

3. The method according to claim 1, wherein The power-on process of the virtual machine monitor includes: Run the virtual machine monitor, start the first physical central processing unit, so that the first physical central processing unit starts the second physical central processing unit through the power state coordination interface PSCI, and run the idle process of the virtual machine monitor to enter the waiting interrupt wake-up state; the first physical central processing unit is the physical central processing unit of the host, and the second physical central processing unit is a non-started physical central processing unit; Load the image of the virtual machine and start the virtual machine; During the startup process of the virtual machine, in response to a power state coordination interface request to start the second physical central processing unit, create and bind the virtual machine central processing unit to the corresponding second physical central processing unit.

4. The method according to claim 1, characterized in that, After generating a rescheduling event and switching to the idle state of the virtual machine monitor in response to the instruction execution error, it further includes: Receive an interrupt request, and the types of the interrupt request include: physical interrupt request, virtual interrupt request, and inter-processor interrupt request; the physical interrupt request is an interrupt request generated by a physical peripheral, the virtual interrupt request is an interrupt request generated by a virtual peripheral, and the inter-processor interrupt request is an interrupt request generated between processors inside the virtual machine; In response to the interrupt request, process the interrupt request in a preset manner.

5. The method according to claim 4, wherein When the interrupt request is the physical interrupt request, the step of processing the interrupt request in a preset manner in response to the interrupt request includes: Process the physical interrupt through a physical central processing unit so that the virtual machine directly responds to the interrupt request.

6. The method according to claim 4, wherein When the interrupt request is the virtual interrupt request, in response to the interrupt request, process the interrupt request in a preset manner, including: Call an instruction through a virtual machine monitor to trigger the virtual machine monitor to set a register to trigger a virtual interrupt; Send the virtual interrupt request to a virtual machine central processing unit through a virtual machine central processing unit interface so that the virtual machine central processing unit processes the virtual interrupt.

7. The method according to claim 4, characterized in that When the interrupt request is the inter-processor interrupt request, in response to the interrupt request, process the interrupt request in a preset manner, including: Update the number of the virtual machine central processing unit to the number of the corresponding physical central processing unit; Write the triggered inter-core interrupt number and the physical number of the receiving interrupt core into a register through the virtual machine so that the virtual machine receives the inter-processor interrupt request and processes the inter-processor interrupt request.

8. A virtual machine monitor scheduling device, characterized in that Include: A subscription module, configured to subscribe to a software delegated exception interface event during the power-on process of the virtual machine monitor; The software delegated exception interface event is used to register a handler with the firmware to receive notifications of relevant system events; the virtual machine monitor is responsible for the scheduling of the virtual machine central processing unit, and the resources of the physical central processing unit corresponding to the virtual machine central processing unit are exclusive resources of the virtual machine central processing unit; A control module, configured to control, based on the virtual machine manager of the software delegated exception interface event, the virtual machine to enter the virtual machine monitor, cancel the virtualized access to physical memory, and return an instruction execution error when the client virtual machine is executed; A scheduling module, configured to, in response to the instruction execution error, reset the virtualized access memory control, generate a rescheduling event, and switch to execute in the idle state of the virtual machine monitor.

9. An electronic device, characterized in that, Include: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, enable the one or more processors to implement the virtual machine monitor scheduling method according to any one of claims 1 to 8.

10. A vehicle, characterized in that, Include: The electronic device according to claim 9.

Citation Information

Cited By

  • Virtualization system interrupt processing optimization method and device, equipment and medium

    CN122086529A