Patent ID: 11972285
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 15:
16. A non-volatile readable storage medium, configured to store computer-readable instructions when performed by a processor cause the processor to perform:
configuring, by the processor in a host mode, a register of the processor to enable the processor to receive an interrupt request from other hardware of the virtualized device when running a virtual processor that runs in a guest mode; and
performing, by the processor in the guest mode:
receiving an interrupt request from the other hardware;
determining a processing entity of the interrupt request based on information; and
based on determining that the processing entity of the received interrupt request comprises a virtual processor currently running on the processor, invoking, based on the information, an interrupt service routine corresponding to the interrupt request to process the interrupt request, the information comprising a correspondence between the interrupt request, the processing entity, and the interrupt service routine;

configuring, by the processor in the host mode, the virtual processor that is to run on the processor to be able to operate a physical interrupt controller of the virtualized device;
based on the processing entity of the interrupt request being another virtual processor and the another virtual processor is in service, the method further comprises performing, by the processor in the guest mode:
operating the physical interrupt controller to send an inter-processor interrupt (IPI) request to the another virtual processor, the IPI request carrying an identifier of the interrupt request, and the another virtual processor does not comprise the virtual processor currently running on the processor; and
based on no other virtual processors being in service, the method further comprises performing, by the processor in the guest mode:
recording the interrupt request in a storage area sharable with all the other virtual processors, wherein in response to a priority of the interrupt request being lower than or equal to priorities of all in-service virtual processors, only the identifier of the interrupt request is recorded without targeting a specific virtual processor;
determining a transit virtual processor from the other virtual processors; and
sending an IPI interrupt request to the transit virtual processor, whereby the transit virtual processor traps out; and

performing, by the processor in the host mode swapping in one of the other virtual processors corresponding to the received interrupt request for processing the interrupt request.