CN110162377A - A kind of communication means and logic processor - Google Patents
A kind of communication means and logic processor Download PDFInfo
- Publication number
- CN110162377A CN110162377A CN201810152182.2A CN201810152182A CN110162377A CN 110162377 A CN110162377 A CN 110162377A CN 201810152182 A CN201810152182 A CN 201810152182A CN 110162377 A CN110162377 A CN 110162377A
- Authority
- CN
- China
- Prior art keywords
- processor
- virtual
- ipi
- logic processor
- logic
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45579—I/O management, e.g. providing access to device drivers or storage
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Hardware Redundancy (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种通信方法和逻辑处理器。The present application relates to the field of computer technology, in particular to a communication method and a logic processor.
背景技术Background technique
在当前的处理器(Central Processing Unit,CPU)中,一个物理CPU模块对外呈现为多个指令处理部件,每个指令处理部件可以独立地执行一个指令流。这些指令处理部件一般被称作逻辑处理器(Logical CPU)。在计算机系统运行过程中,逻辑处理器之间需要进行异步通信,比如:一个逻辑处理器需要通知其它逻辑处理器进行任务切换。又如,一个逻辑处理器需要通知其它逻辑处理器清除某些转换监视缓冲器(Translation LookasideBuffer,TLB)表项。又如,一个逻辑处理器需要通知其它逻辑处理器进行初始化。逻辑处理器间的这种异步通信一般被称作处理器间中断(Inter Processor Interrupt,IPI),或者软件中断(Software Generated Interrupt,SGI)。In a current processor (Central Processing Unit, CPU), a physical CPU module is externally presented as multiple instruction processing units, and each instruction processing unit can independently execute an instruction stream. These instruction processing components are generally called logical processors (Logical CPU). During the operation of a computer system, asynchronous communication is required between logical processors, for example, one logical processor needs to notify other logical processors to perform task switching. In another example, a logical processor needs to notify other logical processors to clear certain translation lookaside buffer (Translation Lookaside Buffer, TLB) entries. In another example, a logical processor needs to notify other logical processors to perform initialization. This asynchronous communication between logical processors is generally called an Inter Processor Interrupt (IPI), or a Software Generated Interrupt (SGI).
计算机虚拟化是将单台物理计算机呈现为网络上多台计算机的技术,网络用户可以使用、但实际上并不存在的计算机被称作虚拟计算机,简称为虚拟机(Virtual Machine,VM)。对网络用户而言,虚拟机和真实的物理计算机一样,具有处理器、内存、网卡、磁盘等硬件设备。虚拟机所包含的处理器被称作虚拟处理器(Virtual CPU),当逻辑处理器运行虚拟处理器对应的实体时,就对外体现为虚拟处理器正在运行。将虚拟处理器在运行时向其他虚拟处理器发送的IPI称为虚拟IPI。Computer virtualization is a technology that presents a single physical computer as multiple computers on the network. Computers that network users can use but do not actually exist are called virtual computers, or virtual machines (VMs) for short. For network users, a virtual machine, like a real physical computer, has hardware devices such as processors, memory, network cards, and disks. The processor included in the virtual machine is called a virtual processor (Virtual CPU). When the logical processor runs the entity corresponding to the virtual processor, it is externally shown that the virtual processor is running. The IPI sent by a virtual processor to other virtual processors during operation is called a virtual IPI.
为了让多个虚拟机安全地共处于单台物理计算机上,需对虚拟机的能力进行限制,但又不能妨碍虚拟机的正常工作,这一过程被称作计算机系统虚拟化,负责实现计算机系统虚拟化的软件被称作虚拟机监控器(Virtual Machine Monitor,VMM)。In order to allow multiple virtual machines to safely co-exist on a single physical computer, it is necessary to limit the capabilities of the virtual machines without hindering the normal work of the virtual machines. This process is called computer system virtualization and is responsible for realizing the The virtualized software is called a virtual machine monitor (Virtual Machine Monitor, VMM).
硬件虚拟机(Hardware Virtual Machine,HVM)是一种依赖于硬件CPU支持实现的虚拟化,它的特点是:不要求虚拟机操作系统对计算机系统虚拟化提供配合,虚拟机操作系统可以像管理物理计算机一样管理虚拟机,如发送IPI。硬件对于虚拟化的支持可体现为:提供一个特定的处理器运行模式,如虚拟化模式。硬件处理器保证“运行于此模式下的虚拟机操作系统查看到的处理器状态与非虚拟化情形相同,HVM的虚拟机操作系统进行的特权操作要么能够直接完成,要么会导致逻辑处理器退出当前运行模式,转到VMM的处理逻辑”。此时当VMM需要让某个虚拟处理器处于运行状态时,VMM就令逻辑处理器进入虚拟化模式,逻辑处理器执行此虚拟处理器在运行状态需要执行的代码,逻辑处理器在发送IPI时需要退出虚拟化模式,由VMM向逻辑处理器注册“退出虚拟化模式后应当执行的代码入口”。Hardware Virtual Machine (Hardware Virtual Machine, HVM) is a kind of virtualization that relies on hardware CPU support. Its characteristics are: it does not require the virtual machine operating system to provide cooperation with computer system virtualization. Manage the virtual machine like a computer, such as sending IPI. Hardware support for virtualization can be embodied as: providing a specific processor operating mode, such as a virtualization mode. The hardware processor guarantees that "the state of the processor seen by the virtual machine operating system running in this mode is the same as that of the non-virtualized situation, and the privileged operations performed by the virtual machine operating system of HVM can either be completed directly or cause the logical processor to exit. In the current operating mode, go to the processing logic of the VMM". At this time, when the VMM needs to keep a virtual processor in the running state, the VMM makes the logical processor enter the virtualization mode, and the logical processor executes the code that the virtual processor needs to execute in the running state. When the logical processor sends an IPI To exit the virtualization mode, the VMM registers the "code entry that should be executed after exiting the virtualization mode" with the logical processor.
现有技术中计算机系统虚拟化通过VMM软件实现,VMM软件采取与非虚拟化情形下相同的方式,一个虚拟处理器向目标虚拟处理器发送IPI是基于逻辑处理器发送IPI来实现的,而IPI是导致逻辑处理器退出虚拟化模式的操作,因此作为发送方的逻辑处理器在退出虚拟化模式时进行模式切换需要一定的时间,这会增大发送方的处理器资源占用和IPI的最终传输延迟。In the prior art, computer system virtualization is realized by VMM software, and the VMM software adopts the same method as in the non-virtualization situation. A virtual processor sends an IPI to a target virtual processor based on a logical processor sending an IPI, and the IPI It is an operation that causes the logical processor to exit the virtualization mode. Therefore, it takes a certain amount of time for the logical processor as the sender to switch modes when it exits the virtualization mode, which will increase the processor resource usage of the sender and the final transmission of IPI. Delay.
发明内容Contents of the invention
本申请实施例提供了一种通信方法和逻辑处理器,用于减少对发送方的处理器资源占用和IPI的最终传输延迟。The embodiment of the present application provides a communication method and a logical processor, which are used to reduce processor resource occupation of the sender and final transmission delay of the IPI.
为解决上述技术问题,本申请实施例提供以下技术方案:In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:
第一方面,本申请实施例提供一种通信方法,其特征在于,包括:当第一逻辑处理器进入虚拟化模式之后,所述第一逻辑处理器获取处理器间中断IPI信息,所述IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;所述第一逻辑处理器对所述目标虚拟处理器的标识进行虚拟处理器地址翻译,得到所述目标虚拟处理器当前运行所在的目标逻辑处理器;所述第一逻辑处理器向所述目标逻辑处理器发送所述IPI信息。In the first aspect, the embodiment of the present application provides a communication method, which is characterized by comprising: after the first logical processor enters the virtualization mode, the first logical processor acquires inter-processor interrupt IPI information, and the IPI The information includes: the identification of the target virtual processor and virtual interrupt information; the first logical processor performs virtual processor address translation on the identification of the target virtual processor to obtain the target logic where the target virtual processor is currently running A processor: the first logical processor sends the IPI information to the target logical processor.
在本申请实施例中,当第一逻辑处理器进入虚拟化模式之后,第一逻辑处理器获取处理器中断IPI信息,IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译,得到目标虚拟处理器当前运行所在的目标逻辑处理器;第一逻辑处理器向目标逻辑处理器发送IPI信息。本申请实施例中,第一逻辑处理器可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,从而可以确定出目标虚拟处理器当前运行所在的目标逻辑处理器,因此第一逻辑处理器可以在虚拟化模式直接向正在运行的目标虚拟处理器发送IPI信息,使得目标虚拟处理器可以被注入IPI,不需要通过VMM来实现对IPI信息进行发送,第一逻辑处理器也不需要退出虚拟化模式,因此可以减少对发送方的处理器资源占用和IPI的最终传输延迟。In this embodiment of the present application, after the first logical processor enters the virtualization mode, the first logical processor acquires processor interrupt IPI information, and the IPI information includes: the target virtual processor identifier and virtual interrupt information; the first logical processor The processor performs virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running; the first logical processor sends IPI information to the target logical processor. In this embodiment of the present application, the first logical processor can perform virtual processor address translation on the identifier of the target virtual processor, so as to determine the target logical processor where the target virtual processor is currently running. Therefore, the first logical processor can In the virtualization mode, IPI information is directly sent to the running target virtual processor, so that the target virtual processor can be injected into IPI, without the need to send IPI information through the VMM, and the first logical processor does not need to exit virtualization mode, thus reducing the processor resource occupation of the sender and the final transmission delay of the IPI.
在本申请第一方面的一种可能设计中,所述方法还包括:所述第一逻辑处理器对所述目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定所述目标虚拟处理器没有在任何一个逻辑处理器运行时,所述第一逻辑处理器存储所述IPI信息,并退出所述虚拟化模式;所述第一逻辑处理器通知虚拟机监控器VMM所述第一逻辑处理器存储了所述IPI信息。其中,第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定目标虚拟处理器没有在任何一个逻辑处理器运行时,则说明该第一逻辑处理器无法确定出目标虚拟处理器当前运行所在的目标逻辑处理器,此时可以将IPI信息存储下来,例如存储到发送方异常信息存储区域中,使得运行于非虚拟化模式的vmm软件可以查询到IPI发送详情信息。In a possible design of the first aspect of the present application, the method further includes: after the first logical processor performs virtual processor address translation on the identifier of the target virtual processor, determine the target virtual processor When no logical processor is running, the first logical processor stores the IPI information and exits the virtualization mode; the first logical processor notifies the virtual machine monitor VMM that the first logical processor The device stores the IPI information. Wherein, after the first logical processor performs virtual processor address translation on the identification of the target virtual processor and determines that the target virtual processor is not running on any logical processor, it means that the first logical processor cannot determine the target virtual processor. The target logical processor where the processor is currently running can store the IPI information at this time, for example, in the sender exception information storage area, so that the vmm software running in the non-virtualization mode can query the IPI sending details.
在本申请第一方面的一种可能设计中,所述方法还包括:当所述第一逻辑处理器向所述目标逻辑处理器发送所述IPI信息失败时,所述第一逻辑处理器存储所述IPI信息,并退出所述虚拟化模式;所述第一逻辑处理器通知VMM所述第一逻辑处理器存储了所述IPI信息。其中,第一逻辑处理器可以设置“投送中断”时所使用的中断号,在逻辑处理器进入虚拟化模式后,执行IPI信息。退出虚拟化模式之后,则判断退出原因,若原因是“虚拟化模式下投送虚拟中断”,则由VMM使用中断号继续执行IPI中断信息。In a possible design of the first aspect of the present application, the method further includes: when the first logical processor fails to send the IPI information to the target logical processor, the first logical processor stores the IPI information, and exit the virtualization mode; the first logical processor notifies the VMM that the first logical processor stores the IPI information. Wherein, the first logical processor may set the interrupt number used when "delivering interrupt", and execute the IPI information after the logical processor enters the virtualization mode. After exiting the virtualization mode, judge the exit reason. If the reason is "virtual interrupt delivery in virtualization mode", the VMM will use the interrupt number to continue executing the IPI interrupt information.
在本申请第一方面的一种可能设计中,所述方法还包括:所述第一逻辑处理器向所述目标逻辑处理器发送所述目标虚拟处理器所在的虚拟机VM的标识。其中,第一逻辑处理器还需要向目标逻辑处理器发送目标虚拟处理器所在的VM的标识,以使得接收方可以确定出该目标虚拟处理器所在的VM。In a possible design of the first aspect of the present application, the method further includes: the first logical processor sending an identifier of the virtual machine VM where the target virtual processor is located to the target logical processor. Wherein, the first logical processor also needs to send the identifier of the VM where the target virtual processor is located to the target logical processor, so that the receiver can determine the VM where the target virtual processor is located.
在本申请第一方面的一种可能设计中,所述第一逻辑处理器对所述目标虚拟处理器的标识进行虚拟处理器地址翻译,包括:所述第一逻辑处理器通过查询虚拟处理器到逻辑处理器的路由表,对对所述目标虚拟处理器的标识进行虚拟处理器地址翻译。其中,在每个逻辑处理器上运行虚拟处理器时,每个逻辑处理器都对应一个根据虚拟处理器编号进行索引的虚拟处理器到逻辑处理器的路由表,一个逻辑处理器可以访问自己对应的虚拟处理器到逻辑处理器的路由表,从而完成从虚拟处理器到相应的逻辑处理器的地址翻译。In a possible design of the first aspect of the present application, the first logical processor performs virtual processor address translation on the identifier of the target virtual processor, including: the first logical processor queries the virtual processor The routing table to the logical processor performs virtual processor address translation on the identifier of the target virtual processor. Wherein, when running a virtual processor on each logical processor, each logical processor corresponds to a virtual processor-to-logical processor routing table indexed according to the virtual processor number, and a logical processor can access its corresponding The routing table from the virtual processor to the logical processor, so as to complete the address translation from the virtual processor to the corresponding logical processor.
在本申请第一方面的一种可能设计中,所述虚拟处理器到逻辑处理器的路由表存储在所述第一逻辑处理器的存储区域中;或,所述虚拟处理器到逻辑处理器的路由表存储在所述第一逻辑处理器所在的可用于物理插拔的处理器的存储区域中;或,所述虚拟处理器到逻辑处理器的路由表存储到内存中。In a possible design of the first aspect of the present application, the routing table from the virtual processor to the logical processor is stored in the storage area of the first logical processor; or, the routing table from the virtual processor to the logical processor The routing table of the virtual processor is stored in the storage area of the physically pluggable processor where the first logical processor is located; or, the routing table from the virtual processor to the logical processor is stored in the memory.
在本申请第一方面的一种可能设计中,所述第一逻辑处理器具有用于修改所述虚拟处理器到逻辑处理器的路由表的接口。In a possible design of the first aspect of the present application, the first logical processor has an interface for modifying the routing table from the virtual processor to the logical processor.
第二方面,本申请实施例提供一种通信方法,包括:当第二逻辑处理器进入虚拟化模式之后,所述第二逻辑处理器接收第一逻辑处理器发送的处理器中断IPI信息,所述IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;所述第二逻辑处理器根据所述虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理,所述第二虚拟处理器是所述第二逻辑处理器进入虚拟模式后正在运行的虚拟处理器。In a second aspect, the embodiment of the present application provides a communication method, including: after the second logical processor enters the virtualization mode, the second logical processor receives processor interrupt IPI information sent by the first logical processor, and the The IPI information includes: the identification of the target virtual processor and virtual interrupt information; the second logical processor performs virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information, and the second virtual processor is the The virtual processor that is running after the second logical processor enters the virtual mode.
本申请的前述实施例中,第一逻辑处理器可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,从而可以确定出目标虚拟处理器当前运行所在的目标逻辑处理器,因此第一逻辑处理器可以在虚拟化模式直接向正在运行的目标虚拟处理器发送IPI信息,第二逻辑处理器作为目标逻辑处理器,该第二逻辑处理器上运行有该目标虚拟处理器,因此第二逻辑处理器可以对该目标虚拟处理器进行IPI注入,不需要通过VMM来实现对IPI信息进行发送,第一逻辑处理器也不需要退出虚拟化模式,因此可以减少对发送方的处理器资源占用和IPI的最终传输延迟。In the foregoing embodiments of the present application, the first logical processor can perform virtual processor address translation on the identifier of the target virtual processor, so as to determine the target logical processor where the target virtual processor is currently running. Therefore, the first logical processor In the virtualization mode, the processor can directly send IPI information to the running target virtual processor. The second logical processor is used as the target logical processor, and the second logical processor runs on the target virtual processor. Therefore, the second logical processor The processor can perform IPI injection on the target virtual processor, and the IPI information does not need to be sent through the VMM, and the first logical processor does not need to exit the virtualization mode, so it can reduce the processor resource occupation and IPI of the sender. final transmission delay.
在本申请第二方面的一种可能设计中,所述方法还包括:当所述第二虚拟处理器的标识与所述目标虚拟处理器的标识不相同时,所述第二逻辑处理器存储所述IPI信息,并退出所述虚拟化模式。其中,第二逻辑处理器确定当前正在运行的第二虚拟处理器并不是目标虚拟处理器时,第二逻辑处理器可以将IPI信息存储下来,例如存储到接收方异常信息存储区域中,使得运行于非虚拟化模式的vmm软件可以查询到IPI发送详情信息。In a possible design of the second aspect of the present application, the method further includes: when the identifier of the second virtual processor is different from the identifier of the target virtual processor, the second logical processor stores the IPI information and exit the virtualization mode. Wherein, when the second logical processor determines that the currently running second virtual processor is not the target virtual processor, the second logical processor may store the IPI information, for example, in the receiver exception information storage area, so that the running The vmm software in non-virtualization mode can query the detailed information of IPI transmission.
在本申请第二方面的一种可能设计中,所述方法还包括:所述第二逻辑处理器接收第一逻辑处理器发送的IPI信息之后,所述第二逻辑处理器确定第二虚拟处理器的标识是否与所述目标虚拟处理器的标识相同;当所述第二虚拟处理器的标识与所述目标虚拟处理器的标识相同时,触发执行如下步骤:所述第二逻辑处理器根据所述虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。In a possible design of the second aspect of the present application, the method further includes: after the second logical processor receives the IPI information sent by the first logical processor, the second logical processor determines the second virtual processing Whether the identifier of the second logical processor is the same as the identifier of the target virtual processor; when the identifier of the second virtual processor is the same as the identifier of the target virtual processor, trigger the execution of the following steps: the second logical processor according to The virtual interrupt information performs virtual interrupt injection processing on the second virtual processor.
在本申请的第三方面中,逻辑处理器的组成模块还可以执行前述第一方面以及各种可能的实现方式中所描述的步骤,详见前述对第一方面以及各种可能的实现方式中的说明。In the third aspect of the present application, the constituent modules of the logic processor can also execute the steps described in the aforementioned first aspect and various possible implementations. For details, see the aforementioned first aspect and various possible implementations. instruction of.
第三方面,本申请实施例提供一种逻辑处理器,所述逻辑处理器为第一逻辑处理器,所述第一逻辑处理器包括:处理模块,用于当第一逻辑处理器进入虚拟化模式之后,获取处理器中断IPI信息,所述IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;所述处理模块,还用于对所述目标虚拟处理器的标识进行虚拟处理器地址翻译,得到所述目标虚拟处理器当前运行所在的目标逻辑处理器;发送模块,用于向所述目标逻辑处理器发送所述IPI信息。In a third aspect, the embodiment of the present application provides a logical processor, the logical processor is a first logical processor, and the first logical processor includes: a processing module, configured to After the mode, the processor interrupt IPI information is obtained, and the IPI information includes: the identification of the target virtual processor and virtual interrupt information; the processing module is also used to translate the address of the virtual processor to the identification of the target virtual processor , to obtain the target logical processor where the target virtual processor is currently running; a sending module, configured to send the IPI information to the target logical processor.
在本申请第三方面的一种可能设计中,所述处理模块,还用于对所述目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定所述目标虚拟处理器没有在任何一个逻辑处理器运行时,存储所述IPI信息,并退出所述虚拟化模式;所述发送模块,还用于通知虚拟机监控器VMM所述第一逻辑处理器存储了所述IPI信息。In a possible design of the third aspect of the present application, the processing module is further configured to determine that the target virtual processor is not in any logical When the processor is running, store the IPI information and exit the virtualization mode; the sending module is further configured to notify a virtual machine monitor VMM that the first logical processor has stored the IPI information.
在本申请第三方面的一种可能设计中,所述处理模块,还用于当所述第一逻辑处理器向所述目标逻辑处理器发送所述IPI信息失败时,存储所述IPI信息,并退出所述虚拟化模式;所述发送模块,还用于通知VMM所述第一逻辑处理器存储了所述IPI信息。In a possible design of the third aspect of the present application, the processing module is further configured to store the IPI information when the first logical processor fails to send the IPI information to the target logical processor, and exit the virtualization mode; the sending module is further configured to notify the VMM that the first logical processor has stored the IPI information.
在本申请第三方面的一种可能设计中,所述发送模块,还用于向所述目标逻辑处理器发送所述目标虚拟处理器所在的虚拟机VM的标识。In a possible design of the third aspect of the present application, the sending module is further configured to send the identifier of the virtual machine VM where the target virtual processor is located to the target logical processor.
在本申请第三方面的一种可能设计中,所述处理模块,具体用于通过查询虚拟处理器到逻辑处理器的路由表,对对所述目标虚拟处理器的标识进行虚拟处理器地址翻译。In a possible design of the third aspect of the present application, the processing module is specifically configured to perform virtual processor address translation on the identifier of the target virtual processor by querying a routing table from a virtual processor to a logical processor .
在本申请第三方面的一种可能设计中,所述虚拟处理器到逻辑处理器的路由表存储在所述第一逻辑处理器的存储区域中;或,所述虚拟处理器到逻辑处理器的路由表存储在所述第一逻辑处理器所在的可用于物理插拔的处理器的存储区域中;或,所述虚拟处理器到逻辑处理器的路由表存储到内存中。In a possible design of the third aspect of the present application, the routing table from the virtual processor to the logical processor is stored in the storage area of the first logical processor; or, the routing table from the virtual processor to the logical processor The routing table of the virtual processor is stored in the storage area of the physically pluggable processor where the first logical processor is located; or, the routing table from the virtual processor to the logical processor is stored in the memory.
在本申请第三方面的一种可能设计中,所述第一逻辑处理器具有用于修改所述虚拟处理器到逻辑处理器的路由表的接口。In a possible design of the third aspect of the present application, the first logical processor has an interface for modifying the routing table from the virtual processor to the logical processor.
第四方面,本申请实施例提供一种逻辑处理器,所述逻辑处理器为第二逻辑处理器,所述第二逻辑处理器包括:接收模块,用于当第二逻辑处理器进入虚拟化模式之后,接收第一逻辑处理器发送的处理器中断IPI信息,所述IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;处理模块,用于根据所述虚拟中断信息对所述第二虚拟处理器进行虚拟中断注入处理,所述第二虚拟处理器是所述第二逻辑处理器进入虚拟模式后正在运行的虚拟处理器。In a fourth aspect, the embodiment of the present application provides a logical processor, the logical processor is a second logical processor, and the second logical processor includes: a receiving module, configured to After the mode, the processor interrupt IPI information sent by the first logical processor is received, and the IPI information includes: the identification of the target virtual processor and virtual interrupt information; the processing module is configured to process the second logical processor according to the virtual interrupt information. The virtual processor performs virtual interrupt injection processing, and the second virtual processor is a running virtual processor after the second logical processor enters the virtual mode.
在本申请第四方面的一种可能设计中,所述处理模块,还用于当所述第二虚拟处理器的标识与所述目标虚拟处理器的标识不相同时,存储所述IPI信息,并退出所述虚拟化模式。In a possible design of the fourth aspect of the present application, the processing module is further configured to store the IPI information when the identifier of the second virtual processor is different from the identifier of the target virtual processor, and exit the virtualization mode.
在本申请第四方面的一种可能设计中,所述处理模块,还用于所述接收模块接收第一逻辑处理器发送的IPI信息之后,确定第二虚拟处理器的标识是否与所述目标虚拟处理器的标识相同;In a possible design of the fourth aspect of the present application, the processing module is further configured to, after the receiving module receives the IPI information sent by the first logical processor, determine whether the identifier of the second virtual processor is consistent with the target The identity of the virtual processors is the same;
所述处理模块,还用于当所述第二虚拟处理器的标识与所述目标虚拟处理器的标识相同时,触发执行如下步骤:根据所述虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。The processing module is further configured to, when the identifier of the second virtual processor is the same as the identifier of the target virtual processor, trigger the execution of the following step: perform a virtual interrupt on the second virtual processor according to the virtual interrupt information Injection processing.
在本申请的第四方面中,逻辑处理器的组成模块还可以执行前述第二方面以及各种可能的实现方式中所描述的步骤,详见前述对第二方面以及各种可能的实现方式中的说明。In the fourth aspect of the present application, the constituent modules of the logical processor can also execute the steps described in the aforementioned second aspect and various possible implementations. For details, refer to the aforementioned second aspect and various possible implementations. instruction of.
第五方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In the fifth aspect, the embodiment of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, it causes the computer to execute the methods described in the above aspects.
第六方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a sixth aspect, the embodiments of the present application provide a computer program product including instructions, which, when run on a computer, cause the computer to execute the methods described in the above aspects.
第七方面,本申请实施例提供一种通信装置,该通信装置可以包括终端设备或者芯片等实体,所述通信装置包括:处理器、存储器;所述存储器用于存储指令;所述处理器用于执行所述存储器中的所述指令,具体执行如前述第一方面或第二方面中任一项所述的方法。In the seventh aspect, the embodiment of the present application provides a communication device, which may include entities such as terminal equipment or chips, and the communication device includes: a processor and a memory; the memory is used to store instructions; the processor is used to Executing the instructions in the memory, specifically performing the method as described in any one of the foregoing first aspect or second aspect.
第八方面,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持网络设备实现上述方面中所涉及的功能,例如,例如发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存网络设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In an eighth aspect, the present application provides a chip system, the chip system includes a processor, configured to support the network device to implement the functions involved in the above aspect, for example, for example, sending or processing the data involved in the above method and/or information. In a possible design, the chip system further includes a memory, and the memory is configured to store necessary program instructions and data of the network device. The system-on-a-chip may consist of chips, or may include chips and other discrete devices.
附图说明Description of drawings
图1为本申请实施例提供的处理器的系统架构示意图;FIG. 1 is a schematic diagram of a system architecture of a processor provided in an embodiment of the present application;
图2为本申请实施例提供的一种通信方法的方框流程示意图;FIG. 2 is a schematic block diagram of a communication method provided by an embodiment of the present application;
图3为本申请实施例提供的另一种通信方法的方框流程示意图;FIG. 3 is a schematic block flow diagram of another communication method provided by an embodiment of the present application;
图4为本申请实施例提供的逻辑处理器的基本架构示意图;FIG. 4 is a schematic diagram of a basic architecture of a logic processor provided in an embodiment of the present application;
图5为本申请实施例的发送方的逻辑处理器和接收方的逻辑处理器之间的一种交互流程示意图;FIG. 5 is a schematic diagram of an interaction flow between the logical processor of the sender and the logical processor of the receiver according to an embodiment of the present application;
图6为本申请实施例中发送方的逻辑处理器和接收方的逻辑处理器之间的另一种交互流程示意图;FIG. 6 is a schematic diagram of another interaction flow between the logical processor of the sender and the logical processor of the receiver in the embodiment of the present application;
图7为本申请实施例中处理器socket包括的模块示意图;FIG. 7 is a schematic diagram of modules included in the processor socket in the embodiment of the present application;
图8为本申请实施例提供的虚拟化模式下逻辑处理器执行IPI信息时的流程示意图;FIG. 8 is a schematic flow diagram of a logical processor executing IPI information in a virtualization mode provided by an embodiment of the present application;
图9为本申请实施例提供的虚拟化模式下逻辑处理器检测到notify_if中有信息后的处理流程示意图;9 is a schematic diagram of the processing flow after the logical processor detects that there is information in notify_if in the virtualization mode provided by the embodiment of the present application;
图10为本申请实施例提供的虚拟化模式下逻辑处理器对于notify_if请求的处理流程示意图;FIG. 10 is a schematic diagram of a processing flow for a notify_if request by a logical processor in virtualization mode provided by an embodiment of the present application;
图11为本申请实施例提供的一种第一逻辑处理器的组成结构示意图;FIG. 11 is a schematic diagram of the composition and structure of a first logical processor provided by the embodiment of the present application;
图12为本申请实施例提供的一种第二逻辑处理器的组成结构示意图。FIG. 12 is a schematic diagram of the composition and structure of a second logical processor provided by the embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供了一种通信方法和逻辑处理器,用于减少对发送方的处理器资源占用和IPI的最终传输延迟。The embodiment of the present application provides a communication method and a logical processor, which are used to reduce processor resource occupation of the sender and final transmission delay of the IPI.
下面结合附图,对本申请的实施例进行描述。Embodiments of the present application are described below in conjunction with the accompanying drawings.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。The terms "first", "second" and the like in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is merely a description of the manner in which objects with the same attribute are described in the embodiments of the present application. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, product, or apparatus comprising a series of elements is not necessarily limited to those elements, but may include elements not expressly included. Other elements listed explicitly or inherent to the process, method, product, or apparatus.
首先对本申请实施例中的重要术语作出如下说明:First, the important terms in the embodiments of the present application are explained as follows:
虚拟机:在计算机科学中的体系结构里,是指一种特殊的软件,它可以在计算机平台和终端用户之间创建一种环境,而终端用户则是基于这个软件所创建的环境来操作软件。在计算机科学中,虚拟机是指可以像真实机器一样运行程序的计算机的软件实现。指通过软件模拟的具有完整硬件系统功能的、运行在一个独立环境中的完整计算机系统。一台物理机可以根据应用需要虚拟出多台虚拟机,实现在一台物理机上同时运行多个操作系统。对于每个操作系统,用户都可以进行虚拟的分区、配置。同时,用户可在多个操作系统间切换。虚拟机是一个软件计算机,类似于一台物理机,运行操作系统和应用。多个虚拟机能够在同一主机系统上同步运行。Virtual machine: In the architecture of computer science, it refers to a special software that can create an environment between the computer platform and the end user, and the end user operates the software based on the environment created by the software . In computer science, a virtual machine is a software implementation of a computer that can run programs like a real machine. Refers to a complete computer system that is simulated by software and has complete hardware system functions and runs in an independent environment. One physical machine can virtualize multiple virtual machines according to application needs, so that multiple operating systems can run on one physical machine at the same time. For each operating system, users can perform virtual partitioning and configuration. At the same time, users can switch between multiple operating systems. A virtual machine is a software computer, similar to a physical machine, that runs an operating system and applications. Multiple virtual machines can run simultaneously on the same host system.
虚拟机监控器(Virtual Machine Monitor,VMM):VMM其实就是一个简单的操作系统。它提供很多抽象的虚拟机可以让多个操作系统同时运行。甚至这些操作系统也不需要相同。从系统的角度看,这个时候的每一个虚拟机其实相当于VMM这个OS(操作系统)的一个进程。Virtual Machine Monitor (Virtual Machine Monitor, VMM): VMM is actually a simple operating system. It provides many abstract virtual machines that allow multiple operating systems to run simultaneously. Even these operating systems don't need to be the same. From the perspective of the system, each virtual machine at this time is actually equivalent to a process of the OS (operating system) of VMM.
hyper-threading:超线程:采用另一个思路去提高CPU的性能,让CPU可以同时执行多重线程,就能够让CPU发挥更大效率,即所谓“超线程(Hyper-Threading,简称“HT”)”技术。超线程技术就是利用特殊的硬件指令,把两个逻辑内核模拟成两个物理芯片,让单个处理器都能使用线程级并行计算,进而兼容多线程操作系统和软件,减少了CPU的闲置时间,提高CPU的运行效率。采用超线程技术能同时执行两个线程,但它并不像两个真正的CPU那样,每个CPU都具有独立的资源。当两个线程都同时需要某一个资源时,其中一个要暂时停止,并让出资源,直到这些资源闲置后才能继续。因此超线程的性能并不等于两个CPU的性能。hyper-threading: Hyper-threading: using another idea to improve the performance of the CPU, so that the CPU can execute multiple threads at the same time, so that the CPU can be more efficient, that is, the so-called "Hyper-Threading (HT" for short)" technology. Hyper-threading technology uses special hardware instructions to simulate two logical cores into two physical chips, so that a single processor can use thread-level parallel computing, which is compatible with multi-threaded operating systems and software, reducing CPU idle time. Improve CPU operating efficiency. Using hyper-threading technology can execute two threads at the same time, but it is not like two real CPUs, each CPU has independent resources. When two threads both need a certain resource at the same time, one of them should temporarily stop and give up the resource until these resources are idle before continuing. Therefore, the performance of hyperthreading is not equal to the performance of two CPUs.
Socket:插座。连接器的接收插座,用于插进插头。Socket: socket. A receiving receptacle for a connector into which a plug is inserted.
处理器socket:可以进行物理插拔的CPU硬件模块。Processor socket: A CPU hardware module that can be physically plugged and unplugged.
处理器中断(Inter-Processor Interrupt,IPI):一个处理器向另外一个处理器发出的异步通知。在有的系统上,被称作SGI/软件中断。IPI是一种特别的中断。在对称多处理器(SMP,symmetric multiprocessing)环境下,它可以被任意一个处理器用来对另一个处理器产生中断。IPI典型地被用来实现高速缓存间的一致性同步(Cache CoherencySynchronization)和通知对方进行任务调度/抢先。Inter-Processor Interrupt (IPI): An asynchronous notification from one processor to another. On some systems, this is called SGI/Software Interrupt. IPI is a special interrupt. In a symmetric multiprocessing (SMP, symmetric multiprocessing) environment, it can be used by any processor to interrupt another processor. IPI is typically used to achieve coherent synchronization between caches (Cache CoherencySynchronization) and notify the other party for task scheduling/preemption.
对称多处理(symmetric multiprocessing,SMP):SMP指在一个计算机上汇集了一组处理器(多CPU),各CPU之间共享内存子系统以及总线结构。系统将任务队列对称地分布于多个CPU之上,所有的CPU都可以平等地访问内存、输入/输出(Input/Output,I/O)和外部设备。Symmetric multiprocessing (symmetric multiprocessing, SMP): SMP refers to the collection of a group of processors (multiple CPUs) on a computer, and the memory subsystem and bus structure are shared between each CPU. The system distributes task queues symmetrically over multiple CPUs, and all CPUs can equally access memory, input/output (Input/Output, I/O) and external devices.
以下分别进行详细说明。Each will be described in detail below.
请参阅图1所示,为本申请一个实施例提供的处理器的系统架构示意图,该系统架构可以包括:处理器和虚拟机,其中处理器是硬件,虚拟机是软件。处理器也称为中央处理单元,是计算机的运算和控制单元,它是解释和执行指令的部件,具有取址、译码和执行指令的基本功能,以及通过计算机的主要数据传输通道(例如总线),与其它部件交换信息。处理器可以包括多个逻辑处理器(logical processor,LP),该逻辑处理器也可以称为物理处理器,例如LP1、LP2、…、LPn,n表示逻辑处理器的个数,n的取值可以为正整数,逻辑处理器是处理器socket中所包含的、具有独立执行线程的处理器单元。虚拟机可以包括多个虚拟处理器(virtual processor,VP),例如Vp1、VP2、…、VPn,n的取值可以为正整数。Please refer to FIG. 1 , which is a schematic diagram of a system architecture of a processor provided by an embodiment of the present application. The system architecture may include: a processor and a virtual machine, wherein the processor is hardware, and the virtual machine is software. The processor, also known as the central processing unit, is the calculation and control unit of the computer. It is a component that interprets and executes instructions. ), to exchange information with other components. The processor may include a plurality of logical processors (logical processor, LP), and the logical processor may also be called a physical processor, such as LP1, LP2, ..., LPn, n represents the number of logical processors, and the value of n It can be a positive integer, and a logical processor is a processor unit included in a processor socket with independent execution threads. The virtual machine may include multiple virtual processors (virtual processors, VPs), such as Vp1, VP2, ..., VPn, and the value of n may be a positive integer.
如图2,本申请实施例提供的一种通信方法,包括:As shown in Figure 2, a communication method provided by the embodiment of this application includes:
201、当第一逻辑处理器进入虚拟化模式之后,第一逻辑处理器获取IPI信息,IPI信息包括:目标虚拟处理器的标识和虚拟中断信息。201. After the first logical processor enters the virtualization mode, the first logical processor acquires IPI information, where the IPI information includes: an identifier of a target virtual processor and virtual interrupt information.
本申请实施例中,第一逻辑处理器上当前运行有虚拟处理器,将第一逻辑处理器上正在运行的虚拟处理器定义为第一虚拟处理器,该第一虚拟处理器需要向目标虚拟处理器注入IPI时,第一虚拟处理器可以使用第一逻辑处理器来发送IPI信息,其中,该IPI信息包括:目标虚拟处理器的标识和虚拟中断信息。该目标虚拟处理器的标识可以是目标虚拟处理器的编号,该虚拟中断信息可以是虚拟IPI的详情信息,例如该虚拟中断信息可以包括中断号和中断发送方式。In this embodiment of the present application, a virtual processor is currently running on the first logical processor, and the virtual processor running on the first logical processor is defined as the first virtual processor. When the processor injects the IPI, the first virtual processor may use the first logical processor to send IPI information, where the IPI information includes: an identifier of the target virtual processor and virtual interrupt information. The identifier of the target virtual processor may be the number of the target virtual processor, and the virtual interrupt information may be detailed information of the virtual IPI, for example, the virtual interrupt information may include an interrupt number and an interrupt sending method.
202、第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译,得到目标虚拟处理器当前运行所在的目标逻辑处理器。202. The first logical processor performs virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running.
在本申请实施例中,第一逻辑处理器中可以实现虚拟处理器编号到逻辑处理器编号的翻译,其功能包括虚拟处理器编号到逻辑处理器编号对应表的维护和查询。因此当第一逻辑处理器获取到目标虚拟处理器的标识之后,可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,得到目标虚拟处理器当前运行所在的目标逻辑处理器。In the embodiment of the present application, the first logical processor can realize the translation from the virtual processor number to the logical processor number, and its function includes maintaining and querying the correspondence table between the virtual processor number and the logical processor number. Therefore, after the first logical processor obtains the identifier of the target virtual processor, it may perform virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running.
在本申请的一些实施例中,步骤202第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译,包括:In some embodiments of the present application, in step 202, the first logical processor performs virtual processor address translation on the identification of the target virtual processor, including:
第一逻辑处理器通过查询虚拟处理器到逻辑处理器的路由表,对对目标虚拟处理器的标识进行虚拟处理器地址翻译。The first logical processor performs virtual processor address translation on the identifier of the target virtual processor by querying a virtual processor-to-logical processor routing table.
其中,在每个逻辑处理器上运行虚拟处理器时,每个逻辑处理器都对应一个根据虚拟处理器编号进行索引的虚拟处理器到逻辑处理器的路由表,一个逻辑处理器可以访问自己对应的虚拟处理器到逻辑处理器的路由表,从而完成从虚拟处理器到相应的逻辑处理器的地址翻译。Wherein, when running a virtual processor on each logical processor, each logical processor corresponds to a virtual processor-to-logical processor routing table indexed according to the virtual processor number, and a logical processor can access its corresponding The routing table from the virtual processor to the logical processor, so as to complete the address translation from the virtual processor to the corresponding logical processor.
在本申请的一些实施例中,虚拟处理器到逻辑处理器的路由表存储在第一逻辑处理器的存储区域中;或,In some embodiments of the present application, the routing table from the virtual processor to the logical processor is stored in the storage area of the first logical processor; or,
虚拟处理器到逻辑处理器的路由表存储在第一逻辑处理器所在的可用于物理插拔的处理器的存储区域中;或,The routing table from the virtual processor to the logical processor is stored in the storage area of the processor where the first logical processor is located and can be used for physical plugging; or,
虚拟处理器到逻辑处理器的路由表存储到内存中。The virtual processor to logical processor routing table is stored in memory.
其中,可用于物理插拔的处理器是指前述的处理器socket。即虚拟处理器到逻辑处理器的路由表可以由一个逻辑处理器单独存储,也可以在该逻辑处理器所属的处理器socket的范围内进行全局共享,或者存储到内存中,从而每个逻辑处理器可以使用一个虚拟处理器指针从该内存中读取到虚拟处理器到逻辑处理器的路由表。Wherein, the processor that can be used for physical plugging refers to the aforementioned processor socket. That is, the routing table from a virtual processor to a logical processor can be stored independently by a logical processor, or it can be shared globally within the scope of the processor socket to which the logical processor belongs, or stored in memory, so that each logical processor The virtual processor can use a virtual processor pointer to read the virtual processor to logical processor routing table from this memory.
在本申请的一些实施例中,第一逻辑处理器具有用于修改虚拟处理器到逻辑处理器的路由表的接口。In some embodiments of the present application, the first logical processor has an interface for modifying a virtual processor to logical processor routing table.
其中,逻辑处理器还可以提供修改虚拟处理器到逻辑处理的路由表的支持机制,例如在此支持机制被触发时,当前逻辑处理器对自身可访问的虚拟处理器到逻辑处理的路由表进行修改。又如,逻辑处理器可利用处理器间通信机制,通知其它逻辑处理器修改虚拟处理器到逻辑处理的路由表,具体实现方式此处不做限定。Among them, the logical processor can also provide a support mechanism for modifying the routing table from the virtual processor to the logical processing. Revise. As another example, a logical processor may use an inter-processor communication mechanism to notify other logical processors to modify a routing table from a virtual processor to a logical processor, and the specific implementation manner is not limited here.
203、第一逻辑处理器向目标逻辑处理器发送IPI信息。203. The first logical processor sends the IPI information to the target logical processor.
在本申请实施例中,第一逻辑处理器确定出目标虚拟处理器当前运行所在的目标逻辑处理器之后,第一逻辑处理器可以向目标逻辑处理器发送IPI信息,使得该目标逻辑处理器可以按照IPI信息执行IPI注入。In this embodiment of the application, after the first logical processor determines the target logical processor where the target virtual processor is currently running, the first logical processor can send IPI information to the target logical processor, so that the target logical processor can Perform IPI injection according to IPI information.
在本申请的一些实施例中,本申请实施例提供的通信方法还可以包括如下步骤:In some embodiments of the present application, the communication method provided in the embodiment of the present application may further include the following steps:
第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定目标虚拟处理器没有在任何一个逻辑处理器运行时,第一逻辑处理器存储IPI信息,并退出虚拟化模式;After the first logical processor performs virtual processor address translation on the identification of the target virtual processor, and determines that the target virtual processor is not running on any logical processor, the first logical processor stores the IPI information and exits the virtualization mode;
第一逻辑处理器通知VMM第一逻辑处理器存储了所述IPI信息。The first logical processor notifies the VMM that the first logical processor stores the IPI information.
其中,第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定目标虚拟处理器没有在任何一个逻辑处理器运行时,则说明该第一逻辑处理器无法确定出目标虚拟处理器当前运行所在的目标逻辑处理器,此时可以将IPI信息存储下来,例如存储到发送方异常信息存储区域中,使得运行于非虚拟化模式的vmm软件可以查询到IPI发送详情信息。Wherein, after the first logical processor performs virtual processor address translation on the identification of the target virtual processor and determines that the target virtual processor is not running on any logical processor, it means that the first logical processor cannot determine the target virtual processor. The target logical processor where the processor is currently running can store the IPI information at this time, for example, in the sender exception information storage area, so that the vmm software running in the non-virtualization mode can query the IPI sending details.
在本申请的一些实施例中,本申请实施例提供的通信方法还可以包括如下步骤:In some embodiments of the present application, the communication method provided in the embodiment of the present application may further include the following steps:
当第一逻辑处理器向目标逻辑处理器发送IPI信息失败时,第一逻辑处理器存储IPI信息,并退出虚拟化模式;When the first logical processor fails to send the IPI information to the target logical processor, the first logical processor stores the IPI information and exits the virtualization mode;
第一逻辑处理器通知VMM第一逻辑处理器存储了IPI信息。The first logical processor notifies the VMM that the first logical processor stores the IPI information.
其中,第一逻辑处理器可以设置“投送中断”时所使用的中断号,在逻辑处理器进入虚拟化模式后,执行IPI信息。退出虚拟化模式之后,则判断退出原因,若原因是“虚拟化模式下投送虚拟中断”,则由VMM使用中断号继续执行IPI中断信息。Wherein, the first logical processor may set the interrupt number used when "delivering interrupt", and execute the IPI information after the logical processor enters the virtualization mode. After exiting the virtualization mode, judge the exit reason. If the reason is "virtual interrupt delivery in virtualization mode", the VMM will use the interrupt number to continue executing the IPI interrupt information.
在本申请的一些实施例中,本申请实施例提供的通信方法还可以包括如下步骤:In some embodiments of the present application, the communication method provided in the embodiment of the present application may further include the following steps:
第一逻辑处理器向目标逻辑处理器发送目标虚拟处理器所在的虚拟机(VirtualMachine,VM)的标识。The first logical processor sends an identifier of a virtual machine (Virtual Machine, VM) where the target virtual processor is located to the target logical processor.
其中,第一逻辑处理器还需要向目标逻辑处理器发送目标虚拟处理器所在的VM的标识,以使得接收方可以确定出该目标虚拟处理器所在的VM。Wherein, the first logical processor also needs to send the identifier of the VM where the target virtual processor is located to the target logical processor, so that the receiver can determine the VM where the target virtual processor is located.
通过前述实施例的举例说明可知,当第一逻辑处理器进入虚拟化模式之后,第一逻辑处理器获取处理器中断IPI信息,IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译,得到目标虚拟处理器当前运行所在的目标逻辑处理器;第一逻辑处理器向目标逻辑处理器发送IPI信息。本申请实施例中,第一逻辑处理器可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,从而可以确定出目标虚拟处理器当前运行所在的目标逻辑处理器,因此第一逻辑处理器可以在虚拟化模式直接向正在运行的目标虚拟处理器发送IPI信息,使得目标虚拟处理器可以被注入IPI,不需要通过VMM来实现对IPI信息进行发送,第一逻辑处理器也不需要退出虚拟化模式,因此可以减少对发送方的处理器资源占用和IPI的最终传输延迟。It can be seen from the examples of the foregoing embodiments that when the first logical processor enters the virtualization mode, the first logical processor acquires processor interrupt IPI information, and the IPI information includes: the target virtual processor identifier and virtual interrupt information; The logical processor performs virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running; the first logical processor sends IPI information to the target logical processor. In this embodiment of the present application, the first logical processor can perform virtual processor address translation on the identifier of the target virtual processor, so as to determine the target logical processor where the target virtual processor is currently running. Therefore, the first logical processor can In the virtualization mode, IPI information is directly sent to the running target virtual processor, so that the target virtual processor can be injected into IPI, without the need to send IPI information through the VMM, and the first logical processor does not need to exit virtualization mode, thus reducing the processor resource occupation of the sender and the final transmission delay of the IPI.
前述实施例对发送方的逻辑处理器的执行流程进行了说明,接下来从接收方的逻辑处理器的执行流程进行举例说明,请参阅图3所示,本申请实施例提供的通信方法主要包括如下步骤:The foregoing embodiments have described the execution flow of the logic processor of the sender, and then illustrate the execution flow of the logic processor of the receiver with an example. Please refer to FIG. 3. The communication method provided by the embodiment of the present application mainly includes Follow the steps below:
301、当第二逻辑处理器进入虚拟化模式之后,第二逻辑处理器接收第一逻辑处理器发送的IPI信息,IPI信息包括:目标虚拟处理器的标识和虚拟中断信息。301. After the second logical processor enters the virtualization mode, the second logical processor receives IPI information sent by the first logical processor, where the IPI information includes: an identifier of a target virtual processor and virtual interrupt information.
其中,本申请实施例中基于处理器硬件的通信机制,第一逻辑处理器发送IPI信息后,第二逻辑处理器作为接收方可以接收该IPI信息,第二逻辑处理器可以从该IPI信息确定出目标虚拟处理器的标识和虚拟中断信息。Among them, in the embodiment of the present application, based on the communication mechanism of the processor hardware, after the first logical processor sends the IPI information, the second logical processor can receive the IPI information as the receiver, and the second logical processor can determine from the IPI information Output the identification and virtual interrupt information of the target virtual processor.
302、第二逻辑处理器根据虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。302. The second logical processor performs virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information.
在本申请实施例中,正在运行的第二虚拟处理器就是需要被注入中断的虚拟处理器,由第二逻辑处理器根据虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。通过第一逻辑处理器和第二逻辑处理器之间的硬件直接通信,本申请实施例中可以实现对目标虚拟处理器的虚拟终端注入处理,整个过程不需要VMM软件的接入,第二逻辑处理器也不需要退出虚拟化模式。In this embodiment of the present application, the running second virtual processor is the virtual processor that needs to be injected with an interrupt, and the second logical processor performs virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information. Through the hardware direct communication between the first logical processor and the second logical processor, in the embodiment of the present application, the virtual terminal injection process to the target virtual processor can be realized. The whole process does not require the access of VMM software, and the second logical processor The processor also does not need to exit virtualization mode.
在本申请的一些实施例中,在步骤301执行之后,还可以执行如下步骤:In some embodiments of the present application, after step 301 is performed, the following steps may also be performed:
第二逻辑处理器确定第二虚拟处理器的标识是否与目标虚拟处理器的标识相同,第二虚拟处理器是第二逻辑处理器进入虚拟模式后正在运行的虚拟处理器。The second logical processor determines whether the identifier of the second virtual processor is the same as the identifier of the target virtual processor, and the second virtual processor is the running virtual processor after the second logical processor enters the virtual mode.
当第二虚拟处理器的标识与目标虚拟处理器的标识相同时,触发执行前述的步骤302:第二逻辑处理器根据虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。When the identifier of the second virtual processor is the same as the identifier of the target virtual processor, the aforementioned step 302 is triggered: the second logical processor performs virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information.
在本申请实施例中,第二逻辑处理器判断该第二逻辑处理器当前正在运行的第二虚拟处理器是否就是该目标虚拟处理器,例如第二逻辑处理器可以确定第二虚拟处理器的标识是否与目标虚拟处理器的标识相同,第二虚拟处理器是第二逻辑处理器进入虚拟模式后正在运行的虚拟处理器。In this embodiment of the present application, the second logical processor judges whether the second virtual processor currently running on the second logical processor is the target virtual processor, for example, the second logical processor may determine the Whether the identifier is the same as the identifier of the target virtual processor, the second virtual processor is the running virtual processor after the second logical processor enters the virtual mode.
在本申请实施例中,当第二虚拟处理器的标识与目标虚拟处理器的标识相同时,说明该正在运行的第二虚拟处理器就是需要被注入中断的虚拟处理器,此时由第二逻辑处理器根据虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。通过第一逻辑处理器和第二逻辑处理器之间的硬件直接通信,本申请实施例中可以实现对目标虚拟处理器的虚拟终端注入处理,整个过程不需要VMM软件的接入,第二逻辑处理器也不需要退出虚拟化模式。In the embodiment of the present application, when the ID of the second virtual processor is the same as the ID of the target virtual processor, it means that the running second virtual processor is the virtual processor that needs to be interrupted. At this time, the second The logical processor performs virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information. Through the hardware direct communication between the first logical processor and the second logical processor, in the embodiment of the present application, the virtual terminal injection process to the target virtual processor can be realized. The whole process does not require the access of VMM software, and the second logical processor The processor also does not need to exit virtualization mode.
在本申请的一些实施例中,本申请实施例提供的通信方法还可以包括如下步骤:In some embodiments of the present application, the communication method provided in the embodiment of the present application may further include the following steps:
当第二虚拟处理器的标识与目标虚拟处理器的标识不相同时,第二逻辑处理器存储IPI信息,并退出所述虚拟化模式。When the identifier of the second virtual processor is different from the identifier of the target virtual processor, the second logical processor stores the IPI information and exits the virtualization mode.
其中,第二逻辑处理器确定当前正在运行的第二虚拟处理器并不是目标虚拟处理器时,第二逻辑处理器可以将IPI信息存储下来,例如存储到接收方异常信息存储区域中,使得运行于非虚拟化模式的vmm软件可以查询到IPI发送详情信息。Wherein, when the second logical processor determines that the currently running second virtual processor is not the target virtual processor, the second logical processor may store the IPI information, for example, in the receiver exception information storage area, so that the running The vmm software in non-virtualization mode can query the detailed information of IPI transmission.
在本申请的一些实施例中,本申请实施例提供的通信方法还可以包括如下步骤:In some embodiments of the present application, the communication method provided in the embodiment of the present application may further include the following steps:
当第二逻辑处理器进入非虚拟化模式之后,第二逻辑处理器接收第一逻辑处理器发送的IPI信息,IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;After the second logical processor enters the non-virtualization mode, the second logical processor receives the IPI information sent by the first logical processor, and the IPI information includes: the identification of the target virtual processor and virtual interrupt information;
第二逻辑处理器确定第二虚拟处理器的标识是否与目标虚拟处理器的标识相同;the second logical processor determines whether the identity of the second virtual processor is the same as the identity of the target virtual processor;
当第二虚拟处理器的标识与目标虚拟处理器的标识相同时,第二逻辑处理器将第二逻辑处理器和第二虚拟处理器的对应关系更新到虚拟处理器到逻辑处理器的路由表中。When the identifier of the second virtual processor is the same as the identifier of the target virtual processor, the second logical processor updates the correspondence between the second logical processor and the second virtual processor to the routing table from the virtual processor to the logical processor middle.
其中,当第二逻辑处理器进入非虚拟化模式之后,即第二逻辑处理器并不是处于虚拟化模式,第二逻辑处理器可以将第二逻辑处理器和第二虚拟处理器的对应关系更新到虚拟处理器到逻辑处理器的路由表中,从而实现逻辑处理器对于该路由表的动态更新。Wherein, after the second logical processor enters the non-virtualization mode, that is, the second logical processor is not in the virtualization mode, the second logical processor can update the corresponding relationship between the second logical processor and the second virtual processor Into the routing table from the virtual processor to the logical processor, so as to realize the dynamic update of the routing table by the logical processor.
通过前述实施例的举例说明可知,本申请实施例中,第一逻辑处理器可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,从而可以确定出目标虚拟处理器当前运行所在的目标逻辑处理器,因此第一逻辑处理器可以在虚拟化模式直接向正在运行的目标虚拟处理器发送IPI信息,第二逻辑处理器作为目标逻辑处理器,该第二逻辑处理器上运行有该目标虚拟处理器,因此第二逻辑处理器可以对该目标虚拟处理器进行IPI注入,不需要通过VMM来实现对IPI信息进行发送,第一逻辑处理器也不需要退出虚拟化模式,因此可以减少对发送方的处理器资源占用和IPI的最终传输延迟。It can be known from the examples of the foregoing embodiments that in the embodiment of the present application, the first logical processor can perform virtual processor address translation on the identification of the target virtual processor, so as to determine the target logical processor where the target virtual processor is currently running. Therefore, the first logical processor can directly send IPI information to the running target virtual processor in the virtualization mode, and the second logical processor acts as the target logical processor on which the target virtual processor runs Therefore, the second logical processor can perform IPI injection on the target virtual processor without sending the IPI information through the VMM, and the first logical processor does not need to exit the virtualization mode, so the sending party can be reduced The processor resource usage and the final transmission delay of IPI.
为便于更好的理解和实施本申请实施例的上述方案,下面举例相应的应用场景来进行具体说明。In order to facilitate a better understanding and implementation of the above-mentioned solutions in the embodiments of the present application, the corresponding application scenarios are exemplified below for specific description.
本申请实施例可以解决的技术问题是HVM的虚拟处理器之间必须借助VMM发送IPI,而无法直接通信,从而导致CPU资源占用和IPI的最终传输延迟的问题。后续实施例中发送IPI和发送IPI中断的含义相同。The technical problem that the embodiments of the present application can solve is that the virtual processors of the HVM must send IPIs through the VMM, but cannot communicate directly, which leads to problems of CPU resource occupation and final transmission delay of IPIs. In subsequent embodiments, the meanings of sending IPI and sending IPI interrupt are the same.
虚拟处理器之间借助VMM发送IPI的过程中导致“CPU资源占用和IPI的最终传输延迟的问题”的主要原因是“借助VMM进行IPI通信”的过程中,逻辑处理器会退出虚拟化模式,具体原因如下:The main reason for "the problem of CPU resource occupation and the final transmission delay of IPI" in the process of sending IPI between virtual processors with the help of VMM is that during the process of "IPI communication with the help of VMM", the logical processor will exit the virtualization mode. The specific reasons are as follows:
1)、发送IPI中断时需要指定接收方的逻辑处理器编号,但HVM感知到的虚拟处理器编号与物理计算机的逻辑处理器编号一般是不同的,若HVM采用标准的IPI发送逻辑,IPI将被送到错误的逻辑处理器;1) When sending an IPI interrupt, you need to specify the logical processor number of the receiver, but the virtual processor number perceived by HVM is generally different from the logical processor number of the physical computer. If HVM uses standard IPI sending logic, IPI will was sent to the wrong logical processor;
2)、若允许虚拟处理器直接发送IPI中断,则恶意的虚拟机可能会通过向虚拟机没有使用的逻辑处理器发送IPI,造成系统死机或影响其他虚拟机的正常工作;2) If the virtual processor is allowed to directly send IPI interrupts, a malicious virtual machine may send IPI to a logical processor not used by the virtual machine, causing the system to crash or affect the normal operation of other virtual machines;
3)、逻辑处理器无法正确处理“接收虚拟IPI中断的虚拟处理器当前不在运行、甚至处于阻塞状态”的情形。3) The logical processor cannot correctly handle the situation that "the virtual processor receiving the virtual IPI interrupt is currently not running, or even in a blocked state".
本申请实施例中,逻辑处理器具有“可获得虚拟处理器到逻辑处理器对应关系“的机制。逻辑处理器具有在虚拟化模式下不借助VMM,通过目标逻辑处理器新增的“虚拟处理器地址翻译模块”监控目标虚拟处理器是否正在运行,从而判断是否需要VMM软件的介入。在逻辑处理器因虚拟处理器执行IPI发送指令而退出虚拟化模式时,具有向VMM软件暴露目标虚拟处理器编号和虚拟IPI中断详情的功能的机制,从而使得VMM软件可以在逻辑处理器退出虚拟化模式后,查询获得退出的原因,进而由VMM软件完成虚拟IPI的发送过程。In the embodiment of the present application, the logical processor has a mechanism of "obtaining the corresponding relationship between virtual processors and logical processors". The logical processor can monitor whether the target virtual processor is running through the newly added "virtual processor address translation module" of the target logical processor without the help of VMM in virtualization mode, so as to judge whether the intervention of VMM software is needed. When the logical processor exits the virtualization mode due to the virtual processor executing the IPI sending instruction, it has a mechanism to expose the target virtual processor number and virtual IPI interrupt details to the VMM software, so that the VMM software can exit the virtualization mode when the logical processor exits the virtualization mode. After the mode is changed, the reason for the exit is obtained by querying, and then the sending process of the virtual IPI is completed by the VMM software.
需要说明的是,本申请实施例中,逻辑处理器发送IPI发送命令,不需要退出虚拟化模式。It should be noted that, in the embodiment of the present application, the logical processor does not need to exit the virtualization mode when sending the IPI sending command.
本申请实施例的应用场景是计算机系统的CPU,如x86处理器,ARM处理器等。The application scenario of the embodiment of the present application is a CPU of a computer system, such as an x86 processor, an ARM processor, and the like.
图4为本申请实施例提供的逻辑处理器的基本架构示意图。本申请实施例主要对CPU硬件进行优化。如图4所示,本申请实施例针对CPU硬件,除了包含指令处理逻辑模块之外,还包括如下模块:虚拟处理器地址翻译模块,虚拟处理器中断收发模块,目标匹配模块,发送方异常信息存储模块,接收方异常信息存储模块,发送方异常信息查询模块,接收方异常信息查询模块,接收方异常报告模块。FIG. 4 is a schematic diagram of a basic architecture of a logic processor provided by an embodiment of the present application. The embodiment of the present application mainly optimizes the CPU hardware. As shown in Figure 4, the embodiment of the present application is aimed at the CPU hardware. In addition to the instruction processing logic module, it also includes the following modules: a virtual processor address translation module, a virtual processor interrupt transceiver module, a target matching module, and sender exception information A storage module, a receiver exception information storage module, a sender exception information query module, a receiver exception information query module, and a receiver exception report module.
接下来对上述各模块的功能及其相互关系进行描述如下:Next, the functions and interrelationships of the above modules are described as follows:
虚拟处理器地址翻译模块:负责实现虚拟处理器编号到逻辑处理器编号的翻译,其功能包括虚拟处理器编号到逻辑处理器编号对应表的维护和查询。当逻辑处理器运行虚拟化模式因执行IPI发送指令,通过虚拟处理器地址翻译模块无法获得有效的逻辑处理器编号时,逻辑处理器将待发送的IPI详情记录在发送方异常信息存储模块,并退出虚拟化模式;Virtual processor address translation module: responsible for realizing the translation from virtual processor numbers to logical processor numbers, and its functions include maintaining and querying the correspondence table between virtual processor numbers and logical processor numbers. When the logical processor runs in the virtualization mode and cannot obtain an effective logical processor number through the virtual processor address translation module due to the execution of the IPI sending instruction, the logical processor records the details of the IPI to be sent in the sender exception information storage module, and exit virtualization mode;
目标匹配模块:负责判断逻辑处理器接收到的虚拟中断注入请求的目标接收者是否是当前正在运行的虚拟处理器;Target matching module: responsible for judging whether the target recipient of the virtual interrupt injection request received by the logical processor is the currently running virtual processor;
虚拟处理器中断收发模块:包括发送端接口和中断注入子模块两部分。指令处理逻辑模块通过向当前逻辑处理器的发送端接口发送请求,来通知需接收IPI中断的逻辑处理器的中断注入子模块。当虚拟处理器中断收发模块的中断注入子模块接收到来自其它逻辑处理器的中断注入请求时,若当前逻辑处理器正处于非虚拟化模式,则触发接收方异常报告模块工作。若当前逻辑处理器正处于虚拟化模式,就根据目标匹配模块的判定结果,决定是向虚拟处理器投送中断。或者,当前逻辑处理器将接收到的中断注入请求详情记录在接收方异常信息存储模块,且转入非虚拟化模式。Virtual processor interrupt transceiver module: includes two parts, the sender interface and the interrupt injection sub-module. The instruction processing logic module notifies the interrupt injection submodule of the logic processor that needs to receive the IPI interrupt by sending a request to the sender interface of the current logic processor. When the interrupt injection sub-module of the virtual processor interrupt transceiver module receives an interrupt injection request from other logical processors, if the current logical processor is in the non-virtualization mode, it will trigger the exception report module of the receiver to work. If the current logical processor is in the virtualization mode, it is determined whether to send an interrupt to the virtual processor according to the determination result of the target matching module. Alternatively, the current logical processor records the details of the received interrupt injection request in the receiver exception information storage module, and turns into a non-virtualization mode.
发送方异常信息查询模块和接收方异常信息查询模块,可以为运行于非虚拟化模式的VMM软件提供查询IPI发送详情的支持。The abnormal information query module of the sender and the abnormal information query module of the receiver can provide support for querying IPI sending details for the VMM software running in the non-virtualization mode.
接收方异常报告模块被触发后,执行VMM软件在此之前向逻辑处理器注册的异常处理流程。After the exception reporting module of the receiver is triggered, it executes the exception handling process registered with the logic processor by the VMM software before that.
在本申请实施例所述的逻辑处理器中,位于逻辑处理器LP_X的虚拟处理器VP_x向虚拟处理器VP_y发送IPI中断时,主要过程可以包括如下步骤:In the logical processor described in the embodiment of the present application, when the virtual processor VP_x located in the logical processor LP_X sends an IPI interrupt to the virtual processor VP_y, the main process may include the following steps:
步骤一,主要包括如下1)和2)这两种情况。Step 1 mainly includes the following two situations: 1) and 2).
1)逻辑处理器LP_X的虚拟处理器地址翻译模块显示“虚拟处理器VP_y当前正在逻辑处理器LP_Y上运行”。1) The virtual processor address translation module of the logical processor LP_X displays "the virtual processor VP_y is currently running on the logical processor LP_Y".
在虚拟处理器VP_x执行“向虚拟处理器VP_y发送IPI中断”的指令时,LP_X的指令处理逻辑模块通过其虚拟处理器地址翻译模块,得到VP_y位于有效的逻辑处理器LP_Y上,由指令处理逻辑模块通知虚拟处理器中断收发模块的发送端接口进行中断的投送,或者由虚拟处理器地址翻译模块通知虚拟处理器中断收发模块的发送端接口进行中断的投送。逻辑处理器LP_X的发送端接口将虚拟中断注入请求发送到逻辑处理器LP_Y的中断注入子模块。When the virtual processor VP_x executes the instruction "send an IPI interrupt to the virtual processor VP_y", the instruction processing logic module of LP_X obtains that VP_y is located on the effective logical processor LP_Y through its virtual processor address translation module, and the instruction processing logic The module notifies the virtual processor to interrupt the sender interface of the transceiver module to deliver the interrupt, or the virtual processor address translation module notifies the virtual processor to interrupt the sender interface of the transceiver module to deliver the interrupt. The sender interface of the logical processor LP_X sends the virtual interrupt injection request to the interrupt injection submodule of the logical processor LP_Y.
2)逻辑处理器LP_X的虚拟处理器地址翻译模块显示“虚拟处理器VP_y当前没在逻辑处理器上运行”:2) The virtual processor address translation module of the logical processor LP_X displays "the virtual processor VP_y is not currently running on the logical processor":
指令处理逻辑模块通过虚拟处理器地址翻译模块获知“虚拟处理器VP_y当前没有在逻辑处理器上运行”后,将IPI发送指令的详情写入发送方异常信息存储模块,该逻辑处理器LP_X退出虚拟化模式。VMM软件可以通过发送方异常信息查询模块,获得指令处理逻辑模块在之前放入在发送方异常信息存储模块中的信息。After the instruction processing logic module learns that "the virtual processor VP_y is not currently running on the logical processor" through the virtual processor address translation module, it writes the details of the instruction sent by the IPI into the exception information storage module of the sender, and the logical processor LP_X exits the virtual processor LP_X. mode. The VMM software can obtain the information that the instruction processing logic module put in the sender exception information storage module before through the sender exception information query module.
步骤一执行之后,执行步骤二:After step 1 is executed, execute step 2:
当逻辑处理器LP_Y的中断注入模块接收到来自其他逻辑处理器的中断注入消息时,主要包括如下1)和2)这两种情况。:When the interrupt injection module of the logical processor LP_Y receives the interrupt injection message from other logical processors, it mainly includes the following two situations 1) and 2). :
1)、目标匹配模块判定“当前正在运行中断注入消息对应的虚拟处理器”。1) The target matching module determines that "the virtual processor corresponding to the interrupt injection message is currently running".
中断注入子模块在收到中断注入消息后,通过目标匹配模块发现当前正在运行与此中断注入消息对应的虚拟处理器,则直接通知指令处理逻辑模块对当前的虚拟处理器注入IPI中断。After receiving the interrupt injection message, the interrupt injection sub-module finds that the virtual processor corresponding to the interrupt injection message is currently running through the target matching module, and then directly notifies the instruction processing logic module to inject an IPI interrupt into the current virtual processor.
2)、目标匹配模块判定“当前未运行中断注入消息对应的虚拟处理器”。2) The target matching module determines that "the virtual processor corresponding to the interrupt injection message is not currently running".
中断注入子模块在收到中断注入消息后,通过目标匹配模块发现应当由当前不在本逻辑处理器上运行的虚拟处理器接收此IPI中断,则将中断注入消息的详情记录到接收方异常信息存储模块,并通过接收方异常报告模块通知指令处理逻辑模块进行异常处理。指令处理逻辑模块在接收到此异常报告后,若当前正在虚拟化模式,则退出虚拟化模式;否则直接转入异常情况(如中断)处理流程。VMM软件可以通过接收方异常信息查询模块,获得指令处理逻辑模块在之前放入到接收方异常信息存储模块中的信息。After the interrupt injection sub-module receives the interrupt injection message, it finds that the IPI interrupt should be received by the virtual processor that is not currently running on the logical processor through the target matching module, and then records the details of the interrupt injection message to the receiver's exception information storage module, and notify the instruction processing logic module to perform exception handling through the exception reporting module of the receiver. After receiving the exception report, the instruction processing logic module exits the virtualization mode if it is currently in the virtualization mode; otherwise, it directly transfers to the abnormal situation (such as interruption) processing flow. The VMM software can obtain the information that the instruction processing logic module put into the receiver exception information storage module before through the receiver exception information query module.
需要指出的是,虚拟处理器地址翻译模块、虚拟处理器中断收发模块、目标匹配模块、接收方异常信息存储模块、发送方异常信息存储模块、接收方异常信息查询模块、发送方异常信息查询模块、接收方异常报告模块均是逻辑模块,两个或多个逻辑处理器完全可以共享其中的某个或某些逻辑模块的实现,比如:逻辑处理器LP_X和逻辑处理器LP_Y可能会共享虚拟处理器中断收发模块。It should be pointed out that the virtual processor address translation module, the virtual processor interrupt transceiver module, the target matching module, the receiver exception information storage module, the sender exception information storage module, the receiver exception information query module, and the sender exception information query module The exception reporting module of the receiver is a logical module, and two or more logical processors can completely share the implementation of one or some of the logical modules, for example: logical processor LP_X and logical processor LP_Y may share virtual processing Interrupt transceiver module.
本申请实施例提供的逻辑处理器具体可以是ARM处理器硬件。如图5所示,为本申请实施例的发送方的逻辑处理器和接收方的逻辑处理器之间的一种交互流程示意图。在IPI发送方的逻辑处理器进入虚拟化模式后,若获取到IPI发送指令时,则首先查找目标虚拟处理器所在的逻辑处理器,不能获得有效的逻辑处理器编号时,将IPI中断投送信息记录到VMM软件可访问的区域,然后退出虚拟化模式,并向VMM软件暴露退出原因。当能够获得有效的逻辑处理器时,利用中断信息传输机制,通知接收方逻辑处理器进行虚拟中断注入,其中,被传输的中断信息中还可以包含虚拟中断相关信息。接收方的逻辑处理器收到中断信息后,通过目标匹配模块的匹配逻辑判断当前是否正在运行目标虚拟处理器,若是,则进行虚拟中断注入,否则就转到异常处理。The logical processor provided in the embodiment of the present application may specifically be ARM processor hardware. As shown in FIG. 5 , it is a schematic diagram of an interaction flow between the logic processor of the sender and the logic processor of the receiver in the embodiment of the present application. After the logical processor of the IPI sender enters the virtualization mode, if the IPI sending command is obtained, it will first search for the logical processor where the target virtual processor is located, and if the valid logical processor number cannot be obtained, the IPI interrupt will be sent The information is recorded to an area accessible by the VMM software, and then the virtualization mode is exited, and the exit reason is exposed to the VMM software. When a valid logical processor can be obtained, the interrupt information transmission mechanism is used to notify the recipient logical processor to perform virtual interrupt injection, wherein the transmitted interrupt information may also include information related to the virtual interrupt. After the receiver's logic processor receives the interrupt information, it judges whether the target virtual processor is currently running through the matching logic of the target matching module, and if so, injects the virtual interrupt, otherwise it turns to exception handling.
图6是本申请实施例中发送方的逻辑处理器和接收方的逻辑处理器之间的另一种交互流程示意图。主要包括如下过程:Fig. 6 is a schematic diagram of another interaction flow between the logic processor of the sender and the logic processor of the receiver in the embodiment of the present application. It mainly includes the following processes:
步骤一,设置“投送中断”时所使用的中断号,例如假设设置的中断号为中断vec。在逻辑处理器进入虚拟化模式后,执行IPI发送指令或其他指令,比如计算cpu指令、定时器指令。其中,该中断号用于区分不同虚拟处理器的中断。Step 1: Set the interrupt number used when "delivering interrupts", for example, assume that the set interrupt number is interrupt vec. After the logical processor enters the virtualization mode, it executes the IPI to send instructions or other instructions, such as computing cpu instructions and timer instructions. Wherein, the interrupt number is used to distinguish interrupts of different virtual processors.
步骤二,若执行IPI发送指令后,退出虚拟化模式,则判断退出原因,若原因是“虚拟化模式下投送虚拟中断”,则使用中断号继续执行IPI中断发送指令;若是其他原因,则执行其他处理逻辑。Step 2: If the virtualization mode is exited after executing the IPI sending command, determine the reason for the exit. If the reason is "virtual interrupt delivery in virtualization mode", use the interrupt number to continue executing the IPI interrupt sending command; if it is for other reasons, then Execute other processing logic.
步骤三,使用中断号继续执行IPI中断发送指令,判断之前在虚拟化模式下投送IPI是否失败,若是投送IPI失败,则根据当前的目标逻辑处理器更新虚拟处理器到逻辑处理器的路由信息,然后清除注入失败信息,最后进行虚拟中断的注入;若不是投送IPI失败,则直接进行虚拟中断的注入。Step 3: Use the interrupt number to continue to execute the IPI interrupt sending command, and judge whether the IPI delivery failed in the virtualization mode before, and if the IPI delivery fails, update the route from the virtual processor to the logical processor according to the current target logical processor information, then clear the injection failure information, and finally inject the virtual interrupt; if it is not a failure to deliver the IPI, then directly inject the virtual interrupt.
图7为本申请实施例中处理器socket包括的模块示意图。处理器socket中所包含的主要相关模块:FIG. 7 is a schematic diagram of modules included in the processor socket in the embodiment of the present application. The main related modules included in the processor socket:
每个处理器socket都对应一个用来指示“本socket所包含的逻辑处理器编号”的位图lp_bitmap。Each processor socket corresponds to a bitmap lp_bitmap used to indicate "the logical processor number contained in this socket".
每个逻辑处理器都对应一个存储了<vmid,虚拟处理器,ntr>的投送中断存储区域pintr_info,其中,中断存储区域存储的“虚拟处理器”为虚拟IPI中断的目标虚拟处理器编号,vmid为目标虚拟处理器所在vm的编号,intr为被投送的虚拟IPI中断所包含的相关信息,如虚拟IPI中断号、投送方式等。Each logical processor corresponds to a delivery interrupt storage area pintr_info that stores <vmid, virtual processor, ntr>, where the "virtual processor" stored in the interrupt storage area is the target virtual processor number of the virtual IPI interrupt, vmid is the number of the vm where the target virtual processor is located, and intr is the relevant information contained in the delivered virtual IPI interrupt, such as the virtual IPI interrupt number and delivery method.
在运行虚拟处理器时,每个逻辑处理器都对应一个存储了<虚拟处理器,vmid,intr>的投送失败存储区f_info,其中“虚拟处理器”为虚拟IPI中断的目标虚拟处理器编号,vmid为目标虚拟处理器所在的虚拟机的编号,intr为被投送的虚拟IPI中断所包含的相关信息,如虚拟IPI中断号、投送方式。另外,本申请实施例还具有向VMM软件暴露此信息的机制。When running a virtual processor, each logical processor corresponds to a delivery failure storage area f_info that stores <virtual processor, vmid, intr>, where "virtual processor" is the target virtual processor number of the virtual IPI interrupt , vmid is the number of the virtual machine where the target virtual processor is located, and intr is the relevant information contained in the delivered virtual IPI interrupt, such as the virtual IPI interrupt number and delivery method. In addition, the embodiment of the present application also has a mechanism for exposing this information to the VMM software.
在运行虚拟处理器时,每个逻辑处理器都记录了当前虚拟处理器的编号和当前虚拟处理器所在VM的编号vmid。When running a virtual processor, each logical processor records the number of the current virtual processor and the number vmid of the VM where the current virtual processor is located.
在运行虚拟处理器时,每个逻辑处理器都对应一个根据虚拟处理器编号进行索引的虚拟处理器到逻辑处理器路由表,逻辑处理器只能访问自己对应的虚拟处理器到逻辑处理器路由表。When running virtual processors, each logical processor corresponds to a virtual processor to logical processor routing table indexed according to the virtual processor number, and the logical processor can only access its corresponding virtual processor to logical processor routing surface.
逻辑处理器提供“虚拟中断注入通知”的接收端硬件接口notify_if,接收端和发送端位于同一个处理器socket。The logical processor provides the hardware interface notify_if of the receiving end of "virtual interrupt injection notification", and the receiving end and the sending end are located in the same processor socket.
逻辑处理器提供“虚拟中断注入通知转IPI中断号”的设置接口failed_vec。The logical processor provides the setting interface failed_vec of "virtual interrupt injection notification transfer to IPI interrupt number".
逻辑处理器提供“接收虚拟中断注入消息”的硬件接口recv_if,接收端和发送端位于不同的处理器socket。虚拟IPI的发送方所在的lpcpu可通过此接口传递包括接收方所在的逻辑处理器编号、接收虚拟IPI的虚拟处理器编号、接收虚拟IPI的虚拟处理器所在的VM的编号、虚拟IPI的详情(如中断号、发送方式);The logical processor provides the hardware interface recv_if for "receiving virtual interrupt injection messages", and the receiving end and sending end are located in different processor sockets. The lpcpu where the sender of the virtual IPI is located can pass this interface, including the number of the logical processor where the receiver is located, the number of the virtual processor that receives the virtual IPI, the number of the VM where the virtual processor that receives the virtual IPI is located, and the details of the virtual IPI ( Such as interrupt number, sending method);
每个逻辑处理器都对应一个pintr_info仲裁逻辑,仲裁逻辑的输入为每个socket内其他逻辑处理器的pintr_info请求线、本逻辑处理器的recv_if处理逻辑,如对于一个具有24个逻辑处理器的socket而言,每个逻辑处理器的仲裁逻辑包含23条来自其它逻辑处理器的pintr_info请求线、1条来自recv_if处理逻辑的请求线。当pintr_info仲裁逻辑同时接收到多个pintr_info发送请求时,按照轮流的方式,放行某一个pintr_info发送请求,以免多个发送方同时写pintr_info存储区造成信息丢失。Each logical processor corresponds to a pintr_info arbitration logic. The input of the arbitration logic is the pintr_info request line of other logical processors in each socket and the recv_if processing logic of this logical processor. For example, for a socket with 24 logical processors Specifically, the arbitration logic of each logical processor includes 23 pintr_info request lines from other logical processors and 1 request line from the recv_if processing logic. When the pintr_info arbitration logic receives multiple pintr_info sending requests at the same time, it releases a certain pintr_info sending request in a turn-by-turn manner, so as to avoid information loss caused by multiple senders writing the pintr_info storage area at the same time.
需要说明的是,投送失败存储区域f_info、虚拟处理器到物理处理器(即逻辑处理器)路由表、虚拟处理器id、vmid与逻辑处理器并不一定是一一对应关系,比如,对于X86处理器来说,f_info、虚拟处理器到逻辑处理器路由表、虚拟处理器id、vmid可以被定义在vmcs控制结构中,从而在执行不同的虚拟处理器时,由于切换了vmcs,逻辑处理器自动换用不同的f_info、虚拟处理器到逻辑处理器路由表、虚拟处理器id和vmid。另外,处理器socket对应的lp_bitmap可以由逻辑处理器在执行“设置逻辑处理器编号指令”时,自动维护,也可以由系统软件或虚拟化管理软件进行维护。It should be noted that there is not necessarily a one-to-one correspondence between delivery failure storage area f_info, virtual processor to physical processor (that is, logical processor) routing table, virtual processor id, vmid and logical processors. For example, for For X86 processors, f_info, virtual processor to logical processor routing table, virtual processor id, and vmid can be defined in the vmcs control structure, so that when executing different virtual processors, due to the switching of vmcs, the logical processing The processor automatically switches to a different f_info, virtual processor to logical processor routing table, virtual processor id, and vmid. In addition, the lp_bitmap corresponding to the processor socket can be automatically maintained by the logical processor when executing the "instruction for setting logical processor number", or can be maintained by system software or virtualization management software.
如图8所示,为本申请实施例提供的虚拟化模式下逻辑处理器执行IPI发送指令时的流程示意图。在虚拟化模式运行的处理器按照如下方式执行IPI中断发送指令:As shown in FIG. 8 , it is a schematic flowchart of a logical processor executing an IPI sending instruction in a virtualization mode provided by the embodiment of the present application. A processor running in virtualization mode executes the IPI interrupt sending instruction as follows:
1)、若不能唯一确定IPI中断发送指令中指定的接收者,则转到步骤11)。1) If the recipient specified in the IPI interrupt sending instruction cannot be uniquely determined, go to step 11).
2)、根据虚拟处理器到物理处理器路由表,查找目标虚拟处理器所在的逻辑处理器lpcpu。2) Find the logical processor lpcpu where the target virtual processor is located according to the routing table from the virtual processor to the physical processor.
3)、若当前socket所对应的lp_bitmap不包括步骤1)获得的lpcpu,则转到步骤8),若包括步骤1)得到的lpCPU,转到步骤4)。3), if the lp_bitmap corresponding to the current socket does not include the lpcpu obtained in step 1), then go to step 8), if it includes the lpCPU obtained in step 1), go to step 4).
4)、指令处理逻辑模块向lpcpu的pintr_info仲裁逻辑发送请求,等待其放行信号。4) The instruction processing logic module sends a request to the pintr_info arbitration logic of the lpcpu, and waits for its release signal.
5)、将当前逻辑处理器对应的vmid、IPI发送指令所指定的目标虚拟处理器编号、IPI发送指令所指定的IPI中断详情(如中断号、发送方式)放入lpcpu的投送中断存储区pintr_info。步骤5执行之后,执行步骤9)。5), put the vmid corresponding to the current logical processor, the target virtual processor number specified by the IPI sending instruction, and the IPI interrupt details (such as interrupt number, sending method) specified by the IPI sending instruction into the delivery interrupt storage area of lpcpu pintr_info. After step 5 is executed, step 9) is executed.
6)、利用notify_if,通知lpcpu进行虚拟IPI中断的注入。6) Use notify_if to notify lpcpu to inject virtual IPI interrupt.
7)、IPI中断发送指令执行结束。7) The execution of the IPI interrupt sending instruction ends.
8)、若lpcpu不是合法的逻辑处理器编号,则转到步骤11)。8). If lpcpu is not a legal logical processor number, go to step 11).
9)、利用recv_if,向目标lpcpu发送虚拟中断注入消息。9). Using recv_if, send a virtual interrupt injection message to the target lpcpu.
10)、IPI中断发送指令执行结束。10). The execution of the IPI interrupt sending instruction ends.
11)、将目标虚拟处理器编号(或编号的集合)、IPI发送指令所指定的IPI中断详情记入当前的投送失败存储区f_info,且将f_info中的vmid设置为无效值。11) Record the target virtual processor number (or a set of numbers) and the IPI interrupt details specified by the IPI sending instruction into the current delivery failure storage area f_info, and set the vmid in f_info to an invalid value.
12)、退出虚拟化模式。12) Exit the virtualization mode.
如图9所示,为本申请实施例提供的虚拟化模式下逻辑处理器检测到notify_if中有信息后的处理流程示意图。在虚拟化模式运行的逻辑处理器通过notify_if接收到虚拟中断注入通知时,执行包括如下步骤的流程:As shown in FIG. 9 , it is a schematic diagram of the processing flow after the logical processor detects that there is information in notify_if in the virtualization mode provided by the embodiment of the present application. When a logical processor running in virtualization mode receives a virtual interrupt injection notification through notify_if, it executes a process including the following steps:
1)、将本逻辑处理器对应的pintr_info信息缓存到cached_info临时存储区中;1), cache the pintr_info information corresponding to this logic processor in the cached_info temporary storage area;
2)、若当前逻辑处理器对应的虚拟处理器id不等于cached_info中记录的虚拟处理器编号,或当前逻辑处理器对应的vmid不等于cached_info中记录的vmid,则转到步骤5);2), if the virtual processor id corresponding to the current logical processor is not equal to the virtual processor number recorded in cached_info, or the vmid corresponding to the current logical processor is not equal to the vmid recorded in cached_info, then go to step 5);
3)、按照cached_info记录的信息,向当前虚拟处理器注入虚拟中断;3), according to the information recorded in cached_info, inject a virtual interrupt into the current virtual processor;
4)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求,并结束处理过程;4), notify the pintr_info arbitration logic to release the next pintr_info sending request, and end the processing process;
5)、根据cached_info中的信息,填写本逻辑处理器的f_info,其vmid为cached_info中的对应值;5), according to the information in cached_info, fill in the f_info of this logical processor, and its vmid is the corresponding value in cached_info;
6)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求,并退出虚拟化运行模式,结束对于“虚拟中断注入通知”的处理。6) Notify the pintr_info arbitration logic to release the next pintr_info sending request, exit the virtualization operation mode, and end the processing of "virtual interrupt injection notification".
需要说明的是,在运行虚拟处理器前,VMM利用failed_vec接口,设置notify_vector:“虚拟中断注入失败后,通过notify_if接收到虚拟中断注入通知,或者通过recv_if接收到虚拟中断注入消息的逻辑处理器所接收到的IPI中断的编号”。It should be noted that before running the virtual processor, the VMM uses the failed_vec interface to set notify_vector: "After the virtual interrupt injection fails, the logical processor that receives the virtual interrupt injection notification through notify_if or receives the virtual interrupt injection message through recv_if The number of the IPI interrupt received".
接下来针对notify_if和recv_if这两种实现场景对接收端的逻辑处理器的执行流程进行举例说明,在非虚拟化模式运行的逻辑处理器通过notify_if接收到虚拟中断注入通知时,执行包括如下步骤的流程:Next, for the two implementation scenarios of notify_if and recv_if, an example is given to illustrate the execution flow of the logical processor at the receiving end. When the logical processor running in the non-virtualization mode receives the virtual interrupt injection notification through notify_if, it executes the flow including the following steps :
1)、将本逻辑处理器对应的pintr_info信息缓存到cached_info临时存储区中。1) Caching the pintr_info information corresponding to this logical processor into the cached_info temporary storage area.
2)、根据cached_info中的信息,填写本逻辑处理器的f_info,其vmid为cached_info中的对应值。2) According to the information in cached_info, fill in the f_info of this logical processor, and its vmid is the corresponding value in cached_info.
3)、通知pintr_info仲裁逻辑可以放行下一个pintr_info发送请求。3) Notify the pintr_info arbitration logic that the next pintr_info sending request can be released.
4)、执行notify_vector所对应的中断处理程序。4). Execute the interrupt handler corresponding to notify_vector.
5)、结束对于虚拟中断注入通知的处理。5). End the processing of the virtual interrupt injection notification.
逻辑处理器通过recv_if接收到虚拟中断注入消息时,执行包括如下步骤的流程:When the logical processor receives a virtual interrupt injection message through recv_if, it executes a process including the following steps:
1)、将消息中包含的目的虚拟处理器编号、目的vm编号,IPI中断详情放入cached_info临时存储区域。1) Put the destination virtual processor number, destination vm number, and IPI interrupt details included in the message into the cached_info temporary storage area.
2)、向虚拟中断注入消息中指定的目的逻辑处理器的pintr_info仲裁逻辑发送请求,等待其放行信号。2) Send a request to the pintr_info arbitration logic of the destination logical processor specified in the virtual interrupt injection message, and wait for its release signal.
3)、将cached_info中所包含的信息放入lpcpu的投送中断存储区pintr_info。3) Put the information contained in the cached_info into the delivery interrupt storage area pintr_info of the lpcpu.
4)、利用notify_if,通知当前逻辑处理器进行虚拟IPI中断的注入。4) Use notify_if to notify the current logical processor to inject virtual IPI interrupts.
5)、结束对于虚拟中断注入消息的处理。5). End the processing of the virtual interrupt injection message.
运行于在非虚拟化模式下的逻辑处理器在执行IPI中断发送指令时,发现此指令的执行将导致某个虚拟处理器接收到虚拟IPI中断,则在按照标准方式执行此IPI发送指令之外,还额外执行包括如下步骤的流程:When a logical processor running in non-virtualization mode executes an IPI interrupt sending instruction, and finds that the execution of this instruction will cause a virtual processor to receive a virtual IPI interrupt, then in addition to executing the IPI sending instruction in a standard manner , additionally executes a process that includes the following steps:
1)、若当前逻辑处理器的f_info信息中包含的vmid为有效值,则处理结束。否则继续下面的过程。1) If the vmid contained in the f_info information of the current logical processor is a valid value, the processing ends. Otherwise continue with the process below.
2)、获得当前IPI中断发送指令所对应的逻辑处理器编号dest_cpu。2) Obtain the logical processor number dest_cpu corresponding to the current IPI interrupt sending instruction.
3)、根据当前逻辑处理器的f_info信息,获得目标虚拟处理器编号为dest_虚拟处理器。3) According to the f_info information of the current logical processor, the number of the target virtual processor is obtained as dest_virtual processor.
4)、更新当前逻辑处理器的虚拟处理器到逻辑处理器路由表中,dest_虚拟处理器所对应的逻辑处理器为dest_cpu。4) Update the virtual processor of the current logical processor to the logical processor routing table, and the logical processor corresponding to the dest_virtual processor is dest_cpu.
5)、处理结束。5) The processing ends.
本申请的前述实施例中,逻辑处理器都包含一个虚拟处理器到逻辑处理器路由表,该虚拟处理器到逻辑处理器路由表对VMM软件透明,即VMM软件是无感知的。在虚拟化模式下,逻辑处理器执行IPI发送指令时,会根据此路由表,将目标虚拟处理器编号翻译为逻辑处理器编号,并向翻译后得到的逻辑处理器提交虚拟IPI中断注入通知。逻辑处理器在收到虚拟IPI中断注入通知后,在确认当前正在运行此虚拟IPI中断对应的目标虚拟处理器时,才向当前虚拟处理器注入虚拟IPI中断;在非虚拟化模式下逻辑处理器在执行IPI发送指令时,会自动填充虚拟处理器到逻辑处理器路由表中的相应表项。In the foregoing embodiments of the present application, the logical processors all include a virtual processor-to-logical processor routing table, and the virtual processor-to-logical processor routing table is transparent to the VMM software, that is, the VMM software is unaware. In the virtualization mode, when the logical processor executes the IPI sending instruction, it will translate the target virtual processor number into a logical processor number according to the routing table, and submit a virtual IPI interrupt injection notification to the translated logical processor. After the logical processor receives the virtual IPI interrupt injection notification, it injects the virtual IPI interrupt into the current virtual processor when it confirms that it is currently running the target virtual processor corresponding to the virtual IPI interrupt; in the non-virtualization mode, the logical processor When the IPI is executed to send an instruction, the corresponding entry in the routing table from the virtual processor to the logical processor will be automatically filled.
本申请实施例可以保证逻辑处理器可以在虚拟化模式直接向某个正在运行的虚拟处理器发送IPI中断,且能够处理“目标虚拟处理器当前实际并未运行”的情形。The embodiment of the present application can ensure that the logical processor can directly send an IPI interrupt to a running virtual processor in the virtualization mode, and can handle the situation that "the target virtual processor is not currently actually running".
在本申请实施例中,发送方的逻辑处理器可以根据路由逻辑仅能获得目标虚拟处理器所在的逻辑处理器,并不直接操纵目标虚拟处理器的中断描述信息。这种方式的优点是:1)在路由表非全局共享时,本申请实施例可以实现自适应的构建路由表。2)在虚拟中断投送时,逻辑处理器之间只有一种信息传输通道(即中断投送信息),因此无需针对多种类型信息传递时需要解决的信息同步问题,简化了两个逻辑处理器之间的处理过程。In the embodiment of the present application, the logical processor of the sender can only obtain the logical processor where the target virtual processor is located according to the routing logic, and does not directly manipulate the interrupt description information of the target virtual processor. The advantages of this method are: 1) When the routing table is not shared globally, the embodiment of the present application can implement self-adaptive construction of the routing table. 2) During virtual interrupt delivery, there is only one information transmission channel between logical processors (that is, interrupt delivery information), so there is no need to solve the information synchronization problem that needs to be solved when transmitting multiple types of information, and the two logic processes are simplified processing between processors.
本申请的另一些实施例,VM的虚拟处理器到逻辑处理器路由表不再是逻辑处理器私有的数据结构,而是一个由整个处理器socket内所有的逻辑处理器共享使用全局数据结构。举例说明,根据<vm编号,虚拟处理器编号>的散列值,将<vm编号,虚拟处理器编号,逻辑处理器编号>存储在socket内的存储区域(如cache中)。当逻辑处理器加载运行虚拟处理器时(比如x86处理器加载虚拟处理器对应的VMCS数据结构时),逻辑处理器根据当前虚拟处理器的编号、当前虚拟处理器所在虚拟机的编号、当前逻辑处理器编号,更新散列表。当逻辑处理器卸载虚拟处理器时(比如x86处理器卸载虚拟处理器对应的VMCS数据结构时),逻辑处理器根据当前虚拟处理器的编号、当前虚拟处理器所在虚拟机的编号、当前逻辑处理器编号,将散列表中<vmid,虚拟处理器id>对应的表项删除。In other embodiments of the present application, the virtual processor-to-logical processor routing table of the VM is no longer a logical processor-private data structure, but a global data structure shared by all logical processors in the entire processor socket. For example, according to the hash value of <vm number, virtual processor number>, store <vm number, virtual processor number, logical processor number> in a storage area in the socket (such as in cache). When the logical processor loads and runs the virtual processor (for example, when the x86 processor loads the VMCS data structure corresponding to the virtual processor), the logical processor is based on the number of the current virtual processor, the number of the virtual machine where the current virtual processor is located, and the current logic Processor number, update the hash table. When the logical processor unloads the virtual processor (for example, when the x86 processor unloads the VMCS data structure corresponding to the virtual processor), the logical processor will process the CPU number, delete the entry corresponding to <vmid, virtual processor id> in the hash table.
本申请的前述实施例中,逻辑处理器可以避免存放虚拟处理器到逻辑处理器路由表,且路由表的构建速度更快。In the aforementioned embodiments of the present application, the logic processor can avoid storing the virtual processor to logic processor routing table, and the routing table can be built faster.
本申请的另一些实施例,虚拟处理器到逻辑处理器路由表被存放在内存中,在运行虚拟处理器时,每个逻辑处理器都对应一个虚拟处理器指针,该指针指向了虚拟处理器到逻辑处理器路由表在内存中的位置。虚拟处理器到逻辑处理器路由表与逻辑处理器并不一定是一一对应关系,比如,对于X86处理器来说,虚拟处理器指针可以被定义在vmcs结构中,从而在执行不同的虚拟处理器时,由于切换了vmcs,逻辑处理器自动换用不同的虚拟处理器子帧。In other embodiments of the present application, the virtual processor to logical processor routing table is stored in the memory, and when the virtual processor is running, each logical processor corresponds to a virtual processor pointer, which points to the virtual processor to the location in memory of the logical processor routing table. The virtual processor to logical processor routing table does not necessarily have a one-to-one correspondence with logical processors. For example, for X86 processors, virtual processor pointers can be defined in the vmcs structure to perform different virtual processing When the processor is switched, the logical processor automatically switches to a different virtual processor subframe due to the switching of the vmcs.
当虚拟处理器到逻辑处理器路由表被存放在允许处理器进行缓存的内存区域时,处理器可以利用其高速缓存机制,实现对于虚拟处理器到逻辑处理器路由表的快速检索。When the VP-to-LP routing table is stored in a memory area that allows the processor to cache, the processor can use its cache mechanism to quickly retrieve the VP-to-LP routing table.
当逻辑处理器加载运行虚拟处理器时(比如x86处理器加载虚拟处理器对应的VMCS数据结构时),逻辑处理器直接设置虚拟处理器指针(即虚拟处理器_rte)所指向的虚拟处理器到逻辑处理器路由表。比如:若虚拟处理器子帧的值为0x10000、路由表中每个表项占用2个字节,当逻辑处理器10在加载编号为80的虚拟处理器时,逻辑处理器10将把内存0x100a0处的2个字节设置为10。When the logical processor loads and runs the virtual processor (for example, when the x86 processor loads the VMCS data structure corresponding to the virtual processor), the logical processor directly sets the virtual processor pointed to by the virtual processor pointer (ie virtual processor _rte) to the logical processor routing table. For example: if the value of the virtual processor subframe is 0x10000, and each entry in the routing table occupies 2 bytes, when the logical processor 10 is loading the virtual processor numbered 80, the logical processor 10 will use the memory 0x100a0 The 2 bytes at are set to 10.
当逻辑处理器卸载虚拟处理器时(比如x86处理器卸载虚拟处理器对应的VMCS数据结构时),逻辑处理器直接清除虚拟处理器到逻辑处理器路由表中的相应表项。比如:若虚拟处理器指针的值为0x10000、路由表中每个表项占用2个字节,当逻辑处理器10在卸载编号为80的虚拟处理器时,逻辑处理器10将把内存0x100a0处的2个字节设置为无效值(如0xffff)。When the logical processor unloads the virtual processor (for example, when the x86 processor unloads the VMCS data structure corresponding to the virtual processor), the logical processor directly clears the corresponding entry in the routing table from the virtual processor to the logical processor. For example: if the value of the virtual processor pointer is 0x10000, and each entry in the routing table occupies 2 bytes, when the logical processor 10 unloads the virtual processor numbered 80, the logical processor 10 will put the memory at 0x100a0 2 bytes are set to an invalid value (such as 0xffff).
本申请的另一些实施例中,pintr_info中包含了src_cpu信息,其中src_cpu指示了“执行虚拟IPI发送操作的逻辑处理器编号”,比如,若虚拟处理器20当前运行编号为10的逻辑处理器上、虚拟处理器20在虚拟化模式下向虚拟处理器30发送IPI中断、当前虚拟处理器到逻辑处理器路由表指示“虚拟处理器30位于编号为11的逻辑处理器上”、且当前无其它逻辑处理器向编号为11的逻辑处理器投送中断,则虚拟处理器20本次IPI发送动作将导致编号为11的逻辑处理器的pintr_info的src_cpu变为10。In other embodiments of the present application, pintr_info includes src_cpu information, where src_cpu indicates "the logical processor number that executes the virtual IPI sending operation", for example, if the virtual processor 20 is currently running on the logical processor numbered 10 , the virtual processor 20 sends an IPI interrupt to the virtual processor 30 in the virtualization mode, the current virtual processor to the logical processor routing table indicates that "the virtual processor 30 is located on the logical processor numbered 11", and there are currently no other The logical processor sends an interrupt to the logical processor numbered 11, and the current IPI sending action of the virtual processor 20 will cause the src_cpu of the pintr_info of the logical processor numbered 11 to become 10.
如图10所示,为本申请实施例提供的虚拟化模式下逻辑处理器对于notify_if请求的处理流程示意图。在虚拟化模式运行的逻辑处理器通过notify_if接收到虚拟中断注入通知时,执行包括如下步骤的流程:As shown in FIG. 10 , it is a schematic flow diagram of a processing flow of a logical processor in a virtualization mode for a notify_if request provided by the embodiment of the present application. When a logical processor running in virtualization mode receives a virtual interrupt injection notification through notify_if, it executes a process including the following steps:
1)、将本逻辑处理器对应的pintr_info信息缓存到cached_info临时存储区中;1), cache the pintr_info information corresponding to this logic processor in the cached_info temporary storage area;
2)、若cached_info中包含的虚拟处理器编号小于0,则转到步骤15)。其中,虚拟处理器编号小于0,表示该虚拟处理器不合法。2) If the virtual processor number contained in cached_info is less than 0, go to step 15). Wherein, if the number of the virtual processor is less than 0, it means that the virtual processor is illegal.
3)、若当前逻辑处理器对应的虚拟处理器id不等于cached_info中记录的虚拟处理器编号,或当前逻辑处理器对应的vmid不等于cached_info中记录的vmid,则转到步骤6)。3) If the virtual processor id corresponding to the current logical processor is not equal to the virtual processor number recorded in cached_info, or the vmid corresponding to the current logical processor is not equal to the vmid recorded in cached_info, then go to step 6).
4)、按照cached_info记录的信息,向当前虚拟处理器注入虚拟中断。4) According to the information recorded in cached_info, a virtual interrupt is injected into the current virtual processor.
5)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求,并完成对于“虚拟中断注入通知”的处理。5) Notify the pintr_info arbitration logic to release the next pintr_info sending request, and complete the processing of "virtual interrupt injection notification".
6)、根据cached_info中的信息,填写本逻辑处理器的f_info,其vmid为cached_info中的对应值。6) According to the information in cached_info, fill in the f_info of this logical processor, and its vmid is the corresponding value in cached_info.
7)、获得cached_info中包含的src_cpu。7) Obtain the src_cpu contained in cached_info.
8)、若src_cpu不位于本socket,转到步骤9),否则转到步骤11)。8), if src_cpu is not located in this socket, go to step 9), otherwise go to step 11).
9)、向src_cpu发送recv_if消息,消息体包含的虚拟处理器编号cached_info中虚拟处理器编号的按“位”取反后的值。如:若处理器最大只能支持32767个虚拟处理器时,当cached_info中虚拟处理器编号为1,此recv_if中虚拟处理器编号为0xfffe,vm编号为cached_info中的编号。9) Send a recv_if message to src_cpu, and the value of the virtual processor number in cached_info contained in the message body is reversed by "bit". For example: if the processor can only support a maximum of 32767 virtual processors, when the virtual processor number in cached_info is 1, the virtual processor number in this recv_if is 0xfffe, and the vm number is the number in cached_info.
10)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求,并结束处理过程。10), notify the pintr_info arbitration logic to release the next pintr_info sending request, and end the processing process.
11)、向src_cpu的pintr_info仲裁逻辑发送请求,等待其放行信号。11) Send a request to the pintr_info arbitration logic of src_cpu, and wait for its release signal.
12)、将cached_info中包含的vmid、cached_info中虚拟处理器编号按“位”取反后的值放入src_cpu的投送中断存储区pintr_info。12) Put the vmid included in cached_info and the value of the virtual processor number in cached_info inverted according to "bit" into pintr_info, the delivery interrupt storage area of src_cpu.
13)、利用notify_if,通知src_cpu进行虚拟IPI中断的注入。13) Use notify_if to notify src_cpu to inject virtual IPI interrupts.
14)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求、退出虚拟化运行模式,并结束对于“虚拟中断注入通知”的处理。14) Notify the pintr_info arbitration logic to release the next pintr_info sending request, exit the virtualization operation mode, and end the processing of "virtual interrupt injection notification".
15)、将cached_info中所包含的虚拟处理器编号按“位”取反,获得真实的虚拟处理器编号r虚拟处理器。15) Invert the number of the virtual processor included in the cached_info according to "bits" to obtain the real virtual processor number r virtual processor.
16)、若当前逻辑处理器对应的vmid与cached_info中指定的虚拟机编号相等,则将逻辑处理器所使用的虚拟处理器到逻辑处理器路由表中,r虚拟处理器对应的表项设置为无效值。16), if the vmid corresponding to the current logical processor is equal to the virtual machine number specified in cached_info, then set the virtual processor used by the logical processor to the logical processor routing table, and the entry corresponding to the r virtual processor is set to Invalid value.
17)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求,并完成对于虚拟中断注入通知的处理。17) Notify the pintr_info arbitration logic to release the next pintr_info sending request, and complete the processing of the virtual interrupt injection notification.
在非虚拟化模式运行的逻辑处理器通过notify_if接收到虚拟中断注入通知时,执行包括如下步骤的流程:When a logical processor running in non-virtualization mode receives a virtual interrupt injection notification through notify_if, it executes a process including the following steps:
1)、将本逻辑处理器对应的pintr_info信息缓存到cached_info临时存储区中。1) Caching the pintr_info information corresponding to this logical processor into the cached_info temporary storage area.
2)、若cached_info中包含的虚拟处理器编号小于0,则转到步骤5)。2) If the virtual processor number contained in cached_info is less than 0, go to step 5).
3)、根据cached_info中的信息,填写本逻辑处理器的f_info,其vmid为cached_info中的对应值。3) According to the information in cached_info, fill in the f_info of this logical processor, and its vmid is the corresponding value in cached_info.
4)、通知pintr_info仲裁逻辑可以放行下一个pintr_info发送请求,并执行notify_vector所对应的中断处理程序,且结束对于虚拟中断注入通知的处理;4), notify the pintr_info arbitration logic to release the next pintr_info sending request, and execute the interrupt handler corresponding to notify_vector, and end the processing of the virtual interrupt injection notification;
5)、将cached_info中所包含的虚拟处理器编号按“位”取反,获得真实的虚拟处理器编号r虚拟处理器。5) Invert the virtual processor number contained in cached_info according to "bits" to obtain the real virtual processor number r virtual processor.
6)、若逻辑处理器对应的vmid与cached_info中指定的虚拟机编号相同,则将逻辑处理器所使用的虚拟处理器到逻辑处理器路由表中,r虚拟处理器对应的表项设置为无效值。6) If the vmid corresponding to the logical processor is the same as the virtual machine number specified in cached_info, set the virtual processor used by the logical processor to the logical processor routing table, and set the entry corresponding to the r virtual processor to invalid value.
7)、通知pintr_info仲裁逻辑放行下一个pintr_info发送请求,完成对于虚拟中断注入通知的处理。7) Notify the pintr_info arbitration logic to release the next pintr_info sending request, and complete the processing of the virtual interrupt injection notification.
本申请的另一些实施例中,逻辑处理器还提供修改虚拟处理器到物理处理器路由表的支持机制(如指令、特定寄存器等)。例如一种可行的实现方式是,在此支持机制被触发时,当前逻辑处理器对自身可访问的虚拟处理器到物理处理器路由表进行修改。又如另一种可行的实现方式是:逻辑处理器可利用处理器间通信机制,通知其它逻辑处理器修改虚拟处理器到逻辑处理器路由表。In other embodiments of the present application, the logical processor also provides a support mechanism (such as instructions, specific registers, etc.) for modifying the routing table from the virtual processor to the physical processor. For example, a feasible implementation manner is that when the support mechanism is triggered, the current logical processor modifies the routing table from virtual processors to physical processors accessible to itself. As another example, another feasible implementation manner is: a logical processor may use an inter-processor communication mechanism to notify other logical processors to modify the virtual processor-to-logical processor routing table.
本申请实施例可以给软件更大的自由度,方便进行虚拟处理器到逻辑处理器路由表的构建。相对于前述实施例,本申请实施例可以由软件实现非频繁出现的“需要通知IPI发送方更新虚拟处理器到逻辑处理器路由表”情形,从而简化处理器的硬件设计。The embodiment of the present application can give the software more freedom and facilitate the construction of the routing table from virtual processors to logical processors. Compared with the foregoing embodiments, the embodiment of the present application can implement the infrequently occurring situation of "need to notify the IPI sender to update the virtual processor to logical processor routing table" by software, thereby simplifying the hardware design of the processor.
本申请实施例可以包括如下的技术方案:Embodiments of the present application may include the following technical solutions:
(一)逻辑处理器具有“可获得虚拟处理器到逻辑处理器对应关系“的机制,即逻辑处理器新增配置“根据虚拟处理器编号查询此虚拟处理器当前所在的逻辑处理器编号”的功能,即新增“虚拟处理器地址翻译模块”等功能,发送方根据路由逻辑仅能获得目标虚拟处理器所在的逻辑处理器,并不直接操纵目标虚拟处理器的中断描述信息:(1) Logical processors have the mechanism of "obtaining the corresponding relationship between virtual processors and logical processors", that is, the newly added configuration of logical processors "query the logical processor number where this virtual processor is currently located according to the virtual processor number" Functions, that is, adding functions such as "virtual processor address translation module", the sender can only obtain the logical processor where the target virtual processor is located according to the routing logic, and does not directly manipulate the interrupt description information of the target virtual processor:
1、可以是逻辑处理器内部私有的虚拟处理器到逻辑处理器路由表;1. It can be a private virtual processor to logical processor routing table inside the logical processor;
2、可以是被socket内所有逻辑处理器共享的<vm标识,虚拟处理器标识>到逻辑处理器路由表;2. It can be the routing table from <vm ID, virtual processor ID> shared by all logical processors in the socket to the logical processor;
3、可以是存放在内存中的、对应每个虚拟机一份的、虚拟处理器到逻辑处理器路由表,且逻辑处理器内部记录了此虚拟机唯一路由表的内存地址;3. It can be a virtual processor-to-logical processor routing table stored in memory, corresponding to each virtual machine, and the logical processor internally records the memory address of the unique routing table of this virtual machine;
4、多个逻辑处理器之间的“虚拟处理器地址翻译模块”等可以共享;4. The "virtual processor address translation module" among multiple logical processors can be shared;
5、在路由表非全局共享时,本方式可以实现自适应的构建路由表(见实施例1的说明);5. When the routing table is not shared globally, this method can realize self-adaptive construction of the routing table (see the description of embodiment 1);
6、在虚拟中断投送时,逻辑处理器之间只有一种信息传输通道(中断投送信息)。6. During virtual interrupt delivery, there is only one information transmission channel (interrupt delivery information) between logical processors.
(二)逻辑处理器具有在虚拟化模式下不借助VMM,通过获得的目标逻辑处理器新增的“虚拟处理器地址翻译模块”监控目标虚拟处理器是否正在运行,从而判断是否需要VMM软件的介入:(2) The logical processor has the ability to monitor whether the target virtual processor is running through the newly added "virtual processor address translation module" of the obtained target logical processor without the help of VMM, so as to determine whether VMM software is needed intervention:
1、若判断显示当前目标虚拟处理器正在运行,发送方通过新增的“虚拟处理器中断收发模块”的“发送端接口”子模块将虚拟IPI中断注入请求发送到目标逻辑处理器中新增的“虚拟处理器中断收发模块”的“中断注入”子模块:1. If the judgment shows that the current target virtual processor is running, the sender sends the virtual IPI interrupt injection request to the target logical processor through the "send interface" sub-module of the newly added "virtual processor interrupt transceiver module". The "interrupt injection" submodule of the "virtual processor interrupt transceiver module":
当目标逻辑处理器的中断注入子模块接收到来自其他逻辑处理器的中断注入消息时,新增的“目标匹配模块”判定当前是否正在运行“中断注入消息对应的虚拟处理器”:When the interrupt injection submodule of the target logical processor receives an interrupt injection message from another logical processor, the newly added "target matching module" determines whether the "virtual processor corresponding to the interrupt injection message" is currently running:
1)若判断正在运行,则直接通知指令处理逻辑模块对当前的虚拟处理器注入IPI中断,完成IPI中断直通;1) If it is determined that it is running, the instruction processing logic module is directly notified to inject an IPI interrupt into the current virtual processor to complete the IPI interrupt pass-through;
2)若判断未在运行,则将中断注入消息的详情记录到接收方新增的“异常信息存储模块”,并通过接收方新增的“异常报告模块”通知指令处理逻辑模块进行异常处理。指令处理逻辑模块在接收到此异常报告后,若当前正在虚拟化模式,则退出虚拟化模式;否则直接转入异常情况(如中断)处理流程。2) If it is judged that it is not running, record the details of the interrupt injection message to the newly added "abnormal information storage module" of the receiver, and notify the instruction processing logic module to handle the exception through the newly added "abnormal report module" of the receiver. After the instruction processing logic module receives the exception report, if it is currently in the virtualization mode, it exits the virtualization mode; otherwise, it directly transfers to the abnormal situation (such as interruption) processing flow.
2、若判断显示当前目标虚拟处理器处于未运行或阻塞状态,将IPI发送指令的详情写入发送方异常信息存储模块,并退出虚拟化模式。VMM软件可以通过发送方异常信息查询模块,获得指令处理逻辑模块在之前放入在发送方异常信息存储模块中的信息。2. If it is determined that the current target virtual processor is not running or blocked, write the details of the IPI sending instruction into the sender exception information storage module, and exit the virtualization mode. The VMM software can obtain the information stored in the sender exception information storage module by the instruction processing logic module through the sender exception information query module.
3、多个逻辑处理器之间的“虚拟处理器中断收发模块”等可以共享。3. The "virtual processor interrupt transceiver module" among multiple logical processors can be shared.
(三)在逻辑处理器因虚拟处理器执行IPI发送指令而退出虚拟化模式时,参考如上(一)(二)机制,逻辑处理器通过新增配置“发送方异常信息存储/查询模块”,“接收方异常报告模块”、“接收方异常信息存储/查询模块”等功能,具有向VMM软件暴露目标虚拟处理器编号和虚拟IPI中断详情的功能,从而使得VMM软件可以在逻辑处理器退出虚拟化模式后,查询获得退出的原因,进而采用传统模式完成虚拟IPI的发送过程。(3) When the logical processor exits the virtualization mode due to the execution of the IPI sending instruction by the virtual processor, referring to the above (1) (2) mechanism, the logical processor configures the "sender exception information storage/query module" newly, Functions such as "receiver exception report module" and "receiver exception information storage/query module" have the function of exposing the target virtual processor number and virtual IPI interrupt details to the VMM software, so that the VMM software can exit the virtual After the virtualization mode, query the reason for the exit, and then use the traditional mode to complete the sending process of the virtual IPI.
首先,本申请实施例解决如下的问题:发送IPI中断时需要指定接收方的逻辑处理器编号,但HVM无法获得目标处理器编号,若HVM采用标准的IPI发送逻辑,IPI将被送到错误的逻辑处理器。First of all, the embodiment of the present application solves the following problem: when sending an IPI interrupt, it is necessary to specify the logical processor number of the receiver, but the HVM cannot obtain the target processor number. If the HVM uses the standard IPI sending logic, the IPI will be sent to the wrong logical processor.
本申请实施例中,逻辑处理器通过新增的“虚拟处理器地址翻译模块”具有“可获得虚拟处理器到逻辑处理器对应关系“的机制;In the embodiment of this application, the logical processor has a mechanism of "obtaining the corresponding relationship between virtual processors and logical processors" through the newly added "virtual processor address translation module";
本申请实施例中,HVM可通过“虚拟处理器地址翻译模块”获得目标逻辑处理器的编号。发送方根据路由逻辑仅能获得目标虚拟处理器所在的逻辑处理器,并不直接操纵目标虚拟处理器的中断描述信息。这种方式的优点是:1)在路由表非全局共享时,本方式可以实现自适应的构建路由表。2)在虚拟中断投送时,逻辑处理器之间只有一种信息传输通道(中断投送信息)。In the embodiment of the present application, the HVM can obtain the serial number of the target logical processor through the "virtual processor address translation module". The sender can only obtain the logical processor where the target virtual processor is located according to the routing logic, and does not directly manipulate the interrupt description information of the target virtual processor. The advantages of this method are: 1) When the routing table is not shared globally, this method can implement self-adaptive construction of the routing table. 2) During virtual interrupt delivery, there is only one information transmission channel (interrupt delivery information) between logical processors.
其次,现有技术的虚拟处理器必须借助VMM发送IPI中断,若允许直接发送IPI中断,则恶意的虚拟机可能会通过向虚拟机没有使用的逻辑处理器发送IPI中断,造成系统死机或影响其他虚拟机的正常工作;Secondly, the virtual processors in the prior art must use the VMM to send IPI interrupts. If direct sending of IPI interrupts is allowed, a malicious virtual machine may send an IPI interrupt to a logical processor not used by the virtual machine, causing the system to crash or affect other normal operation of the virtual machine;
本申请实施例中,逻辑处理器具有在虚拟化模式下不借助VMM,通过获得的目标逻辑处理器新增的“虚拟处理器地址翻译模块”监控目标虚拟处理器是否正在运行,从而判断是否需要VMM软件的介入;In the embodiment of the present application, the logical processor has the newly added "virtual processor address translation module" of the obtained target logical processor to monitor whether the target virtual processor is running without the help of VMM in the virtualization mode, so as to determine whether it needs Intervention of VMM software;
本申请实施例中,若通过新增的“虚拟处理器地址翻译模块”监控判断目标虚拟处理器正在运行,则发出虚拟IPI中断注入请求,并且目标逻辑处理器新增的“目标匹配模块”判定当前是否正在运行“中断注入消息对应的虚拟处理器”,则可以完成HVM的虚拟处理器之间直接IPI通信。In the embodiment of the present application, if the newly added "virtual processor address translation module" monitors and judges that the target virtual processor is running, a virtual IPI interrupt injection request is issued, and the newly added "target matching module" of the target logical processor determines Whether the "virtual processor corresponding to the interrupt injection message" is currently running, the direct IPI communication between the virtual processors of the HVM can be completed.
最后,现有技术的虚拟处理器借助VMM发送IPI中断的方法,导致逻辑处理器无法正确处理“接收虚拟IPI中断的虚拟处理器当前不在运行、甚至处于阻塞状态”的情形;Finally, the prior art virtual processor sends an IPI interrupt by means of the VMM, which causes the logical processor to be unable to correctly handle the situation that "the virtual processor receiving the virtual IPI interrupt is currently not running or even in a blocked state";
本申请实施例中,在逻辑处理器因虚拟处理器执行IPI发送指令而退出虚拟化模式时,具有向VMM软件暴露目标虚拟处理器编号和虚拟IPI中断详情的功能的机制;In the embodiment of the present application, when the logical processor exits the virtualization mode because the virtual processor executes the IPI sending instruction, it has a mechanism for exposing the target virtual processor number and virtual IPI interrupt details to the VMM software;
本申请实施例中,使得VMM软件可以在逻辑处理器退出虚拟化模式后,查询获得退出的原因,进而采用传统模式完成虚拟IPI的发送过程。In the embodiment of the present application, after the logical processor exits the virtualization mode, the VMM software can inquire about the exit reason, and then use the traditional mode to complete the sending process of the virtual IPI.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.
为便于更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关装置。In order to facilitate better implementation of the above solutions in the embodiments of the present application, related devices for implementing the above solutions are also provided below.
本申请实施例还提供的一种逻辑处理器,该逻辑处理器具体为前述的第一逻辑处理器,请参阅图11所示,本申请实施例提供的第一逻辑处理器1100,可以包括:处理模块1101、发送模块1102,其中,The embodiment of the present application also provides a logical processor, which is specifically the aforementioned first logical processor. Please refer to FIG. 11 . The first logical processor 1100 provided in the embodiment of the present application may include: Processing module 1101, sending module 1102, wherein,
处理模块1101,用于当第一逻辑处理器进入虚拟化模式之后,获取处理器中断IPI信息,所述IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;The processing module 1101 is configured to acquire processor interrupt IPI information after the first logical processor enters the virtualization mode, where the IPI information includes: an identifier of a target virtual processor and virtual interrupt information;
所述处理模块1101,还用于对所述目标虚拟处理器的标识进行虚拟处理器地址翻译,得到所述目标虚拟处理器当前运行所在的目标逻辑处理器;The processing module 1101 is further configured to perform virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running;
发送模块1102,用于向所述目标逻辑处理器发送所述IPI信息。A sending module 1102, configured to send the IPI information to the target logical processor.
本申请实施例中,第一逻辑处理器上当前运行有虚拟处理器,将第一逻辑处理器上正在运行的虚拟处理器定义为第一虚拟处理器,该第一虚拟处理器需要向目标虚拟处理器注入IPI时,第一虚拟处理器可以使用第一逻辑处理器来发送IPI信息,其中,该IPI信息包括:目标虚拟处理器的标识和虚拟中断信息。该目标虚拟处理器的标识可以是目标虚拟处理器的编号,该虚拟中断信息可以是虚拟IPI的详情信息,例如该虚拟中断信息可以包括中断号和中断发送方式。In this embodiment of the present application, a virtual processor is currently running on the first logical processor, and the virtual processor running on the first logical processor is defined as the first virtual processor. When the processor injects the IPI, the first virtual processor may use the first logical processor to send IPI information, where the IPI information includes: an identifier of the target virtual processor and virtual interrupt information. The identifier of the target virtual processor may be the number of the target virtual processor, and the virtual interrupt information may be detailed information of the virtual IPI, for example, the virtual interrupt information may include an interrupt number and an interrupt sending method.
在本申请实施例中,第一逻辑处理器中可以实现虚拟处理器编号到逻辑处理器编号的翻译,其功能包括虚拟处理器编号到逻辑处理器编号对应表的维护和查询。因此当第一逻辑处理器获取到目标虚拟处理器的标识之后,可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,得到目标虚拟处理器当前运行所在的目标逻辑处理器。In the embodiment of the present application, the first logical processor can realize the translation from the virtual processor number to the logical processor number, and its function includes maintaining and querying the correspondence table between the virtual processor number and the logical processor number. Therefore, after the first logical processor obtains the identifier of the target virtual processor, it may perform virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running.
在本申请实施例中,第一逻辑处理器确定出目标虚拟处理器当前运行所在的目标逻辑处理器之后,第一逻辑处理器可以向目标逻辑处理器发送IPI信息,使得该目标逻辑处理器可以按照IPI信息执行IPI注入。In this embodiment of the application, after the first logical processor determines the target logical processor where the target virtual processor is currently running, the first logical processor can send IPI information to the target logical processor, so that the target logical processor can Perform IPI injection according to IPI information.
在本申请的一些实施例中,所述处理模块1101,还用于对所述目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定所述目标虚拟处理器没有在任何一个逻辑处理器运行时,存储所述IPI信息,并退出所述虚拟化模式;In some embodiments of the present application, the processing module 1101 is further configured to determine that the target virtual processor is not running on any logical processor after performing virtual processor address translation on the identification of the target virtual processor , store the IPI information, and exit the virtualization mode;
所述发送模块102,还用于通知虚拟机监控器VMM所述第一逻辑处理器存储了所述IPI信息。The sending module 102 is further configured to notify a virtual machine monitor VMM that the first logical processor has stored the IPI information.
其中,第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译之后,确定目标虚拟处理器没有在任何一个逻辑处理器运行时,则说明该第一逻辑处理器无法确定出目标虚拟处理器当前运行所在的目标逻辑处理器,此时可以将IPI信息存储下来,例如存储到发送方异常信息存储区域中,使得运行于非虚拟化模式的vmm软件可以查询到IPI发送详情信息。Wherein, after the first logical processor performs virtual processor address translation on the identification of the target virtual processor and determines that the target virtual processor is not running on any logical processor, it means that the first logical processor cannot determine the target virtual processor. The target logical processor where the processor is currently running can store the IPI information at this time, for example, in the sender exception information storage area, so that the vmm software running in the non-virtualization mode can query the IPI sending details.
在本申请的一些实施例中,所述处理模块1101,还用于当所述第一逻辑处理器向所述目标逻辑处理器发送所述IPI信息失败时,存储所述IPI信息,并退出所述虚拟化模式;In some embodiments of the present application, the processing module 1101 is further configured to store the IPI information and exit the IPI information when the first logical processor fails to send the IPI information to the target logical processor. The virtualization mode described above;
所述发送模块102,还用于通知VMM所述第一逻辑处理器存储了所述IPI信息。The sending module 102 is further configured to notify the VMM that the first logic processor has stored the IPI information.
其中,第一逻辑处理器可以设置“投送中断”时所使用的中断号,在逻辑处理器进入虚拟化模式后,执行IPI信息。退出虚拟化模式之后,则判断退出原因,若原因是“虚拟化模式下投送虚拟中断”,则由VMM使用中断号继续执行IPI中断信息。Wherein, the first logical processor may set the interrupt number used when "delivering interrupt", and execute the IPI information after the logical processor enters the virtualization mode. After exiting the virtualization mode, judge the exit reason. If the reason is "virtual interrupt delivery in virtualization mode", the VMM will use the interrupt number to continue executing the IPI interrupt information.
在本申请的一些实施例中,所述发送模块1102,还用于向所述目标逻辑处理器发送所述目标虚拟处理器所在的虚拟机VM的标识。In some embodiments of the present application, the sending module 1102 is further configured to send the identifier of the virtual machine VM where the target virtual processor is located to the target logical processor.
其中,第一逻辑处理器还需要向目标逻辑处理器发送目标虚拟处理器所在的VM的标识,以使得接收方可以确定出该目标虚拟处理器所在的VM。Wherein, the first logical processor also needs to send the identifier of the VM where the target virtual processor is located to the target logical processor, so that the receiver can determine the VM where the target virtual processor is located.
在本申请的一些实施例中,所述处理模块1101,具体用于通过查询虚拟处理器到逻辑处理器的路由表,对对所述目标虚拟处理器的标识进行虚拟处理器地址翻译。In some embodiments of the present application, the processing module 1101 is specifically configured to perform virtual processor address translation on the identifier of the target virtual processor by querying a routing table from virtual processors to logical processors.
其中,在每个逻辑处理器上运行虚拟处理器时,每个逻辑处理器都对应一个根据虚拟处理器编号进行索引的虚拟处理器到逻辑处理器的路由表,一个逻辑处理器可以访问自己对应的虚拟处理器到逻辑处理器的路由表,从而完成从虚拟处理器到相应的逻辑处理器的地址翻译。Wherein, when running a virtual processor on each logical processor, each logical processor corresponds to a virtual processor-to-logical processor routing table indexed according to the virtual processor number, and a logical processor can access its corresponding The routing table from the virtual processor to the logical processor, so as to complete the address translation from the virtual processor to the corresponding logical processor.
在本申请的一些实施例中,所述虚拟处理器到逻辑处理器的路由表存储在所述第一逻辑处理器的存储区域中;或,In some embodiments of the present application, the routing table from the virtual processor to the logical processor is stored in the storage area of the first logical processor; or,
所述虚拟处理器到逻辑处理器的路由表存储在所述第一逻辑处理器所在的可用于物理插拔的处理器的存储区域中;或,The routing table from the virtual processor to the logical processor is stored in the storage area of the processor where the first logical processor is located and can be used for physical plugging; or,
所述虚拟处理器到逻辑处理器的路由表存储到内存中。The routing table from the virtual processor to the logical processor is stored in the memory.
其中,可用于物理插拔的处理器是指前述的处理器socket。即虚拟处理器到逻辑处理器的路由表可以由一个逻辑处理器单独存储,也可以在该逻辑处理器所属的处理器socket的范围内进行全局共享,或者存储到内存中,从而每个逻辑处理器可以使用一个虚拟处理器指针从该内存中读取到虚拟处理器到逻辑处理器的路由表。Wherein, the processor that can be used for physical plugging refers to the aforementioned processor socket. That is, the routing table from a virtual processor to a logical processor can be stored independently by a logical processor, or it can be shared globally within the scope of the processor socket to which the logical processor belongs, or stored in memory, so that each logical processor The virtual processor can use a virtual processor pointer to read the virtual processor to logical processor routing table from this memory.
在本申请的一些实施例中,所述第一逻辑处理器具有用于修改所述虚拟处理器到逻辑处理器的路由表的接口。In some embodiments of the present application, the first logical processor has an interface for modifying the virtual processor-to-logical processor routing table.
其中,逻辑处理器还可以提供修改虚拟处理器到逻辑处理的路由表的支持机制,例如在此支持机制被触发时,当前逻辑处理器对自身可访问的虚拟处理器到逻辑处理的路由表进行修改。又如,逻辑处理器可利用处理器间通信机制,通知其它逻辑处理器修改虚拟处理器到逻辑处理的路由表,具体实现方式此处不做限定。Among them, the logical processor can also provide a support mechanism for modifying the routing table from the virtual processor to the logical processing. Revise. As another example, a logical processor may use an inter-processor communication mechanism to notify other logical processors to modify a routing table from a virtual processor to a logical processor, and the specific implementation manner is not limited here.
通过前述实施例的举例说明可知,当第一逻辑处理器进入虚拟化模式之后,第一逻辑处理器获取处理器中断IPI信息,IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;第一逻辑处理器对目标虚拟处理器的标识进行虚拟处理器地址翻译,得到目标虚拟处理器当前运行所在的目标逻辑处理器;第一逻辑处理器向目标逻辑处理器发送IPI信息。本申请实施例中,第一逻辑处理器可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,从而可以确定出目标虚拟处理器当前运行所在的目标逻辑处理器,因此第一逻辑处理器可以在虚拟化模式直接向正在运行的目标虚拟处理器发送IPI信息,使得目标虚拟处理器可以被注入IPI,不需要通过VMM来实现对IPI信息进行发送,第一逻辑处理器也不需要退出虚拟化模式,因此可以减少对发送方的处理器资源占用和IPI的最终传输延迟。It can be seen from the examples of the foregoing embodiments that when the first logical processor enters the virtualization mode, the first logical processor acquires processor interrupt IPI information, and the IPI information includes: the target virtual processor identifier and virtual interrupt information; The logical processor performs virtual processor address translation on the identifier of the target virtual processor to obtain the target logical processor where the target virtual processor is currently running; the first logical processor sends IPI information to the target logical processor. In this embodiment of the present application, the first logical processor can perform virtual processor address translation on the identifier of the target virtual processor, so as to determine the target logical processor where the target virtual processor is currently running. Therefore, the first logical processor can In the virtualization mode, IPI information is directly sent to the running target virtual processor, so that the target virtual processor can be injected into IPI, without the need to send IPI information through the VMM, and the first logical processor does not need to exit virtualization mode, thus reducing the processor resource occupation of the sender and the final transmission delay of the IPI.
本申请实施例还提供的另一种逻辑处理器,该逻辑处理器具体为前述的第二逻辑处理器,请参阅图12所示,本申请实施例提供的第二逻辑处理器1200,可以包括:接收模块1201、处理模块1202,其中,Another logical processor provided in the embodiment of the present application, the logical processor is specifically the aforementioned second logical processor, please refer to FIG. 12 , the second logical processor 1200 provided in the embodiment of the present application may include : receiving module 1201, processing module 1202, wherein,
接收模块1201,用于当第二逻辑处理器进入虚拟化模式之后,接收第一逻辑处理器发送的IPI信息,所述IPI信息包括:目标虚拟处理器的标识和虚拟中断信息;The receiving module 1201 is configured to receive the IPI information sent by the first logical processor after the second logical processor enters the virtualization mode, where the IPI information includes: the identification of the target virtual processor and virtual interrupt information;
处理模块1202,用于根据所述虚拟中断信息对所述第二虚拟处理器进行虚拟中断注入处理,所述第二虚拟处理器是所述第二逻辑处理器进入虚拟模式后正在运行的虚拟处理器。The processing module 1202 is configured to perform virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information, and the second virtual processor is a running virtual processor after the second logical processor enters the virtual mode device.
其中,本申请实施例中基于处理器硬件的通信机制,第一逻辑处理器发送IPI信息后,第二逻辑处理器作为接收方可以接收该IPI信息,第二逻辑处理器可以从该IPI信息确定出目标虚拟处理器的标识和虚拟中断信息。Among them, in the embodiment of the present application, based on the communication mechanism of the processor hardware, after the first logical processor sends the IPI information, the second logical processor can receive the IPI information as the receiver, and the second logical processor can determine from the IPI information Output the identification and virtual interrupt information of the target virtual processor.
在本申请实施例中,正在运行的第二虚拟处理器就是需要被注入中断的虚拟处理器,由第二逻辑处理器根据虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。通过第一逻辑处理器和第二逻辑处理器之间的硬件直接通信,本申请实施例中可以实现对目标虚拟处理器的虚拟终端注入处理,整个过程不需要VMM软件的接入,第二逻辑处理器也不需要退出虚拟化模式。In this embodiment of the present application, the running second virtual processor is the virtual processor that needs to be injected with an interrupt, and the second logical processor performs virtual interrupt injection processing on the second virtual processor according to the virtual interrupt information. Through the hardware direct communication between the first logical processor and the second logical processor, in the embodiment of the present application, the virtual terminal injection process to the target virtual processor can be realized. The whole process does not require the access of VMM software, and the second logical processor The processor also does not need to exit virtualization mode.
在本申请的一些实施例中,所述处理模块1202,还用于当所述第二虚拟处理器的标识与所述目标虚拟处理器的标识不相同时,存储所述IPI信息,并退出所述虚拟化模式。In some embodiments of the present application, the processing module 1202 is further configured to store the IPI information when the identifier of the second virtual processor is different from the identifier of the target virtual processor, and exit the The virtualization mode described above.
在本申请的一些实施例中,所述处理模块1202,还用于所述接收模块1201接收第一逻辑处理器发送的IPI信息之后,确定第二虚拟处理器的标识是否与所述目标虚拟处理器的标识相同;In some embodiments of the present application, the processing module 1202 is further configured to determine whether the identifier of the second virtual processor is consistent with that of the target virtual processor after the receiving module 1201 receives the IPI information sent by the first logical processor. The identification of the device is the same;
所述处理模块1202,还用于当所述第二虚拟处理器的标识与所述目标虚拟处理器的标识相同时,触发执行如下步骤:根据所述虚拟中断信息对第二虚拟处理器进行虚拟中断注入处理。The processing module 1202 is further configured to, when the identifier of the second virtual processor is the same as the identifier of the target virtual processor, trigger the execution of the following steps: virtualize the second virtual processor according to the virtual interrupt information Interrupt injection processing.
在本申请实施例中,第二逻辑处理器判断该第二逻辑处理器当前正在运行的第二虚拟处理器是否就是该目标虚拟处理器,例如第二逻辑处理器可以确定第二虚拟处理器的标识是否与目标虚拟处理器的标识相同,第二虚拟处理器是第二逻辑处理器进入虚拟模式后正在运行的虚拟处理器。In this embodiment of the present application, the second logical processor judges whether the second virtual processor currently running on the second logical processor is the target virtual processor, for example, the second logical processor may determine the Whether the identifier is the same as the identifier of the target virtual processor, the second virtual processor is the running virtual processor after the second logical processor enters the virtual mode.
通过前述实施例的举例说明可知,本申请实施例中,第一逻辑处理器可以对目标虚拟处理器的标识进行虚拟处理器地址翻译,从而可以确定出目标虚拟处理器当前运行所在的目标逻辑处理器,因此第一逻辑处理器可以在虚拟化模式直接向正在运行的目标虚拟处理器发送IPI信息,第二逻辑处理器作为目标逻辑处理器,该第二逻辑处理器上运行有该目标虚拟处理器,因此第二逻辑处理器可以对该目标虚拟处理器进行IPI注入,不需要通过VMM来实现对IPI信息进行发送,第一逻辑处理器也不需要退出虚拟化模式,因此可以减少对发送方的处理器资源占用和IPI的最终传输延迟。It can be known from the examples of the foregoing embodiments that in the embodiment of the present application, the first logical processor can perform virtual processor address translation on the identification of the target virtual processor, so as to determine the target logical processor where the target virtual processor is currently running. Therefore, the first logical processor can directly send IPI information to the running target virtual processor in the virtualization mode, and the second logical processor acts as the target logical processor on which the target virtual processor runs Therefore, the second logical processor can perform IPI injection on the target virtual processor without sending the IPI information through the VMM, and the first logical processor does not need to exit the virtualization mode, so the sending party can be reduced The processor resource usage and the final transmission delay of IPI.
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction and execution process between the modules/units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effect it brings is the same as that of the method embodiment of the present application. The specific content can be Refer to the descriptions in the foregoing method embodiments of the present application, and details are not repeated here.
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储有程序,该程序执行包括上述方法实施例中记载的部分或全部步骤。The embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a program, and the program executes some or all of the steps described in the above method embodiments.
需要说明的是,本申请实施例中处理器还可以称为中央处理单元(英文全称:Central Processing Unit,英文简称:CPU)。具体的应用中,处理器的各个组件通过总线系统耦合在一起。处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(英文全称:digital signal processing,英文缩写:DSP)、专用集成电路(英文全称:Application Specific Integrated Circuit,英文缩写:ASIC)、现场可编程门阵列(英文全称:Field-Programmable Gate Array,英文缩写:FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。It should be noted that the processor in the embodiment of the present application may also be referred to as a central processing unit (English full name: Central Processing Unit, English abbreviation: CPU). In a specific application, various components of the processor are coupled together through a bus system. The processor can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (English full name: digital signal processing, English abbreviation: DSP), an application specific integrated circuit (English full name: Application Specific Integrated Circuit, English abbreviation: ASIC), field programmable gate Array (English full name: Field-Programmable Gate Array, English abbreviation: FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。In addition, it should be noted that the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be A physical unit can be located in one place, or it can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present application. In addition, in the drawings of the device embodiments provided in the present application, the connection relationship between the modules indicates that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可以用硬件实现,或固件实现,或它们的组合方式来实现。当使用软件实现时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括RAM、ROM、EEPROM、CD-ROM或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。此外。任何连接可以适当的成为计算机可读介质。例如,如果软件是使用同轴电缆、光纤光缆、双绞线、数字用户线(DSL)或者诸如红外线、无线电和微波之类的无线技术从网站、服务器或者其他远程源传输的,那么同轴电缆、光纤光缆、双绞线、DSL或者诸如红外线、无线和微波之类的无线技术包括在所属介质的定影中。如本申请所使用的,盘(Disk)和碟(disc)包括压缩光碟(CD)、激光碟、光碟、数字通用光碟(DVD)、软盘和蓝光光碟,其中盘通常磁性的复制数据,而碟则用激光来光学的复制数据。上面的组合也应当包括在计算机可读介质的保护范围之内。Through the above description of the implementation manners, those skilled in the art can clearly understand that the present application can be implemented by hardware, firmware, or a combination thereof. When implemented in software, the functions described above may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. By way of example but not limitation: computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or may be used to carry or store information in the form of instructions or data structures desired program code and any other medium that can be accessed by a computer. also. Any connection can suitably be a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwave are included in the fixation of the respective media. As used in this application, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disc, and blu-ray disc, where discs usually reproduce data magnetically, and discs Lasers are used to optically reproduce the data. Combinations of the above should also be included within the scope of computer-readable media.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).
Claims (23)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810152182.2A CN110162377A (en) | 2018-02-14 | 2018-02-14 | A kind of communication means and logic processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810152182.2A CN110162377A (en) | 2018-02-14 | 2018-02-14 | A kind of communication means and logic processor |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110162377A true CN110162377A (en) | 2019-08-23 |
Family
ID=67635505
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810152182.2A Pending CN110162377A (en) | 2018-02-14 | 2018-02-14 | A kind of communication means and logic processor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110162377A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111930396A (en) * | 2020-06-29 | 2020-11-13 | 广西东信易联科技有限公司 | An upgrade method of communication module in 4G router based on notify mechanism |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101187902A (en) * | 2006-09-22 | 2008-05-28 | 英特尔公司 | Sharing information between clients in a virtual machine environment |
CN102945186A (en) * | 2005-12-30 | 2013-02-27 | 英特尔公司 | Delivering interrupts directly to a virtual processor |
US20150026678A1 (en) * | 2013-07-19 | 2015-01-22 | Hitachi, Ltd. | Control method for computer, and computer |
US20170206177A1 (en) * | 2016-01-15 | 2017-07-20 | Intel Corporation | Interrupts between virtual machines |
-
2018
- 2018-02-14 CN CN201810152182.2A patent/CN110162377A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102945186A (en) * | 2005-12-30 | 2013-02-27 | 英特尔公司 | Delivering interrupts directly to a virtual processor |
CN101187902A (en) * | 2006-09-22 | 2008-05-28 | 英特尔公司 | Sharing information between clients in a virtual machine environment |
US20150026678A1 (en) * | 2013-07-19 | 2015-01-22 | Hitachi, Ltd. | Control method for computer, and computer |
US20170206177A1 (en) * | 2016-01-15 | 2017-07-20 | Intel Corporation | Interrupts between virtual machines |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111930396A (en) * | 2020-06-29 | 2020-11-13 | 广西东信易联科技有限公司 | An upgrade method of communication module in 4G router based on notify mechanism |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108243118B (en) | Method and physical host for forwarding packets | |
US11467978B2 (en) | Method and apparatus for hardware virtualization | |
US9880941B2 (en) | Sharing an accelerator context across multiple processes | |
KR101993915B1 (en) | Efficient live-transfer of remotely accessed data | |
CN107995129B (en) | NFV message forwarding method and device | |
US8295275B2 (en) | Tagging network I/O transactions in a virtual machine run-time environment | |
US9996484B1 (en) | Hardware acceleration for software emulation of PCI express compliant devices | |
US10178054B2 (en) | Method and apparatus for accelerating VM-to-VM network traffic using CPU cache | |
US20180225204A1 (en) | Buffer manager | |
US7877436B2 (en) | Mechanism to provide reliability through packet drop detection | |
CN108351829B (en) | System and method for input/output computing resource control | |
US20100095080A1 (en) | Data Communications Through A Host Fibre Channel Adapter | |
BR102021023356A2 (en) | TECHNOLOGIES FOR SEARCHING TRANSLATIONS OF DOWNLOAD DEVICE ADDRESSES | |
US9690495B2 (en) | Emulating memory mapped I/O for coherent accelerators in error state | |
CN108021518A (en) | A kind of data interactive method and computing device | |
Markussen et al. | Smartio: Zero-overhead device sharing through pcie networking | |
US10768965B1 (en) | Reducing copy operations for a virtual machine migration | |
US8255913B2 (en) | Notification to task of completion of GSM operations by initiator node | |
US20200319944A1 (en) | User-space parallel access channel for traditional filesystem using capi technology | |
CN105556473A (en) | I/O task processing method, device and system | |
US8055817B2 (en) | Efficient handling of queued-direct I/O requests and completions | |
CN114417373A (en) | A data access method and device for NVMe-oF user mode client | |
US8146094B2 (en) | Guaranteeing delivery of multi-packet GSM messages | |
US10545697B1 (en) | Reverse order request queueing by para-virtual device drivers | |
CN110162377A (en) | A kind of communication means and logic processor |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190823 |
|
WD01 | Invention patent application deemed withdrawn after publication |