Directed Interrupt Virtualization with an Interrupt Table
By using interrupt tables in a multiprocessor computer system to map the interrupt target ID to the logical processor ID and directly address the target processor, the problem of low interrupt signal routing efficiency is solved, and efficient interrupt processing and system performance improvement is achieved.
Patent Information
- Application Number
- CN202080013265.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-02-14
- Filing Date
- 2020-02-03
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2040-02-03
AI Technical Summary
In multiprocessor computer systems, the routing efficiency of interrupt signals is inefficient, especially in virtual machine environments, resulting in unoptimized use of processor resources.
Mapping the interrupt target ID to the logical processor ID by using an interrupt table in the bus attachment device and addressing the target processor directly to improve the forwarding efficiency of the interrupt signal.
It realizes efficient forwarding of interrupt signals, reduces cache traffic, improves system performance, and avoids performance losses caused by broadcasting of interrupt signals.
Smart Images

Figure CN113412472B_ABST
Abstract
Description
Background Art
[0001] The present disclosure generally relates to interrupt handling within a computer system, and more particularly to handling interrupts generated by a bus-connected module in a multi-processor computer system.
[0002] Interrupts are used to signal to a processor that an event requires the processor's attention. For example, a hardware device (e.g., a hardware device connected to the processor via a bus) uses an interrupt to convey that it needs attention from the operating system. In the case where the receiving processor is currently performing some activity, the receiving processor may suspend its current activity, save its state, and handle the interrupt, for example, by executing an interrupt handler, in response to receiving the interrupt signal. The interruption of the processor's current activity due to the reception is only temporary. After handling the interrupt, the processor may resume its suspended activity. Thus, interrupts can allow for performance improvements by eliminating the processor's ineffective waiting time in a polling loop for external events.
[0003] In a multi-processor computer system, interrupt routing efficiency issues may arise. The challenge is to forward an interrupt signal sent by a hardware device (e.g., a bus-connected module) to a processor among multiple processors allocated for use by the operating system in an efficient manner. This can be particularly challenging in the case where interrupts are used to communicate with a guest operating system on a virtual machine. A hypervisor or virtual machine monitor (VMM) creates and runs one or more virtual machines, i.e., guest machines. The virtual machine provides a virtual operating platform to the guest operating system executing thereon while hiding the physical characteristics of the underlying platform. Using multiple virtual machines allows multiple operating systems to run in parallel. Since it is executed on a virtual operating platform, the view of the processor by the guest operating system of the processor can generally be different from the underlying physical view of the processor, for example. The guest operating system uses a virtual processor ID to identify the processor, which is usually inconsistent with the underlying logical processor ID. The hypervisor that manages the execution of the guest operating system defines a mapping between the underlying logical processor ID and the virtual processor ID used by the guest operating system. However, this mapping and the selection of the processor scheduled for use by the guest operating system are not static, but can be changed by the hypervisor while the guest operating system is running, without the knowledge of the guest operating system. Figure 1 Generally, this challenge is addressed by using broadcast to forward the interrupt signal. When using broadcast, the interrupt signal is continuously forwarded among multiple processors until a processor suitable for handling the interrupt signal is encountered. However, in the case of a multi-processor, the probability that the processor that first receives the broadcast interrupt signal is actually suitable for handling the interrupt signal may be quite low. In addition, being suitable for handling the interrupt signal does not necessarily mean that the corresponding processor is the best choice for handling the interrupt.
[0004] Summary of the Invention
[0005] Various embodiments provide a method, a computer system, and a computer program product for providing an interrupt signal to a guest operating system, where the guest operating system is executed using one or more of a plurality of processors of a computer system allocated for use by the guest operating system, as described by the subject matter of the independent claims. Advantageous embodiments are described in the dependent claims. If the embodiments of the present invention are not mutually exclusive, they can be freely combined with each other.
[0006] In one aspect, the present invention relates to a method for providing an interrupt signal to a guest operating system, where the guest operating system is executed using one or more of a plurality of processors of a computer system allocated for use by the guest operating system. The computer system further includes one or more bus connection modules operably connected to the plurality of processors via a bus and bus-attached devices. The computer system further includes a memory operably connected to the bus-attached devices. Each of the plurality of processors is assigned a logical processor ID used by the bus-attached device to address the corresponding processor. Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID used by the guest operating system and one or more bus connection modules to address the corresponding processor. The method includes: receiving, by the bus-attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying one of the processors allocated for use by the guest operating system as a target processor for processing the interrupt signal; retrieving, by the bus-attached device, a first copy of an interrupt table entry assigned to the received interrupt target ID from an interrupt table stored in the memory, the first copy of the interrupt table entry including a first mapping of the received interrupt target ID to a logical processor ID; converting, by the bus-attached device, the received interrupt target ID to a logical processor ID using the first copy of the interrupt table entry; and forwarding, by the bus-attached device, the interrupt signal to the target processor for processing by directly addressing the target processor using the converted logical processor ID.
[0007] In another aspect, the present invention relates to a computer system for providing an interrupt signal to a guest operating system that is executed using one or more of a plurality of processors of a computer system that are allocated for use by the guest operating system. The computer system further includes one or more bus connection modules operably connected to the plurality of processors via a bus and bus attached devices. The computer system further includes a memory operably connected to the bus attached devices. Each of the plurality of processors is assigned a logical processor ID that is used by the bus attached devices to address the respective processor. Each of the plurality of processors that is allocated for use by the guest operating system is further assigned an interrupt target ID that is used by the guest operating system and one or more bus connection modules to address the respective processor. The computer system is configured to execute a method that includes: receiving, by the bus attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying one of the processors that is allocated for use by the guest operating system as a target processor for processing the interrupt signal; retrieving, by the bus attached device, a first copy of an interrupt table entry assigned to the received interrupt target ID from an interrupt table stored in the memory, the first copy of the interrupt table entry including a current mapping of the received interrupt target ID to a logical processor ID; converting, by the bus attached device, the received interrupt target ID to a logical processor ID using the first copy of the interrupt table entry; and forwarding, by the bus attached device, the interrupt signal to the target processor for processing by directly addressing the target processor using the converted logical processor ID.
[0008] In another aspect, the present invention relates to a computer program product for providing an interrupt signal to a guest operating system that is executed using one or more of a plurality of processors of a computer system allocated for use by the guest operating system. The computer system further includes one or more bus connection modules operably connected to the plurality of processors via a bus and bus-attached devices. The computer system further includes a memory operably connected to the bus-attached devices. Each of the plurality of processors is assigned a logical processor ID used by the bus-attached devices to address the corresponding processor. Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID used by the guest operating system and one or more bus connection modules to address the corresponding processor. The computer program product includes a computer-readable non-transitory medium readable by a processing circuit and storing instructions for execution by the processing circuit to perform a method, the method including: receiving, by a bus-attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying one of the processors allocated for use by the guest operating system as a target processor for processing the interrupt signal; retrieving, by the bus-attached device, a first copy of an interrupt table entry assigned to the received interrupt target ID from an interrupt table stored in the memory, the first copy of the interrupt table entry including a current mapping of the received interrupt target ID to a logical processor ID; converting, by the bus-attached device, the received interrupt target ID to a logical processor ID using the first copy of the interrupt table entry; and forwarding, by the bus-attached device, the interrupt signal to the target processor for processing by directly addressing the target processor using the converted logical processor ID. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Embodiments of the present invention are explained in more detail below by way of example only, with reference to the accompanying drawings, in which:
[0010] Figure 1 A schematic diagram of an exemplary computer system is depicted,
[0011] Figure 2 A schematic diagram of an exemplary virtualization scheme is depicted,
[0012] Figure 3 A schematic diagram of an exemplary virtualization scheme is depicted,
[0013] Figure 4 A schematic diagram of an exemplary virtualization scheme is depicted,
[0014] Figure 5 A schematic diagram of an exemplary computer system is depicted,
[0015] Figure 6 A schematic diagram of an exemplary computer system is depicted,
[0016] Figure 7 depicts a schematic flowchart of an exemplary method
[0017] Figure 8 depicts a schematic flowchart of an exemplary method
[0018] Figure 9 depicts a schematic flowchart of an exemplary method
[0019] Figure 10 depicts a schematic flowchart of an exemplary method
[0020] Figure 11 depicts a schematic diagram of an exemplary computer system
[0021] Figure 12 depicts a schematic flowchart of an exemplary method
[0022] Figure 13 depicts a schematic flowchart of an exemplary method
[0023] Figure 14 depicts a schematic flowchart of an exemplary method
[0024] Figure 15 depicts a schematic flowchart of an exemplary method
[0025] Figure 16 depicts a schematic diagram of an exemplary data structure
[0026] Figure 17 depicts a schematic diagram of an exemplary vector structure
[0027] Figure 18 depicts a schematic diagram of an exemplary vector structure
[0028] Figure 19 depicts a schematic diagram of an exemplary vector structure
[0029] Figure 20 depicts a schematic diagram of an exemplary vector structure
[0030] Figure 21 depicts a schematic flowchart of an exemplary method
[0031] Figure 22 depicts a schematic diagram of an exemplary computer system
[0032] Figure 23 depicts a schematic diagram of an exemplary computer system
[0033] Figure 24 depicts a schematic diagram of an exemplary computer system
[0034] Figure 25 depicts a schematic diagram of an exemplary computer system
[0035] FIG. 26 depicts a schematic diagram of an exemplary unit, and
[0036] Figure 27 depicts a schematic diagram of an exemplary computer system. DETAILED DESCRIPTION
[0037] The description of the various embodiments of the present invention will be presented for purposes of illustration, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein are chosen to best explain the principles of the embodiments, the practical application or technical improvement of technologies found in the marketplace, or to enable other ordinary skilled in the art to understand the embodiments disclosed herein.
[0038] Embodiments can have the beneficial effect of enabling a bus-attached device to directly address a target processor. Thus, by issuing a bus connection module to select a target processor ID, an interrupt signal can be targeted at a specific processor (i.e., the target processor) of a multiprocessor computer system. For example, a processor can be selected as the target processor of an interrupt signal that has previously performed activities related to the interrupt. Processing the interrupt signal by the same processor as the corresponding activity can result in performance advantages because, in the case where the same processor also processes the interrupt signal, all data in the context of that interrupt may already be available to the processor and / or stored in the local cache, enabling quick access to the corresponding processor without a large amount of cache traffic.
[0039] Thus, broadcasting of the interrupt signal can be avoided, for which, from a performance perspective, e.g., minimizing cache traffic, it cannot be guaranteed that the processor that will finally process the interrupt is the most suitable for the task. Instead of providing the interrupt signal to all processors, where each processor attempts to process it and one processor wins, the interrupt signal can be directly provided to the target processor, thereby improving the efficiency of interrupt signal processing.
[0040] Embodiments can have the beneficial effect of providing an interrupt table (IRT) including interrupt table entries (IRTE), each entry providing a mapping of an interrupt target ID to a logical processor ID. Thus, the entries can define a unique assignment of each interrupt target ID to a logical processor ID. According to an embodiment, the interrupt target ID can be provided in the form of a virtual processor ID. According to an embodiment, the interrupt target ID can be any other ID used by a guest operating system to identify a separate processor in use.
[0041] According to an embodiment, an IRT is provided in a memory for use by a bus-attached device to map an interrupt target ID to a logical processor ID. According to an embodiment, the IRT is provided in a single location. An address indicator indicating the memory address of the IRT may be provided, such as a pointer. The address indicator may be provided, for example, by an entry in a device table fetched by the bus-attached device from the memory. Embodiments may have the beneficial effect that a large mapping table does not have to be stored in the bus-attached device. If needed, an interrupt table for mapping may be stored in the memory and accessed by the bus-attached device. Thus, the bus-attached device may only have to process a working copy of one or more interrupt table entries for each interrupt signal to be forwarded. The number of interrupt table entries may preferably be small, such as one.
[0042] According to an embodiment, the IRT or individual IRTEs may be updated upon rescheduling of the processor. According to an embodiment, the IRT may be stored in an internal section of the memory (i.e., the HSA).
[0043] The interrupt mechanism may be implemented using directed interrupts. When the bus-attached device forwards an interrupt signal for processing to a target processor defined by an issuing bus connection module, the bus-attached device may be enabled to directly address the target processor using the logical processor ID of the target processor. Converting the interrupt target ID to a logical processor ID by the bus connection device may further ensure that from the perspective of the guest operating system, the same processor is always addressed, even if the mapping between the interrupt target ID and the logical processor ID or the selection of the processor to be scheduled for use by the guest operating system may be changed by the hypervisor.
[0044] According to an embodiment, the interrupt signal is received in the form of a message signaled interrupt, which includes the interrupt target ID of the target processor. Using message signaled interrupt (MSI) is a method by which a bus connection module (such as a Peripheral Component Interconnect (PCI) or a Peripheral Component Interconnect Express (PCIe) function) generates a Central Processing Unit (CPU) interrupt to notify a guest operating system using the corresponding central processing unit of the occurrence of an event or the existence of a certain state. MSI provides an in-band method of signaling an interrupt using special in-band messages, thus avoiding the need for a dedicated path separate from the main data path to send such control information, such as dedicated interrupt pins on each device. MSI relies more on exchanging special messages indicating interrupts through the main data path. When the bus connection module is configured to use MSI, the corresponding module requests an interrupt by performing an MSI write operation of a specified number of bytes of data to a special address. The combination of this special address (i.e., the MSI address) and a unique data value (i.e., the MSI data) is referred to as an MSI vector.
[0045] Modern PCIe standard adapters have the ability to present multiple interrupts. For example, MSI-X allows a bus-connected module to allocate up to 2048 interrupts. Thus, it is possible to direct individual interrupts to different processors, such as in high-speed network applications that rely on multi-processor systems. MSI-X allows the allocation of multiple interrupts, each with a separate MSI address and MSI data value.
[0046] To send an interrupt signal, an MSI-X message can be used. The required content of the MSI-X message can be determined using the MSI-X data table. The MSI-X data table local to the bus-connected module (i.e., the PCIe adapter / function) can be indexed by the number assigned to each interrupt signal (also known as an interrupt request (IRQ)). The MSI-X data table content is under the control of the guest operating system and can be set into the operating system through the boot of hardware and / or firmware. A single PCIe adapter can include multiple PCIe functions, and each PCIe function can have an independent MSI-X data table. This can be the case, for example, for single root input / output virtualization (SR-IOV) or multi-functional devices.
[0047] The interrupt target ID (e.g., virtual processor ID) can be directly encoded as part of the message (e.g., MSI-X message) sent by the bus-connected module, which includes the interrupt signal. The message (e.g., MSI-X message) can include a requester ID (i.e., the ID of the bus-connected module), the above-mentioned interrupt target ID, DIBV or AIBV index, MSI address, and MSI data. The MSI-X message can provide 64 bits for the MSI address and 32 bits for the data. The bus-connected module can use an MSI request interrupt by performing an MSI write operation of a specific MSI data value to a special MSI address.
[0048] The device table is a shared table that can be fully indexed by the requester ID (RID) of the interrupt requester (i.e., the bus-connected module). The bus-attached device remaps and issues the interrupt, i.e., the bus-attached device translates the interrupt target ID and uses it to directly address the target processor.
[0049] The guest operating system can use the virtual processor ID to identify processors in a multi-processor computer system. Thus, the view of the processors by the guest operating system can be different from the view of the underlying system that uses logical processor IDs. The bus-connected module that provides resources used by the guest operating system can use the virtual processor ID as a resource for communicating with the guest operating system. For example, the MSI-X data table can be under the control of the guest operating system. As an alternative to the virtual processor ID, any other ID can be defined for the bus-connected module to address the processor.
[0050] The interrupt is presented to the guest operating system or other software executing thereon, such as other programs, etc. As used herein, the term "operating system" includes operating system device drivers.
[0051] As used herein, the term "bus connection module" may include any type of bus connection module. According to an embodiment, the module may be a hardware module, such as a storage function, a processing module, a network module, an encryption module, a PCI / PCIe adapter, other types of input / output modules, etc. According to other embodiments, the module may be a software module, i.e., a function, such as a storage function, a processing function, a network function, an encryption function, a PCI / PCIe function, other types of input / output functions, etc. Thus, in the examples given herein, unless otherwise stated, the module may be used interchangeably with a function (such as a PCI / PCIe function) and an adapter (such as a PCI / PCIe function).
[0052] Embodiments may have the following advantages: providing an interrupt signal routing mechanism, such as an MSI-X message routing mechanism, which allows it to keep the bus connection modules (such as PCIe adapters and functions) and the device drivers for operating or controlling the bus connection modules unchanged. In addition, the hypervisor can be prevented from intercepting the underlying architecture for implementing communication between the bus connection module and the guest operating system, such as the PCIe MSI-X architecture. In other words, the change to the interrupt signal routing mechanism can be implemented outside the hypervisor and the bus connection module.
[0053] According to an embodiment, the first copy of the interrupt table entry further includes a first copy of a run indicator that indicates whether the target processor identified by the interrupt target ID is scheduled to be used by the guest operating system. The method includes: using the first copy of the run indicator by the bus-attached device to check whether the target processor is scheduled to be used by the guest operating system, and if the target processor is scheduled, continuing to forward the interrupt signal; otherwise, using broadcast by the bus-attached device to forward the interrupt signal for processing to multiple processors.
[0054] Embodiments may have the beneficial effect of preventing interrupts from targeting processors that are not running (i.e., not scheduled to be used by the guest operating system). Embodiments may have the beneficial effect of supporting hypervisor rescheduling of processors.
[0055] The run indicator indicates whether the target processor identified by the interrupt target ID received together with the interrupt signal is scheduled for use by the guest operating system. The run indicator may be implemented, for example, in the form of a run bit, i.e., the run bit is a single bit that indicates whether the processor to which the corresponding bit is assigned is running (i.e., is scheduled for use by the guest operating system). Thus, an enabled run bit can tell the bus-attached device that the target processor is currently scheduled, while a disabled run bit can tell the bus-attached device that the target processor is not currently scheduled. In the case where the target processor is not running, the bus-attached device can send a fallback broadcast interrupt request in the correct manner without attempting to directly address one of the processors.
[0056] According to an embodiment, the first copy of the interrupt table entry further includes an interrupt block indicator that indicates whether the target processor identified by the interrupt target ID is currently blocked from receiving the interrupt signal. The method further includes: using the interrupt block indicator by the bus-attached device to check whether the target processor is blocked from receiving the interrupt signal, and if the target processor is not blocked, continuing to forward the interrupt signal; otherwise, blocking, by the bus-attached device, the interrupt signal from being forwarded to the target processor for processing.
[0057] Embodiments can have the beneficial effect of preventing the direct forwarding of an interrupt signal to a processor that is temporarily blocked. Instead, the interrupt signal can be broadcast so that another unblocked processor can process it in a timely manner. According to an embodiment, a direct interrupt block indicator is introduced in the interrupt entry of the interrupt table in the memory. The direct interrupt block indicator can be implemented in the form of a single bit (i.e., the dIBPIA bit).
[0058] According to an embodiment, the IRTE is fetched from the memory, and the run indicator is checked to determine whether the target processor is scheduled. In the case where the target processor is scheduled, the direct interrupt block indicator is enabled to prevent the target processor from receiving another interrupt signal while processing the current interrupt signal. Otherwise, another interrupt signal may interfere with the processing of the current interrupt signal. To ensure that the target processor has not been rescheduled during this period, the IRTE is refetched and the current run indicator is checked again to determine whether the target processor is still scheduled. In the case where the target processor is still scheduled, the logical processor ID of the target processor can be used to directly address the target processor to forward the interrupt signal to the target processor. In addition, it can be checked whether the logical processor ID of the target processor provided by the IRTE for the received interrupt target ID is still the same.
[0059] According to an embodiment, the method further includes: using broadcast by the bus-attached device to forward the interrupt signal for processing to the remaining processors among the multiple processors.
[0060] According to an embodiment, the method further includes: checking, by an interrupt handler of a guest operating system, whether any interrupt addressed to a target processor is waiting to be processed by the target processor; and if no interrupt addressed to the target processor is waiting to be processed by the target processor, changing, by the guest operating system, an interrupt block indicator in an interrupt table entry assigned to the target processor to indicate that the target processor is not blocked.
[0061] According to an embodiment, the method further includes: if the target processor is not blocked, changing, by a bus-attached device, an interrupt block indicator in an interrupt table entry assigned to an interrupt target ID to indicate that a first logical processor ID is blocked, the change being performed before forwarding an interrupt signal to the target processor for processing.
[0062] Embodiments can have the beneficial effect of preventing the direct forwarding of a number of interrupt signals to a target processor, which forwarding can cause delays due to the interrupts interfering with each other.
[0063] According to an embodiment, the method further includes: after changing the interrupt block indicator, retrieving, by the bus-attached device, a second copy of the interrupt table entry assigned to the received interrupt target ID; and checking, by the bus-attached device, the second copy of the interrupt table entry to rule out a predefined type of change of the second copy of the interrupt table relative to a first copy of the interrupt table entry, a successful ruling out of the predefined type of change being required to forward the interrupt signal to the target processor for processing.
[0064] Embodiments can have the beneficial effect of directly forwarding interrupt signals based on stale information provided by the interrupt table.
[0065] According to an embodiment, the predefined type of change is a change of a first mapping of the received interrupt target ID relative to a second mapping of the received interrupt target ID to a second logical processor ID among logical processor IDs included in the second copy of the interrupt table entry, wherein if the second mapping includes a change relative to the first mapping, the bus-attached device uses broadcasting to forward the interrupt signal for processing to multiple processors.
[0066] According to an embodiment, the bus-attached device uses the second copy of the interrupt table entry to convert the received interrupt target ID into a logical processor ID of the target processor. Embodiments can have the beneficial effect of being able to use up-to-date mapping information.
[0067] According to an embodiment, a predefined type change is a change of a first copy of a run indicator relative to a second copy of the run indicator included by a second copy of an interrupt table entry, wherein, if the second copy of the run indicator includes a change relative to a first copy of a run bit and the second run indicator indicates that the target processor is not scheduled to be used by an operating system, a bus-attached device uses a broadcast to forward an interrupt signal for processing to a plurality of processors. The embodiment can have the beneficial effect of preventing the interrupt signal from being forwarded to an unscheduled target processor.
[0068] According to an embodiment, a double fetch of an IRTE can be performed to prevent an interrupt signal from being sent to a processor that has been deactivated, for example, during that time. According to an embodiment, after forwarding the interrupt signal to a processor identified by a logical processor ID obtained from a conversion of an interrupt target ID using a first copy of the IRTE, a second copy of the same IRTE can be fetched to check whether any change of the IRTE has occurred during that time. In the case where the IRTE has been updated during that time, there is a risk that the interrupt signal has been forwarded to a deactivated processor. Therefore, the second copy of the IRTE can be used to convert the interrupt target ID again and forward the interrupt signal to a processor identified by the logical processor ID resulting from the second conversion. According to an alternative embodiment, in the case where the second copy of the IRTE does not match the first copy, the complete method starting from fetching the first copy of the IRTE can be repeated. For example, a third copy of the IRTE can be fetched in place of the first copy of the IRTE, or the second copy of the IRTE can be in place of the first copy of the IRTE and a third copy of the IRTE can be fetched to also repeat the double-fetch scheme for parts of the method. The scheme can be repeated until a match is achieved. According to another alternative embodiment, in the case where the second copy of the IRTE does not match the first copy, a broadcast can be used to forward the interrupt signal. According to an embodiment, the bus-attached device participates in a memory-cache coherence protocol and detects a replacement of the IRTE through the same mechanism, such as cache snooping. The CPU can detect cache line replacement.
[0069] The embodiment can have the beneficial effect of avoiding cache flushing that may have inefficient scaling. The double fetch can be global or dedicated to the IRTE, i.e., the entire entry can be subject to the double fetch or limited to specific information included by the corresponding entry.
[0070] According to an embodiment, a race condition can be detected by check logic that checks whether the receiving processor is still the correct target processor with respect to the CPU, the race condition being caused by the time required to transform the interrupt target ID and forward the interrupt signal to the target processor until it reaches the processor. For this check, the interrupt target ID and / or the logical partition ID received together with the interrupt request can be compared with the current interrupt target ID and / or the logical partition ID assigned to the receiving processor as a reference. In the case of a match, the receiving processor that is directly addressed using the logical processor ID obtained from the transformation using a copy of the IRTE is actually the correct target processor. Thus, the information provided by the copy of the IRTE is already up-to-date. In the case of a mismatch, the copy of the IRTE is not yet up-to-date, and the receiving processor is no longer the target processor. In the case of a mismatch, the interrupt signal can be forwarded to the target operating system, for example, using a broadcast.
[0071] According to an embodiment, there can be three entities operating in parallel, namely, a bus-attached device, a target processor that processes the interrupt signal, and a hypervisor that can change the assignment between the interrupt target ID and the logical processor ID. According to an embodiment, in a physically distributed system, there may be no central synchronization point that provides a virtual appearance of such a system at a latency cost, other than the memory. Embodiments using a secondary acquisition scheme can have the beneficial effect of providing a method optimized for speed against secondary delivery or even misses of interrupt requests.
[0072] In view of the interrupt signal, the following actions can be performed: A1) read a first copy of the IRTE, A2) send an interrupt request to the directly addressed processor, and A3) read a second copy of the IRTE. At the same time, the following sequence of changes to the assignment between the interrupt target ID and the logical processor ID can occur: B1) activate an additional processor with an additional logical processor ID and deactivate a previous processor with a previous logical processor ID, and B2) update the IRTE with the additional logical processor ID, that is, replace the previous logical processor ID with the additional logical processor ID.
[0073] In certain error situations, a processor (such as the target processor) can be reset to a checkpoint and lose intermediate information. To regain the lost information, the processor can scan all IRTE entries for that particular processor, that is, all IRTE entries for the logical processor ID assigned to it, and deliver direct interrupt requests as indicated by pending direct interrupt indicators (such as, the dPIA bit) present in the memory that is not affected by the processor recovery.
[0074] If an interrupt signal is to be presented, the outstanding direct interrupt indicator (e.g., the IRTE.dPIA bit) included by the IRTE can be used as the master copy, i.e., the single point of truth. To simplify processor recovery, the outstanding direct interrupt indicator in the processor can be used as a shadow copy of, e.g., the IRTE.dPIA bit to keep the direct interrupt outstanding on the processor.
[0075] In the case where the memory has the property of strict ordering, given steps A1, A2, and B1, only the following sequences are possible: Alternative 1 is A1 → A3 → B1, and alternative 2 is A1 → B1 → A3. In the case of alternative 1, the first and second copies of the IRTE can match. Thus, the interrupt signal can be forwarded to the previous processor instead of the current target processor. The previous processor can see a mismatch regarding the interrupt target ID and / or the logical partition ID and initiate a broadcast of the received interrupt signal. In the case of alternative 2, the bus-attached device can see a mismatch between the first and second copies of the IRTE. In response to this mismatch, the bus-attached device can broadcast the interrupt signal. Due to the broadcast, the interrupt signal can be received by additional processors that see a hit and directly process the received interrupt request. The embodiment can have the beneficial effect of closing the timing window by an over-initiative-approach.
[0076] According to an embodiment, the method further includes the bus-attached device retrieving a copy of a device table entry from a device table stored in the memory, the device table entry including an interrupt table address indicator indicating the memory address of the interrupt table, and the bus-attached device using the memory address of the interrupt table to retrieve a first copy of the interrupt table entry. According to an embodiment, the device table entry further includes a direct signaling indicator indicating whether the target processor is to be directly addressed, wherein the method further includes: if the direct signaling indicator indicates direct forwarding of the interrupt signal, using the logical processor ID of the target processor to directly address the target processor to perform forwarding of the interrupt signal; otherwise, the bus-attached device uses broadcast to forward the interrupt signal for processing to multiple processors.
[0077] The embodiment can have the beneficial effect of controlling whether the interrupt signal is forwarded using direct addressing or broadcast with the direct signaling indicator. Using the direct signaling indicator for each bus-connected module can provide a separate predefined selection as to whether direct addressing or broadcast is to be performed for the interrupt signal received from that bus-connected module.
[0078] According to an embodiment, the memory further includes an interrupt summary vector, the device table entry further includes an interrupt summary vector address indicator indicating the memory address of the interrupt summary vector, the interrupt summary vector includes an interrupt summary indicator for each bus-connected module, and each interrupt summary indicator is assigned to a bus-connected module to indicate whether there is an interrupt signal issued by the corresponding bus-connected module to be processed. Wherein, the method further includes: using the indicated memory address of the interrupt summary vector by the bus-attached device to update the interrupt summary indicator assigned to the bus-connected module from which the interrupt signal is received, so that the updated interrupt summary indicator indicates that there is an interrupt signal issued by the corresponding bus-connected module to be processed.
[0079] The embodiment can have the beneficial effect of monitoring and recording from which bus-connected modules there are interrupt signals to be processed. This information can be particularly useful in cases where a broadcast must be performed, such as as a fallback when direct addressing fails or is unavailable.
[0080] According to an embodiment, the memory further includes a directed interrupt summary vector, wherein the device table entry further includes a directed interrupt summary vector address indicator indicating the memory address of the directed interrupt summary vector, the directed interrupt summary vector includes a directed interrupt summary indicator for each interrupt target ID, and each directed interrupt summary indicator is assigned to an interrupt target ID to indicate whether there is an interrupt signal addressed to the corresponding interrupt target ID to be processed. Wherein, the method further includes: using the indicated memory address of the directed interrupt summary vector by the bus-attached device to update the interrupt summary indicator assigned to the target processor ID to which the received interrupt signal is addressed, so that the updated interrupt summary indicator indicates that there is an interrupt signal addressed to the corresponding interrupt target ID to be processed.
[0081] The embodiment can have the beneficial effect of monitoring and recording for which target processor ID there are interrupt signals to be processed. This information can be particularly useful in cases where a broadcast must be performed, such as as a fallback when direct addressing fails or is unavailable.
[0082] When an interruption cannot be directly delivered, e.g., because the hypervisor has not yet scheduled the target processor, the guest operating system can benefit from delivering the interruption with the originally expected affinity (i.e., information about which processor the interruption was expected for) by using broadcasting. In such a case, the bus-attached device can set the bit designating the target processor in the directed interruption signaling vector (DISB) after setting the directed interruption signaling vector (DIBV) and before delivering the broadcast interruption request to the guest operating system. If the guest operating system receives a broadcast interruption request, it can then identify which target processors have interruption signals pending to be signaled in the DIBV by scanning and disabling the direct interruption summary indicator in the DISB (e.g., scanning and resetting the direct interruption summary bit). Thus, the guest operating system can be enabled to decide whether the interruption signal is to be processed by the current processor that received the broadcast or further forwarded to the original target processor.
[0083] According to an embodiment, the memory further includes one or more interruption signal vectors, the device table entry further includes an interruption signal vector address indicator indicating the memory address of the interruption signal vector in the one or more interruption signal vectors, each interruption signal vector includes one or more signal indicators, each interruption signal indicator is assigned to a bus-connected module in the one or more bus-connected modules and an interruption target ID to indicate whether an interruption signal addressed to the corresponding interruption target ID has been received from the corresponding bus-connected module, wherein the method further includes: using the indicated memory address of the interruption signal vector by the bus-attached device to select the interruption signal indicator assigned to the bus-connected module that issued the received interruption signal and the interruption target ID to which the received interruption signal is addressed; updating the selected interruption signal indicator such that the selected interruption signal indicator indicates that there is an interruption signal issued by the corresponding bus-connected module and addressed to the corresponding interruption target ID to be processed.
[0084] According to an embodiment, each interruption signal vector includes an interruption signal indicator per interruption target ID assigned to the corresponding interruption target ID, each interruption signal vector is assigned to a separate bus-connected module, and the interruption signal indicator of the corresponding interruption signal vector is further assigned to the corresponding separate bus-connected module. The embodiment can have the beneficial effect of enabling the guest operating system to track which target processors the bus-connected modules have issued interruption signals to be processed for.
[0085] According to an embodiment, each of the interrupt signal vectors includes an interrupt signal indicator for each bus connection module assigned to the corresponding bus connection module, each interrupt signal vector is assigned to a separate target processor ID, and the interrupt signal indicator of the corresponding interrupt signal vector is also assigned to the corresponding target processor ID. The embodiment can have the beneficial effect of enabling the guest operating system to track from which bus connection modules the interrupt signals have been issued for processing by a specific target processor.
[0086] Thus, the interrupt signal vectors can be implemented as directed interrupt signal vectors sorted according to the target processor ID, i.e., optimized to track directed interrupts. In other words, the main order criterion is the target processor ID rather than the requester ID identifying the issuing bus connection module. Depending on the number of bus connection modules, each directed interrupt signal vector can include one or more directed interrupt signal indicators.
[0087] Thus, sorting of interrupt signal indicators (e.g., in the form of interrupt signaling bits) indicating that individual interrupt signals (e.g., in the form of MSI-X messages) have been sequentially received within consecutive memory regions (e.g., cache lines) for individual bus connection modules (e.g., PCIe functions) can be avoided. Enabling and / or disabling the interrupt signal indicator by setting and / or resetting the interrupt signaling bit, for example, requires the corresponding consecutive memory regions to be moved to one processor to correspondingly change the corresponding interrupt signal indicator.
[0088] From the perspective of the guest operating system, it can be expected that the processor processes all indicators for which it is responsible, i.e., in particular all indicators assigned to the corresponding processor. This can achieve a performance advantage because, in the case where each processor is processing all data assigned to it, the likelihood that the data required in this context is provided to the processor and / or stored in the local cache may be high, enabling fast access to the corresponding data for the processor without a large amount of cache traffic.
[0089] However, each processor attempting to process all indicators for which it is responsible may still result in high cache traffic between processors because each processor needs to write all cache lines for all functions. Because the indicators assigned to each individual processor can be distributed across all consecutive regions (e.g., cache lines).
[0090] The interrupt signaling indicators can be reordered in the form of a directed interrupt signaling vector such that all interrupt signaling indicators assigned to the same interrupt target ID are grouped in the same contiguous memory region (e.g., cache line). Thus, a processor that expects to process the indicators assigned to a corresponding processor (i.e., interrupt target ID) may only need to load a single contiguous memory region. Thus, a contiguous region per interrupt target ID is used instead of a contiguous region per bus-connected module. For all interrupt signals received from all available bus-connected modules that are targeted at a particular processor that is the target processor identified by the interrupt target ID, each processor may only need to scan and update a single contiguous memory region, e.g., a cache line.
[0091] According to an embodiment, the hypervisor may apply an offset to the guest operating system to align the bits to a different offset.
[0092] According to an embodiment, the device table entry further includes a logical partition ID that identifies the logical partition to which the guest operating system is assigned, and forwarding the interrupt signal by the bus-attached device further includes forwarding the logical partition ID together with the interrupt signal. The embodiment can have the beneficial effect of enabling the receiving processor to check which guest operating system the interrupt signal is addressed to.
[0093] According to an embodiment, the method further includes retrieving, by the bus-attached device, an interrupt subclass ID to which the received interrupt signal is assigned, and forwarding the interrupt signal by the bus-attached device further includes forwarding the interrupt subclass ID together with the interrupt signal.
[0094] According to an embodiment, instructions provided on a computer-readable non-transitory medium for execution by a processing circuit are configured to perform any one of the embodiments of the method for providing an interrupt signal to a guest operating system as described herein.
[0095] According to an embodiment, the computer system is further configured to perform any embodiment of the method for providing an interrupt signal to a guest operating system as described herein.
[0096] Figure 1Illustrates an exemplary computer system 100 for providing an interrupt signal to a guest operating system. The computer system 100 includes multiple processors 130 for executing a guest operating system. The computer system 100 also includes a memory 140, also referred to as storage memory or main memory. The memory 140 can provide a memory space, i.e., a memory segment, which is allocated for use by the hardware, firmware, and software components included in the computer system 100. The memory 140 can be used by the hardware and firmware of the computer system 100 as well as by software (such as a hypervisor, host / guest operating systems, application programs, etc.). One or more bus connection modules 120 are operably connected to the multiple processors 130 and the memory 140 via a bus 102 and a bus attachment device 110. The bus attachment device 110 manages the communication between the bus connection module 120 and the processors 130 on one hand, and the communication between the bus connection module 120 and the memory 140 on the other hand. The bus connection module 120 can be connected to the bus 102 directly or via one or more intermediate components (such as a switch 104).
[0097] The bus connection module 120 can be provided, for example, in the form of a high-speed Peripheral Component Interconnect Express (PCIe) module, also referred to as a PCIe adapter or the PCIe function provided by a PCIe adapter. The PCIe function 120 can issue a request, which is sent to the bus attachment device 110, such as a PCI host bridge (PHB), also referred to as a PCI bridge unit (PBU). The bus attachment device 110 receives the request from the bus connection module 120. The request can include, for example, an input / output address for performing a direct memory access (DMA) to the memory 140 by the bus attachment device 110 or an input / output address indicating an interrupt signal (such as a message signal interrupt (MSI)).
[0098] Figure 2 Illustrates an exemplary virtual machine support provided by the computer system 100. The computer system 100 can include one or more virtual machines 202 and at least one hypervisor 200. The virtual machine support can provide the ability to operate a large number of virtual machines, each of which is capable of executing a guest operating system 204, such as z / Linux. Each virtual machine 201 can function as a separate system. Thus, each virtual machine can be reset independently, execute a guest operating system, and run different programs, such as application programs. The operating system or application programs running in the virtual machine can appear to have access to a complete computer system. However, in fact, only a portion of the available resources of the computer system are available for use by the corresponding operating system or application programs.
[0099] A virtual machine can use the V=V model, where the memory allocated to the virtual machine is supported by virtual memory rather than real memory. Thus, each virtual machine has a virtual linear memory space. Physical resources are owned by a hypervisor such as hypervisor 200, and the shared physical resources are dispatched by the hypervisor to guest operating systems as needed to meet their processing requirements. The V=V virtual machine model assumes that the interaction between the guest operating systems and the physical shared machine resources is controlled by the VM hypervisor because a large number of clients may prevent the hypervisor from simply partitioning the hardware resources and allocating the hardware resources to the configured clients.
[0100] Processor 120 can be allocated by hypervisor 200 to virtual machine 202. Virtual machine 202 can be allocated, for example, one or more logical processors. Each logical processor can represent all or a share of physical processor 120 that can be dynamically allocated by hypervisor 200 to virtual machine 202. Virtual machine 202 is managed by hypervisor 200. Hypervisor 200 can be implemented, for example, in the firmware running on processor 120, or can be a part of the operating system executing on computer system 100. Hypervisor 200 can be, for example, a VM hypervisor, such as that provided by International Business Machines Corporation of Armonk, New York
[0101] Figure 3 An exemplary multi-level virtual machine support provided by computer system 100 is depicted. In addition to Figure 2 the first-level virtualization, a second-level virtualization is provided, where a second hypervisor 210 executes on a first-level guest operating system that acts as the host operating system for the second hypervisor 210. The second hypervisor 210 can manage one or more second-level virtual machines 212, each of which is capable of executing a second-level guest operating system 212.
[0102] Figure 4Illustrates an exemplary pattern for using different types of IDs to identify processors at different architectural levels of a computer system 100. The underlying firmware 220 may provide a logical processor ID ICPU 222 to identify the processor 130 of the computer system 100. The first-level hypervisor 200 uses the logical processor ID ICPU 222 to communicate with the processor 130. The first-level hypervisor may provide a first virtual processor ID vCPU 224 for use by the guest operating system 204 or the second-level hypervisor 219 executing on a virtual machine managed by the first-level hypervisor 200. The hypervisor 200 may group the first virtual processor IDs vCPU 224 to provide logical partitions (also known as zones) to the guest operating system 204 and / or the hypervisor 210. The first virtual processor ID vCPU 224 is mapped by the first-level hypervisor 200 to the logical processor ID ICPU222. One or more of the first virtual processor IDs vCPU 224 provided by the first-level hypervisor 200 may be assigned to each guest operating system 204 or hypervisor 210 executing using the first-level hypervisor 200. The second-level hypervisor 210 executing on the first-level hypervisor 200 may provide one or more virtual machine execution software, such as other guest operating systems 214. To this end, the second-level hypervisor manages a second virtual processor ID vCPU 226 for use by the second-level guest operating system 214 executing on the virtual machine of the first-level hypervisor 200. The second virtual processor ID vCPU 226 is mapped by the second-level hypervisor 200 to the first virtual processor ID vCPU 224.
[0103] The bus connection module 120 that addresses the processor 130 used by the first / second-level guest operating system 204 may use a target processor ID in the form of the first / second virtual processor IDs vCPU 224, 226 or a replacement ID derived from the first / second virtual processor IDs vCPU 224, 226.
[0104] Figure 5Depicts a simplified schematic setup of a computer system 100, which shows the main parties involved in a method for providing an interrupt signal to a guest operating system executing on the computer system 100. For illustrative purposes, the simplified setup includes a bus connection module (BCM) 120 that sends an interrupt signal to a guest operating system executing on one or more processors (CPUs) 130. The interrupt signal is sent to a bus-attached device 110 together with an interrupt target ID (IT_ID) that identifies one of the processors 130 as the target processor. The bus-attached device 110 is an intermediate device that manages the communication between the bus connection module 120 and the processors 130 and the memory 140 of the computer system 100. The bus-attached device 110 receives the interrupt signal and uses the interrupt target ID to identify the logical processor ID of the target processor in order to directly address the corresponding target processor. The directed forwarding to the target processor can improve the efficiency of data processing, for example, by reducing cache traffic.
[0105] Figure 6 Depicts Figure 5 The computer system 100. The bus-attached device 110 is configured to perform a status update of the status of the bus connection module 120 in a module-specific area (MSA) 149 of the memory 140. Such a status update can be performed in response to receiving a direct memory access (DMA) write from the bus connection module specifying the status update to be written to the memory 140.
[0106] The memory further includes a device table (DT) 144, where there is a device table entry (DTE) 146 for each bus connection module 120. After receiving an interrupt signal (e.g., an MSI-X write message) having an interrupt target ID identifying the target processor for an interrupt request and a requester ID identifying the origin of the interrupt request in the form of a bus connection module 120, the bus-attached device 110 fetches the DTE 146 assigned to the requesting bus connection module 120. The DTE 146 can, for example, use the dIRQ bit to indicate whether directed addressing of the target processor is enabled for the requesting bus connection module 120. The bus-attached device updates the entries of the directed interrupt signal vector (DIBV) 162 and the directed interrupt summary vector (DISB) 160 to keep track of which processor 130 the interrupt signal has been received for. The DISB 160 can include one entry per interrupt target ID, which indicates whether there is an interrupt signal from any bus connection module 120 to be processed for that processor 130. Each DIBV 162 is assigned to one of the interrupt target IDs (i.e., the processor 130) and can include one or more entries. Each entry is assigned to one of the bus connection modules 120. Thus, the DIBV indicates from which bus connection modules there is an interrupt signal to be processed for a particular processor 130. This can have the advantage that in order to check whether there are any interrupt signals to be processed or from which bus connection module 120 there is an interrupt signal for a particular processor, only the signal entries (e.g., bits) or signal vectors (e.g., bit vectors) need to be read from the memory 140. According to an alternative embodiment, an interrupt signal vector (AIBV) and an interrupt summary vector (AISB) can be used. Each of the entries of the AIBV and the AISB is assigned to a particular bus connection module 120.
[0107] The bus-attached device 110 uses an entry (IRTE) 152 of an interrupt table (IRT) 150 stored in the memory 140 to convert an interrupt target ID (IT_ID) to a logical processor ID, and uses the logical processor ID to directly address the target processor to forward the received interrupt signal to the target processor. For the conversion, the bus-attached device 110 fetches a copy 114 of the entry (IRTE) 152. The copy can be fetched from the local cache or from the memory 140 using the address (IRT@) of the interrupt table 150 provided by a copy of the DTE 146. The IRTE 152 provides a mapping from the interrupt target ID to the logical processor ID, which the bus-attached device 110 uses to directly address the target processor in the case of directed interrupt forwarding. Each processor includes firmware (e.g., millicode 132) for receiving and processing direct interrupt signals. The firmware may also include, for example, the microcode and / or macrocode of the processor 130. It may include hardware-level instructions and / or data structures used in the implementation of higher-level machine code. According to an embodiment, it may include proprietary code that can be delivered as microcode, which includes trusted software or microcode specific to the underlying hardware and controls the operating system's access to the system hardware. In addition, the firmware of the processor 130 may include checking logic 134 to check whether the receiving processor is the same as the target processor according to the interrupt target ID forwarded by the bus-attached device 110 to the receiving processor 130. In the case where the receiving processor 130 is not the target processor, i.e., where the received interrupt target ID does not match the reference interrupt target ID of the receiving processor 130, the interrupt signal is broadcast to the logical partition to find a processor for processing the interrupt signal.
[0108] Figure 7A through 7C are flowcharts of an exemplary method for performing a status update of bus connection module 120 via bus attached device 110 using a DMA write request. In step 300, the bus connection module may decide to update its status and trigger an interrupt, for example, to indicate signal completion. In step 310, the bus connection module initiates a direct memory access (DMA) write to a section of memory (i.e., main memory) assigned to the host running on the computer system via the bus attached device, in order to update the status of the bus connection module. DMA is a hardware mechanism that allows the peripheral components of a computer system to transfer their I / O data directly to and from the main memory without involving the system processor. To perform DMA, the bus connection module sends a DMA write request to the bus attached device, for example, in the form of an MSI-X message. In the case of PCIe, the bus connection module may refer to, for example, the PCIe function provided on a PCIe adapter. In step 320, the bus connection module receives the DMA write request with the status update of the bus connection module and uses the received update to update the memory. The update may be performed in the area of the host memory reserved for the corresponding bus connection module.
[0109] Figure 8 is for using Figure 6 Computer system 100 provides an interrupt signal to a guest operating system. In step 330, the bus attached device receives an interrupt signal sent by the bus connection module, for example, in the form of an MSI-X write message. This transmission of the interrupt signal may be performed according to the specifications of the PCI architecture. The MSI-X write message includes an interrupt target ID that identifies the target processor of the interrupt. The interrupt target ID may be, for example, a virtual processor ID used by the guest operating system to identify the processors of a multi-processor computer system. According to an embodiment, the interrupt target ID may be any other ID agreed upon by the guest operating system and the bus connection module in order to be able to identify the processor. Such another ID may be, for example, the result of a mapping of the virtual processor ID: In addition, the MSI-X write message may also include an interrupt requester ID (RID) (i.e., the ID of the PCIe function that issued the interrupt request), a vector index that defines the offset of the vector entry within the vector, an MSI address (e.g., a 64-bit address), and MSI data (e.g., 32-bit data). The MSI address and MSI data may indicate that the corresponding write message is actually an interrupt request in the form of an MSI message.
[0110] In step 340, the bus-attached device retrieves a copy of an entry of the device table stored in the memory. The device table entry (DTE) provides an address indicator for one or more vectors or vector entries to be updated to indicate that an interrupt signal for the target processor has been received. The address indicator of the vector entry may include, for example, the address of the vector in the memory and the offset within the vector. In addition, the DTE may provide a direct signaling indicator that indicates whether the target processor is to be directly addressed by the bus-attached device using the interrupt target ID provided together with the interrupt signal. In addition, the DTE may provide a logical partition ID (also referred to as a region ID) and an interrupt subclass ID. A corresponding copy of the device table entry may be retrieved from the cache or from the memory.
[0111] In step 342, the bus-attached device uses the interrupt target ID received together with the interrupt signal and the address indicator of the memory indicating the IRT provided by the DTE to retrieve a copy of the IRTE from the memory. In the case of the secondary acquisition method, this step is part one of the secondary acquisition.
[0112] In step 350, the bus-attached device updates the vector specified in the DTE. In step 360, the bus-attached device checks the direct signaling indicator provided together with the interrupt signal. In the case where the direct signaling indicator indicates no direct signaling, the bus-attached device forwards the interrupt signal by broadcast using the region identifier and the interrupt subclass identifier to provide the interrupt signal to the processor used by the guest operating system. In the case where the direct signaling indicator indicates no direct signaling, in step 370, the interrupt signal is forwarded to the processor via broadcast. The broadcast message includes the region ID and / or the interrupt subclass ID. When received by the processor, if the interrupt request is enabled for the region, the status bit is atomically set, for example, according to the nested communication protocol. In addition, the firmware (e.g., microcode) on this processor interrupts its activity, e.g., program execution, and switches to execute the interrupt handler of the guest operating system.
[0113] In the case where the direct signaling indicator indicates direct signaling, in step 380, the bus-attached device converts the interrupt target ID provided together with the interrupt signal into a logical processor ID assigned to the processor used by the guest operating system. For this conversion, the bus-attached device may use the first copy of the IRTE.
[0114] In step 390, the bus-attached device uses the logical processor ID to directly address the corresponding processor to forward the interrupt signal to the target processor, i.e., send a direct message. The direct message includes the interrupt target ID. The direct message may also include a region ID and / or an interrupt subclass ID. The receiving processor includes interrupt target ID checking logic. In the case where the interrupt target ID is unique per logical partition only, the checking logic may also consider the logical partition ID.
[0115] In the case of implementing a secondary fetch, the method proceeds to step 392. In step 392, the bus-attached device fetches a second copy of the IRTE. In step 394, the data provided by the second copy is compared with the data provided by the first copy. A match indicates that the interrupt has been forwarded to the correct target processor and the IRTE update has not been performed yet. In the case of a mismatch, one or more steps after step 342 may be repeated. According to an embodiment, all steps after step 342 may be repeated. In the case of a secondary fetch, step 392 constitutes part two of the secondary fetch method, preventing a direct message from being sent to an inactive processor. If the IRTE has not changed, the re-fetching in step 392 can be performed using the local proximity BAD cache, incurring only a small overhead.
[0116] In step 396, the firmware (e.g., microcode) of the target processor receives the interrupt. In response, the firmware may interrupt its activity, such as program execution, and switch to execute the interrupt handler of the guest operating system. The interrupt may be presented to the guest operating system with a direct signaling indication. In the case where the checking logic is implemented on the receiving processor, a check may be performed to check whether the received interrupt target ID and / or logical partition ID match the interrupt target ID and / or logical partition currently assigned to the receiving processor and accessible to the checking logic. In the case of a mismatch, the receiving firmware may initiate a broadcast and use the logical partition ID and / or interrupt subclass ID to broadcast the received interrupt request to the remaining processors to identify a valid target processor for handling the interrupt.
[0117] Figure 9It is an additional flowchart further showing the method of FIG. 8. First, an interrupt message can be sent to the bus-attached device. It can be checked whether the DTE assigned to the interrupt requester (i.e., the bus connection module) is cached in the local cache operably connected to the bus-attached device. In the case where the DTE is not cached, the corresponding DTE can be fetched from the memory by the bus-attached device. The vector address indicator provided by the DTE can be used to set vector bits in the memory. Then, in step 410, the direct signaling indicator provided by the DTE is used to check whether the target processor is to be directly addressed by the bus-attached device using the interrupt target ID provided together with the interrupt signal. In the case where the target processor is not to be directly targeted, the method continues to broadcast the interrupt request to the processors. In the case where the target processor is to be directly targeted, the method continues to fetch a copy of the IRTE assigned to the received interrupt target ID from the memory in step 413 and use the fetched copy of the IRTE to convert the interrupt target ID into a logical processor ID in step 414. After sending the message forwarding the interrupt signal to the target processor in step 416, in step 417, a second copy of the RTE is fetched. In step 421, the bus-attached device checks for potential updates of the IRTE during this period, i.e., whether the IRTE has changed. In the case where the data provided by the second copy and the first copy of the IRTE match, the method continues with step 418. Otherwise, the second copy of the IRTE can be used to repeat the steps performed after receiving the first copy of the IRTE in step 413. According to an alternative embodiment, step 413 can also be repeated. According to another embodiment, in the case of a mismatch, the method can continue to broadcast the interrupt signal.
[0118] The logical processor ID is used to directly address the target processor. The message includes the interrupt target ID, the logical partition ID, and the interrupt subclass ID. In step 418, the processor receives the message. In step 419, the processor checks whether the interrupt target ID and / or the logical partition ID match the current interrupt target ID and / or the logical partition ID provided as a reference for the check. In the case of a match, in step 420, the processor presents the interrupt request to the guest operating system. In the case of a mismatch, in step 422, the processor broadcasts the interrupt request to other processors. Then, the processor continues its activity until the next interrupt message is received.
[0119] Figure 10Describes a method for performing an exemplary secondary fetch scheme to ensure that the IRTEs used are up-to-date. In step 500, an interrupt signal (e.g., an MSI-X message) is sent from the bus connection module 120 (e.g., a PCIe adapter or a PCIe function on a PCIe adapter) to the bus-attached device 110 (e.g., a PCIe primary bridge (PHB)). In step 502, the bus-attached device 110 requests from the memory 140 the first copy of the IRTE assigned to the interrupt target ID provided together with the interrupt signal. In step 504, the memory 140 sends a copy of the IRTE in response to the request. The time point at which the copy of the IRTE is sent marks the last time point at which the IRTE was truly up-to-date. At this time point, a time window begins, during which the IRTE can be updated and the data provided by the first copy of the IRTE can become obsolete. The time window ends when the interrupt is processed by the target processor 130. From this time point on, any changes to the IRTE no longer affect the processing of the received interrupt signal. In step 506, the bus-attached device 110 sends a request to the IRTE to enable the directed pending interrupt indicator, e.g., set the directed pending interrupt array (dPIA) bits. The enabled directed pending interrupt indicator indicates that a directed interrupt is waiting for the interrupt target ID. In step 508, the setting of the directed pending interrupt indicator is acknowledged by the memory 140. In step 510, the interrupt signal is forwarded in the form of a directed interrupt request using direct addressing to the target processor 130 identified by the logical processor ID obtained by translating the interrupt target ID using the IRTE. As the target processor 130 receives the directed interrupt request, the time window is closed. In step 512, after the time window is closed, the bus-attached device 110 reads the second copy of the IRTE from the IRTE provided in the memory 140. In step 514, after receiving the requested second copy of the IRTE, the bus-attached device 110 checks whether the second copy of the IRTE matches the first copy of the IRTE, i.e., whether the IRTE, specifically the mapping of the interrupt target ID, has changed. In the case of a match, the method ends with the target processor 130 resetting the directed pending interrupt indicator in the IRTE after the interrupt request has been presented to and processed by the guest operating system. In the case of a mismatch, the method can continue with step 502. Alternatively, the method can continue with the bus-attached device 110 broadcasting the received interrupt signal.
[0120] Figure 11 Describes Figure 6Another embodiment of computer system 100. The IRTE 152 further provides a run indicator 154 and / or a block indicator 146. The run indicator 154 indicates whether the target processor identified by the interrupt target ID is fully scheduled (i.e., running), and the block indicator 146 indicates whether the target processor is currently blocked from receiving interrupt signals. In the case where the target processor is not scheduled or is temporarily blocked, a broadcast can be initiated to enable timely interrupt handling.
[0121] Figure 12 is an exemplary method for a computer system 100 to provide an interrupt signal to a guest operating system using Figure 11 is a flowchart of an exemplary method. Figure 12 The method continues with step 342 after step 340 in FIG. 8. In step 342, the bus-attached device retrieves a copy of the IRTE from the memory using the interrupt target ID received together with the interrupt signal and the address indicator indicating the memory of the IRT provided by the DTE. In step 350, the bus-attached device updates the vector specified in the DTE.
[0122] In step 360, the bus-attached device checks the direct signaling indicator provided together with the interrupt signal. In the case where the direct signaling indicator indicates no direct signaling, in step 370, the bus-attached device forwards the interrupt signal by broadcast using the region identifier and the interrupt subclass identifier to provide the interrupt signal to the processors used by the guest operating system. In the case where the direct signaling indicator indicates direct signaling, in step 362, the bus-attached device further checks whether the run indicator included in the copy of the IRTE indicates that the target processor identified by the interrupt target ID is running.
[0123] In the case where the target processor is not running, in step 364, the bus-attached device uses, for example, the logical partition ID and / or the interrupt subclass ID to identify a processor suitable for handling the interrupt and sends a broadcast interrupt as a fallback. In the case where no suitable processor with a matching logical partition ID and / or interrupt subclass ID is found, the hypervisor (i.e., the processor assigned to be used by the hypervisor) rather than the processor assigned to the guest operating system can receive the interrupt request. If one or more processors assigned to the guest operating system are scheduled, the hypervisor can decide to broadcast the interrupt request again. For the entries of the processors assigned to the operating system, the hypervisor can check the direct interrupt pending indicator to be presented to the incoming processor, such as the dPIA bit. According to an embodiment, the hypervisor can, for example, selectively reschedule (i.e., wake up) the target processor.
[0124] While the target processor is running, at step 366, check whether a direct interrupt block indicator (e.g., the dIBPIA bit) is enabled. An enabled direct interrupt block indicator indicates that interrupt delivery is not currently as expected by the guest operating system interrupt handler. Thus, if the direct interrupt block indicator is enabled, at step 368, an interrupt signal may be broadcast.
[0125] If the direct interrupt block indicator is disabled to indicate that the target processor is not currently blocked, at step 380, continue the delivery of the current interrupt signal by translating the received interrupt target ID so as to directly forward the interrupt to the target processor using the logical processor ID provided by the IRTE for the received interrupt target ID.
[0126] At step 380, the bus-attached device translates the interrupt target ID provided with the interrupt signal into the logical processor ID of the processor assigned for use by the guest operating system. For this translation, the bus-attached device may use a mapping table included by the bus-attached device. The bus-attached device may include a mapping table or sub-table for each zone (i.e., logical partition).
[0127] At step 390, the bus-attached device uses the logical processor ID to directly address the corresponding processor to forward the interrupt signal to the target processor, i.e., send a direct message. At step 396, the receiving firmware (e.g., microcode) of the target processor accepts the directly addressed interrupt for presentation to the guest operating system. In response, the firmware may interrupt its activity, e.g., program execution, and switch to execute the guest operating system interrupt handler. The interrupt may be presented to the guest operating system with a direct signaling indication.
[0128] According to an embodiment, the receiving processor includes interrupt target ID checking logic. The direct message includes the interrupt target ID. The direct message may also include a zone ID and / or an interrupt subclass ID. In the case where the interrupt target ID is unique per logical partition only, the checking logic may also consider the logical partition ID. The checking logic may check whether the received interrupt target ID and / or logical partition ID match the interrupt target ID and / or logical partition currently assigned to the receiving processor and accessible to the checking logic. In the case of a mismatch, the receiving firmware may initiate a broadcast and use the logical partition ID and / or interrupt subclass ID to identify a valid target processor for handling the interrupt to broadcast the received interrupt request to the remaining processors. In the case of a match, the receiving firmware (e.g., microcode) of the target processor accepts the directly addressed interrupt for presentation to the guest operating system.
[0129] Figure 13 is further illustrated Figure 12Additional flowchart of the method. In the case where the target processor will be directly targeted, like Figure 9 as Figure 13 shown, the method continues with step 410. The method continues by fetching a copy of the IRTE assigned to the received interrupt target ID from memory at step 413. At step 413a, it is checked whether the run indicator included in the IRTE is enabled. In the case where the run indicator is disabled, at step 413b, the interrupt signal can be forwarded by the bus-attached device using broadcast. In the case where the run indicator is enabled, the bus-attached device continues to check whether the directed blocking indicator is enabled at step 413c. In the case where the directed blocking indicator is not enabled, the bus-attached device continues to convert the interrupt target ID into a logical processor ID using the fetched copy of the IRTE at step 414. Otherwise, the interrupt signal can be suppressed at step 413d.
[0130] Figure 14Depicts another method for performing a secondary fetch of an IRTE to ensure that the information provided by the IRTE is up-to-date. In step 600, an interrupt signal (e.g., an MSI-X message) is sent from the bus connection module 120 (e.g., a PCIe adapter or a PCIe function on a PCIe adapter) to the bus-attached device 110 (e.g., a PCIe host bridge (PHB)). In step 602, the bus-attached device 110 requests a copy of the IRTE assigned to the interrupt target ID provided with the interrupt signal from the memory 140. In step 604, the memory 140 sends a first copy of the IRTE in response to the request. The first copy includes a run indicator (e.g., run bit R = 1) indicating that the target processor is scheduled, a directed interrupt blocking indicator (e.g., directed blocking bit dIBPIA = 0) indicating that the target processor is not currently blocked from receiving the interrupt signal, and a logical processor ID ICPU. The bus-attached device 110 uses the logical processor ID ICPU to directly address the target processor 130. Since the run indicator indicates that the target processor 130 is running, in step 606, the bus-attached device 110 enables the directed interrupt pending indicator in the IRTE, e.g., sets dPIA = 1, and blocks the target processor from receiving other interrupts, e.g., sets dIBPIA = 1. To check that the content of the IRTE has not been changed during this time, e.g., the target processor 130 has been deactivated, in step 608, the critical time window is closed by requesting a re-read of the IRTE. In step 610, the memory 140 sends a second current copy of the IRTE in response to the request. The second copy includes a run indicator (e.g., run bit R = 1) indicating that the target processor 130 is still scheduled, a directed interrupt blocking indicator enabled by the bus-attached device, and the same logical processor ID ICPU as provided by the first copy of the IRTE. Since the run indicator and the ICPU have not changed, the method continues in step 612 to use the ICPU to send an interrupt request directly addressed to the target processor 130. The target processor 130 presents the interrupt to the guest operating system and processes the interrupt. When the processing of the interrupt ends, the target processor 130 disables the directed interrupt pending indicator (e.g., resets dPIA = 0) and the directed interrupt blocking indicator (e.g., resets dIBPIA = 0).
[0131] Figure 15 Depicts Figure 14Alternative flowchart of the method, which shows the situation where the information included in the IRTE changes during this period. In step 600, an interrupt signal (such as an MSI-X message) is sent from the bus connection module 120 (such as a PCIe adapter or a PCIe function on the PCIe adapter) to the bus-attached device 110 (such as a PCIe primary bridge (PHB)). In step 602, the bus-attached device 110 requests a copy of the IRTE assigned to the interrupt target ID provided together with the interrupt signal from the memory 140. In step 604, the memory 140 sends a first copy of the IRTE in response to the request. The first copy includes a run indicator (such as, run bit R = 1) indicating that the target processor 130 is scheduled and the logical processor ID ICPU. The logical processor ID ICPU is used by the bus-attached device 110 to directly address the target processor 130. Since the run indicator indicates that the target processor 130 is running, in step 606, the bus-attached device 110 enables the directed interrupt pending indicator in the IRTE, such as setting dPIA = 1, and blocks the target processor from receiving other interrupts, such as setting dIBPIA = 1. To check that the content of the IRTE has not changed during this period, such as the target processor 130 being deactivated, the critical time window is closed in step 608 by requesting a re-read of the IRTE. In step 610, the memory 140 sends a second current copy of the IRTE in response to the request. In this example, the target processor 130 has been deactivated for the guest operating system during this period. Therefore, the second copy includes a run indicator indicating that the target processor 130 is no longer scheduled, such as run bit R = 0. The logical processor ID ICPU may or may not be the same as the ICPU provided by the first copy of the IRTE. The directed interrupt block indicator remains enabled by the bus-attached device. Since the run indicator and / or the ICPU have changed, the method continues to use broadcast to send an interrupt request to the processor in step 612.
[0132] Figure 16 Shows an exemplary DTE 146, which includes the memory address IRT@ of the IRT, the logical partition ID (region), and the offset (DIBVO) within the DIBV assigned to the interrupt target ID. The DIBVO identifies the start of a segment or entry of the vector assigned to a specific bus connection module. The interrupt signal (such as an MSI-X message) can provide a DIBV-Idx, which is added to the DIBVO to identify a specific entry of the vector assigned to the bus connection module. In addition, a directed interrupt number (NOI) is provided, which defines the maximum number of bits reserved for the corresponding bus connection module in the DIBV. Further details of the DIBV are shown in Figure 19A are shown. In the case of the AIBV, the DTE can provide the corresponding AIBV-specific parameters as shown in Figure 19B are shown.
[0133] In addition, an exemplary IRTE 152 is depicted. The IRTE 152 may include a logical partition ID (region), an interrupt subclass ID (DISC), a memory address DISB@ of the DISB, an offset DISBO within the DISB, and a memory address DIBV of the DIBV of the interrupt target ID assigned to the target processor.
[0134] Figure 17 The schematic structures of the DISB 160 and a plurality of DIBVs 162 are depicted. The DISB 160 may be provided in the form of a continuous memory section (e.g., a cache line), which includes an entry 161 (e.g., a bit) for each interrupt target ID. Each entry indicates whether there is an interrupt request (IRQ) to be processed by the corresponding processor identified by the interrupt target ID. For each interrupt target ID, i.e., the entry of the DISB 160, a DIBV 162 is provided. Each DIBV 162 is assigned to a specific interrupt target ID and includes one or more entries 163MN A, MN B for each bus connection module. Each of the DIBVs 162 may be provided in the form of a continuous memory section, such as a cache line, which includes the entries 163 assigned to the same interrupt target ID. The entries of different bus connection modules may be sorted using different offsets DIBVO for each bus connection module.
[0135] Figure 18 The schematic structures of the AISB 170 and a plurality of AIBVs 172 are depicted. The AISB 170 may be provided in the form of a continuous memory section (e.g., a cache line), which includes the entries 171 (e.g., bits) for each bus connection module MN A to MN D. Each entry indicates whether there is an interrupt request (IRQ) from the corresponding bus connection module to be processed. For each bus connection module, i.e., the entry of the AISB 170, an AIBV 172 is provided. Each AIBV 172 is assigned to a specific bus connection module and includes one or more entries 173 for each interrupt target ID. Each of the AIBVs 172 may be provided in the form of a continuous memory section (e.g., a cache line), which includes the entries 173 assigned to the same bus connection module. The entries regarding different target processor IDs may be sorted using different offsets AIBVO for each bus connection module.
[0136] Figure 20A and 20BExemplary DISB 160 and AISB 170 are shown respectively. Entries 161, 171 can be addressed using base addresses DISB@ and AISB@ respectively, in combination with offsets DISBO and AISBO respectively. In the case of DISB 160, DISBO can be the same as, for example, the interrupt target ID to which the corresponding entry 161 is assigned. The interrupt target ID can be provided, for example, in the form of a virtual processor ID (vCPU).
[0137] Figure 21A and 21B An exemplary method for providing an interrupt signal to a guest operating system is shown. In step 704, a bus connection module (BCM) (e.g., a virtual function on a PCI adapter, i.e., a PCI adapter (VF)) sends an interrupt signal. The interrupt signal can be sent, for example, in the form of an MSI-X message MSI-X(VF, vCPU, DIBV-Idx), which includes an identifier of the virtual function VF, an interrupt target ID in the form of, for example, a virtual processor ID vCPU, and an offset (e.g., DIBV-Idx) that identifies an entry (e.g., a bit) within a directed interrupt signal vector. In step 706, a bus attached device (BAD) (e.g., a PCI host bridge (PHB), also referred to as a PCI bridge unit (PBU)) receives the interrupt signal.
[0138] In step 708, the PBU reads the entry of the device table (DT) assigned to the VF. The entry of the DT stored in the hardware system area (HSA) of the memory is illustrated as a row of the table. The entry of the DT can include the address of the interrupt table (IRT@) and a directed signaling bit (S) indicating whether directed signaling is to be performed. The PBU uses IRT@ to fetch the entry of the IRT assigned to the vCPU from the HSA, which includes a running bit (R) indicating whether the vCPU is running, a directed interrupt block bit (dIBPIA) indicating whether the vCPU is blocked from receiving interrupts, and a directed interrupt pending bit (dPIA) indicating whether an interrupt directed to the vCPU is pending. In step 700, at an earlier time point, a start interpret execution instruction (SIE-Entry) that initiates a state change of the target processor from the hypervisor mode to the guest mode has been issued. In step 701, R is set to 1 in the IRTE assigned to the target processor, and the logical processor ID (TrgtPU#) of the target processor is provided. Then, the method ends at 702. For firmware and hardware, TrgtPU# refers to the physical ID of the processing unit (1 physical PU), while for zOS and logical partitions (LPAR), TrgtPU# refers to the logical ID of the processing unit (logical PU).
[0139] In step 710, the PBU uses the DIBV-Idx from MSI-X to set the bits in the DIBV that are assigned to the vCPU to indicate the presence of an interrupt signal targeted at the vCPU from the VF. In step 712, the PBU checks whether the IRTE is blocked, i.e., IRTE.dIBIA == 1. In the case of the IRTE assigned to the vCPU being blocked from receiving other interrupts by the vCPU, the method ends in step 714. In the case where the IRTE is not blocked, the method proceeds to step 716, where the PBU checks whether the vCPU is running, i.e., whether R is set in the IRTE.
[0140] If R is set, the method proceeds to step 718 to perform directed addressing. In step 718, dlBPIA and dPIA are set to 1 in the IRTE, indicating that the vCPU is currently blocked from receiving interrupt signals and that the interrupt addressed to the vCPU is pending. In step 720, it is checked whether the IRTE (more precisely, the status of R and / or TrgtPU# in the IRTE) has changed compared to the IRTE in step 78. Thus, a secondary acquisition scheme of reading the IRTE twice is implemented to ensure that no relevant changes have occurred, for example, due to SIE entries of another guest as shown in step 722, between the reads.
[0141] In step 722, the SIE entry instruction for another guest is executed on the target processor. In step 724, the other guest reads the IRTE of the previous guest and issues an atomic reset command for R in step 726, i.e., sets R = 0 and indicates that the vCPU is no longer running. Additionally, dPIA is read from the IRTE. In step 728, it is checked whether dPIA is set (IRTE.dPIA == 1), indicating that the interrupt for the vCPU is still pending. If no interrupt is pending, the method ends in step 730. If the interrupt is still pending, then in step 732, the pending interrupt indicator PU.dPIA is reset on the target PU and IRTE.dPIA of the IRTE is reset, and a broadcast for the pending interrupt is initiated. Thus, if a relevant change in the IRTE is determined in step 720, the interrupt is broadcast.
[0142] If no relevant change to the IRTE is determined in step 720, the method proceeds to step 734. In step 734, the interrupt signal (directed PCI interrupt SYSOP) is directed and forwarded to the target PU, which is also referred to as the directed PU. In step 736, the directed PU receives the directed PCI interrupt, and in step 738, a pending interrupt indicator PU.dPIA is set on the directed PU. In step 739, it is checked whether the directed PU is masked, that is, generally, prevented from receiving and executing interrupts. If the directed PU is masked, the method ends at step 740. If the directed PU is not masked, for example, due to unmasking as shown in step 742, the method proceeds to execute the interrupt by the firmware (e.g., millicode) (mCode IO-Irpt) of the directed PU in step 744. In step 746, PU.dPIA and IRTE.dPIA are reset to indicate that the interrupt is no longer pending.
[0143] In step 748, the operating system interrupt handler (OS IO-Irpt) is called, and in step 750, the DIBV bit set in step 710 is read and reset. In step 752, a loop is made over all DIBV bits of the DIBV assigned to the target PU (i.e., the directed PU). Thus, all interrupts of the target PU can be processed successively. In the case where all DIBV bits have been processed, in step 754, the target PU is unblocked (SIC.OC17) by resetting IRTE.dIBPIA. In addition, the DIBV is reread in order to determine in step 756 whether another DIBV bit has been set in the meantime. If this is the case, the corresponding interrupt is processed, otherwise the method ends at step 758.
[0144] If the result of the check in step 716 is that R is not set, the method proceeds to step 760 to perform a broadcast as a fallback. In step 760, the directed interrupt summary indicator is enabled in the directed interrupt summary vector, for example, by setting a bit. Each bit of the interrupt summary vector is assigned to a CPU, indicating whether there are any interrupts to be processed by the corresponding CPU. In step 764, the interrupt is broadcast (SIGI.enq.IBPIA) and received by any PU in step 766. In step 768, the block bit is set in the IBPIA for the corresponding PU, indicating that the PU is currently blocked from receiving interrupts. In step 770, it is checked whether the IBPIA has been changed by setting the block bit, i.e., whether the IBPIA is 0→1. If the IBPIA has not been changed, i.e., it has been blocked, the method ends in step 772. If the IBPIA has been changed, then in step 774, the pending bit is set in the PIA for the corresponding PU. In step 776, it is checked whether the PU is masked, i.e., generally, blocked from receiving and executing interrupts. If the PU is masked, the method ends in step 778. If the PU is not masked, for example, due to unmasking as shown in step 780, the method proceeds to step 782 where the interrupt is executed by the firmware of the PU (e.g., microcode) (mCode IO-Irpt). In step 784, the pending bit in the PIA is reset to indicate that the interrupt is no longer pending.
[0145] In step 786, the operating system interrupt handler (OS IO-Irpt) is called and in step 788, the DISB bit set in step 760 is read and reset. In steps 790 and 792, the corresponding directed PU is signaled that the interrupt has been processed. In step 794, a loop is made over all the DISB bits in the DISB array, each bit being assigned to another PU. DISB summarizes all the interrupts to be processed by broadcast. The interrupts are sorted according to the PU they are targeted at. Thus, all the interrupts to be processed by broadcast can be processed successively by the PUs. In the case where all the DISB bits have been processed, in step 796 the PU is unblocked (SIC.OC1) by resetting the IBPIA. In addition, DISB is reread in order to determine in step 798 whether another DISB bit has been set in the meantime. If this is the case, the corresponding interrupt is processed, otherwise the method ends in step 799.
[0146] The guest operating system can be implemented, for example, using a paged storage mode guest. For example in, the paged guest can be interpretively executed at interpretive level 2 via the start interpret execution (SIE) instruction. For example, a logical partition (LPAR) hypervisor executes the SIE instruction to start a logical partition in physical fixed memory. The operating system in this logical partition (e.g., ) can issue SIE instructions to execute its client (virtual) machine in its virtual storage device. Therefore, the LPAR hypervisor can use level 1 SIE, while The hypervisor may use Level 2 SIE.
[0147] According to an embodiment, the computer system is provided by International Business Machines Corporation System Server. System Based on a about The details are in the z / Architecture Principles of Operation. publication( Publication No. SA22-7832-11, August 25, 2017), which is incorporated herein by reference in its entirety. System and is a registered trademark of International Business Machines Corporation in Armonk, New York. Other names used herein may be registered trademarks, trademarks or product names of International Business Machines Corporation or other companies.
[0148] According to the embodiment, computer systems of other architectures can implement and use one or more aspects of the present invention. Servers other than servers (such as Power Systems servers or other servers provided by International Business Machines Corporation) or servers of other companies implement, use and / or benefit from one or more aspects of the present invention. Further, although in the examples herein, the bus connection module and the bus attachment device are considered to be part of the server, in other embodiments, they are not necessarily considered to be part of the server, but can only be considered to be coupled to the system memory and / or other components of the computer system. The computer system does not need to be a server. Further, although the bus connection module can be PCIe, one or more aspects of the present invention can use other bus connection modules. PCIe adapters and PCIe functions are just examples. Further, one or more aspects of the present invention are applicable to interrupt schemes other than PCI MSI and PCI MSI-X. Further, although the example in which a bit is set is described, in other embodiments, a byte or other type of indicator can be set. In addition, DTE and other structures can include more, less or different information.
[0149] Further, other types of computer systems can benefit from one or more aspects of the present invention. By way of example, a data processing system suitable for storing and / or executing program code is available, which includes at least two processors directly or indirectly coupled to memory elements via a system bus. The memory elements include, for example, local memory employed during actual execution of the program code, mass storage devices, and a cache memory that provides temporary storage of at least some program code to reduce the number of times code must be retrieved from the mass storage device during execution.
[0150] Input / output or I / O devices include, but are not limited to, keyboards, displays, pointing devices, DASD, tapes, CDs, DVDs, thumb drives, and other storage media, etc., which can be coupled to the system directly or via an intermediate I / O controller. A network adapter can also be coupled to the system to enable the data processing system to be coupled to other data processing systems or remote printers or storage devices via an intermediate private or public network. Modems, cable modems, and Ethernet cards are just a few of the available types of network adapters.
[0151] Reference Figure 22, depicts representative components of a host computer system 800 for implementing one or more aspects of the present invention. The representative host computer 800 includes one or more processors (e.g., CPU 801) communicating with computer memory 802 and an I / O interface to storage media device 811 and network 810 for communicating with other computers or a SAN, etc. The CPU 801 conforms to an architecture having an architectural instruction set and architectural functions. The CPU 801 may have a dynamic address translation (DAT) 803 for converting program addresses, virtual addresses into real addresses of the memory. The DAT may include a translation lookaside buffer (TLB) 807 for caching the translations, so that later accesses to blocks of the computer memory 802 do not require the latency of address translation. A cache 809 may be used between the computer memory 802 and the CPU 801. The cache 809 may be hierarchical, providing a large high-level cache available to more than one CPU and smaller, faster, lower-level caches between the high-level cache and each CPU. In some implementations, the lower-level cache may be split to provide separate low-level caches for instruction fetch and data access. According to an embodiment, instructions may be fetched from the memory 802 via the cache 809 by an instruction fetch unit 804. The instructions may be decoded in an instruction decode unit 806 and, in some embodiments, dispatched to one or more instruction execution units 808 together with other instructions. A number of execution units 808 may be employed, such as arithmetic execution units, floating-point execution units, and branch instruction execution units. The instructions are executed by the execution units, accessing operands from registers or memory specified by the instructions as needed. If an operand is to be accessed from the memory 802, e.g., loaded or stored, the load / store unit 805 may handle the access under the control of the instruction being executed. The instructions may be executed in hardware circuitry or in internal microcode (i.e., firmware), or by a combination of both.
[0152] A computer system may include information in local or main memory, as well as addressing, protection, and reference and change records. Some aspects of addressing include address formats, the concept of address space, various types of addresses, and the way one type of address is converted to another type of address. Some main memories include permanently allocated storage locations. The main memory provides direct addressable fast access storage of data to the system. Data and programs will be loaded into the main memory, e.g., from input devices, before they can be processed.
[0153] The main memory may include one or more smaller and faster accessed buffer memories, sometimes referred to as caches. The cache may be physically associated with the CPU or an I / O processor. The effects of the physical construction (other than on performance) and the use of different storage media are generally not observable by the executing program.
[0154] Separate caches may be maintained for instruction and data operands. Information within a cache may be maintained in contiguous bytes at integral boundaries, known as cache blocks or cache lines. The model may provide an EXTRACT CACHE ATTRIBUTE instruction that returns the size of a cache line in bytes. The model may also provide PREFETCH DATA and PREFETCH DATA RELATIVE LONG instructions that implement prefetching of stores into the data or instruction cache or releasing data from the cache.
[0155] Memory may be viewed as a long horizontal string of bits. For most operations, access to memory may be made in a left-to-right order. The bit string is subdivided into eight-bit units. An eight-bit unit is called a byte, which is the basic building block of all information formats. Each byte location in a memory device may be identified by a unique non-negative integer, which is the address of that byte location, also known as the byte address. Adjacent byte locations may have consecutive addresses, starting from 0 on the left and proceeding in a left-to-right order. Addresses are unsigned binary integers and may be, for example, 24, 31, or 64 bits.
[0156] Information is transferred between memory and the CPU one byte or a group of bytes at a time. Unless otherwise specified, for example in a group of bytes in memory is addressed by the leftmost byte of the group. The number of bytes in a group is implied or explicitly specified by the operation to be performed. When used in CPU operations, a group of bytes is called a field. Within each group of bytes, for example in the bits are numbered in a left-to-right order. In In it, the leftmost bit is sometimes referred to as the "high-order" bit, and the rightmost bit as the "low-order" bit. However, the number of bits is not the storage address. Only bytes are addressable. To operate on the individual bits of a byte in storage, the entire byte can be accessed. In, for example, z / Architecture, the bits in a byte can be numbered 0 to 7 from left to right. The bits in an address can be numbered 8 - 31 or 40 - 63 for a 24-bit address, or 1 - 31 or 33 - 63 for a 31-bit address; for a 64-bit address, they are numbered 0 - 63. In any other fixed-length format of multiple bytes, the bits making up the format can be numbered consecutively starting from 0. For error detection and preferably for correction, one or more check bits can be sent along with each byte or group of bytes. Such check bits are generated automatically by the machine and cannot be directly controlled by a program. Storage capacity is expressed in number of bytes. When the length of a storage operand field is implied by the opcode of an instruction, the field is said to have a fixed length, which can be one, two, four, eight, or sixteen bytes. For some instructions, larger fields can be implied. When the length of a storage operand field is not implied but is explicitly specified, the field is said to have a variable length. A variable-length operand can vary in length by an increment of one byte or in multiples of two bytes or other multiples with certain instructions. When information is placed in a storage device, only the contents of the byte positions included in the specified field are replaced, even if the width of the physical path to the storage device may be greater than the length of the field being stored.
[0157] Some information units will be stored on integer boundaries. When the storage address of an information unit is a multiple of the byte length of that unit, the boundary is called an integer for that information unit. Special names are given to fields of 2, 4, 8, and 16 bytes on integer boundaries. A halfword is a group of two consecutive bytes on a two-byte boundary and is a basic building block of an instruction. A word is a group of four consecutive bytes on a four-byte boundary. A doubleword is a group of eight consecutive bytes on an eight-byte boundary. A quadword is a group of sixteen consecutive bytes on a sixteen-byte boundary. When a storage address specifies a halfword, word, doubleword, or quadword, the binary representation of the address contains one, two, three, or four rightmost zero bits respectively. Instructions are to be on a two-byte integer boundary. Most instructions' storage operands have no boundary alignment requirements.
[0158] On a device that implements separate caches for instructions and data operands, if a program stores into a cache line from which an instruction is subsequently fetched, significant latency may be experienced, regardless of whether the store changes the instruction that is subsequently fetched.
[0159] In one embodiment, the present invention can be implemented by software, which is sometimes referred to as licensed internal code, firmware, microcode, nano code, pico code, etc., any of which is in line with the present invention. Referring to FIG. 20, the software program code embodying the present invention can be accessed from a long-term storage medium device 811 such as a CD-ROM drive, a tape drive, or a hard disk drive. The software program code can be embodied on any of a variety of known media used with a data processing system, such as a disk, a hard disk drive, or a CD-ROM. The code can be distributed on such media, or can be distributed from the computer memory 802 to a user or from the storage device of one computer system to other computer systems via a network 810 for use by users of such other systems.
[0160] The software program code can include an operating system that controls the functions and interactions of various computer components and one or more application programs. The program code can be paged from the storage medium device 811 to a relatively high-speed computer storage device 802, in which it is available for processing by the processor 801. Well-known techniques and methods can be used for embodying software program code in memory, on a physical medium, and / or distributing software code via a network. The program code can be referred to as a "computer program product" when it is created and stored on a tangible medium, which includes but is not limited to electronic memory modules (RAM), flash memory, optical discs (CD), DVDs, magnetic tapes. The computer program product medium can be read by a processing circuit, preferably in a computer system, for execution by the processing circuit.
[0161] Figure 23 A representative workstation or server hardware system in which embodiments of the present invention can be implemented is shown. Figure 23 The system 820 includes a representative basic computer system 821, such as a personal computer, a workstation, or a server, which includes optional peripheral devices. The basic computer system 821 includes one or more processors 826 and a bus that is used to connect the (one or more) processors 826 to other components of the system 821 and enable communication therebetween according to known techniques. The bus connects the processor 826 to a memory 825 and a long-term storage device 827, which may include, for example, a hard disk drive (e.g., including any of magnetic media, CDs, DVDs, and flash memory) or a tape drive. The system 821 may also include a user interface adapter that connects the microprocessor 826 via the bus to one or more interface devices, such as a keyboard 824, a mouse 823, a printer / scanner 830, and / or other interface devices (which can be any user interface device, such as a touch-sensitive screen, a digitizing tablet, etc.). The bus also connects a display device 822, such as an LCD screen or a monitor, to the microprocessor 826 via a display adapter.
[0162] The system 821 can communicate with other computers or computer networks through a network adapter capable of communicating 828 with the network 829. Example network adapters are communication channels, token rings, Ethernet, or modems. Alternatively, the system 821 can communicate using a wireless interface (such as a Cellular Digital Packet Data (CDPD) card). The system 821 can be associated with these other computers in a local area network (LAN) or a wide area network (WAN), or the system 821 can be a client in a client / server arrangement with another computer, etc.
[0163] Figure 24 A data processing network 840 is shown in which embodiments of the present invention can be implemented. The data processing network 840 can include multiple separate networks, such as wireless networks and wired networks, and each network can include multiple separate workstations 841, 842, 843, 844. Additionally, as will be understood by those skilled in the art, one or more LANs can be included, where a LAN can include multiple intelligent workstations coupled to a host processor.
[0164] Still referring to Figure 24 , the network can also include mainframe computers or servers, such as a gateway computer (e.g., client server 846) or an application server (e.g., remote server 848), which can access a data repository and can also be accessed directly from the workstation 845. The gateway computer 846 can serve as an entry point into each separate network. A gateway may be required when connecting one network protocol to another. Preferably, the gateway 846 can be coupled to another network, such as the Internet 847, through a communication link. The gateway 846 can also be directly coupled to one or more workstations 841, 842, 843, 844 using a communication link. The gateway computer can be implemented using an IBM eServer TM System server provided by International Business Machines Corporation.
[0165] Also referring to Figure 23 and Figure 24 , the software programming code embodying the present invention can be accessed by the processor 826 of the system 820 from a long-term storage medium 827 such as a CD-ROM drive or a hard disk drive. The software programming code can be included on any of various known media used with a data processing system, such as a disk, a hard disk drive, or a CD-ROM. The code can be distributed on such media, or can be distributed from the memory or storage device of one computer system to users 850, 851 through a network to other computer systems for use by users of such other systems.
[0166] Alternatively, programming code can be included in the memory 825 and accessed by the processor 826 using the processor bus. Such programming code can include an operating system that controls the functions and interactions of various computer components and one or more application programs 832. The program code can be paged from the storage medium 827 into the high-speed memory 825, where it is available for processing by the processor 826. Well-known techniques and methods can be used for including software programming code in the memory, on physical media, and / or distributing software code via a network.
[0167] The cache that is most readily available to the processor (i.e., the cache that is faster and smaller than other caches of the processor) is the lowest-level cache, also known as L1 or first-level cache, while the main memory is the highest-level cache, also known as Ln (e.g., L3) if there are n (e.g., n = 3) levels. The lowest-level cache can be divided into an instruction cache and a data cache, where the instruction cache is also known as the I-cache, which holds machine-readable instructions to be executed, and the data cache is also known as the D-cache, which holds data operands.
[0168] Reference Figure 25 , depicts an exemplary processor embodiment of the processor 826. One or more levels of cache 853 can be employed to buffer memory blocks in order to improve processor performance. The cache 853 is a buffer of cache lines that hold memory data that may be used. A cache line can be, for example, 64, 128, or 256 bytes of memory data. Separate caches can be employed to cache instructions and cache data. Cache coherence (i.e., synchronization of copies of lines in the memory and the cache) can be provided by various suitable algorithms, such as the "snoop" algorithm. The main memory device 825 of the processor system can be referred to as a cache. In a processor system having four levels of cache 853, the main storage device 825 is sometimes referred to as a fifth-level (L5) cache because it can be faster and holds only a portion of the non-volatile storage available to the computer system. The main storage device 825 "caches" data pages that are paged into and out of the main storage device 825 by the operating system.
[0169] The program counter (instruction counter) 861 keeps track of the address of the instruction currently to be executed. The program counter in the processor is 64 bits and can be truncated to 31 or 24 bits to support previous addressing limitations. The program counter can be embodied in the program status word (PSW) of the computer so that it persists during context switching. Thus, an ongoing program with a program counter value can be interrupted, for example, by the operating system, resulting in a context switch from the program environment to the operating system environment. When the program is inactive, the PSW of the program maintains the program counter value, and when the operating system is executing, the program counter in the PSW of the operating system is used. The program counter can be incremented by an amount equal to the number of bytes of the current instruction. Reduced instruction set computing (RISC) instructions can be of fixed length, while complex instruction set computing (CISC) instructions can be of variable length. IBM 's instructions are CISC instructions of length 2, 4, or 6 bytes. The program counter 861 can be modified, for example, by a context switch operation or a branch taken operation of a branch instruction. In a context switch operation, the current program counter value along with other state information about the program being executed (such as condition codes) is saved in the program status word, and a new program counter value is loaded, pointing to the instruction of the new program module to be executed. A branch taken operation can be performed to allow the program to make decisions or loop within the program by loading the result of the branch instruction into the program counter 861.
[0170] An instruction fetch unit 855 can be employed to fetch instructions on behalf of the processor 826. The fetch unit fetches the "next sequential instruction", the target instruction of a branch taken instruction, or the first instruction of a program after a context switch. Modern instruction fetch units can employ prefetch techniques to speculatively prefetch instructions based on the likelihood of the prefetch instructions being used. For example, the fetch unit can fetch 16 bytes of instructions, which includes the next sequential instruction and additional bytes of other sequential instructions.
[0171] Then, the fetched instruction(s) can be executed by the processor 826. According to an embodiment, the fetched instruction(s) can be passed to the dispatch unit 856 of the fetch unit. The dispatch unit decodes the instruction(s) and forwards information about the decoded instruction(s) to the appropriate units 857, 858, 860. The execution unit 857 can receive information about the decoded arithmetic instruction from the instruction fetch unit 855 and can perform arithmetic operations on the operands according to the opcode of the instruction. The operands can preferably be provided to the execution unit 857 from the memory 825, the architectural register 859, or the immediate field of the instruction being executed. The result of the execution can be stored in the memory 825, the register 859, or other machine hardware (such as control registers, PSW registers, etc.) when it is stored.
[0172] The processor 826 may include one or more units 857, 858, 860 for performing functions of instructions. Refer to Figure 26A , the execution unit 857 may communicate with the architectural general registers 859, the decode / dispatch unit 856, the load / store unit 860, and other processor units 865 through the interface logic 871. The execution unit 857 may employ a number of register circuits 867, 868, 869 to hold information for the operation of the arithmetic logic unit (ALU) 866. The ALU performs arithmetic operations (such as addition, subtraction, multiplication, and division) and logical functions (such as AND, OR, exclusive OR (XOR), circular shift). Preferably, the ALU may support design-related special operations. Other circuits may provide other architectural facilities 872, such as including condition code and recovery support logic. The result of the ALU operation may be held in the output register circuit 870 configured to forward the result to various other processing functions. There are many arrangements of processor units, and this description is only intended to provide a representative understanding of one embodiment.
[0173] The ADD instruction, for example, may be executed in the execution unit 857 having arithmetic and logical functions, while the floating-point instruction, for example, would be executed in the floating-point execution having dedicated floating-point capabilities. Preferably, the execution unit operates on the operands identified by the instruction by performing the function defined by the opcode on the operands. For example, the ADD instruction may be executed by the execution unit 857 on the operands found in two registers 859 identified by the register fields of the instruction.
[0174] The execution unit 857 performs arithmetic addition on two operands and stores the result in a third operand, where the third operand may be a third register or one of the two source registers. The execution unit preferably utilizes the arithmetic logic unit (ALU) 866, which is capable of performing various logical functions (such as shift, rotate, AND, OR, and XOR) and various algebraic functions (including any one of addition, subtraction, multiplication, and division). Some ALUs 866 are designed for scalar operations and some for floating-point operations. The data may be in big-endian mode (where the least significant byte is at the highest byte address) or little-endian mode (where the least significant byte is at the lowest byte address), depending on the architecture. IBM is in big-endian mode. The signed field may be sign-and-magnitude, one's complement, or two's complement, depending on the architecture. Two's complement may be advantageous because the ALU does not need to be designed with subtraction capabilities, as negative or positive values in two's complement only require addition within the ALU. Numbers may be described in shorthand, for example, a 12-bit field defines the address of a 4,096-byte block and is described as a 4K-byte (kilobyte) block.
[0175] Refer to Figure 26BBranch instruction information for executing a branch instruction can be sent to a branch unit 858, which typically employs a branch prediction algorithm (such as a branch history table 882) to predict the outcome of a branch before other conditional operations are completed. The target of the current branch instruction will be fetched and speculatively executed before the conditional operation is completed. When the conditional operation is completed, based on the condition of the conditional operation and the speculative result, the branch instruction that has been speculatively executed is either completed or discarded. The branch instruction can test a condition code, and if the condition code meets the branch requirement of the branch instruction, it branches to a target address, which can be calculated based on a number of numbers including, for example, numbers found in a register field or an immediate field of the instruction. The branch unit 858 can employ an ALU 874 having multiple input register circuits 875, 876, 877 and an output register circuit 880. The branch unit 858 can communicate with, for example, general-purpose registers 859, a decode dispatch unit 856, or other circuitry 873.
[0176] The execution of a set of instructions may be interrupted for various reasons, such as a context switch initiated by an operating system, a program exception or error that causes a context switch, an I / O interrupt signal that causes a context switch, or multithreaded activity of multiple programs in a multithreaded environment. Preferably, the context switch action saves the state information about the currently executing program and then loads the state information about another program being called. The state information can be saved in, for example, hardware registers or memory. The state information preferably includes a program counter value pointing to the next instruction to be executed, condition codes, memory translation information, and architecture register contents. The context switch activity can be implemented by hardware circuitry, application programs, operating system programs, or firmware code (such as microcode, pico-microcode, or licensed internal code (LIC)) either individually or in combination.
[0177] The processor accesses operands according to an instruction definition method. The instruction can use a value of a part of the instruction to provide an immediate operand, and can provide one or more register fields that explicitly point to general-purpose registers or special-purpose registers (such as floating-point registers). The instruction can utilize an implicit register identified by an opcode field as an operand. The instruction can use a memory location for an operand. The memory location of the operand can be provided by a register, an immediate field, or a combination of a register and an immediate field, as exemplified by a long displacement tool, where the instruction defines a base register, an index register, and an immediate field, i.e., a displacement field, which are added together to provide, for example, the address of the operand in memory. Unless otherwise indicated, a location herein can mean a location in the main memory.
[0178] Reference Figure 26C, the processor uses the load / store unit 860 to access memory. The load / store unit 860 can perform a load operation by obtaining the address of the target operand in the memory 853 and loading the operand into the register 859 or another memory 853 location, or can perform a store operation by obtaining the address of the target operand in the memory 853 and storing the data obtained from the register 859 or another memory 853 location in the target operand location in the memory 853. The load / store unit 860 can be speculative and can access memory in a sequence that is out of order with respect to the instruction sequence. However, the load / store unit 860 gives the appearance that the program instructions are being executed in order. The load / store unit 860 can communicate with the general-purpose register 859, the decode / dispatch unit 856, the cache / memory interface 853, or other elements 883, and includes various register circuits, an ALU 885, and control logic 890 to calculate the memory address and provide pipeline ordering to keep the operations in order. Some operations can be out of order, but the load / store unit provides the function of making the out-of-order operations appear to the program as if they have been executed in order.
[0179] Preferably, the addresses "seen" by an application program are generally referred to as virtual addresses. Virtual addresses are sometimes also referred to as "logical addresses" and "effective addresses". These virtual addresses are virtual because they are redirected to physical memory locations through one of various dynamic address translation (DAT) techniques, which include but are not limited to prefixing the virtual address with only an offset value, translating the virtual address via one or more translation tables, which preferably include at least a segment table and a page table, either alone or in combination. Preferably, the segment table has entries that point to the page table. In , a translation hierarchy is provided that includes a region first table, a region second table, a region third table, a segment table, and an optional page table. The performance of address translation is typically improved by utilizing a translation lookaside buffer (TLB), which includes entries that map virtual addresses to associated physical memory locations. These entries are created when the DAT uses the translation table to translate the virtual address. Then, subsequent uses of the virtual address can utilize the entries in the fast TLB instead of slow sequential translation table access. The TLB contents can be managed by various replacement algorithms, including least recently used (LRU).
[0180] Each processor in a multiprocessor system is responsible for keeping shared resources such as I / O, caches, TLBs, and memory interlocked for consistency. So-called "snooping" techniques can be utilized in maintaining cache consistency. In a snooping environment, each cache line can be marked as being in any one of a shared state, an exclusive state, a modified state, an invalid state, etc., for the purpose of sharing.
[0181] The I / O unit 854 can provide the processor with means for attaching to peripheral devices such as including magnetic tapes, disks, printers, displays, and networks. The I / O unit is typically presented to computer programs by software drivers. In a host (such as from of System ), channel adapters and open system adapters are I / O units of the host that provide communication between the operating system and peripheral devices.
[0182] Furthermore, other types of computer systems can benefit from one or more aspects of the present invention. As an example, a computer system can include an emulator, such as software or other emulation mechanisms, where a particular architecture including, for example, instruction execution, architectural functions (such as address translation), and architectural registers is emulated, or a subset thereof is emulated, for example, on a native system having a processor and memory. In such an environment, one or more emulation functions of the emulator can implement one or more aspects of the present invention, even if the computer on which the emulator is executed may have an architecture different from the emulated capabilities. For example, in emulation mode, a particular instruction or operation being emulated can be decoded, and appropriate emulation functions can be constructed to implement the individual instruction or operation.
[0183] In an emulation environment, a host computer can include, for example, a memory for storing instructions and data, an instruction fetch unit for fetching instructions from the memory and optionally providing local buffering for the fetched instructions, an instruction decoding unit for receiving the fetched instructions and determining the type of the fetched instructions, and an instruction execution unit for executing the instructions. Execution can include: loading data from the memory into registers, storing data from the registers back into the memory, and / or performing a certain type of arithmetic or logical operation, as determined by the decoding unit. For example, each unit can be implemented in software. The operations performed by these units can be implemented as one or more subroutines within the emulator software.
[0184] More specifically, in a mainframe, architecture machine instructions are used by programmers, such as "C" programmers, for example, through a compiler application. These instructions stored in a storage medium can be executed locally in a server, or alternatively, executed in a machine with a different architecture. They can be executed in existing and future mainframe servers and in other servers (such as Power Systems servers and System servers) being emulated. They can be executed in machines running Linux on various machines using hardware manufactured by AMD TM etc. In addition to in In addition to executing on such hardware, Linux can also be used, as well as machines that use the emulation of Hercules, UMX, or FSI (Fundamental Software, Inc), where the execution is typically in emulation mode. In emulation mode, the emulation software is executed by the native processor to emulate the architecture of the processor being emulated.
[0185] The native processor can execute emulation software that includes firmware or the native operating system to perform the emulation of the processor being emulated. The emulation software is responsible for fetching and executing the instructions of the architecture of the processor being emulated. The emulation software maintains the emulated program counter to track the instruction boundaries. The emulation software can fetch one or more emulated machine instructions at a time and convert one or more emulated machine instructions into a corresponding set of native machine instructions to be executed by the native processor. These converted instructions can be cached to enable faster conversion. However, the emulation software has to maintain the architectural rules of the architecture of the processor being emulated to ensure that the operating systems and applications written for the processor being emulated work correctly. In addition, the emulation software has to provide the resources recognized by the architecture of the processor being emulated, including but not limited to control registers, general-purpose registers, floating-point registers, dynamic address translation functions including, for example, segment tables and page tables, interrupt mechanisms, context-switching mechanisms, a calendar (TOD) clock, and an architectural interface to the I / O subsystem, so that an operating system or application designed to run on the processor being emulated can run on the native processor with the emulation software.
[0186] The particular instruction being emulated is decoded, and subroutines are called to perform the functions of the individual instructions. The emulation software functions that emulate the functions of the processor being emulated are implemented, for example, in "C" subroutines or drivers or in some other way that provides drivers for the particular hardware.
[0187] In Figure 27An example of a simulated host computer system 892 of a host computer system 800' that provides a simulated host architecture is provided. In the simulated host computer system 892, the host processor (i.e., CPU) 891 is a simulated host processor or a virtual host processor and includes a simulated processor 893 having a native instruction set architecture different from that of the processor 891 of the host computer 800'. The simulated host computer system 892 has a memory 894 accessible to the simulated processor 893. In an example embodiment, the memory 894 is partitioned into a host computer memory 896 portion and a simulation routine 897 portion. According to the host computer architecture, the host computer memory 896 can be used for programs of the simulated host computer 892. The simulated processor 893 executes native instructions of an architecture instruction set different from that of the simulated processor 891, where the native instructions are obtained from the simulation routine memory 897 and host instructions can be accessed from a program in the host computer memory 896 for execution by employing one or more instructions obtained in a sequence and access / decoding routine, where the sequence and access / decoding routine can decode the accessed host instructions to determine a native instruction execution routine for simulating the function of the accessed host instructions. Other tools defined for the host computer system 800' architecture can be simulated by architecture tool routines, including tools such as general-purpose registers, control registers, dynamic address translation, and I / O subsystem support, as well as processor caches. The simulation routine can also utilize functions available in the simulated processor 893 (such as general-purpose registers and dynamic translation of virtual addresses) to improve the performance of the simulation routine. Specialized hardware and offload engines can also be provided to assist the processor 893 in simulating the functions of the host computer 800'.
[0188] It should be understood that one or more of the above embodiments of the present invention can be combined as long as the combined embodiments are not mutually exclusive. Ordinal numbers, such as "first" and "second", are used herein to indicate different elements assigned the same name, but do not necessarily establish any order of the corresponding elements.
[0189] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0190] The present invention can be a system, method, and / or computer program product. The computer program product can include one or more computer-readable storage media having computer-readable program instructions thereon for causing a processor to execute aspects of the present invention.
[0191] A computer-readable storage medium can be a tangible device that is capable of retaining and storing instructions for use by an instruction execution device. The computer-readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer-readable storage medium includes the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punched card or raised structures in a groove having instructions recorded thereon, and any appropriate combination of the foregoing. As used herein, a computer-readable storage medium should not be construed to be a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0192] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a corresponding computing / processing device, or downloaded to an external computer or external storage device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network). The network can include a copper transmission cable, an optical transmission fiber, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium within the corresponding computing / processing device.
[0193] The computer-readable program instructions for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state-setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages (such as Smalltalk, C++) and traditional procedural programming languages (such as the "C" programming language or similar programming languages). The computer-readable program instructions may be executed entirely on a computer of a user's computer system, partially on a computer of a user's computer system (as a stand-alone software package), partially on a computer of a user's computer system and partially on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the computer of the user's computer system through any type of network (including a local area network (LAN) or a wide area network (WAN)), or may be connected to an external computer (e.g., using an Internet service provider via the Internet). In some embodiments, in order to perform aspects of the present invention, an electronic circuit, including, for example, a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), may execute the computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit.
[0194] Aspects of the present invention are described herein with reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0195] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions executed via the processor of the computer or other programmable data processing apparatus create a means for implementing the functions / acts specified in the flowchart and / or one or more block diagram blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, a programmable data processing apparatus, and / or other devices to operate in a particular manner, such that the computer-readable storage medium in which the instructions are stored comprises an article of manufacture that includes instructions for implementing aspects of the functions / acts specified in the flowchart and / or one or more block diagram blocks.
[0196] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus, or other devices to produce a computer-implemented process such that the instructions executed on the computer, other programmable apparatus, or other devices implement the functions / acts specified in the flowchart and / or one or more block diagram blocks.
[0197] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which includes one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may in fact be executed substantially in parallel, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
[0198] Possible combinations of the above features may be as follows:
[0199] 1. A method for providing an interrupt signal to a guest operating system, the guest operating system being executed using one or more processors of a plurality of processors of a computer system that is allocated for use by the guest operating system, the computer system further including one or more bus connection modules operably connected to the plurality of processors via a bus and bus-attached devices, the computer system further including a memory operably connected to the bus-attached devices,
[0200] Each of the plurality of processors is assigned a logical processor ID that is used by the bus-attached device to address the corresponding processor,
[0201] Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID for use by the guest operating system and one or more bus connection modules to address the corresponding processor,
[0202] The method includes:
[0203] Receiving, by the bus-attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying one of the processors allocated for use by the guest operating system as a target processor for processing the interrupt signal,
[0204] A bus-attached device retrieves a first copy of an interrupt table entry assigned to the received interrupt target ID from an interrupt table stored in a memory, the first copy of the interrupt table entry including a first mapping of the received interrupt target ID to a logical processor ID.
[0205] The bus-attached device uses the first copy of the interrupt table entry to convert the received interrupt target ID into a logical processor ID.
[0206] The bus-attached device uses the converted logical processor ID to directly address the target processor and forwards the interrupt signal to the target processor for processing.
[0207] 2. The method according to item 1, wherein the interrupt signal is received in the form of a message-signaled interrupt and includes the interrupt target ID of the target processor.
[0208] 3. The method according to any of the preceding items, wherein the first copy of the interrupt table entry further includes a first copy of a run indicator to indicate whether the target processor identified by the interrupt target ID is scheduled to be used by a guest operating system, and the method further includes:
[0209] The bus-attached device uses the first copy of the run indicator to check whether the target processor is scheduled to be used by a guest operating system.
[0210] If the target processor is scheduled, continue forwarding the interrupt signal.
[0211] Otherwise, the bus-attached device uses broadcast to forward the interrupt signal for processing to multiple processors.
[0212] 4. The method according to any of the preceding items, wherein the first copy of the interrupt table entry further includes an interrupt block indicator that indicates whether the target processor identified by the interrupt target ID is currently blocked from receiving interrupt signals, and the method further includes:
[0213] The bus-attached device uses the interrupt block indicator to check whether the target processor is blocked from receiving interrupt signals.
[0214] If the target processor is not blocked, continue forwarding the interrupt signal.
[0215] Otherwise, the bus-attached device blocks the interrupt signal from being forwarded to the target processor for processing.
[0216] 5. The method according to item 4, the method further includes: the bus-attached device uses broadcast to forward the interrupt signal for processing to the remaining processors among the multiple processors.
[0217] 6. The method according to any one of items 4 to 5, the method further comprising: checking, by an interrupt handler of the guest operating system, whether any interrupt addressed to the target processor is waiting to be processed by the target processor, and if no interrupt addressed to the target processor is waiting to be processed by the target processor, changing, by the guest operating system, an interrupt block indicator in the interrupt table entry assigned to the target processor to indicate that the target processor is not blocked.
[0218] 7. The method according to item 6, the method further comprising: if the target processor is not blocked, changing, by the bus-attached device, an interrupt block indicator in the interrupt table entry assigned to the interrupt target ID to indicate that the logical processor ID is blocked, the change being performed before forwarding the interrupt signal to the target processor for processing.
[0219] 8. The method according to item 7, the method further comprising:
[0220] after changing the interrupt block indicator, retrieving, by the bus-attached device, a second copy of the interrupt table entry assigned to the received interrupt target ID,
[0221] checking, by the bus-attached device, the second copy of the interrupt table entry to rule out predefined type changes of the second copy of the interrupt table relative to the first copy of the interrupt table entry, successful exclusion of the predefined type change being required for forwarding the interrupt signal to the target processor for processing.
[0222] 9. The method according to item 8, the predefined type change is a change of a first mapping of the received interrupt target ID relative to a second mapping of the received interrupt target ID to a second logical processor ID included in the logical processor IDs by the second copy of the interrupt table entry, and if the second mapping includes a change relative to the first mapping, forwarding, by the bus-attached device, the interrupt signal for processing to a plurality of processors using broadcasting.
[0223] 10. The method according to any one of items 8 to 9, the predefined change type is a change of a first copy of the run indicator relative to a second copy of the run indicator included in the second copy of the interrupt table entry, and if the second copy of the run indicator includes a change relative to the first copy of the run bit, and the second run indicator indicates that the target processor is not scheduled to be used by the operating system, forwarding, by the bus-attached device, the interrupt signal for processing to a plurality of processors using broadcasting.
[0224] 11. The method according to any one of the preceding items, the method further comprising: retrieving, by a bus-attached device, a copy of a device table entry from a device table stored in a memory, the device table entry including an interrupt table address indicator indicating a memory address of an interrupt table, the bus-attached device using the memory address of the interrupt table to retrieve a first copy of an interrupt table entry.
[0225] 12. The method according to item 11, the device table entry further including a direct signaling indicator indicating whether a target processor is to be directly addressed, the method further comprising:
[0226] If the direct signaling indicator indicates direct forwarding of an interrupt signal, using the logical processor ID of the target processor to directly address the target processor to perform forwarding of the interrupt signal,
[0227] Otherwise, forwarding, by the bus-attached device, the interrupt signal for processing to a plurality of processors using a broadcast.
[0228] 13. The method according to any one of items 11 to 12, the memory further including an interrupt summary vector, the device table entry further including an interrupt summary vector address indicator indicating a memory address of the interrupt summary vector, the interrupt summary vector including an interrupt summary indicator for each bus-connected module, each interrupt summary indicator being assigned to a bus-connected module to indicate whether there is an interrupt signal issued by the corresponding bus-connected module to be processed,
[0229] The method further comprising: updating, by the bus-attached device, the interrupt summary indicator assigned to the bus-connected module from which the interrupt signal is received using the indicated memory address of the interrupt summary vector, such that the updated interrupt summary indicator indicates that there is an interrupt signal issued by the corresponding bus-connected module to be processed.
[0230] 14. The method according to any one of items 11 to 13, the memory further including a directed interrupt summary vector, the device table entry further including a directed interrupt summary vector address indicator indicating a memory address of the directed interrupt summary vector, the directed interrupt summary vector including a directed interrupt summary indicator for each interrupt target ID, each directed interrupt summary indicator being assigned to an interrupt target ID to indicate whether there is an interrupt signal addressed to the corresponding interrupt target ID to be processed,
[0231] The method further comprising: updating, by the bus-attached device, the interrupt summary indicator assigned to the target processor ID to which the received interrupt signal is addressed using the indicated memory address of the directed interrupt summary vector, such that the updated interrupt summary indicator indicates that there is an interrupt signal addressed to the corresponding interrupt target ID to be processed.
[0232] 15. The method according to any one of items 11 to 14, wherein the memory further includes one or more interrupt signal vectors, the device table entry further includes an interrupt signal vector address indicator indicating the memory address of the interrupt signal vector in the one or more interrupt signal vectors, each interrupt signal vector includes one or more signal indicators, and each interrupt signal indicator is assigned to a bus connection module in the one or more bus connection modules and an interrupt target ID to indicate whether an interrupt signal addressed to the corresponding interrupt target ID has been received from the corresponding bus connection module.
[0233] The method further includes:
[0234] using the indicated memory address of the interrupt signal vector by the bus-attached device to select an interrupt signal indicator assigned to the bus connection module that issued the received interrupt signal and the interrupt target ID to which the received interrupt signal is addressed;
[0235] updating the selected interrupt signal indicator such that the selected interrupt signal indicator indicates that there is an interrupt signal issued by the corresponding bus connection module and addressed to the corresponding interrupt target ID to be processed.
[0236] 16. The method according to item 15, wherein each interrupt signal vector includes an interrupt signal indicator for each interrupt target ID assigned to the corresponding interrupt target ID, and each interrupt signal vector is assigned to a separate bus connection module, and the interrupt signal indicator of the corresponding interrupt signal vector is further assigned to the corresponding separate bus connection module.
[0237] 17. The method according to item 15, wherein each interrupt signal vector includes an interrupt signal indicator for each bus connection module assigned to the corresponding bus connection module, and each interrupt signal vector is assigned to a separate target processor ID, and the interrupt signal indicator of the corresponding interrupt signal vector is further assigned to the corresponding target processor ID.
[0238] 18. The method according to any one of the preceding claims, wherein the device table entry further includes a logical partition ID identifying the logical partition to which the guest operating system is assigned, and forwarding the interrupt signal by the bus-attached device further includes forwarding the logical partition ID together with the interrupt signal.
[0239] 19. The method according to any one of the preceding claims, wherein the method further includes: retrieving, by the bus-attached device, an interrupt subclass ID to which the received interrupt signal is assigned, and forwarding the interrupt signal by the bus-attached device further includes forwarding the interrupt subclass ID together with the interrupt signal.
[0240] 20. A computer system for providing an interrupt signal to a guest operating system, the guest operating system being executed using one or more of a plurality of processors of a computer system allocated for use by the guest operating system. The computer system further includes one or more bus connection modules operably connected to the plurality of processors via a bus and bus attached devices. The computer system further includes a memory operably connected to the bus attached devices.
[0241] Each of the plurality of processors is assigned a logical processor ID, which is used by the bus attached device to address the corresponding processor.
[0242] Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID, which is used by the guest operating system and one or more bus connection modules to address the corresponding processor.
[0243] The computer system is configured to execute a method, the method including:
[0244] Receiving, by the bus attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying, as a target processor for processing the interrupt signal, one of the processors to be allocated for use by the guest operating system.
[0245] Retrieving, by the bus attached device, a first copy of an interrupt table entry assigned to the received interrupt target ID from an interrupt table stored in the memory, the first copy of the interrupt table entry including a current mapping of the received interrupt target ID to a logical processor ID.
[0246] Converting, by the bus attached device, the received interrupt target ID to a logical processor ID using the first copy of the interrupt table entry.
[0247] Forwarding, by the bus attached device, the interrupt signal to the target processor for processing by directly addressing the target processor using the converted logical processor ID.
[0248] 21. A computer program product for providing an interrupt signal to a guest operating system, the guest operating system being executed using one or more of a plurality of processors of a computer system allocated for use by the guest operating system. The computer system further includes one or more bus connection modules operably connected to the plurality of processors via a bus and bus attached devices. The computer system further includes a memory operably connected to the bus attached devices.
[0249] Each of the plurality of processors is assigned a logical processor ID, which is used by the bus attached device to address the corresponding processor.
[0250] Each of a plurality of processors allocated for use by a guest operating system is also allocated an interrupt target ID, which is used by the guest operating system and one or more bus connection modules to address the corresponding processor.
[0251] A computer program product includes a computer-readable non-transitory medium that can be read by a processing circuit and stores instructions for execution by the processing circuit to perform a method, the method including:
[0252] Receiving, by a bus-attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying, as a target processor for processing the interrupt signal, one of the processors allocated for use by the guest operating system.
[0253] Retrieving, by the bus-attached device, from an interrupt table stored in a memory, a first copy of an interrupt table entry assigned to the received interrupt target ID, the first copy of the interrupt table entry including a current mapping of the received interrupt target ID to a logical processor ID.
[0254] Converting, by the bus-attached device, the received interrupt target ID to a logical processor ID using the first copy of the interrupt table entry.
[0255] Forwarding, by the bus-attached device, the interrupt signal to the target processor for processing by directly addressing the target processor using the converted logical processor ID.
Claims
1. A method for providing an interrupt signal to a guest operating system, the guest operating system being executed using one or more of a plurality of processors of a computer system that are allocated for use by the guest operating system. The computer system further includes one or more bus connection modules operably connected to the plurality of processors via a bus and bus-attached devices. The computer system further includes a memory operably connected to the bus-attached devices. Each of the plurality of processors is assigned a logical processor ID, which is used by the bus-attached device to address the corresponding processor. Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID for use by the guest operating system and the one or more bus connection modules to address the corresponding processor. The method comprises: receiving, by the bus-attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying one of the processors allocated for use by the guest operating system as a target processor for processing the interrupt signal; retrieving, by the bus-attached device, a first copy of an interrupt table entry assigned to the received interrupt target ID from an interrupt table stored in the memory, the first copy of the interrupt table entry including a first mapping of the received interrupt target ID to a logical processor ID; using, by the bus-attached device, the first copy of the interrupt table entry to convert the received interrupt target ID into the logical processor ID; using, by the bus-attached device, the logical processor ID obtained from the conversion to directly address the target processor to forward the interrupt signal to the target processor for processing.
2. The method according to claim 1, wherein the interrupt signal is received in the form of a message-signaled interrupt, including the interrupt target ID of the target processor.
3. The method according to claim 1, wherein the first copy of the interrupt table entry further includes a first copy of a run indicator to indicate whether the target processor identified by the interrupt target ID is scheduled for use by the guest operating system. The method further comprises: checking, by the bus-attached device, whether the target processor is scheduled for use by the guest operating system using the first copy of the run indicator; if the target processor is scheduled, continuing to forward the interrupt signal; otherwise, forwarding, by the bus-attached device, the interrupt signal for processing to the plurality of processors using broadcast.
4. The method according to claim 1, wherein the first copy of the interrupt table entry further includes an interrupt inhibit indicator indicating whether the target processor identified by the interrupt target ID is currently inhibited from receiving interrupt signals. The method further comprises: checking, by the bus-attached device, whether the target processor is inhibited from receiving interrupt signals using the interrupt inhibit indicator. If the target processor is not blocked, continue to forward the interrupt signal, otherwise, the interrupt signal is blocked from being forwarded to the target processor for processing by the bus-attached device.
5. The method according to claim 4, the method further comprises: The bus-attached device uses broadcasting to forward the interrupt signal for processing to the remaining processors among the multiple processors.
6. The method according to claim 4, the method further comprises: The interrupt handler of the guest operating system checks whether any interrupt addressed to the target processor is waiting to be processed by the target processor. If no interrupt addressed to the target processor is waiting to be processed by the target processor, the guest operating system changes the interrupt block indicator in the interrupt table entry assigned to the target processor to indicate that the target processor is not blocked.
7. The method according to claim 6, the method further comprises: If the target processor is not blocked, the bus-attached device changes the interrupt block indicator in the interrupt table entry assigned to the interrupt target ID to indicate that the logical processor ID is blocked, and the change is performed before forwarding the interrupt signal to the target processor for processing.
8. The method according to claim 7, the method further comprises: After changing the interrupt block indicator, the bus-attached device retrieves a second copy of the interrupt table entry assigned to the received interrupt target ID, The bus-attached device checks the second copy of the interrupt table entry to exclude a predefined type of change of the second copy of the interrupt table relative to the first copy of the interrupt table entry. Successful exclusion of the predefined type of change is required for forwarding the interrupt signal to the target processor for processing.
9. The method according to claim 8, wherein, The predefined type of change is a change of the first mapping of the received interrupt target ID relative to the second mapping of the received interrupt target ID to a second logical processor ID among the logical processor IDs included in the second copy of the interrupt table entry. If the second mapping includes a change relative to the first mapping, the bus-attached device uses broadcasting to forward the interrupt signal for processing to the multiple processors.
10. The method according to claim 8, wherein, The predefined type change indicates a change of a first copy of a run indicator indicating whether the target processor identified by the interrupt target ID is scheduled for use by the guest operating system relative to a second copy of the run indicator included in the second copy of the interrupt table entry. If the second copy of the run indicator includes a change relative to the first copy of the run indicator, and the second copy of the run indicator indicates that the target processor is not scheduled for use by the operating system, the bus-attached device uses broadcasting to forward the interrupt signal for processing to the plurality of processors.
11. The method according to claim 1, the method further comprises: retrieving, by the bus-attached device, a copy of a device table entry from a device table stored in the memory, the device table entry including an interrupt table address indicator indicating a memory address of the interrupt table, and the bus-attached device using the memory address of the interrupt table to retrieve the first copy of the interrupt table entry.
12. The method according to claim 11, wherein, the device table entry further includes a direct signaling indicator indicating whether the target processor is to be directly addressed, and the method further comprises: if the direct signaling indicator indicates direct forwarding of the interrupt signal, using the logical processor ID of the target processor to directly address the target processor to perform forwarding of the interrupt signal, otherwise, the bus-attached device uses broadcasting to forward the interrupt signal for processing to the plurality of processors.
13. The method according to claim 11, wherein, the memory further includes an interrupt summary vector, the device table entry further includes an interrupt summary vector address indicator indicating a memory address of the interrupt summary vector, the interrupt summary vector includes an interrupt summary indicator for each bus-connected module, and each interrupt summary indicator is assigned to a bus-connected module to indicate whether there is an interrupt signal issued by the corresponding bus-connected module to be processed, the method further comprises: the bus-attached device using the indicated memory address of the interrupt summary vector to update the interrupt summary indicator assigned to the bus-connected module from which the interrupt signal is received, such that the updated interrupt summary indicator indicates that there is an interrupt signal issued by the corresponding bus-connected module to be processed.
14. The method according to claim 11, wherein, the memory further includes a directed interrupt summary vector, the device table entry further includes a directed interrupt summary vector address indicator indicating a memory address of the directed interrupt summary vector, the directed interrupt summary vector includes a directed interrupt summary indicator for each interrupt target ID, and each directed interrupt summary indicator is assigned to an interrupt target ID to indicate whether there is an interrupt signal addressed to the corresponding interrupt target ID to be processed, The method further includes: using the indicated memory address of the directed interrupt summary vector by the bus-attached device to update the interrupt summary indicator assigned to the target processor ID to which the received interrupt signal is addressed, so that the updated interrupt summary indicator indicates that there is an interrupt signal addressed to the corresponding interrupt target ID to be processed.
15. The method according to claim 11, wherein, the memory further includes one or more interrupt signal vectors, and the device table entry further includes an interrupt signal vector address indicator indicating the memory address of the interrupt signal vector in the one or more interrupt signal vectors. Each of the interrupt signal vectors includes one or more signal indicators, and each interrupt signal indicator is assigned to a bus connection module in the one or more bus connection modules and an interrupt destination ID to indicate whether an interrupt signal addressed to the corresponding interrupt target ID has been received from the corresponding bus connection module. The method further includes: using the indicated memory address of the interrupt signal vector by the bus-attached device to select an interrupt signal indicator assigned to the bus connection module that issues the received interrupt signal and the interrupt target ID to which the received interrupt signal is addressed, updating the selected interrupt signal indicator so that the selected interrupt signal indicator indicates that there is an interrupt signal issued by the corresponding bus connection module and addressed to the corresponding interrupt target ID to be processed.
16. The method according to claim 15, wherein, each of the interrupt signal vectors includes an interrupt signal indicator for each interrupt target ID assigned to the corresponding interrupt target ID, and each of the interrupt signal vectors is assigned to a separate bus connection module, and the interrupt signal indicator of the corresponding interrupt signal vector is also assigned to the corresponding separate bus connection module.
17. The method according to claim 15, wherein, each of the interrupt signal vectors includes an interrupt signal indicator for each bus connection module assigned to the corresponding bus connection module, and each of the interrupt signal vectors is assigned to a separate target processor ID, and the interrupt signal indicator of the corresponding interrupt signal vector is also assigned to the corresponding target processor ID.
18. The method according to claim 11, wherein, the device table entry further includes a logical partition ID identifying the logical partition to which the guest operating system is assigned, and forwarding the interrupt signal by the bus-attached device further includes forwarding the logical partition ID together with the interrupt signal.
19. The method according to claim 1, the method further includes: retrieving, by the bus-attached device, an interrupt subclass ID identifying the interrupt subclass to which the received interrupt signal is assigned, and forwarding the interrupt signal by the bus-attached device further includes forwarding the interrupt subclass ID together with the interrupt signal.
20. A computer system for providing an interrupt signal to a guest operating system, the guest operating system being executed using one or more of a plurality of processors of the computer system that are allocated for use by the guest operating system, the computer system further including one or more bus connection modules operably connected to the plurality of processors via a bus and bus-attached devices, the computer system further including a memory operably connected to the bus-attached devices, Each of the plurality of processors is assigned a logical processor ID, which is used by the bus-attached device to address the corresponding processor, Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID, which is used by the guest operating system and the one or more bus connection modules to address the corresponding processor, The computer system is configured to execute a method, the method comprising: Receiving, by the bus-attached device, an interrupt signal having an interrupt target ID from one of the bus connection modules, the interrupt target ID identifying, as a target processor for processing the interrupt signal, one of the processors allocated for use by the guest operating system, Retrieving, by the bus-attached device, from an interrupt table stored in the memory, a first copy of an interrupt table entry assigned to the received interrupt target ID, the first copy of the interrupt table entry including a current mapping of the received interrupt target ID to a logical processor ID, Using, by the bus-attached device, the first copy of the interrupt table entry to convert the received interrupt target ID into the logical processor ID, Using, by the bus-attached device, the logical processor ID obtained from the conversion to directly address the target processor to forward the interrupt signal to the target processor for processing.
21. A computer program product for providing an interrupt signal to a guest operating system, the guest operating system being executed using one or more of a plurality of processors of the computer system that are allocated for use by the guest operating system, the computer system further including one or more bus connection modules operably connected to the plurality of processors via a bus and bus-attached devices, the computer system further including a memory operably connected to the bus-attached devices, Each of the plurality of processors is assigned a logical processor ID, which is used by the bus-attached device to address the corresponding processor, Each of the plurality of processors allocated for use by the guest operating system is further assigned an interrupt target ID, which is used by the guest operating system and one or more bus connection modules to address the corresponding processor, The computer program product includes a computer-readable non-transitory medium, which can be read by a processing circuit and stores instructions for execution by the processing circuit to execute a method, the method comprising: An interrupt signal with an interrupt target ID is received by the bus-attached device from one of the bus connection modules, and the interrupt target ID is to be assigned to identify, in one of the processors used by the guest operating system, a target processor for processing the interrupt signal. A first copy of an interrupt table entry assigned to the received interrupt target ID is retrieved by the bus-attached device from an interrupt table stored in the memory, and the first copy of the interrupt table entry includes a current mapping of the received interrupt target ID to a logical processor ID. The bus-attached device uses the first copy of the interrupt table entry to convert the received interrupt target ID into the logical processor ID. The bus-attached device uses the logical processor ID obtained from the conversion to directly address the target processor to forward the interrupt signal to the target processor for processing.
Citation Information
Patent Citations
Lightweight, low overhead debug bus
CN108228408A
Computer system providing universal architecture adaptive to variety of processor types and bus protocols
CN1175735A