主权项 |
1. An interrupt information processing method applied to a system that comprises an interrupt controller, a virtual machine monitor, a register, and at least one virtual machine,
wherein the interrupt controller comprises at least one virtual central processing unit (CPU) interrupt interface, wherein the register stores interrupt processing functions that are used to be called by the virtual machine monitor, wherein each interrupt processing function comprises an interrupt number, and wherein the method comprises: receiving, by the virtual machine monitor, Q pieces of first interrupt information, wherein Q is an integer greater than or equal to 1; obtaining, by the virtual machine monitor, an interrupt processing function from the register according to an interrupt number of each piece of first interrupt information, wherein the interrupt processing function corresponds to the interrupt number of each piece of first interrupt information; calling, by the virtual machine monitor, the obtained interrupt processing function to obtain M pieces of second interrupt information, wherein the M pieces of second interrupt information are interrupt information to be sent to a processor corresponding to one of the at least one virtual machine and that is in the Q pieces of first interrupt information, wherein M is a positive integer less than or equal to Q; obtaining, by the virtual machine monitor, an identifier of one of the at least one virtual machine virtual machine corresponding to the M pieces of second interrupt information; and writing, by the virtual machine monitor, the M pieces of second interrupt information and the identifier of the one of the at least one virtual machine corresponding to the M pieces of second interrupt information into a virtual CPU interrupt interface such that after the one of the at least one virtual machine corresponding to the M pieces of second interrupt information is running, the virtual CPU interrupt interface sends the M pieces of second interrupt information to a processor running the one of the at least one virtual machine corresponding to the M pieces of second interrupt information. |