[go: up one dir, main page]

HK1201347B - Providing by one program to another program access to a warning track facility - Google Patents

Providing by one program to another program access to a warning track facility Download PDF

Info

Publication number
HK1201347B
HK1201347B HK15101778.9A HK15101778A HK1201347B HK 1201347 B HK1201347 B HK 1201347B HK 15101778 A HK15101778 A HK 15101778A HK 1201347 B HK1201347 B HK 1201347B
Authority
HK
Hong Kong
Prior art keywords
program
client
host
grace period
guest
Prior art date
Application number
HK15101778.9A
Other languages
Chinese (zh)
Other versions
HK1201347A1 (en
Inventor
小查尔斯.盖尼
J.P.库巴拉
M.法雷尔
D.W.施米特
B.皮尔斯
R.罗杰斯
J.马尔德
Original Assignee
国际商业机器公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US13/352,518 external-priority patent/US9104508B2/en
Application filed by 国际商业机器公司 filed Critical 国际商业机器公司
Publication of HK1201347A1 publication Critical patent/HK1201347A1/en
Publication of HK1201347B publication Critical patent/HK1201347B/en

Links

Description

由一个程序向另一个程序提供对警告追踪设施的存取Providing access to warning tracking facilities from one program to another

技术领域Technical Field

本发明的方面大体上涉及计算环境内的处理,且具体而言,涉及促进与共享资源相关联的处理。Aspects of the present invention generally relate to processing within a computing environment, and more particularly, to facilitating processing associated with shared resources.

背景技术Background Art

资源共享的环境的一种类型为虚拟环境,该虚拟环境包括主机中央处理单元(CPU)及一个或多个客户机中央处理单元。由在主机CPU上执行的主机程序(例如,主机操作系统)来布建(provision)客户机CPU(亦称为虚拟CPU)。主机程序执行动作以从底层主机配置分配资源并将那些资源指派给客户机CPU。One type of resource-sharing environment is a virtual environment, which includes a host central processing unit (CPU) and one or more client central processing units. A host program (e.g., a host operating system) executing on the host CPU provisions the client CPUs (also known as virtual CPUs). The host program performs actions to allocate resources from the underlying host configuration and assign those resources to the client CPUs.

在一个特定实施例中,当主机CPU进入解译执行模式时,存在客户机CPU。在此点处,客户机操作系统(本文中亦称作客户机程序)开始虚拟化CPU上的执行,同时主机程序暂时中止主机CPU上的执行。在解译执行模式结束时,主机程序继续执行CPU上的执行。链接技术存在于主机与客户机之间,主机及客户机状态藉由这些连结技术而得以保存及恢复。通常,当主机程序启动客户机程序时,主机程序暂时中止,直至客户机程序返回为止。客户机CPU与主机CPU两者是一个主机CPU的不同模式。In one specific embodiment, a guest CPU exists when the host CPU enters interpreted execution mode. At this point, the guest operating system (also referred to herein as the guest program) begins execution on the virtualized CPU, while the host program temporarily suspends execution on the host CPU. At the end of interpreted execution mode, the host program resumes execution on the CPU. Linking technology exists between the host and guest, allowing host and guest states to be saved and restored. Typically, when the host program launches a guest program, the host program is temporarily suspended until the guest program returns. The guest CPU and host CPU are both different modes of the host CPU.

主机配置通常包括计算机系统的所有资源。这些资源包括(但不限于)中央处理单元(CPU)、主存储器及输入/输出(I/O)器件。在此系统中,多个客户机CPU可由单一主机CPU来支持。此情形藉由以下操作来实现:为每个客户机CPU指派称作时间片(timeslice)的一段时间以使用主机CPU,以及接着将主CPU移动至另一客户机CPU达一时间片,等等。主机CPU可支持之客户机CPU的数目根据主机CPU之能力以及待指派给每个客户机CPU之所要能力而变化。A host configuration typically includes all of a computer system's resources. These resources include, but are not limited to, the central processing unit (CPU), main memory, and input/output (I/O) devices. In this system, multiple client CPUs can be supported by a single host CPU. This is achieved by assigning each client CPU a period of time, called a timeslice, to use the host CPU, then moving the host CPU to another client CPU for a timeslice, and so on. The number of client CPUs a host CPU can support varies depending on the host CPU's capabilities and the desired capabilities to be assigned to each client CPU.

客户机配置通常由两个或两个以上客户机CPU形成,且被称作客户机多处理(MP)配置。可藉由单独主机CPU之共享或甚至藉由共享单一主机CPU来布建每个客户机CPU。此共享的一个属性在于:客户机CPU可操作达称作时间片的一段时间,且接着处于非作用中的达某一任意一段时间。非作用中时段基于以下各者而变化:由系统建立的优先权策略、将共享主机CPU的客户机CPU的总数,以及正使用的特定共享技术。A guest configuration is typically formed from two or more guest CPUs and is referred to as a guest multiprocessing (MP) configuration. Each guest CPU can be configured by sharing a separate host CPU or even by sharing a single host CPU. One property of this sharing is that a guest CPU can be operational for a period of time called a time slice and then inactive for some arbitrary period of time. The inactive period varies based on the priority policy established by the system, the total number of guest CPUs that will share the host CPU, and the specific sharing technology being used.

在此客户机多处理系统中,有时称作可分派单元(DU)的程序可由客户机CPU上的客户机操作系统来分派,且接着在该可分派单元的执行期间,该可分派单元的主机时间片期满。此情形可使可分派单元处于以下状况下:使得可分派单元无法在客户机多处理配置的任何其他客户机CPU上继续,而不管任何其他客户机CPU的可用性。确切而言,可分派单元必须等待唯一客户机CPU以接收其下一时间片以便继续。基于共享技术以及客户机配置的相对优先权,可使下一时间片延迟达相当的一段时间。即使客户机配置具有能够执行可分派单元的其他客户机CPU,可分派单元的继续也是不可能的(归因于在先前时间片期满时保存的可分派单元的客户机CPU的状态)。可分派单元系非作用中的,直至该精确状态可用以使客户机CPU继续为止。In this client multiprocessing system, a program, sometimes referred to as a dispatchable unit (DU), may be dispatched by the guest operating system on a client CPU, and then during the execution of the dispatchable unit, the host time slice for the dispatchable unit expires. This situation may place the dispatchable unit in a condition such that the dispatchable unit cannot be continued on any other client CPU in the client multiprocessing configuration, regardless of the availability of any other client CPUs. Specifically, the dispatchable unit must wait for a unique client CPU to receive its next time slice in order to continue. Based on the sharing technology and the relative priorities of the client configurations, the next time slice may be delayed for a considerable period of time. Even if the client configuration has other client CPUs capable of executing the dispatchable unit, continuation of the dispatchable unit is not possible (due to the state of the dispatchable unit's client CPU that was saved at the expiration of the previous time slice). The dispatchable unit is inactive until the precise state is available for the client CPU to continue.

发明内容Summary of the Invention

经由提供一种用于有助于促进计算环境中的处理的计算机程序产品来克服先前技术的缺点且提供优点。该计算机程序产品包括计算机可读储存介质,该计算机可读储存介质可由处理电路读取且储存指令以供该处理电路执行以用于执行方法。该方法例如包括:由第一程序将警告追踪设施已安装在计算环境内的指示提供给第二程序,该警告追踪设施将宽限期提供给该第二程序以执行第一功能;由该第一程序通知该第二程序该宽限期已经开始;以及由该第一程序在该宽限期之后执行第二功能。The shortcomings of the prior art are overcome and advantages are provided by providing a computer program product for facilitating processing in a computing environment. The computer program product includes a computer-readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method. The method includes, for example: providing, by a first program, an indication that a warning tracking facility has been installed in the computing environment to a second program, the warning tracking facility providing a grace period to the second program to perform a first function; notifying, by the first program, the second program that the grace period has begun; and performing, by the first program, a second function after the grace period.

本文中亦描述且主张与本发明的一个或多个方面有关的方法以及系统。另外,本文中亦描述且可主张与本发明的一个或多个方面有关的服务。Methods and systems related to one or more aspects of the present invention are also described and claimed herein. Additionally, services related to one or more aspects of the present invention are also described and may be claimed herein.

经由本发明的技术来实现额外特征以及优点。本发明的其他实施例以及方面在本文中加以详细描述且被视为所主张的本发明的一部分。Additional features and advantages are realized through the techniques of the present invention.Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

特别指出本发明的一个或多个方面,且在说明书完结时于申请专利范围中作为实例清楚地主张本发明的一个或多个方面。本发明的前述内容以及目标、特征以及优点自以下结合附图进行的详细描述而显而易见。One or more aspects of the present invention are particularly pointed out and clearly claimed as examples in the claims at the end of the specification. The foregoing content and objects, features and advantages of the present invention will become apparent from the following detailed description taken in conjunction with the accompanying drawings.

图1描绘含有且使用本发明的一个或多个方面的计算环境的实施例;FIG1 depicts an embodiment of a computing environment that incorporates and uses one or more aspects of the present invention;

图2描绘含有且使用本发明的一个或多个方面的计算环境的另一实施例;FIG2 depicts another embodiment of a computing environment that incorporates and uses one or more aspects of the present invention;

图3描绘含有且使用本发明的一个或多个方面的计算环境的又一实施例;FIG3 depicts yet another embodiment of a computing environment that incorporates and uses one or more aspects of the present invention;

图4描绘根据本发明的方面的与警告追踪中断设施的客户机观测相关联的逻辑的实施例;FIG4 depicts an embodiment of logic associated with alerting a client observation of an outage tracking facility according to aspects of the present invention;

图5描绘根据本发明的方面的与警告追踪中断设施的主机观测相关联的逻辑的实施例;FIG5 depicts an embodiment of logic associated with alerting a host observation of a tracking outage facility according to aspects of the present invention;

图6描绘根据本发明的方面的与处置客户机退出的主机相关联的逻辑的实施例;FIG6 depicts an embodiment of logic associated with a host handling a client exit according to aspects of the present invention;

图7描绘根据本发明的方面的警告追踪中断设施逻辑的概述的实施例;FIG7 depicts an embodiment of an overview of warning tracking interruption facility logic according to aspects of the present invention;

图8A至图8C描绘根据本发明的方面的与警告追踪中断设施处理相关联的逻辑的实施例;8A-8C depict embodiments of logic associated with warning trace interruption facility processing according to aspects of the present invention;

图9描绘根据本发明的方面的与接收警告追踪中断相关联的逻辑的实施例;FIG9 depicts an embodiment of logic associated with receiving a warning tracking interrupt according to aspects of the present invention;

图10描绘根据本发明的方面的所使用的诊断指令的格式的实施例;FIG10 depicts an embodiment of the format of a diagnostic instruction used in accordance with aspects of the present invention;

图11描绘含有本发明的一个或多个方面所述的计算机程序产品的实施例;FIG11 depicts an embodiment of a computer program product incorporating one or more aspects of the present invention;

图12描绘含有且使用本发明的一个或多个方面的主计算机系统的实施例;FIG12 depicts an embodiment of a host computer system containing and using one or more aspects of the present invention;

图13描绘含有且使用本发明的一个或多个方面的计算机系统的另一个实例;FIG13 depicts another example of a computer system that can contain and use one or more aspects of the present invention;

图14描绘含有且使用本发明的一个或多个方面的包含计算机网络的计算机系统的另一个实例;FIG14 depicts another example of a computer system including a computer network that incorporates and uses one or more aspects of the present invention;

图15描绘含有且使用本发明的一个或多个方面的计算机系统的各种组件的实施例;FIG15 depicts an embodiment of various components of a computer system that may contain and use one or more aspects of the present invention;

图16A描绘含有且使用本发明的一个或多个方面的图15的计算机系统的执行单元的实施例;FIG16A depicts an embodiment of an execution unit of the computer system of FIG15 incorporating and using one or more aspects of the present invention;

图16B描绘含有且使用本发明的一个或多个方面的图15的计算机系统的分支单元的实施例;FIG16B depicts an embodiment of a branching unit of the computer system of FIG15 that incorporates and uses one or more aspects of the present invention;

图16C描绘含有且使用本发明的一个或多个方面的图15的计算机系统的加载/储存单元的实施例;以及FIG. 16C depicts an embodiment of a load/store unit of the computer system of FIG. 15 incorporating and using one or more aspects of the present invention; and

图17描绘含有且使用本发明的一个或多个方面的仿真主计算机系统的实施例。FIG. 17 depicts an embodiment of a simulated host computer system that incorporates and utilizes one or more aspects of the present invention.

具体实施方式DETAILED DESCRIPTION

根据本发明的方面,提供用于向程序(例如,操作系统)警告其具有执行功能的宽限期的能力。举例而言,对程序给予宽限期以执行清理(例如,完成、停止和/或移动可分派单元)。According to aspects of the present invention, a capability is provided for warning a program (e.g., an operating system) that it has a grace period to perform a function. For example, the program is given a grace period to perform cleanup (e.g., complete, stop, and/or move dispatchable units).

根据本发明的另一方面,向程序和/或处理器警告其将失去对资源(例如,共享资源)的存取。举例而言,将如下警告提供给与其他处理器共享资源的处理器:该处理器将失去对资源的存取。作为另一个实例,在共享处理器上执行的诸如操作系统的程序(亦即,程序与其他程序共享处理器)警告其将失去其处理器资源。According to another aspect of the present invention, a program and/or processor is warned that it will lose access to a resource (e.g., a shared resource). For example, a processor that shares a resource with other processors is warned that the processor will lose access to the resource. As another example, a program such as an operating system executing on a shared processor (i.e., a program that shares the processor with other programs) is warned that it will lose its processor resources.

在一个特定实施例中,提供如下能力:向在由主机CPU布建(provision)的客户机CPU上执行的客户机程序提供:关于自主机CPU给予客户机CPU的时间片的期满的警告;或关于主机对客户机的时间片的优先执行的警告。该警告提供宽限期,客户机CPU可使用该宽限期来执行特定功能,诸如完成可分派单元的执行、在可分派单元为可重新分派的点停止可分派单元和/或将可分派单元移动至另一客户机CPU。In one particular embodiment, the following capability is provided: providing a guest program executing on a guest CPU provisioned by a host CPU with a warning of the expiration of a timeslice granted to the guest CPU by the host CPU, or a warning of the host prioritizing execution of a timeslice over a guest CPU, wherein the warning provides a grace period that the guest CPU can use to perform certain functions, such as completing execution of a dispatchable unit, stopping the dispatchable unit at a point where it is re-dispatched, and/or moving the dispatchable unit to another guest CPU.

如本文中所使用,作为实例,宽限期包括时间量、指令的数目、循环的数目等。宽限期具有可执行一个或多个功能的预定持续时间。As used herein, a grace period includes, by way of example, an amount of time, a number of instructions, a number of cycles, etc. The grace period has a predetermined duration during which one or more functions may be executed.

参看图1来描述含有且使用本发明的一个或多个方面的计算环境的一个实施例。在此特定实施例中,计算环境100包括共享资源104的多个处理器102。对每个处理器(和/或在处理器上执行的诸如操作系统的程序)给予称作时间片的某一时间量以共享资源。作为实例,资源包括中央处理单元资源、内存、输入/输出器件或接口,和/或其他资源。向能够存取资源的处理器(或在处理器上执行的程序)警告处理器的存取将结束,且因此,处理器(或程序)将执行特定动作,诸如清理、完成工作单元、停止工作单元、移动工作单元等。One embodiment of a computing environment that includes and uses one or more aspects of the present invention is described with reference to FIG1 . In this particular embodiment, the computing environment 100 includes a plurality of processors 102 that share resources 104. Each processor (and/or a program executing on the processor, such as an operating system) is given a certain amount of time, called a time slice, to share the resources. As examples, resources include central processing unit resources, memory, input/output devices or interfaces, and/or other resources. A processor (or program executing on the processor) that has access to a resource is warned that the processor's access is about to end, and therefore, the processor (or program) is to perform a specific action, such as cleanup, completing a work unit, stopping a work unit, moving a work unit, etc.

参看图2来描述含有且使用本发明的一个或多个方面的计算环境200的另一实施例。计算环境200系基于例如由International Business Machines Corporation(Armonk,New York)供应的描述于2010年8月的题为“z/Architecture Principles of Operation”的公开案(公开案第SA22-7832-08号第九版本)中,该案藉此以全文引用的方式并入本文中。在一个实例中,基于的计算环境包括由International Business Machines Corporation(Armonk,New York)供应的服务器。以及以及下文提及的以及为International Business Machines Corporation(Armonk,New York,USA)的注册商标。本文中所使用的其他名称可为InternationalBusiness Machines Corporation或其他公司的注册商标、商标或产品名称。Another embodiment of a computing environment 200 that incorporates and uses one or more aspects of the present invention is described with reference to FIG2 . The computing environment 200 is based on, for example, the z/ Architecture Principles of Operation publication No. SA22-7832-08, Revision 9, dated August 2010, provided by International Business Machines Corporation (Armonk, New York), which is hereby incorporated by reference in its entirety. In one example, the computing environment includes servers provided by International Business Machines Corporation (Armonk, New York). [The following sentences appear to be unrelated and should likely be omitted.] [The following sentences appear to be unrelated and should likely be omitted.] [The following sentences appear to be unrelated and should likely be omitted.] [The following sentences appear to be unrelated and should likely be omitted.] [The following sentences appear to be unrelated and should likely be omitted.]

作为一个实例,计算环境200包括提供虚拟机支持的中央处理器复合体(centralprocessor complex,CPC)202。CPC202例如包括一个或多个虚拟机204(或在另一实施例中,逻辑分割区)、一个或多个中央处理器206、至少一个主机208(例如,诸如超管理器的控制程序)以及输入/输出子系统210,下文描述前述各者中的每个者。在此实例中,虚拟机以及主机包括于内存中。As an example, computing environment 200 includes a central processor complex (CPC) 202 that provides virtual machine support. CPC 202 includes, for example, one or more virtual machines 204 (or, in another embodiment, logical partitions), one or more central processors 206, at least one host 208 (e.g., a control program such as a hypervisor), and an input/output subsystem 210, each of which is described below. In this example, the virtual machines and the host are contained in memory.

作为实例,CPC的虚拟机支持提供操作大量虚拟机的能力,这些虚拟机各自能够主控诸如或Linux的客户机操作系统212。每个虚拟机204能够作为单独系统起作用。亦即,每个虚拟机可经独立地重设,主控客户机操作系统,并以不同程序操作。在虚拟机中执行的操作系统或应用程序显现为能够存取完全且完整系统,但实际上,仅系统的一部分为可用的。As an example, CPC's virtual machine support provides the ability to operate a large number of virtual machines, each capable of hosting a guest operating system 212 such as Windows XP or Linux. Each virtual machine 204 can function as a separate system. That is, each virtual machine can be independently reconfigured, host a guest operating system, and operate with different programs. The operating system or application running in the virtual machine appears to have access to a complete and intact system, but in reality, only a portion of the system is available.

CPC的实体资源(例如,CPU、内存、I/O器件等)由主机208拥有,且共享实体资源由主机按需要分派给客户机操作系统以满足客户机操作系统的处理需求。客户机操作系统与实体共享机器资源之间的互动由主机控制,此系由于大量客户机通常阻止主机简单地分割硬件资源并将硬件资源指派给所配置的客户机。The CPC's physical resources (e.g., CPU, memory, I/O devices, etc.) are owned by the host 208, and the shared physical resources are allocated by the host to the guest operating systems as needed to meet the guest operating systems' processing needs. The interaction between the guest operating systems and the physical shared machine resources is controlled by the host, as the large number of guests often prevents the host from simply partitioning and assigning hardware resources to the configured guests.

中央处理器206为可指派给虚拟机的实体处理器资源。举例而言,虚拟机204包括一个或多个逻辑处理器,这些逻辑处理器中的每个者表示可经动态地分配给虚拟机的实体处理器资源206的全部或共享。虚拟机204由主机208管理。作为实例,主机可以在处理器206上执行的微码来实施,或可为在机器上执行的主机操作系统的一部分。在一个实例中,主机208为由International Business Machines Corporation(Armonk,New York)供应的处理器资源/系统管理器(PR/SM)。The central processor 206 is a physical processor resource that can be assigned to a virtual machine. For example, a virtual machine 204 includes one or more logical processors, each of which represents all or a share of the physical processor resource 206 that can be dynamically allocated to the virtual machine. Virtual machines 204 are managed by a host 208. As examples, the host can be implemented as microcode executing on processor 206, or can be part of a host operating system executing on the machine. In one example, the host 208 is a processor resource/system manager (PR/SM) supplied by International Business Machines Corporation (Armonk, New York).

输入/输出子系统210指导在器件与主储存器之间的信息的流动。输入/输出子系统210耦接至中央处理复合体,就此而言,输入/输出子系统210可为中央处理复合体的部分或与中央处理复合体分离。I/O子系统减轻中央处理器关于与耦接至CPC的I/O器件直接通信的任务,且准许数据处理与I/O处理同时进行。The input/output subsystem 210 directs the flow of information between devices and main storage. The input/output subsystem 210 is coupled to the central processing complex, in which regard, the input/output subsystem 210 can be part of the central processing complex or separate from the central processing complex. The I/O subsystem relieves the central processor of the task of directly communicating with I/O devices coupled to the CPC and allows data processing to proceed simultaneously with I/O processing.

在一个实施例中,主机(例如,PR/SM)以及处理器(例如,)硬件/固件以受控合作方式彼此互动,以便处理客户机操作系统操作而不需要自/至客户机操作系统以及主机的控制的传送。可在无主机干预情况下经由允许针对客户机解译地执行指令的设施直接执行客户机操作。此设施提供主机可发出的指令“启动解译执行(SIE)”,该指令指明保持客户机(虚拟机)状态以及控制的称作状态描述的控制区块。该指令将CPU置于直接处理客户机指令以及中断的解译执行模式,直至出现需要主机关注的条件为止。当发生此条件时,解译执行结束,且呈现主机中断,或SIE指令完成储存所遭遇的条件的细节;此后一个动作被称作拦截。解译执行的一个实例描述于1985年9月的“System/370ExtendedArchitecture/Interpretive Execution”(IBM公开案第SA22-7095-01号)中,该案藉此以全文引用的方式并入本文中。In one embodiment, the host (e.g., PR/SM) and processor (e.g., ) hardware/firmware interact with each other in a controlled, cooperative manner to process guest operating system operations without requiring the transfer of control to/from the guest operating system and the host. Guest operations can be executed directly without host intervention via a facility that allows instructions to be interpreted for the guest. This facility provides a host-issued instruction, "Start Interpretive Execution (SIE)," which specifies a control block, called a state description, that holds guest (virtual machine) state and control. This instruction places the CPU in an interpretive execution mode, directly processing guest instructions and interrupts, until a condition requiring host attention occurs. When this condition occurs, interpretive execution ends and a host interrupt is presented, or the SIE instruction completes and stores details of the condition encountered; an action hereafter referred to as an intercept. An example of interpretive execution is described in "System/370 Extended Architecture/Interpretive Execution," September 1985 (IBM Publication No. SA22-7095-01), which is hereby incorporated by reference in its entirety.

如本文中所使用,固件例如包括处理器的微码、毫码(millicode)和/或宏码。固件例如包括用于较高层级机器码的实施方案中的硬件层级的指令和/或数据结构。在一个实施例中,固件包括例如专属码,专属码通常作为包括信赖软件的微码或基础硬件特定的微码而递送且控制对系统硬件的操作系统存取。As used herein, firmware includes, for example, microcode, millicode, and/or macrocode for a processor. Firmware includes, for example, hardware-level instructions and/or data structures for implementation in higher-level machine code. In one embodiment, firmware includes, for example, proprietary code, typically delivered as microcode that includes trusted software or underlying hardware-specific microcode and controls operating system access to system hardware.

在图3中描绘含有本发明的一个或多个方面的计算环境的另一个实例。在此实例中,提供仿真主计算机系统300,仿真主计算机系统300仿真主机架构的主计算机302。在仿真主计算机系统300中,主机处理器(CPU)304为仿真主机处理器(或虚拟主机处理器),且经由具有不同于供主计算机302的处理器使用的原生指令集架构的原生指令集架构的仿真处理器306来实现。仿真主计算机系统300具有仿真处理器306可存取的内存308。在实例实施例中,内存308经分割成主计算机内存部分310以及仿真例程部分312。主计算机内存310可用于根据主计算机架构的仿真主计算机302的程序,且可包括主机或超管理器314与执行客户机操作系统318的一个或多个虚拟机316两者(类似于图2中的类似命名的组件)。Another example of a computing environment incorporating one or more aspects of the present invention is depicted in FIG3 . In this example, an emulated host computer system 300 is provided that emulates a host computer 302 of a host architecture. In the emulated host computer system 300, a host processor (CPU) 304 is an emulated host processor (or virtual host processor) and is implemented via an emulated processor 306 having a native instruction set architecture different from the native instruction set architecture used by the processor of the host computer 302. The emulated host computer system 300 has memory 308 accessible to the emulated processor 306. In an example embodiment, the memory 308 is partitioned into a host computer memory portion 310 and an emulated routine portion 312. The host computer memory 310 is available to programs of the emulated host computer 302 according to the host computer architecture and may include both a host or hypervisor 314 and one or more virtual machines 316 executing guest operating systems 318 (similar to the similarly named components in FIG2 ).

模拟处理器306执行不同于模拟处理器304之架构的架构之经建构指令集的原生指令。例如,自仿真例程内存312获得原生指令。模拟处理器306可藉由使用在序列与存取/解码例程中获得之一个或多个指令来自主计算机内存310中的程序存取用于执行之主机指令,该序列与存取/解码例程可解码所存取之主机指令以判定用于仿真所存取之主机指令之功能的原生指令执行例程。一个主机指令可为,例如,启动解译执行(SIE)指令,主机藉由该指令而设法在虚拟机中执行客户机程序。仿真例程312可包括对此指令之支持,且用于根据此SIE指令之定义执行虚拟机316中之一序列客户机指令。The emulation processor 306 executes native instructions of an architecture constructed from an instruction set different from the architecture of the emulation processor 304. For example, the native instructions are obtained from the emulation routine memory 312. The emulation processor 306 can access host instructions for execution from a program in the host computer memory 310 using one or more instructions obtained in a sequence and access/decode routine. The sequence and access/decode routine can decode the accessed host instructions to determine a native instruction execution routine for emulating the function of the accessed host instructions. A host instruction can be, for example, a start interpret execute (SIE) instruction, by which the host attempts to execute a guest program in the virtual machine. The emulation routine 312 may include support for this instruction and is used to execute a sequence of guest instructions in the virtual machine 316 according to the definition of this SIE instruction.

作为实例,针对主计算机系统302之架构定义之其他设施可藉由经建构之设施例程来仿真,包括诸如通用寄存器、控制寄存器、动态地址转译以及I/O子系统支持以及处理器高速缓存的设施。仿真例程亦可利用仿真处理器306中可用之功能(诸如,通用寄存器以及虚拟地址之动态转译)以改良仿真例程的效能。亦可提供专用硬件以及卸除引擎以协处理器306仿真主计算机302之功能。As an example, other facilities defined for the architecture of host computer system 302 can be emulated by constructed facility routines, including facilities such as general registers, control registers, dynamic address translation, I/O subsystem support, and processor caches. The emulation routines can also utilize functions available in the emulated processor 306 (such as general registers and dynamic translation of virtual addresses) to improve the performance of the emulation routines. Specialized hardware and offload engines can also be provided to assist the processor 306 in emulating the functions of the host computer 302.

根据本发明的方面,提供可用于许多类型的计算环境中的警告追踪中断设施。尽管警告追踪中断设施可用于许多类型之环境中,但本文中参看客户机多处理系统来描述设施的方面。如上文所描述,在客户机多处理系统中,客户机操作系统在客户机中央处理单元上分派可分派单元(例如,程序、程序代码等),这些客户机中央处理单元由至少一个主机中央处理单元来主控。主机CPU为客户机CPU提供一时间片(例如,时间量或其他时段,诸如指令之数目、循环之数目等),可分派单元在该时间片期间执行。若在可分派单元之执行期间,时间片期满,则可使得可分派单元处于以下状况:使得其无法在客户机多处理配置的任何其他客户机CPU上继续,而不管任何其他客户机CPU的可用性。确切而言,可分派单元必须等待唯一的客户机CPU来接收其下一时间片以便继续。基于所使用之特定共享技术以及客户机配置之相对优先权,可使下一时间片延迟达相当的一段时间。即使客户机配置具有能够执行可分派单元的其他客户机CPU,可分派单元的继续也是不可能的(归因于在先前时间片期满时保存的可分派单元之客户机CPU的状态)。可分派单元系非作用中的,直至该精确状态可用以继续客户机CPU为止。According to aspects of the present invention, a warning tracking interrupt facility is provided that can be used in many types of computing environments. While the warning tracking interrupt facility can be used in many types of environments, aspects of the facility are described herein with reference to a client multiprocessing system. As described above, in a client multiprocessing system, a client operating system dispatches dispatchable units (e.g., programs, program code, etc.) onto client central processing units (CPUs), which are hosted by at least one host CPU. The host CPU provides a time slice (e.g., a time quantum or other time period, such as a number of instructions, a number of cycles, etc.) to the client CPUs during which the dispatchable unit executes. If the time slice expires during the execution of a dispatchable unit, the dispatchable unit may be placed in a state where it cannot continue on any other client CPU in the client multiprocessing configuration, regardless of the availability of any other client CPUs. Specifically, the dispatchable unit must wait for a unique client CPU to receive its next time slice in order to continue. Depending on the specific sharing technology used and the relative priorities of the client configurations, this delay may be considerable. Even if the guest configuration has other guest CPUs capable of executing the dispatchable unit, continuation of the dispatchable unit is not possible (due to the state of the guest CPU of the dispatchable unit being saved at the expiration of the previous timeslice). The dispatchable unit is inactive until the accurate state is available to continue the guest CPU.

有可能藉由授予额外时间(或其他额外时段,诸如额外指令、循环等)来延长时间片,但即使藉由此额外时间,客户机CPU可延长可分派单元之执行,而仍使可分派单元处于相同的不可分派状况,此系由于将处于正常时间片的期满时间。It is possible to extend the time slice by granting additional time (or other additional time periods, such as additional instructions, cycles, etc.), but even with this additional time, the client CPU can extend the execution of the dispatchable unit while still leaving the dispatchable unit in the same undispatched state, since it will be at the expiration time of the normal time slice.

由于主机程序并不知晓供执行任意可分派单元之任意客户机程序使用的控制以及状态,因此无法在不建立主机程序与客户机程序之间的协议之情况下进行始终对客户机操作系统授予额外时间以清理其可分派单元。在无协议之情况下,将在主处理中消耗对客户机CPU授予之任何额外时间,且仍有可能以相同的可分派单元卡塞状况结束。因此,根据本发明的方面,提供此协议。Because the host program is unaware of the controls and state used by any guest program executing any dispatchable unit, it is not possible to consistently grant the guest operating system extra time to clean up its dispatchable units without establishing a protocol between the host and guest programs. Without this protocol, any extra time granted to the guest CPU will be consumed by the main process, and the client may still end up with the same dispatchable unit jam. Therefore, according to aspects of the present invention, such a protocol is provided.

根据本发明的方面,提供包括警告之宽限期或延长时间,该警告向客户机程序指示应采取特定动作(例如,完成可分派单元或使得可分派单元为可重新分派的)。作为实例,响应于时间片之期满或在时间片期满之前响应于主机优先执行客户机而提供宽限期,以便回收处理器以用于如主机可见之某一其他较高优先权,如本文中进一步详细描述。According to aspects of the present invention, a grace period or extended time is provided that includes a warning indicating to the guest program that a specific action should be taken (e.g., completing a dispatchable unit or making a dispatchable unit re-dispatched). As an example, a grace period is provided in response to the expiration of a timeslice or in response to the host prioritizing execution of the guest before the expiration of a timeslice in order to reclaim the processor for some other higher priority as seen by the host, as described in further detail herein.

作为一个实例,提供宽限期而非无条件地延长时间片。若正常时间片已完全期满,则提供宽限期,但冲销下一正常时间片,以便对各自具有时间片期望值之所有其他虚拟化客户机维持公平。若正常时间片尚未期满,则宽限期取自剩余正常时间。总之,宽限期限制给予客户机CPU之剩余时间(或其他时段),且自身为不可延长的。因此,客户机CPU无法继续执行达任意且未知时段。As an example, a grace period is provided rather than unconditionally extending the time slice. If the normal time slice has fully expired, a grace period is provided, but the next normal time slice is offset to maintain fairness for all other virtualized guests with their own time slice expectations. If the normal time slice has not yet expired, the grace period is taken from the remaining normal time. In short, the grace period limits the remaining time (or other period) given to the guest CPU and is itself non-extendable. Therefore, the guest CPU cannot continue execution for an arbitrary and unknown period of time.

在宽限期的开始,出于清理可分派单元(例如,完成可分派单元、停止可分派单元和/或移动可分派单元)的目的而通知客户机程序。宽限期之强制执行确保:客户机CPU不会超出所授予的额外时段。藉以对客户机程序给予宽限期且向客户机程序通知时间(或其他时段)几乎期满(宽限期已开始)的协议系客户机程序与主机程序之间的协议,客户机程序理解该协议,藉此使得此通知为值得的。亦即,客户机程序通常将藉由在必要时使得当前可分派单元在客户机配置的另一客户机CPU上为可分派的(例如,移动可分派单元)来履行(honor)该通知。At the beginning of the grace period, the guest program is notified for the purpose of cleaning up the dispatchable unit (e.g., completing the dispatchable unit, stopping the dispatchable unit, and/or moving the dispatchable unit). Enforcement of the grace period ensures that the guest CPU does not exceed the additional time period granted. The protocol by which the guest program is granted a grace period and notifies the guest program that the time (or other time period) is almost expired (the grace period has begun) is an agreement between the guest program and the host program, which the guest program understands and thus makes this notification worthwhile. That is, the guest program will generally honor the notification by making the current dispatchable unit dispatchable on another guest CPU in the guest configuration (e.g., moving the dispatchable unit) if necessary.

下文参看图4至图10来描述关于协定以及警告追踪中断设施(亦称作警告追踪或警告追踪设施)的其他细节。参看那些图所描述之实施例涉及具有由一个或多个主机布建之一个或多个客户机的虚拟环境。然而,本发明的一个或多个方面亦涉及其他环境,包括多个处理器和/或多个程序共享资源的非虚拟环境。Further details regarding the protocol and the warning tracking interruption facility (also referred to as warning tracking or warning tracking facility) are described below with reference to Figures 4 through 10. The embodiments described with reference to those figures relate to a virtualized environment having one or more clients deployed by one or more hosts. However, one or more aspects of the present invention also relate to other environments, including non-virtualized environments where multiple processors and/or multiple processes share resources.

参看图4,描述关于如由客户机观测到之警告追踪中断设施协议的细节。如由客户机观测到的警告追踪协议包括,例如,设施已安装指示、客户机注册、通知以及主动(voluntarily)退出,在下文中描述前述各者中之每个者。4, details regarding the protocol for tracking the interruption of a facility as observed by a client are described. The protocol for tracking the interruption of a facility as observed by a client includes, for example, facility installed indication, client registration, notification, and voluntarily exiting, each of which is described below.

参看图4,客户机程序理解警告追踪协议且搜寻设施已安装指示(步骤400)。在一个实例中,此指示为储存于控制区块(例如,“服务调用控制区块(SCCB)”)中的位,该位系使用诸如“读取SCP信息”命令之读取命令来观测。在判定设施已安装之后,客户机程序执行注册(步骤402)。注册系客户机程序将关于客户机程序理解警告追踪中断设施协议的指示传达至主机程序的机制。在一个实例中,使用诊断指令来执行注册,下文进一步描述诊断指令之实例。4 , the client program understands the warning trace protocol and searches for an indication that the facility is installed (step 400). In one example, this indication is a bit stored in a control block (e.g., a "Service Call Control Block (SCCB)") that is observed using a read command such as a "read SCP information" command. After determining that the facility is installed, the client program performs registration (step 402). Registration is a mechanism by which the client program communicates to the host program that the client program understands the warning trace interrupt facility protocol. In one example, registration is performed using diagnostic instructions, examples of which are further described below.

在一个实施例中,自任何客户机中央处理单元启动的注册涵盖多处理配置之所有客户机中央处理单元,此系由于需要跨越客户机多处理配置之客户机CPU的一致行为。在客户机多处理配置中,客户机CPU使用相同主存储器,且假定客户机CPU在有时被称作单一影像的影像中操作。因此,一客户机CPU的注册适用于多处理环境之其他客户机CPU。在一个实施例中,注册为不可撤销的,且此情形有助于避免计时窗,简化开发且允许改良之可测试性。即使注册为不可撤销的,客户机程序亦可判定客户机程序是否将继续参与协议。若客户机程序如此选择,则藉由重设或已重设下文所描述之一个或多个启用指示符,客户机程序不需要参与。In one embodiment, registration initiated from any client central processing unit covers all client central processing units of a multi-processing configuration, because consistent behavior is desired across client CPUs of a client multi-processing configuration. In a client multi-processing configuration, the client CPUs use the same main memory, and it is assumed that the client CPUs operate in an image, sometimes referred to as a single image. Therefore, registration for one client CPU applies to other client CPUs of a multi-processing environment. In one embodiment, registration is irrevocable, and this helps avoid timing windows, simplifies development, and allows for improved testability. Even if registration is irrevocable, the client program can determine whether the client program will continue to participate in the protocol. If the client program so chooses, the client program need not participate by resetting or having reset one or more enable indicators described below.

在针对警告追踪协议注册客户机程序之后,可向客户机CPU通知宽限期(步骤404)。举例而言,主机CPU可向客户机CPU警告时间片之期满(或在另一个实例中,迫近期满)或其时间片之优先执行。在一特定实例中,向已注册客户机配置之CPU通知,例如,其正常时间片之期满,以及提供额外时段以,例如,进行清理之宽限期的开始。After registering the guest program for the alert tracking protocol, the guest CPU may be notified of a grace period (step 404). For example, the host CPU may warn the guest CPU of the expiration (or, in another example, the impending expiration) of its time slice or the prioritization of its time slice. In one specific example, the CPU of a registered guest configuration is notified of, for example, the expiration of its normal time slice and the beginning of a grace period that provides an additional period for, for example, cleanup.

在被通知之后,客户机具有受约束时间量或其他时段、宽限期(例如,在一个特定实施例中,为50微秒),以使得可分派单元为可重新分派的或进行任何其他适当调整。若正常时间片已结束,则,例如,在将控制返回至主机之前,使用宽限期以使得可分派单元为可重新分派的或进行任何其他适当调整。若时间片尚未结束,则使用宽限期,且放弃时间片之任何剩余部分。发生供客户机CPU使用之实际时间的正常账户处理。After being notified, the client has a constrained amount of time or other period, a grace period (e.g., 50 microseconds in one specific embodiment) to make the dispatchable unit re-dispatched or make any other appropriate adjustments. If the normal time slice has ended, then the grace period is used, for example, before returning control to the host, to make the dispatchable unit re-dispatched or make any other appropriate adjustments. If the time slice has not ended, then the grace period is used and any remaining portion of the time slice is discarded. Normal accounting of actual time used by the client CPU occurs.

在作出通知之后,客户机CPU处于受约束时段(例如,有限时间量),在该时段之后,非主动结束客户机CPU之操作。针对每个正常时间片时段仅作出一个通知。因此,客户机CPU仍受确保可在其他处共享基础共享主机CPU的最终时间控制约束,藉此在藉由主机程序提供之总体虚拟化中保留良好次序以及规则。After the notification is made, the guest CPU is in a constrained period (e.g., a finite amount of time) after which the guest CPU's operation is involuntarily terminated. Only one notification is made for each normal time slice period. Thus, the guest CPU remains subject to the ultimate timing control constraints that ensure the underlying shared host CPU can be shared elsewhere, thereby preserving good order and regularity in the overall virtualization provided by the host program.

可藉由使得客户机程序侦测到唯一状态之任何机制来实现通知。实例包括唯一客户机中断、可经设定之架构上定义之主存储器位置,或可用于主机与客户机两者之I/O外部内存器件。前述三者中之第一者需要适当客户机启用以允许中断。后两者需要不浪费宽限期之足够频繁的时段性检验。在之一特定实例中,称作警告追踪中断(WTI)之客户机中断用作通知。Notification can be achieved by any mechanism that allows the guest program to detect a unique state. Examples include a unique guest interrupt, an architecturally defined main memory location that can be configured, or an I/O external memory device available to both the host and the guest. The first of these three requires appropriate guest enablement to allow interrupts. The latter two require sufficiently frequent periodic checks that do not waste grace periods. In one specific example, a guest interrupt called a warning trace interrupt (WTI) is used for notification.

在被警告之后,客户机主动地退出其给定时间片/宽限期(步骤406)。在被通知且使得可分派单元为可重新分派的(例如,停止可分派单元以及移动可分派单元,或完成可分派单元)之后,客户机结束当前时间片/宽限期。此退出用信号向主机程序通知:客户机实际上遵循协议。可发生客户机放弃控制因此返回至主机程序之其他原因。通常,对于使得可分派单元为可重新分派的之受约束处理,将不会发生针对任何这些外来退出之状况。若客户机CPU经由警告追踪中断协议在宽限期内退出,则无论何时发生该状况,均给予关于下一时间片之反馈指示。因此,客户机程序知晓其满足由宽限期强加之时间约束。After being warned, the client actively exits its given time slice/grace period (step 406). After being notified and making the dispatchable unit re-dispatched (e.g., stopping the dispatchable unit and moving the dispatchable unit, or completing the dispatchable unit), the client ends the current time slice/grace period. This exit signals the host program that the client is actually following the protocol. Other reasons may occur for the client to relinquish control and therefore return to the host program. Typically, for constrained processing that makes the dispatchable unit re-dispatched, no conditions will occur for any of these external exits. If the client CPU exits within the grace period via the warning tracking interrupt protocol, a feedback indication regarding the next time slice is given whenever this condition occurs. Thus, the client program knows that it has met the time constraints imposed by the grace period.

若客户机迟延主动退出,则藉由宽限期之期满而优先执行该客户机之执行。下次以正常时间片启动客户机CPU时,给予反馈指示,使得客户机知晓其系迟延的。大体上,此情形可用于客户机程序中之问题判定,此系因为惯常的宽限期允许足够时间来清理以及主动退出。If a guest delays its voluntary exit, the expiration of the grace period allows its execution to be prioritized. The next time the guest CPU is activated with a normal time slice, a feedback indication is provided, letting the guest know it was delayed. This can be used to troubleshoot guest programs, as the usual grace period allows ample time for cleanup and voluntary exit.

若发生外来退出,则下次在正常时间片内启动客户机CPU时,期望将快速地发生主动退出。同一反馈机制将向客户机程序告知:外来退出已被干预且因此提供不同信息以告知问题判定。If an external exit occurs, the next time the guest CPU is started within a normal time slice, it is expected that an active exit will occur quickly. The same feedback mechanism will inform the guest program that an external exit has been intervened and thus provide different information to inform problem determination.

主动退出是藉由使得控制自客户机程序经由主机程序传递的任何机制来实现,且该机制包括前述反馈机制。所使用之机制将定义于特定架构之警告追踪中断协议中,以便供主机程序辨识客户机请求。在一个实例中,此机制包括下文描述之诊断指令。Active exit is achieved by any mechanism that allows control to be transferred from the guest program through the host program, including the feedback mechanism described above. The mechanism used will be defined in the warning trace interrupt protocol of the specific architecture so that the host program can recognize the guest request. In one example, this mechanism includes the diagnostic instructions described below.

除警告追踪中断协议之客户机观测外,在一实施例中,主机亦观测设施,如下文参看图5进一步详细描述。In addition to client observation of the alert tracking outage protocol, in one embodiment, the host also observes the facility, as described in further detail below with reference to FIG. 5 .

参看图5,主机辨识设施已安装指示并将该指示反映至其客户机(步骤500)。举例而言,主机检查控制区块(例如,SCCB)中之已安装位,且辨识警告追踪协议之已安装状态(亦即,其经设定)并知晓主机程序可如何使用该状态而对主机有利。因此,将设施指示反映至其客户机。举例而言,为了将设施反映至客户机,主机设定客户机控制区块(例如,客户机SCCB)或客户机可存取之内存区域中的已安装位。若由于任何原因,主机程序并不希望客户机观测警告追踪中断设施协议之已安装状态且不允许客户机观测警告追踪中断设施协议之已安装状态并使用该状态,则主机程序将未经安装指示传递至客户机(例如,将客户机可见之位设定为零)。此外,在一实施例中,主机程序设定客户机CPU之控制,使得警告追踪协议经停用(例如,关断客户机CPU之状态描述中的一个或多个指明位)。5 , the host identifies the facility installed indication and reflects it to its client (step 500). For example, the host checks the installed bit in the control block (e.g., SCCB) and identifies the installed state of the warning tracking protocol (i.e., it is set) and knows how the host program can use this state to the host's advantage. Therefore, the facility indication is reflected to its client. For example, to reflect the facility to the client, the host sets the installed bit in the client control block (e.g., the client SCCB) or a memory area accessible to the client. If, for any reason, the host program does not want the client to observe the installed state of the warning tracking interrupt facility protocol and does not allow the client to observe and use the installed state of the warning tracking interrupt facility protocol, the host program passes a not installed indication to the client (e.g., sets the client-visible bit to zero). In addition, in one embodiment, the host program sets the control of the client CPU so that the warning tracking protocol is disabled (e.g., turns off one or more designated bits in the status description of the client CPU).

随着客户机启动注册,主机程序接收到未经请求之注册请求,且记住客户机已注册(步骤502)。由任何单一客户机CPU启动之注册请求足以注册客户机多处理配置中之所有客户机CPU。因此,主机程序针对客户机配置之所有CPU启用警告追踪协议(步骤504)。举例而言,主机程序设定客户机CPU之状态描述中之一个或多个指明位以针对客户机启用警告追踪中断设施。不必将注册之反馈传回至客户机。倘若即使在设施未经安装时客户机CPU仍尝试注册,主机将忽略请求且针对警告追踪中断设施协议将不启用客户机CPU。As the client initiates registration, the host program receives the unsolicited registration request and remembers that the client is already registered (step 502). A registration request initiated by any single client CPU is sufficient to register all client CPUs in the client multi-processing configuration. Therefore, the host program enables the warning trace protocol for all CPUs in the client configuration (step 504). For example, the host program sets one or more designated bits in the state description of the client CPU to enable the warning trace interrupt facility for the client. No feedback on the registration needs to be sent back to the client. If the client CPU attempts to register even when the facility is not installed, the host will ignore the request and will not enable the client CPU for the warning trace interrupt facility protocol.

在针对警告追踪设施注册以及启用客户机之后,客户机可接收关于协议之调用的通知(步骤506)。此情形可在若干个情境中实现,如下文所描述。After registering and enabling the client for the alert tracking facility, the client may receive notifications about invocations of the protocol (step 506). This may be achieved in several scenarios, as described below.

作为一个实例,当针对在主机CPU(亦即,主机CPU X)上以解译执行模式操作之客户机CPU启用警告追踪中断协议时,主机程序可启动来自主机CPU Y的协议。亦即,已由主机CPU X布建客户机CPU,且主机CPU X目前不可用于主机程序。若主机程序不得不重新获取CPU X,则主机程序首先使得CPU X退出解译执行模式。亦即,使客户机CPU停止,藉此退出CPU X之解译执行模式。在任何的任意点使客户机CPU停止而不允许客户机CPU自身主动地停止产生警告追踪中断协议意欲解决之问题的风险。警告追踪中断协议藉由允许将主机程序动作变换成客户机CPU X中之通知而允许主机CPU Y请求通知(步骤506)。由于客户机程序先前已注册,因此主机程序期望:客户机程序辨识通知且支持通知之包括主动结束执行之最后步骤的适当处置,因此使主机CPU X之控制返回至主机程序。一旦发生此情形,主机程序便可继续进行,而不管主机CPU X之使用可能已使得程序经启动。As an example, when the Warning Trace Interrupt protocol is enabled for a guest CPU operating in interpreted execution mode on a host CPU (i.e., host CPU X), the host program may initiate the protocol from host CPU Y. That is, the guest CPU has already been provisioned by host CPU X and is currently unavailable to the host program. If the host program must reacquire CPU X, the host program first causes CPU X to exit interpreted execution mode. That is, it halts the guest CPU, thereby exiting CPU X's interpreted execution mode. Halting the guest CPU at any arbitrary point without allowing the guest CPU to proactively halt itself risks creating the very problem the Warning Trace Interrupt protocol is intended to address. The Warning Trace Interrupt protocol allows host CPU Y to request notifications by allowing host program actions to be converted into notifications in guest CPU X (step 506). Since the guest program has previously registered, the host program expects that the guest program will recognize the notifications and support appropriate handling of the notifications, including the final step of proactively terminating execution, thereby returning control of host CPU X to the host program. Once this occurs, the host program can continue regardless of any program activations that may have occurred due to the use of host CPU X.

主机程序藉由,例如,设定任何状态、设定指示符(例如,位)或使得将未经请求的异步信号(例如,警告追踪中断)发送至客户机来通知客户机。尽管已注册,但此通知信号之接收的时间在客户机中仍为未知的。藉由注册,倘若用信号通知,客户机便已恰好同意遵守协议。The host program notifies the client by, for example, setting any state, setting an indicator (e.g., a bit), or causing an unsolicited asynchronous signal (e.g., a warning trace interrupt) to be sent to the client. Despite registration, the time of receipt of this notification signal remains unknown in the client. By registering, the client has just agreed to abide by the protocol if notified by the signal.

在主机单处理器系统中,若一个主机CPU处于解译执行模式从而使得客户机CPU正操作,则不存在其他主机CPU来调用警告追踪中断协议。然而,即使在此状况下,当主机CPU在处于解译执行模式的同时辨识时间片期满时,CPU自身仍可调用警告追踪中断协议,且可接着授予宽限期并执行通知。In a single-processor host system, if one host CPU is in interpretive execution mode, thus enabling the guest CPU to operate, there is no other host CPU to invoke the warning trace interrupt protocol. However, even in this case, when the host CPU recognizes the expiration of a time slice while in interpretive execution mode, the CPU itself can still invoke the warning trace interrupt protocol, and can then grant a grace period and perform the notification.

在通知之另一个实例中,当主机CPU使得将定义于警告追踪中断协议中之通知发送至客户机CPU时(归因于当主机CPU处于解译执行模式时,主机CPU辨识之内部状态改变),发生通知。当针对警告追踪中断协议启用客户机CPU且主机CPU辨识时间片之结束时,发生此情形之实例。在用信号向客户机CPU通知以放弃控制之前,CPU在内部授予宽限期以允许客户机CPU具有足够时间以接收信号、采取适当动作(例如,完成当前可分派单元或使得当前可分派单元为可重新分派的)且主动地结束。在内部,主机CPU保持状态以指示:已向客户机CPU通知。若客户机在宽限期内并未主动地结束,则CPU辨识此情形且结束客户机的执行,藉此藉由结束解译执行模式而使控制返回至主机程序。在一实施例中,客户机无法判定为何调用协议,而是仅判定其被通知清理并结束。可存在用于引起解译执行模式之结束且因此结束客户机执行的其他主机理论基础。举例而言,存在如下情境:将使所有客户机CPU之执行停止以便对整个客户机配置作出某一协调改变。多处理客户机配置并不具有在与客户机配置之其他CPU不同的规则或假定下操作的一些CPU。此不对称性可产生不可预测之客户机结果。In another example of notification, notification occurs when the host CPU causes a notification defined in the warning trace interrupt protocol to be sent to the guest CPU (due to an internal state change recognized by the host CPU while the host CPU is in interpreted execution mode). This occurs when the guest CPU is enabled for the warning trace interrupt protocol and the host CPU recognizes the end of a time slice. Before signaling the guest CPU to relinquish control, the CPU internally grants a grace period to allow the guest CPU sufficient time to receive the signal, take appropriate action (e.g., complete the currently dispatchable unit or make the currently dispatchable unit re-dispatched), and proactively terminate. Internally, the host CPU maintains state indicating that the guest CPU has been notified. If the guest does not proactively terminate within the grace period, the CPU recognizes this and terminates the guest's execution, thereby returning control to the host program by terminating interpreted execution mode. In one embodiment, the guest cannot determine why the protocol was invoked, but only determines that it was notified to clean up and terminate. Other host rationales for causing the termination of interpreted execution mode and, therefore, terminating guest execution may exist. For example, there are scenarios where all guest CPUs are stopped to make a coordinated change to the entire guest configuration. A multi-processing guest configuration does not have some CPUs operating under different rules or assumptions than the other CPUs in the guest configuration. This asymmetry can produce unpredictable guest results.

主机CPU接收已执行主动退出或任何其他原因之退出的客户机CPU之效应(例如,向主机传回CPU资源)(步骤508)。若退出系归因于警告追踪中断协议定义之原因,则主机程序记住在下次启动客户机CPU时向客户机CPU提供反馈(不管可能为多久)。此反馈为肯定(“良好”)指示,假定客户机在宽限期期满之前主动退出。若退出系归因于任何其他原因,则在客户机CPU之下次启动时不发生警告追踪中断协议反馈。The host CPU receives the effects of the guest CPU having performed an active exit or an exit for any other reason (e.g., returning CPU resources to the host) (step 508). If the exit was due to a reason defined by the warning trace interrupt protocol, the host program remembers to provide feedback to the guest CPU the next time the guest CPU is started (regardless of how long that may be). This feedback is a positive ("good") indication, assuming the guest exited voluntarily before the grace period expired. If the exit was due to any other reason, no warning trace interrupt protocol feedback occurs the next time the guest CPU is started.

若客户机迟延主动退出;亦即,客户机执行动作以主动退出,但宽限期已期满,则藉由宽限期之期满而优先执行客户机CPU之执行。下次以正常时间片启动客户机CPU时,给予异常反馈指示,使得客户机知晓其已迟延其主动退出。大体上,此情形可用于客户机程序中之问题判定,此系因为惯常的宽限期允许足够时间来清理以及主动退出。If a guest delays an active exit—that is, the guest performs actions to actively exit, but the grace period has expired—then the expiration of the grace period prioritizes the guest CPU's execution. The next time the guest CPU is activated with a normal time slot, an exception feedback indication is provided, letting the guest know that it has delayed its active exit. This situation can generally be used to troubleshoot problems in guest programs, as the normal grace period allows ample time for cleanup and active exit.

若发生不同于警告追踪中断协议之主动退出的退出,则下次以正常时间片启动客户机CPU时,不包括按警告追踪协议之反馈。If an exit other than an active exit of the warning trace interrupt protocol occurs, the next time the guest CPU is started with a normal time slice, feedback according to the warning trace protocol will not be included.

主动地退出的手段是藉由使得控制自客户机程序传递至主机程序之任何机制来实现,该机制由主机程序辨识为协议主动退出,且该机制包括上述反馈机制。在一个实例中,诊断指令用于主动退出。亦即,具有特定参数之诊断指令用以指示时间片之完成。在诊断指令由客户机程序发出并经执行之后,主机程序判定退出是否为准时的。接着,当再次启动客户机时(其为诊断之后的下一循序指令),提供指示再次启动客户机是否为准时的之条件代码。条件代码,例如,设定于用以在下一循序指令处启动客户机之客户机程序状态字(PSW)中。客户机可接着测试条件代码。The means of actively exiting is to realize by making control be passed to any mechanism of host program from client program, and this mechanism is identified as protocol active exit by host program, and this mechanism includes above-mentioned feedback mechanism.In one example, diagnostic instruction is used for active exit.That is, diagnostic instruction with specific parameters is used to indicate the completion of time slice.After diagnostic instruction is issued by client program and is executed, host program determines whether exit is on time.Then, when restarting client (it is the next sequential instruction after diagnosis), provide indication restart client whether condition code.Condition code, for example, is set in the client program status word (PSW) that is used to start client at next sequential instruction place.Client can then test condition code.

参看图6进一步描述由主机进行之对于客户机主动退出的处置。最初,当客户机CPU停止时,控制返回至主机CPU(步骤600)。作出关于控制是否在宽限期内返回的判定(查询602)。若控制在宽限期内返回,则主机程序按警告追踪中断协议观测主动客户机退出,且记住针对客户机CPU之下次启动之良好反馈,而不管哪一主机CPU可能在该时间布建客户机CPU(步骤604)。此系假定已安装警告追踪中断设施。若控制并未在宽限期内返回,则不记住反馈状态。然而,若客户机执行动作以主动地退出,但主动退出系在宽限期外(查询602),则主机CPU上之主机程序按警告追踪中断协议观测主动客户机退出(即使客户机最终且不得不非主动地退出),且记住针对客户机CPU之下次启动的不良反馈,而不管哪一主机CPU可能在该时间布建客户机CPU(步骤606)。再者,此系假定已安装警告追踪设施。若否,则不记住反馈状态。Referring to FIG6 , the host's handling of a proactive guest exit is further described. Initially, when the guest CPU is stopped, control returns to the host CPU (step 600). A determination is made as to whether control returns within a grace period (query 602). If control returns within the grace period, the host program observes the proactive guest exit according to the warning trace interrupt protocol and remembers good feedback for the next boot of the guest CPU, regardless of which host CPU may have deployed the guest CPU at that time (step 604). This assumes that the warning trace interrupt facility is installed. If control does not return within the grace period, the feedback status is not remembered. However, if the guest performs an action to proactively exit, but the proactive exit is outside the grace period (query 602), the host program on the host CPU observes the proactive guest exit according to the warning trace interrupt protocol (even if the guest ultimately and inevitably exits involuntarily) and remembers bad feedback for the next boot of the guest CPU, regardless of which host CPU may have deployed the guest CPU at that time (step 606). Again, this assumes that the warning trace facility is installed. Otherwise, the feedback status is not remembered.

此后,不管主机记住良好反馈抑或不良反馈,主机程序将主机CPU重新导向至优先执行指派(步骤608)。亦即,将主机重新导向为现在执行使其资源(CPU)返回的一个或多个功能。Thereafter, regardless of whether the host remembers good feedback or bad feedback, the host program redirects the host CPU to the priority execution assignment (step 608). That is, the host is redirected to now execute one or more functions that return its resources (CPU).

此外,在客户机CPU之下次循序启动时,不管哪一主机CPU布建客户机CPU,若记住反馈状态,则在启动客户机CPU之前设定反馈状态指示(步骤610)。在一个实例中,在SIE状态描述中(例如,在状态描述之PSW中)设定反馈状态指示,SIE状态描述指示下一循序指令的启动。Furthermore, when the next sequential instruction of the guest CPU is started, regardless of which host CPU configures the guest CPU, if the feedback state is remembered, the feedback state indicator is set before starting the guest CPU (step 610). In one example, the feedback state indicator is set in a SIE state description (e.g., in a PSW of the state description), and the SIE state description indicates the start of the next sequential instruction.

参看图7至图9来描述关于与警告追踪中断设施相关联之处理的其他细节。详言之,图7描绘与警告追踪中断设施处理之概述相关联之逻辑的一实施例;图8A至图8C提供根据本发明的方面的警告追踪中断设施处理之细节;且图9描绘与接收警告追踪中断相关联之逻辑的一实施例。Additional details regarding the processing associated with the warning trace interrupt facility are described with reference to Figures 7 through 9. Specifically, Figure 7 depicts one embodiment of the logic associated with an overview of the warning trace interrupt facility processing; Figures 8A through 8C provide details of the warning trace interrupt facility processing according to aspects of the present invention; and Figure 9 depicts one embodiment of the logic associated with receiving a warning trace interrupt.

参看图7,最初客户机程序(例如,客户机操作系统)辨识已安装警告追踪中断设施(步骤700)。在一实施例中,此情形是藉由客户机程序观测位于,例如,指明控制区块中之已安装设施指示符,例如位,来实现。若客户机操作系统具有支持以参与警告追踪中断设施,则客户机操作系统辨识警告追踪中断设施已安装指示符,且接着指示其参与协定的能力。在一个实例中,此情形包括注册客户机之参与警告追踪处理的意图(步骤702)。如本文中所描述,在一个实例中,经由诊断指令来执行注册。在注册时,客户机操作系统向主机CPU与主机程序两者指示客户机操作系统知晓如何处置警告追踪中断(WTI),警告追踪中断(WTI)为向客户机提供如下警告之明确中断:例如,客户机将失去对其共享资源,例如,客户机CPU,的存取,且,例如客户机应关于其当前正执行之可分派单元采取动作。在一实施例中,注册为WTI之接收的先决条件。若并未针对警告追踪中断设施注册客户机,则在客户机之时间片期满后,便不供应宽限期,且使客户机CPU脱离解译执行模式。Referring to FIG. 7 , initially, a client program (e.g., a guest operating system) recognizes that a warning trace interrupt facility has been installed (step 700 ). In one embodiment, this is accomplished by the client program observing an installed facility indicator, such as a bit, located, for example, in a designated control block. If the guest operating system has support for participating in the warning trace interrupt facility, the guest operating system recognizes the warning trace interrupt facility installed indicator and then indicates its ability to participate in the protocol. In one example, this includes registering the client's intent to participate in warning trace processing (step 702 ). As described herein, in one example, registration is performed via diagnostic instructions. Upon registration, the guest operating system indicates to both the host CPU and the host program that the guest operating system understands how to handle a warning trace interrupt (WTI), which is an explicit interrupt that provides a warning to the guest that, for example, the guest will lose access to its shared resources, such as the guest CPU, and that, for example, the guest should take action regarding its currently executing dispatchable unit. In one embodiment, registration is a prerequisite for receiving a WTI. If the guest is not registered for the warning trace interrupt facility, no grace period is provided after the guest's time slice expires and the guest CPU is taken out of interpretive execution mode.

在一实施例中,即使已注册,客户机程序仍具有停用WTI之呈现的两个机制。举例而言,可将例如程序状态字(PSW)中的所选定位设定为零,此情形停用包括WTI之所有外部中断的呈现;或可将指定控制寄存器(例如,CR0)中的位设定为零以仅停用WTI。当两个位为一时,启用WTI之呈现。若WTI之呈现保持停用达整个WTI宽限期,则客户机之执行在不利用WTI之情况下结束,该情形构成非主动退出。In one embodiment, even if registered, a guest program has two mechanisms for disabling the presentation of a WTI. For example, a selected bit in the program status word (PSW) can be set to zero, which disables the presentation of all external interrupts, including the WTI; or a bit in a designated control register (e.g., CR0) can be set to zero to disable only the WTI. When both bits are set to one, the presentation of the WTI is enabled. If the presentation of the WTI remains disabled for the entire WTI grace period, the guest's execution ends without utilizing the WTI, which constitutes an involuntary exit.

在客户机CPU的解译执行期间,若客户机CPU在内部辨识主机CPU定时器外部中断条件(例如,期满之时间片)或由主机程序请求之优先执行(查询704),则内部CPU处理在主机接收到控制之前判定是否将执行警告追踪中断处理(查询706)。亦即,内部CPU处理检查针对警告追踪处理启用客户机,且因此判定警告追踪处理应包括于待执行之处理中。若将不执行警告追踪中断处理,则客户机之解译执行结束(步骤708),且控制返回至主机程序(步骤710)。返回至查询706,然而,若将执行警告追踪中断处理,则如下文进一步详细描述,执行处理(步骤712)。During the interpreted execution of the guest CPU, if the guest CPU internally recognizes a host CPU timer external interrupt condition (e.g., an expired time slice) or a priority execution request by the host program (INQUIRY 704), the internal CPU process determines whether warning trace interrupt processing is to be performed before the host receives control (INQUIRY 706). That is, the internal CPU process checks whether the guest is enabled for warning trace processing and, therefore, determines that warning trace processing should be included in the processing to be performed. If warning trace interrupt processing is not to be performed, the interpreted execution of the guest ends (STEP 708) and control returns to the host program (STEP 710). Returning to INQUIRY 706, however, if warning trace interrupt processing is to be performed, the processing is performed (STEP 712), as described in further detail below.

参看图8A至图8C来描述警告追踪中断处理之其他细节的实施例。在此处理中,使用包括以下各者之若干个控制指示符:8A to 8C are provided to describe an embodiment of further details of the warning tracking interruption process. In this process, several control indicators including the following are used:

警告追踪中断设施宽限期作用中内部控制(例如,G位),其并非架构上可见,但供内部CPU逻辑使用;Warning: Internal controls (e.g., G-bit) in effect for the grace period of the trace interrupt facility, which are not architecturally visible but are used by internal CPU logic;

警告追踪中断(WTI)呈现内部控制(例如,P位),其在为1时指示已将WTI呈现给客户机,且在为0时指示尚未呈现WTI。类似于警告追踪中断设施宽限期作用中内部控制,WTI呈现内部控制并非架构上可见,但供内部CPU逻辑使用;A warning trace interrupt (WTI) present internal control (e.g., P bit) that indicates when 1 that the WTI has been presented to the client and when 0 that the WTI has not been presented. Similar to the internal control in the warning trace interrupt facility grace period, the WTI present internal control is not architecturally visible but is used by internal CPU logic.

客户机控制的主机程序优先执行(例如,T位),其例如为客户机CPU状态描述中的警告追踪干预请求指示符;以及Guest-controlled host program priority execution (e.g., T bit), such as a warning trace intervention request indicator in the guest CPU state description; and

在E指示符为一时,存在外部中断之启用。在一个实例中,E指示符为当前程序状态字(PSW)内的位。When the E indicator is one, there is an enablement of the external interrupt. In one example, the E indicator is a bit within the current program status word (PSW).

参看图8A,在一个实例中,辨识主机CPU定时器中断条件(例如,期满之时间片),或辨识警告追踪干预请求(例如,主机希望早早地传回CPU资源;亦即在时间片结束之前传回CPU资源)。若辨识出主机CPU定时器中断条件(查询800),则作出关于宽限期作用中控制指示符是否经设定(例如,G等于1?)的判定(查询802)。若G未经设定,则将G指示符设定为例如1(步骤804),且警告追踪中断设施宽限期将开始。接着保存主机CPU定时器之当前值(所保存值在本文中被称作原始值)(步骤806),且将主机CPU定时器设定为警告追踪宽限期(例如,50微秒)(步骤808)。8A , in one example, a host CPU timer interrupt condition (e.g., an expired time slice) is identified, or a warning trace intervention request is identified (e.g., the host wishes to return CPU resources early; i.e., before the end of the time slice). If a host CPU timer interrupt condition is identified (INQUIRY 800), a determination is made as to whether the grace period active control indicator is set (e.g., is G equal to 1?) (INQUIRY 802). If G is not set, the G indicator is set to, for example, 1 (STEP 804), and the warning trace interrupt facility grace period begins. The current value of the host CPU timer is then saved (the saved value is referred to herein as the raw value) (STEP 806), and the host CPU timer is set to the warning trace grace period (e.g., 50 microseconds) (STEP 808).

此后,作出关于是否针对警告追踪中断启用客户机之判定(查询810)。在一实施例中,若客户机层级2为作用中的从而指示一客户机已启动另一客户机,则客户机2关于客户机1中断而退出解译执行模式,且取消客户机1“启动解译执行”指令。因此,处理在此点处系作为客户机1。若客户机2并非作用中的,则处理仅以客户机1继续。若针对WTI启用客户机,则将警告追踪外部中断(WTI)呈现给客户机(步骤812)。在一个实例中,在需要时,此中断包括特定中断码,该特定中断码经呈现,从而指示其具有宽限期以便执行一个或多个功能(例如,清理)。Thereafter, a determination is made as to whether the client is enabled for warning trace interruption (INQUIRY 810). In one embodiment, if client tier 2 is active, indicating that a client has launched another client, then client 2 exits interpret-execute mode with respect to the client 1 interruption and cancels the client 1 "start interpret-execute" instruction. Thus, processing at this point is as client 1. If client 2 is not active, processing continues with client 1 only. If the client is enabled for WTI, a warning trace external interruption (WTI) is presented to the client (STEP 812). In one example, this interruption includes a specific interruption code, which is presented to indicate a grace period for performing one or more functions (e.g., cleanup), if desired.

另外,将P设定为1,从而指示WTI已经呈现(步骤814)。又,使用互锁更新功能将T位设定为1(若最初已使用干预请求,则T位可能已为1)(步骤816)。使主机CPU定时器中之宽限期继续递减,而不管是否呈现了WTI(步骤818)。接着退出此处理(步骤820)。在一个实例中,退出此程序之指明指示:CPU已完成警告追踪中断设施之当前处理,且CPU正返回至如由CPU之当前状态指明的其他处理。In addition, P is set to 1, indicating that a WTI has occurred (step 814). Furthermore, the T bit is set to 1 using the interlock update function (the T bit may already be 1 if an intervention request was initially used) (step 816). The grace period in the host CPU timer continues to decrement regardless of whether a WTI has occurred (step 818). The process is then exited (step 820). In one embodiment, the indication of exiting the process indicates that the CPU has completed the current processing of the warning trace interrupt facility and is returning to other processing as indicated by the current state of the CPU.

返回至查询810,若针对警告追踪中断未启用客户机,则处理进行至步骤816。在此例子中,针对WTI未启用客户机,因此无法将WTI呈现给客户机。然而,将T位设定为未决的,使得稍后在针对WTI确实启用客户机时可侦测到T位。Returning to query 810, if the client is not enabled for warning tracking interruption, then processing proceeds to step 816. In this example, the client is not enabled for WTI, so WTI cannot be presented to the client. However, the T bit is set to pending so that the T bit can be detected later when the client is indeed enabled for WTI.

返回至查询800,若并非主机CPU定时器中断条件,则辨识警告追踪中断请求(亦即,主机优先执行)。亦即,客户机之状态描述之干预请求字段中的T位为1。因此,作出关于G指示符是否经设定的判定(查询850)。若G指示符未经设定(例如,0),则处理以步骤804继续。在此情形下,T等于1之条件为启动WTI程序的初始原因。然而,若G位经设定,则作出关于P是否经设定的判定(查询852)。若P未经设定(例如,等于0),则处理在呈现WTI之尝试中以步骤810继续。然而,若P经设定(例如,不等于0),则在警告追踪设施宽限期开始之后T等于1的发现无影响,且退出程序(步骤854)。Returning to query 800, if it is not a host CPU timer interrupt condition, a warning trace interrupt request is recognized (i.e., host-first execution). That is, the T bit in the intervention request field of the client's status description is 1. Therefore, a determination is made as to whether the G indicator is set (query 850). If the G indicator is not set (e.g., 0), processing continues with step 804. In this case, the condition of T equal to 1 is the initial reason for initiating the WTI procedure. However, if the G bit is set, a determination is made as to whether P is set (query 852). If P is not set (e.g., equal to 0), processing continues with step 810 in an attempt to present a WTI. However, if P is set (e.g., not equal to 0), then the finding of T equal to 1 after the warning trace facility grace period has no effect, and the procedure is exited (step 854).

返回至查询802,若G经设定(例如,等于1),则客户机CPU已在宽限期中执行,且主机CPU定时器之期满指示宽限期已期满。因此,先前已启动WTI循环,且宽限期已期满。因此,参看图8B,将先前保存之原始主机CPU定时器值减小达在宽限期期间实际使用之时间量,且接着将其加载至主机CPU定时器中(步骤860)。退出解译执行模式(步骤862),且将主机CPU定时器外部中断呈现给主机(步骤864)(此退出为非主动客户机退出之形式)。Returning to query 802, if G is set (e.g., equal to 1), then the guest CPU has been executing within the grace period, and the expiration of the host CPU timer indicates that the grace period has expired. Thus, a WTI cycle has been previously initiated, and the grace period has expired. Therefore, referring to FIG8B, the previously saved original host CPU timer value is decremented by the amount of time actually used during the grace period and then loaded into the host CPU timer (step 860). The interpret execution mode is exited (step 862), and the host CPU timer external interrupt is presented to the host (step 864) (this exit is a form of non-active guest exit).

除以上内容外,可经由可针对WTI启用CPU之某些指令来启动WTI分析。举例而言,参看图8C,如本文中所描述,最初,可针对WTI启用CPU之包括以下各者的若干个指令执行监视:例如,可设定PSW中之指明位的加载PSW(扩展)指令以及接着储存或系统屏蔽指令,以及可设定控制寄存器中之所选定位的“加载控制”。举例而言,可针对中断启用之指令检查用于潜在警告追踪处理的T位。若T=0(查询880),则不存在WTI,且退出此程序(步骤884)。然而,若T=l,则处理以查询822继续。In addition to the above, WTI analysis can be initiated via certain instructions that may enable the CPU for WTI. For example, referring to FIG. 8C , as described herein, initially, monitoring may be performed for several instructions that enable the CPU for WTI, including: for example, a load PSW (extend) instruction that may set a specified bit in the PSW, followed by a store or system mask instruction, and a "load control" instruction that may set a selected bit in a control register. For example, the T bit for potential warning trace processing may be checked for interrupt-enabled instructions. If T=0 (inquiry 880), then there is no WTI, and the program exits (step 884). However, if T=1, processing continues with inquiry 822.

在查询882处,作出关于P是否经设定(例如,等于1)之判定。若P经设定,则退出此程序(步骤884),此系由于先前已侦测到启用。然而,若P未经设定(例如,不等于1),则作出关于G是否经设定(例如,等于1)的另一判定(查询886)。若G未经设定,则处理以步骤804继续(图8A)。然而,若G经设定(例如,等于1)(步骤886(图8C)),则处理以图8A中之查询810继续(步骤888),且退出处理。At query 882, a determination is made as to whether P is set (e.g., equal to 1). If P is set, the process is exited (step 884) since activation has been previously detected. However, if P is not set (e.g., not equal to 1), another determination is made as to whether G is set (e.g., equal to 1) (query 886). If G is not set, processing continues with step 804 (FIG. 8A). However, if G is set (e.g., equal to 1) (step 886 (FIG. 8C)), processing continues with query 810 in FIG. 8A (step 888) and processing is exited.

参看图9来描述警告追踪中断之处理的其他细节。当客户机程序接收到警告追踪中断时,客户机程序执行客户机程序将执行之任何功能(例如,OS功能)以便例如使得可分派工作单元为可重新分派的(步骤900)。举例而言,客户机在特定点处停止可分派单元,保存可分派单元之状态,且将可分派单元移动至另一客户机CPU,或藉由提供状态信息使得可分派单元能够被移动,等等。客户机操作系统藉由向主机程序发出警告追踪清理完成信号而用信号通知客户机操作系统已结束(又称作主动退出)(步骤902)。此信号可为使得客户机操作放弃剩余时间片的任何机制。然而,该信号由主机程序辨识为协议之清理部分。在一个实例中,使用诊断指令之清理已完成功能。9 for further details of the handling of the warning trace interrupt. When the guest program receives the warning trace interrupt, the guest program executes any function that the guest program would execute (e.g., an OS function) to, for example, make a dispatchable work unit re-dispatched (step 900). For example, the guest stops the dispatchable unit at a particular point, saves the state of the dispatchable unit, and moves the dispatchable unit to another guest CPU, or enables the dispatchable unit to be moved by providing state information, etc. The guest operating system signals to the host program that the guest operating system has ended (also known as an active exit) by issuing a warning trace cleanup complete signal to the host program (step 902). This signal can be any mechanism that causes the guest operation to give up the remaining time slice. However, the signal is recognized by the host program as the cleanup portion of the protocol. In one example, the cleanup complete function of the diagnostic instruction is used.

若客户机程序在宽限期期满之前发出清理已完成信号(查询904),则主机程序记住客户机CPU及时退出(步骤906)。此退出系主动退出。当下次启动客户机CPU时,将信号之准时本质指示回至客户机CPU(步骤908)。在一个实例中,客户机继续执行PSW经设定以指示成功条件代码(例如,条件代码0)。If the guest program signals the cleanup completion signal before the grace period expires (INQUIRY 904), the host program remembers the timely exit of the guest CPU (STEP 906). This exit is an active exit. When the guest CPU is next started, the timely nature of the signal is indicated back to the guest CPU (STEP 908). In one example, the guest continues executing the PSW with the PSW set to indicate a success condition code (e.g., condition code 0).

返回至查询904,若客户机程序由于任何原因而花费过长时间,则宽限期借助于使宽限期递减至零之主机CPU定时器而期满,因此将主机CPU定时器外部中断条件呈现给CPU。在此状况下,CPU辨识:客户机已在宽限期中,且并不授予另一宽限期。确切而言,客户机执行停止,且控制藉由接收外部中断而回复至主机程序。主机程序辨识:客户机CPU之此结束为非主动客户机退出。Returning to query 904, if the guest program takes too long for any reason, the grace period expires due to the host CPU timer decrementing the grace period to zero, thus presenting a host CPU timer external interrupt condition to the CPU. In this case, the CPU recognizes that the guest is already within the grace period and does not grant another grace period. Rather, guest execution stops, and control returns to the host program by receiving an external interrupt. The host program recognizes this termination of the guest CPU as an inactive guest exit.

在下次客户机CPU启动时,客户机操作系统可接着发出清理已完成信号,虽然现在已过迟。主机程序不再期望等待清理已完成信号之接收。因此,在下次启动客户机CPU时,将信号之过迟本质指示回至客户机CPU(步骤912)。在一个实例中,客户机继续执行PSW经标示以指示在下次启动时客户机将观察到的迟条件。过迟诊断指令之发出有时被称作陈旧诊断指令,此系因为过迟诊断指令先前错过在宽限期内退出且接着由于不良原因稍后退出。The next time the client CPU is started, the guest operating system can then issue a cleanup complete signal, even though it is now too late. The host program no longer expects to wait for receipt of the cleanup complete signal. Therefore, the late nature of the signal is indicated back to the client CPU the next time the client CPU is started (step 912). In one example, the client continues executing the PSW marked to indicate the late condition that the client will observe the next time it is started. The issuance of a late diagnostic instruction is sometimes referred to as a stale diagnostic instruction because the late diagnostic instruction previously missed exiting within a grace period and then exited later for an undesirable reason.

在一个实例中,在客户机CPU之新启动后,客户机程序便可针对是否已在宽限期内发出信号而检查协议之信号继续执行部分。客户机程序可使用此信息来调查:客户机程序可能因何原因而延迟且作出改良以改良关于未来更及时之统计。In one example, after a fresh boot of the guest CPU, the guest program can check the signal-to-continue portion of the protocol to see if the signal was sent within the grace period. The guest program can use this information to investigate why the guest program might be delayed and make improvements to improve statistics for the future.

在一实施例中,当针对所有外部中断停用客户机时,可启用外部中断之若干个指令执行监视。当针对外部中断启用客户机时,检验WTI启用。在此点上,若WTI经启用且P位为0,则将WTI呈现给客户机CPU。In one embodiment, when the guest is disabled for all external interrupts, several instructions for external interrupt execution monitoring can be enabled. When the guest is enabled for external interrupts, WTI enable is checked. At this point, if WTI is enabled and the P bit is 0, WTI is presented to the guest CPU.

如上文所提及,在一实施例中,诊断功能用以指示清理已完成或针对警告追踪中断设施注册。对于清理已完成,诊断功能在以清理参数发出并执行时用信号通知:发出CPU已执行了与警告追踪外部中断之接收相关联的任何所要处理。当执行完成时,设定条件代码,从而指示是否在警告追踪中断之后允许用于清理之模型相依时间间隔内发出完成。As mentioned above, in one embodiment, a diagnostic function is used to indicate that cleanup has completed or registered for the warning trace interrupt facility. For cleanup completion, when issued with cleanup parameters and executed, the diagnostic function signals that the issuing CPU has performed any required processing associated with receipt of the warning trace external interrupt. Upon completion, a condition code is set to indicate whether completion was issued within the model-dependent time interval allowed for cleanup following the warning trace interrupt.

关于寄存器功能,诊断功能在以寄存器参数发出并执行时用信号通知:发出配置理解警告追踪中断。当执行完成时,设定成功条件代码。注册状态藉由系统重设来清除。Regarding register functions, when issued with register parameters and executed, the diagnostic function signals: a configuration comprehension warning, a trace interrupt, and a success condition code. When the execution is complete, the success condition code is set. The register status is cleared by a system reset.

参看图10来描述诊断指令之格式的一实施例。在一实施例中,诊断指令1000包括:指示诊断功能之作业码1002;第一寄存器字段1004(R1);第二寄存器字段1006(R3);通用寄存器字段1008(B2);以及移位字段1010(D2)。在一个实例中,将D2字段之内容添加至通用寄存器B2之内容。结果并不用以寻址数据,而是将某些位(例如,位48至63)用作操作码扩展。当操作码扩展为预定值时,指定警告追踪清理已完成,且放弃时间片。One embodiment of the format of a diagnostic instruction is described with reference to FIG10 . In one embodiment, diagnostic instruction 1000 includes an operation code 1002 indicating a diagnostic function; a first register field 1004 (R 1 ); a second register field 1006 (R 3 ); a general register field 1008 (B 2 ); and a shift field 1010 (D 2 ). In one example, the contents of the D 2 field are added to the contents of general register B 2 . The result is not used to address data, but rather certain bits (e.g., bits 48 through 63) are used as an opcode extension. When the opcode is extended to a predetermined value, the warning trace cleanup is complete and the time slice is abandoned.

在一个实例中,R3字段未经使用,且其含有零。另外,通用寄存器R1之指定位未经使用且将含有零,且通用寄存器R1之特定位(例如,位63)在为零时指定清理已完成功能,且在为1时指定寄存器功能。In one example, the R3 field is unused and contains zeros. Additionally, designated bits of general register R1 are unused and will contain zeros, and a specific bit of general register R1 (e.g., bit 63) specifies a cleanup completed function when zero and a register function when one.

在使用共享实体CPU之逻辑分割区中,此功能可藉由允许将逻辑CPU正执行所在之实体CPU指派给另一逻辑CPU而改良系统效能。In logical partitions that use a shared physical CPU, this feature can improve system performance by allowing the physical CPU on which a logical CPU is executing to be assigned to another logical CPU.

除诊断外,在WTI宽容间隔期间的任何其他SIE退出(无论何原因)类似地恢复递减达所花费之宽限期时间量的主机CPU定时器之原始值。Aside from diagnostics, any other SIE exit (regardless of the reason) during the WTI grace interval similarly restores the original value of the host CPU timer decremented by the amount of grace period time spent.

本文中详细描述的内容为警告追踪中断设施,在一实施例中,该警告追踪中断设施提供一机制,可藉由该机制将警告追踪外部中断呈现给具有共享CPU资源(诸如,逻辑分割区)之配置中的CPU。控制程序可使用警告追踪外部中断作为信号以使得当前正执行之可分派单元在该配置上之不同CPU上为可分派的。Described herein in detail is a warning trace interrupt facility that, in one embodiment, provides a mechanism by which a warning trace external interrupt can be presented to CPUs in a configuration with shared CPU resources (such as a logical partition). A control program can use the warning trace external interrupt as a signal to make a currently executing dispatchable unit dispatchable on a different CPU in the configuration.

在一实施例中,于时间片中在实体处理器上执行之逻辑(客户机)处理器接收到指示宽限期之警告信号,例如,在逻辑处理器将被中断(自可共享之实体处理器解除分配)之前的时间量,从而使得能够完成由逻辑处理器进行之工作或将工作移动至另一逻辑处理器。作为实例,用信号向客户机CPU通知:其时间片已期满,且客户机CPU应优先执行当前可分派工作单元(DU)以使得当前可分派工作单元在另一客户机CPU上为可重新分派的。在一个实例中,警告信号为一中断,该中断具有指示该中断为WTI的中断码。在另一个实例中,中断码包括关于对宽限期给予之时间量或其他时段的信息。In one embodiment, a logical (guest) processor executing on a physical processor during a timeslice receives a warning signal indicating a grace period, e.g., the amount of time before the logical processor is to be interrupted (de-assigned from a shareable physical processor), thereby allowing work performed by the logical processor to be completed or moved to another logical processor. As an example, the guest CPU is signaled that its timeslice has expired and that the guest CPU should prioritize executing currently dispatchable work units (DUs) so that they are re-dispatched on another guest CPU. In one example, the warning signal is an interrupt with an interrupt code indicating that the interrupt is a WTI. In another example, the interrupt code includes information regarding the amount of time or other period of time given for the grace period.

在一实施例中,警告追踪中断设施可用于非虚拟环境以及虚拟环境中,在这些环境中,一个程序和/或处理器与一个或多个其他程序和/或处理器共享资源(例如,CPU资源或其他资源)。In one embodiment, the alert trace interrupt facility may be used in non-virtualized environments as well as virtualized environments where one program and/or processor shares resources (eg, CPU resources or other resources) with one or more other programs and/or processors.

在环境为虚拟环境的一实施例中,自客户机之观点而言:In one embodiment where the environment is a virtual environment, from the client's perspective:

1.客户机程序观测警告追踪中断协议设施之已安装条件。1. The client program observes the installed conditions of the warning tracking interrupt protocol facility.

2.客户机程序针对警告追踪中断协议注册。2. The client program registers for the warning trace interrupt protocol.

3.客户机CPU根据特定架构(例如,共享内存指示、共享I/O器件指示、中断)接收警告追踪通知。3. The client CPU receives warning tracking notifications based on the specific architecture (e.g., shared memory indication, shared I/O device indication, interrupt).

4.在客户机CPU上执行的客户机程序根据已接收通知之客户机程序的本质来执行可适用处理(期望通知之处理为按操作系统独特的)。4. The guest program executing on the guest CPU performs applicable processing according to the nature of the guest program that has received the notification (it is expected that the processing of the notification is unique to each operating system).

5.客户机CPU根据警告追踪协议主动技术放弃控制。5. The client CPU actively relinquishes control based on the warning tracking protocol technology.

6.在客户机CPU下次启动时,客户机程序可根据警告追踪协议观测反馈。6. The next time the client CPU is started, the client program can observe the feedback according to the warning tracking protocol.

另外,在一实施例中,自主机的观点而言:Additionally, in one embodiment, from the host's perspective:

A.客户机程序观测警告追踪中断协议设施之已安装条件。A. The client program observes the installed conditions of the warning tracking interrupt protocol facility.

1.主机程序获取警告追踪中断协议设施已安装指示。1. The host program obtains an indication that a warning trace interrupt protocol facility has been installed.

2.主机程序持久地记住警告追踪中断协议之已安装状态。2. The host program permanently remembers the installed status of the warning tracking interrupt protocol.

3.主机程序将警告追踪协议已安装状态指示给每个客户机配置。3. The host program indicates to each client configuration that the warning tracking protocol has been installed.

4.主机程序停用所有未注册客户机CPU中之警告追踪协议。4. The host program disables the warning tracking protocol in all unregistered guest CPUs.

5.主机程序做好准备以辨识来自每个客户机配置之客户机警告追踪注册请求。5. The host program is prepared to recognize client alert tracking registration requests from each client configuration.

B.主机程序辨识来自客户机之警告追踪注册请求。B. The host program recognizes the warning tracking registration request from the client.

1.主机程序持久地记住客户机配置理解警告追踪协定。1. The host program persistently remembers the client configuration and understands the warning tracking protocol.

2.主机程序针对警告追踪协议启用客户机。2. The host program enables the client for the alert tracking protocol.

C.在正常客户机CPU X操作期间,使用客户机CPU X之优先执行重新获取对应主机CPU X。C. During normal guest CPU X operation, use the priority execution of guest CPU X to reacquire the corresponding host CPU X.

1.CPU Y中之主机程序用信号向客户机CPU X发通知。1. The host program in CPU Y sends a signal to the guest CPU X.

a.根据警告追踪协议,CPU X经由共享内存位置之更新、共享I/O器件之更新或对客户机CPU X之中断而将通知传播至客户机CPU X。a. According to the alert tracking protocol, CPU X propagates the notification to guest CPU X via an update of a shared memory location, an update of a shared I/O device, or an interrupt to guest CPU X.

D.客户机CPU X停止,从而使控制返回至主机CPU X。D. Guest CPU X halts, returning control to host CPU X.

1.若在宽限期内,则CPU X上之主机程序按警告追踪协议观测主动客户机退出,且记住针对客户机CPU X之下次启动的良好反馈,而不管哪一主机CPU可能在该时间布建客户机CPU X。1. If within the grace period, the host process on CPU X observes the active guest exit according to the alert tracking protocol and remembers the good feedback for the next boot of guest CPU X, regardless of which host CPU may have deployed guest CPU X at that time.

a.若在宽限期内,但客户机CPU X之退出并非根据警告追踪协议,则不记住反馈状态。a. If within the grace period, but the exit of guest CPU X is not based on the warning tracking protocol, the feedback status is not remembered.

2.若不在宽限期内,则CPU X上之主机程序按警告追踪协议观测主动客户机退出,且记住针对客户机CPU X之下次启动的不良反馈,而不管哪一主机CPU可能在该时间布建客户机CPU X。2. If not within the grace period, the host process on CPU X observes the active guest exit according to the warning tracking protocol and remembers the bad feedback for the next startup of guest CPU X, regardless of which host CPU may have deployed guest CPU X at that time.

a.若不在宽限期内,但客户机CPU X之退出并非根据警告追踪协议,则不记住反馈状态。a. If it is not within the grace period, but the exit of guest CPU X is not based on the warning tracking protocol, the feedback status is not remembered.

3.主机CPU X上之主机程序将CPU X重新导向为优先执行指派。3. The host program on host CPU X redirects CPU X to a priority execution assignment.

E.若记住反馈状态,则不管哪一主机CPU布建客户机CPU X,客户机CPU X之下次循序启动在启动客户机CPU X之前根据警告追踪协议设定反馈指示。E. If the feedback status is remembered, no matter which host CPU deploys the guest CPU X, the next sequential startup of the guest CPU X sets the feedback indication according to the warning tracking protocol before starting the guest CPU X.

在一实施例中,客户机配置之客户机处理器接收唯一中断,该中断系针对计算机架构而定义,且中断之含义系警告追踪中断。该中断指示将中断识别为警告追踪中断的特定码。该中断隐含被称作宽限期之相对较短之时间间隔,从而逐渐引导至结束客户机处理器执行。In one embodiment, a client processor configured in a client receives a unique interrupt defined for the computer architecture, which is a warning trace interrupt. The interrupt indicates a specific code identifying the interrupt as a warning trace interrupt. The interrupt implies a relatively short time interval, referred to as a grace period, which gradually leads to the termination of the client processor execution.

在宽限期期间,在一个实例中,名义上期望客户机程序使得当前可分派工作单元在另一客户机处理器上为可重新分派的,因此避免卡塞于当前客户机处理器上、等待其来自主机之下次正常时间片启动。During the grace period, in one example, the guest program is nominally expected to make the currently dispatchable work unit re-dispatched on another guest processor, thus avoiding being stuck on the current guest processor waiting for its next normal time slice start from the host.

在一个实例中,客户机处理器之每次主机程序启动授予相对较短之时间间隔仅一次。自例如客户机处理器正执行所在之现有时间间隔来授予时间间隔。由于自正常剩余时间片来分配所授予之时间间隔,因此时间间隔本质上并非借用时间,而是使用来自当前时间间隔之受约束时间量来确保客户机处理器在相对较短之一段时间内确实被优先执行。In one example, a relatively short time interval is granted only once per host program launch to the guest processor. The time interval is granted, for example, from an existing time interval in which the guest processor is currently executing. Because the granted time interval is allocated from the normal remaining time slice, the time interval does not essentially borrow time, but rather uses a constrained amount of time from the current time interval to ensure that the guest processor is prioritized for a relatively short period of time.

在当前时间片已期满之另一个实例中,除客户机处理器正执行所在之现有时间间隔外,亦将时间间隔授予为额外时间。由主机程序对照将由客户机处理器消耗的期望客户机处理器接下来执行之期望的下一循序正常时间间隔来考虑所授予之时间间隔。仍意欲确保:客户机处理器在相对较短之一段时间内确实被优先执行。In another example where the current time slice has expired, a time interval is granted as additional time in addition to the existing time interval in which the guest processor is currently executing. The host program considers the granted time interval against the next expected sequential normal time interval to be consumed by the guest processor, which is expected to be executed next by the guest processor. This is still intended to ensure that the guest processor is indeed prioritized for a relatively short period of time.

在一个实例中,可产生对警告追踪事件之中断请求以向程序告知:程序正接近共享CPU上的当前执行间隔的结束。中断请求为在注册配置且针对警告追踪中断设施启用配置时产生的未决条件类型。In one example, an interrupt request for a warning trace event may be generated to inform a program that it is nearing the end of its current execution interval on a shared CPU. An interrupt request is a pending condition type generated when a configuration is registered and enabled for the warning trace interrupt facility.

程序(例如,主机以及客户机)之间的合作处理使程序(例如,客户机操作系统)间的资源共享(例如,CPU)优化。一或多项方面以相同CPU利用提供例如更好之响应时间。另外,在超管理器未分派之前释放系统串行化。Cooperative processing between programs (e.g., host and guest) optimizes resource sharing (e.g., CPU) between programs (e.g., guest operating systems). One or more aspects provide, for example, better response times with equal CPU utilization. Additionally, system serialization is freed up before the hypervisor dispatches.

在另一实施例中,本发明的一个或多个方面可供来自操作系统之请求使用以使个别线程继续改良时间敏感性工作之经过时间。亦即,线程可请求额外时间或被提供额外时间以执行功能。In another embodiment, one or more aspects of the present invention can be used to request from an operating system to allow individual threads to continue to improve the elapsed time of time-sensitive work. That is, a thread can request additional time or be provided with additional time to perform a function.

如本领域技术人员将了解,本发明的一个或多个方面可体现为系统、方法或计算机程序产品。因此,本发明的一个或多个方面可采用完全硬件实施例、完全软件实施例(包括固件、常驻软件、微码等)或组合软件与硬体方面之实施例的形式,这些实施例在本文中皆可大体上被称作“电路”、“模块”或“系统”。此外,本发明的一个或多个方面可采用以一个或多个计算机可读媒体体现所述的计算机程序产品之形式,该一个或多个计算机可读媒体上体现有计算机可读程序代码。As will be appreciated by those skilled in the art, one or more aspects of the present invention may be embodied as a system, method, or computer program product. Thus, one or more aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, microcode, etc.), or an embodiment combining software and hardware aspects, all of which may generally be referred to herein as a "circuit," "module," or "system." Furthermore, one or more aspects of the present invention may take the form of a computer program product embodied in one or more computer-readable media having computer-readable program code embodied thereon.

可利用一个或多个计算机可读媒体的任何组合。计算机可读媒体可为计算机可读储存介质。举例而言,计算机可读储存介质可为(但不限于)电子、磁性、光学、电磁、红外线或半导体系统、装置或器件,或前述各者之任何合适组合。计算机可读储存介质之更特定实例(非详尽列表)包括以下各者:具有一或多条导线之电连接、携带型计算机磁盘、硬盘、随机存取内存(RAM)、只读存储器(ROM)、可抹除可程序化只读存储器(EPROM或闪存)、光纤、携带型光盘只读存储器(CD-ROM)、光学储存器件、磁性储存器件,或前述各者之任何合适组合。在此文件之内容脉络中,计算机可读储存介质可为可含有或储存供指令执行系统、装置或器件使用或结合指令执行系统、装置或器件而使用之程序的任何有形媒体。Any combination of one or more computer-readable media may be utilized. A computer-readable medium may be a computer-readable storage medium. For example, a computer-readable storage medium may be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer-readable storage media include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer-readable storage medium may be any tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.

现参看图11,在一个实例中,计算机程序产品1100例如包括一个或多个非暂时性计算机可读储存介质1102以在上面储存计算机可读程序代码构件或逻辑1104,从而提供并促进本发明的一个或多个方面。11 , in one example, a computer program product 1100 includes, for example, one or more non-transitory computer-readable storage media 1102 to store computer-readable program code means or logic 1104 thereon to provide and facilitate one or more aspects of the present invention.

可使用适当媒体来传输体现于计算机可读媒体上之程序代码,适当媒体包括(但不限于)无线媒体、有线媒体、光缆、RF等或前述各者之任何合适组合。Program code embodied on a computer-readable medium may be transmitted using an appropriate medium, including but not limited to wireless media, wired media, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以一种或多种程序设计语言的任何组合来撰写用于进行本发明的一个或多个方面之操作的计算机程序码,该一或多种程序设计语言包括诸如Java、Smalltalk、C++或其类似者之面向对象程序设计语言,以及诸如“C”程序设计语言、组译器或类似程序设计语言之习知程序性程序设计语言。程序代码可完全在用户计算机上执行,部分地在用户计算机上执行,作为独立软件包而执行,部分地在用户计算机上执行且部分地在远程计算机上执行,或完全在远程计算机或服务器上执行。在完全在远程计算机或服务器上执行的情境中,远程计算机可经由任何类型之网络(包括局域网络(LAN)或广域网(WAN))连接至用户计算机,或可连接至外部计算机(例如,使用因特网服务提供商经由因特网)。Computer program code for performing the operations of one or more aspects of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, or the like, and conventional procedural programming languages such as the "C" programming language, an assembler, or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In scenarios where execution occurs entirely on a remote computer or server, the remote computer may be connected to the user's computer via 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., via the Internet using an Internet service provider).

本文中参看根据本发明之实施例之方法、装置(系统)以及计算机程序产品的流程图说明和/或方块图来描述本发明的一个或多个方面。应理解,可藉由计算机程序指令来实施这些流程图说明和/或方块图之每个区块以及这些流程图说明和/或方块图中之区块的组合。可将这些计算机程序指令提供至通用计算机、专用计算机或其他可程序化数据处理装置之一处理器以产生一机器,以使得经由该计算机或其他可程序化数据处理装置之该处理器而执行之指令产生用于实施在该或这些流程图和/或方块图区块中所指定之功能/动作之构件。One or more 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 present invention. It should be understood that each block of these flowchart illustrations and/or block diagrams, and combinations of blocks in these flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce means for implementing the functions/actions specified in the flowchart(s) and/or block diagram(s).

亦可将这些计算机程序指令储存于一计算机可读媒体中,其可指导计算机、其他可程序化数据处理装置或其他器件以特定方式起作用,使得储存于该计算机可读媒体中之指令产生一制造对象,该制造对象包括实施在该或这些流程图和/或方块图区块中所指定之功能/动作的指令。These computer program instructions may also be stored in a computer-readable medium, which can direct a computer, other programmable data processing apparatus or other device to function in a specific manner, so that the instructions stored in the computer-readable medium produce a manufactured object that includes instructions for implementing the functions/actions specified in the one or more flowcharts and/or block diagram blocks.

亦可将这些计算机程序指令加载至计算机、其他可程序化数据处理装置或其他器件上,以使得在该计算机、其他可程序化装置或其他器件上执行一系列操作步骤以产生一计算机实施程序,使得在该计算机或其他可程序化装置上执行之指令提供用于实施在该或这些流程图和/或方块图区块中所指定之功能/动作的程序。These computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are executed on the computer, other programmable apparatus, or other device to produce a computer-implemented program, so that the instructions executed on the computer or other programmable apparatus provide a program for implementing the functions/actions specified in the flowchart(s) and/or block diagram(s).

诸图中的流程图以及方块图说明根据本发明的一个或多个方面的各种实施例的系统、方法以及计算机程序产品之可能实施方案的架构、功能性以及操作。就此而言,流程图或方块图中的每个区块可表示程序代码之一模块、区段或部分,其包含用于实施指定之逻辑功能的一个或多个可执行指令。亦应注意,在一些替代实施方案中,区块中所注释的功能可不以诸图中所注释之次序发生。举例而言,取决于所涉及之功能性,连续展示之两个区块实际上可实质上同时执行,或这些区块有时可以相反次序执行。亦应注意,可藉由执行指定之功能或动作的基于专用硬件之系统或专用硬件与计算机指令之组合来实施方块图和/或流程图说明之每个区块以及方块图和/或流程图说明中之区块的组合。The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementation schemes of the systems, methods, and computer program products of various embodiments according to one or more aspects of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, segment, or portion of program code that includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative embodiments, the functions annotated in the blocks may not occur in the order annotated in the figures. For example, depending on the functionality involved, two blocks shown in succession may actually be executed substantially simultaneously, or the blocks may sometimes be executed in the reverse order. It should also be noted that each block of the block diagram and/or flowchart illustration and the combination of blocks in the block diagram and/or flowchart illustration may be implemented by a dedicated hardware-based system or a combination of dedicated hardware and computer instructions that performs the specified function or action.

除以上内容外,本发明的一个或多个方面亦可由供应客户环境之管理的服务提供商来提供、供应、部署、管理、服务等。举例而言,服务提供商可为一个或多个客户产生、维护、支持等执行本发明的一个或多个方面的计算机程序码和/或计算机底层结构。作为回报,作为实例,服务提供商可在订用和/或收费协议下自客户收取付款。或者或另外,服务提供商可自广告内容销售至一个或多个第三方而收取付款。In addition to the above, one or more aspects of the present invention may also be provided, supplied, deployed, managed, serviced, etc., by a service provider that provides management of a customer environment. For example, a service provider may generate, maintain, support, etc., computer program code and/or computer infrastructure that implements one or more aspects of the present invention for one or more customers. In return, the service provider may receive payment from the customer under a subscription and/or fee agreement, for example. Alternatively or additionally, the service provider may receive payment from the sale of advertising content to one or more third parties.

在本发明的一个方面中,应用程序可经部署以用于执行本发明的一个或多个方面。作为一个实例,应用程序之部署包含提供可操作以执行本发明的一个或多个方面的计算机底层结构。In one aspect of the present invention, an application program may be deployed to perform one or more aspects of the present invention. As an example, deployment of the application program includes providing a computer infrastructure operable to perform one or more aspects of the present invention.

作为本发明的另一方面,可部署一计算机底层结构,其包含将计算机可读程序代码整合至计算系统中,其中与计算系统组合之程序代码能够执行本发明的一或多项方面。As another aspect of the present invention, a computer infrastructure may be deployed that includes integrating computer-readable program code into a computing system, wherein the program code in combination with the computing system is capable of performing one or more aspects of the present invention.

作为本发明的又一方面,可提供用于整合计算机底层结构之程序,其包含将计算机可读程序代码整合至计算机系统中。计算机系统包含计算机可读媒体,其中计算机媒体包含本发明的一个或多个方面。与计算机系统组合之程序代码能够执行本发明的一或多项方面。As another aspect of the present invention, a program for integrating a computer infrastructure may be provided, comprising integrating computer-readable program code into a computer system. The computer system may include a computer-readable medium, wherein the computer medium includes one or more aspects of the present invention. The program code combined with the computer system may be capable of performing one or more aspects of the present invention.

尽管上文描述了各种实施例,但这些实施例仅为实例。举例而言,其他架构的计算环境可含有并使用本发明的一个或多个方面。另外,宽限期可不同于时间量,诸如指令或循环之数目或任何其他可量化值。可在不偏离本发明之精神的情况下进行许多改变和/或添加。While various embodiments have been described above, these embodiments are merely examples. For example, computing environments of other architectures may incorporate and utilize one or more aspects of the present invention. Furthermore, the grace period may be other than an amount of time, such as the number of instructions or cycles, or any other quantifiable value. Numerous changes and/or additions may be made without departing from the spirit of the present invention.

另外,其他类型的计算环境可受益于本发明的一个或多个方面。作为实例,适用于储存和/或执行程序代码之数据处理系统为可用的,其包括直接或经由系统总线间接耦接至内存组件的至少两个处理器。内存组件例如包括在程序代码之实际执行期间所使用之本端内存、大容量储存器,以及高速缓存,该高速缓存对至少某一程序代码提供临时储存以便减少在执行期间必须自大容量储存器撷取程序代码的次数。In addition, other types of computing environments may benefit from one or more aspects of the present invention. As an example, a data processing system suitable for storing and/or executing program code is available, which includes at least two processors coupled directly or indirectly via a system bus to memory components. The memory components include, for example, local memory used during actual execution of the program code, mass storage, and cache memory that provides temporary storage for at least some program code in order to reduce the number of times the program code must be retrieved from the mass storage during execution.

输入/输出或I/O器件(包括(但不限于)键盘、显示器、指针器件、DASD、磁带、CD、DVD、随身碟(thumb drive)以及其他内存媒体等)可直接或经由介入I/O控制器耦接至系统。网络配接器亦可耦接至系统以使得数据处理系统能够经由介入之私用或公用网络耦接至其他数据处理系统或远程打印机或储存器件。调制解调器、电缆调制解调器以及以太网络卡仅为可用类型之网络配接器中的少数几种。Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, DASDs, tapes, CDs, DVDs, thumb drives, and other memory media) can be coupled to the system either directly or through intervening I/O controllers. Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modems, and Ethernet cards are just a few of the available types of network adapters.

下文描述可含有和/或使用本发明的一个或多个方面的计算环境之其他实例。Other examples of computing environments that can contain and/or use one or more aspects of the present invention are described below.

参看图12,描绘实施本发明的一个或多个方面之主计算机系统5000的代表性组件。代表性主计算机5000包含与计算机内存(亦即,中央储存器)5002通信之一个或多个CPU5001,以及用于与其他计算机或SAN以及其类似者通信之至储存介质器件5011以及网络5010的I/O接口。CPU5001符合具有经建构指令集以及经建构功能性之架构。CPU5001可具有用于将程序地址(虚拟地址)变换成内存之实地址的动态地址转译(DAT)5003。DAT通常包括转译后备缓冲器(TLB)5007,其用于对转译进行快取使得对计算机内存5002之区块之稍后存取并不需要地址转译之延迟。通常,高速缓存5009用于计算机内存5002与处理器5001之间。高速缓存5009可为阶层式高速缓存,从而具有可用于一个以上CPU之大高速缓存以及大高速缓存与每个CPU之间的较小之较快速(较低层级)高速缓存。在一些实施方案中,将较低层级高速缓存分裂以提供单独的低层级高速缓存以用于指令提取以及数据存取。在一实施例中,经由高速缓存5009藉由指令提取单元5004自内存5002提取指令。在指令解码单元5006中解码指令,且将指令分派(在一些实施例中,藉由其他指令)给指令执行单元5008。通常,使用若干个执行单元5008,例如算术执行单元、浮点执行单元以及分支指令执行单元。指令系由执行单元执行,从而在需要时自指令指定之寄存器或内存存取操作数。若将自内存5002存取(加载或储存)操作数,则加载/储存单元5005通常在正执行之指令之控制下处置存取。可在硬件电路中或在内部微码(固件)中或藉由两者之组合执行指令。Referring to FIG. 12 , representative components of a host computer system 5000 implementing one or more aspects of the present invention are depicted. The representative host computer 5000 includes one or more CPUs 5001 in communication with computer memory (i.e., central storage) 5002, and I/O interfaces to storage media devices 5011 and networks 5010 for communicating with other computers or SANs and the like. The CPUs 5001 conform to an architecture having a structured instruction set and structured functionality. The CPUs 5001 may have a dynamic address translation (DAT) 5003 for translating program addresses (virtual addresses) into real addresses in memory. The DAT typically includes a translation lookaside buffer (TLB) 5007 for caching translations so that later accesses to blocks of computer memory 5002 do not require the delay of address translation. Typically, a cache 5009 is used between the computer memory 5002 and the processors 5001. Cache 5009 can be a hierarchical cache, with a large cache available to more than one CPU and smaller, faster (lower-level) caches between the large cache and each CPU. In some embodiments, the lower-level caches are split to provide separate low-level caches for instruction fetches and data access. In one embodiment, instructions are fetched from memory 5002 via cache 5009 by instruction fetch unit 5004. Instructions are decoded in instruction decode unit 5006 and dispatched (in some embodiments, along with other instructions) to instruction execution unit 5008. Typically, several execution units 5008 are used, such as an arithmetic execution unit, a floating-point execution unit, and a branch instruction execution unit. Instructions are executed by the execution units, accessing operands from registers or memory specified by the instruction as needed. If operands are to be accessed (loaded or stored) from memory 5002, the load/store unit 5005 typically handles the access under the control of the instruction being executed. Instructions may be executed in hardware circuitry or in internal microcode (firmware), or by a combination of both.

如所注释,计算机系统包括本端(或主)储存器中之信息,以及寻址、保护,以及参考和改变记录。寻址之一些方面包括地址之格式、地址空间之概念、地址之各种类型,以及一类型之地址经转译至另一类型之地址的方式。主储存器中之一些储存器包括永久指派之储存地址。主储存器为系统提供数据之可直接寻址之快速存取储存。数据与程序两者在其可得以处理之前将被加载至主储存器中(自输入器件)。As noted, a computer system includes information in local (or main) storage, as well as addressing, protection, and reference and change logging. Some aspects of addressing include the format of addresses, the concept of address space, the various types of addresses, and the manner in which addresses of one type are translated into addresses of another type. Some of the storage in main storage includes permanently assigned storage addresses. Main storage provides the system with directly addressable, fast-access storage of data. Both data and programs are loaded into main storage (from input devices) before they can be processed.

主储存器可包括有时称作高速缓存之一个或多个较小之较快速存取缓冲储存器。高速缓存通常与CPU或I/O处理器实体地相关联。除效能外,相异储存介质之实体构造以及使用的效应大体上为程序不可观测的。Main storage may include one or more smaller, faster-access buffer memories, sometimes called caches. Caches are typically physically associated with a CPU or I/O processor. Aside from performance, the effects of the physical construction and use of different storage media are generally unobservable to the program.

可维护用于指令以及用于数据操作数的单独高速缓存。高速缓存内之信息以连续字节维持于称作快取区块或快取列(或简称为列)之整体边界上。模型可提供传回快取列之以字节为单位之大小的“撷取高速缓存属性”指令。模型亦可提供“预取数据”以及“预取数据相对长度”指令,前述两个指令实现储存器至数据或指令高速缓存中之预取或数据自高速缓存的释放。Separate caches may be maintained for instructions and for data operands. Information within the cache is maintained as contiguous bytes on general boundaries called cache blocks or cache lines (or simply lines). The model provides a "Get Cache Attributes" command that returns the size of a cache line in bytes. The model also provides "Prefetch Data" and "Prefetch Data Relative Length" commands, which implement prefetches from memory into the data or instruction cache or releases data from the cache.

储存器被视为长水平位串。对于大多数操作而言,对储存器之存取以自左至右序列进行。将位串再分为八个位之单元。八位单元被称作字节,字节系所有信息格式之基本建置区块。储存器中之每个字节位置藉由一唯一非负整数来识别,该非负整数系该字节位置之地址,或简称为字节地址。邻近字节位置具有连续地址,在左侧上以0开始且以自左至右之序列进行。地址为无正负号之二进制整数,且为24个、31个或64个位。Storage is viewed as a long horizontal string of bits. For most operations, storage is accessed in a left-to-right sequence. The bit string is further divided into units of eight bits. Eight-bit units are called bytes, and bytes are the basic building blocks of all information formats. Each byte position in storage is identified by a unique non-negative integer, which is the address of that byte position, or simply the byte address. Adjacent byte positions have consecutive addresses, starting with 0 on the left and proceeding in a left-to-right sequence. Addresses are unsigned binary integers and are 24, 31, or 64 bits.

在储存器与CPU或信道子系统之间一次一个字节或字节群组地传输信息。除非以其他方式指定,否则例如在中,储存器中的字节群组是藉由群组之最左侧字节来寻址。群组中之字节之数目由待执行之操作隐含地或显式地指定。当用于CPU操作中时,字节群组被称作字段。在每个字节群组中,例如在中,以自左至右之序列对位编号。在中,最左侧位有时被称作“高位序”位,且最右侧位被称作“低位序”位。然而,位编号并非储存地址。可仅寻址字节。为了对储存器中之字节的个别位进行操作,存取整个字节。字节中之位自左至右编号为0至7(例如,在中)。地址中之位对于24位地址可编号为8至31或40至63,或对于31位地址可编号为1至31或33至63;地址中之位对于64位地址编号为0至63。在多个字节之任何其他固定长度格式内,构成格式之位自0开始连续编号。出于错误侦测目的,且较佳为了校正,可将一个或多个检查位与每个字节或与字节群组一起来传输。这些检查位藉由机器自动产生,且不可直接受程控。以字节之数目来表达储存容量。当储存操作数字段之长度是藉由指令之操作码隐含时,字段据称为具有固定长度,该固定长度可为一个、两个、四个、八个或十六个字节。可针对一些指令隐含较大字段。当储存操作数字段之长度未经隐含而是经显式陈述时,字段据称为具有可变长度。可变长度操作数之长度可以一字节之增量(或藉由一些指令,以两个字节之倍数或其他倍数)变化。当将信息置放于储存器中时,替换指明字段中所包括的仅那些字节位置之内容,即使至储存器之实体路径的宽度可大于正储存之字段的长度亦如此。Information is transferred between storage and the CPU or channel subsystem one byte or group of bytes at a time. Unless otherwise specified, a group of bytes in storage is addressed by the leftmost byte of the group, such as in . The number of bytes in a group is specified implicitly or explicitly by the operation to be performed. When used in CPU operations, a group of bytes is called a field. Within each group of bytes, such as in , the bits are numbered in a sequence from left to right. In , the leftmost bit is sometimes called the "high-order" bit, and the rightmost bit is called the "low-order" bit. However, the bit number is not a storage address. Only bytes can be addressed. To operate on individual bits of a byte in storage, the entire byte is accessed. The bits in a byte are numbered from left to right 0 to 7 (e.g., in ). The bits in an address may be numbered 8 to 31 or 40 to 63 for a 24-bit address, or 1 to 31 or 33 to 63 for a 31-bit address; the bits in an address are numbered 0 to 63 for a 64-bit address. In any other fixed-length format of multiple bytes, the bits comprising the format are numbered consecutively starting at 0. For error detection purposes, and preferably for correction, one or more check bits may be transmitted with each byte or group of bytes. These check bits are automatically generated by the machine and are not directly programmable. Storage capacity is expressed in terms of the number of bytes. When the length of a storage operand field is implied by the instruction's opcode, the field is said to have a fixed length, which may be one, two, four, eight, or sixteen bytes. Larger fields may be implied for some instructions. When the length of a storage operand field is not implied but explicitly stated, the field is said to have a variable length. The length of a variable-length operand can vary in increments of one byte (or, with some instructions, in multiples of two bytes or other multiples). When information is placed in storage, the contents of only those byte locations included in the specified field are replaced, even though the width of the physical path to storage may be greater than the length of the field being stored.

信息之某些单元将在储存器中的整体边界处。当储存地址为以字节为单位的长度的倍数时,边界对于信息单元而言被称作整体。对整体边界上之2个、4个、8个以及16个字节之字段给予专用名称。半字组(halfword)为二字节边界上之两个连续字节的群组,且为指令之基本建置区块。字组为四字节边界上之四个连续字节的群组。双字组为八字节边界上之八个连续字节的群组。四倍字组(quadword)为16字节边界上之16个连续字节的群组。当储存地址指明半字组、字组、双字组以及四倍字组时,地址之二进制表示分别含有一个、两个、三个或四个最右侧零位。指令将在二字节整体边界上。大多数指令之储存操作数并不具有边界对准要求。Certain units of information will be at integral boundaries in storage. When a storage address is a multiple of a length in bytes, the boundary is referred to as integral for the unit of information. Special names are given to fields of 2, 4, 8, and 16 bytes on integral boundaries. A halfword is a group of two consecutive bytes on a two-byte boundary and is the basic building block of instructions. 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 16 consecutive bytes on a 16-byte boundary. When a storage address specifies a halfword, word, doubleword, and quadword, the binary representation of the address contains one, two, three, or four rightmost zero bits, respectively. Instructions will be on two-byte integral boundaries. The storage operands of most instructions do not have boundary alignment requirements.

在实施用于指令以及数据操作数之单独高速缓存的器件上,若将程序储存至随后提取指令所自之快取列上,则可经历显著延迟,而不管储存器是否变更随后提取的指令。On devices that implement separate caches for instructions and data operands, significant delays may be experienced if a program is stored to a cache line from which instructions are subsequently fetched, regardless of whether the store changes the subsequently fetched instructions.

在一实施例中,可藉由软件(有时指代经授权内码、固件、微码、毫码、皮码(pico-code)及其类似者,前述各者中之任一者将与本发明的一个或多个方面一致)来实践本发明。参看图12,体现本发明的一个或多个方面的软件程序代码可由主机系统5000之处理器5001自诸如CD-ROM光驱、磁带机或硬盘机之长期储存介质器件5011存取。软件程序代码可体现于多种已知媒体中之任一者上以供数据处理系统使用,诸如磁盘、硬盘机或CD-ROM。程序代码可散布于这些媒体上,或可自计算机内存5002散布至用户或经由网络5010自一计算机系统之储存器散布至其他计算机系统以供这些其他系统之用户使用。In one embodiment, the present invention may be implemented using software (sometimes referred to as authorized internal code, firmware, microcode, millicode, picocode, and the like, any of which may be consistent with one or more aspects of the present invention). Referring to FIG. 12 , software program code embodying one or more aspects of the present invention may be accessed by a processor 5001 of a host system 5000 from a long-term storage medium device 5011, such as a CD-ROM drive, tape drive, or hard drive. The software program code may be embodied on any of a variety of known media for use by a data processing system, such as a disk, hard drive, or CD-ROM. The program code may be distributed on these media, or may be distributed to users from computer memory 5002 or from the storage of one computer system to other computer systems via a network 5010 for use by users of those other systems.

软件程序代码包括控制各种计算机组件以及一个或多个应用程序之功能以及互动的操作系统。程序代码通常自储存介质器件5011分页至程序代码可用于由处理器5001进行处理的相对较高速计算机储存器5002。用于将软件程序代码体现于内存中、实体媒体上和/或经由网络散布软件程序代码的技术以及方法为熟知的,且本文中将不进一步加以论述。程序代码在产生并储存于有形媒体(包括但不限于电子内存模块(RAM)、闪存、光盘(CD)、DVD、磁带及其类似者)上时常常被称作“计算机程序产品”。计算机程序产品媒体通常可由较佳计算机系统中之处理电路来读取以供处理电路执行。The software program code includes an operating system that controls the functions and interactions of various computer components and one or more application programs. The program code is typically paged from the storage medium device 5011 to a relatively high-speed computer memory 5002 where the program code is available for processing by the processor 5001. The techniques and methods for embodying software program code in memory, on physical media, and/or distributing software program code over a network are well known and will not be discussed further herein. When program code is generated and stored on tangible media (including but not limited to electronic memory modules (RAM), flash memory, compact discs (CDs), DVDs, magnetic tapes, and the like), it is often referred to as a "computer program product." The computer program product medium is typically readable by processing circuitry in a preferred computer system for execution by the processing circuitry.

图13说明可实践本发明的一个或多个方面的代表性工作站或服务器硬件系统。图13之系统5020包含包括可选周边器件之代表性底层计算机系统5021,诸如个人计算机、工作站或服务器。底层计算机系统5021包括一个或多个处理器5026,以及一总线,该总线用以根据已知技术在处理器5026与系统5021之其他组件之间连接以及实现处理器5026与系统5021之其他组件之间的通信。举例而言,总线将处理器5026连接至内存5025以及长期储存器5027,长期储存器5027可包括硬盘机(包括,例如,磁性媒体、CD、DVD以及闪存中的任一者)或磁带机。系统5021可能亦包括用户接口配接器,其经由总线将微处理器5026连接至一个或多个接口器件(诸如,键盘5024、鼠标5023、打印机/扫描仪5030和/或其他接口器件),这些接口器件可为诸如触敏式屏幕、数字化键入板(entry pad)等之任何用户接口器件。总线亦经由显示器配接器将诸如LCD屏幕或监视器之显示器件5022连接至微处理器5026。FIG13 illustrates a representative workstation or server hardware system in which one or more aspects of the present invention may be practiced. The system 5020 of FIG13 includes a representative underlying computer system 5021, such as a personal computer, workstation, or server, including optional peripheral devices. The underlying computer system 5021 includes one or more processors 5026 and a bus for connecting and enabling communication between the processors 5026 and other components of the system 5021 according to known techniques. For example, the bus connects the processor 5026 to a memory 5025 and to long-term storage 5027, which may include a hard drive (including, for example, any of magnetic media, CDs, DVDs, and flash memory) or a tape drive. The system 5021 may also include a user interface adapter that connects the microprocessor 5026 to one or more interface devices (such as a keyboard 5024, a mouse 5023, a printer/scanner 5030, and/or other interface devices) via the bus. These interface devices can be any user interface device such as a touch-sensitive screen, a digitizing entry pad, etc. The bus also connects a display device 5022 such as an LCD screen or monitor to the microprocessor 5026 via a display adapter.

系统5021可借助于能够与网络5029通信(5028)之网络配接器与其他计算机或计算机之网络通信。实例网络配接器为通信频道、符记环、以太网络或调制解调器。或者,系统5021可使用诸如蜂巢式数字封包数据(CDPD)卡之无线接口进行通信。系统5021可与局域网络(LAN)或广域网(WAN)中之这些其他计算机相关联,或系统5021可为具有另一计算机之客户端/服务器配置中的客户端,等等。所有这些配置以及适当通信硬件和软件为此项技术中知晓的。System 5021 can communicate with other computers or networks of computers by means of a network adapter capable of communicating with network 5029 (5028). Example network adapters are communication channels, token rings, Ethernet networks, or modems. Alternatively, system 5021 can communicate using a wireless interface such as a Cellular Digital Packet Data (CDPD) card. System 5021 can be associated with these other computers in a local area network (LAN) or wide area network (WAN), or system 5021 can be a client in a client/server configuration with another computer, etc. All of these configurations and appropriate communication hardware and software are known in the art.

图14说明可实践本发明的一个或多个方面的数据处理网络5040。数据处理网络5040可包括多个别网络,诸如无线网络和有线网络,这些网络中之每个者可包括多个别工作站5041、5042、5043、5044。另外,如本领域技术人员将了解,可包括一个或多个LAN,其中LAN可包含耦接至主机处理器之多个智能型工作站。FIG14 illustrates a data processing network 5040 in which one or more aspects of the present invention may be practiced. The data processing network 5040 may include a plurality of individual networks, such as wireless networks and wired networks, each of which may include a plurality of individual workstations 5041, 5042, 5043, 5044. Additionally, as will be appreciated by those skilled in the art, one or more LANs may be included, wherein the LANs may include a plurality of intelligent workstations coupled to a host processor.

仍参看图14,网络亦可包括大型计算机或服务器,诸如网关计算机(客户端服务器5046)或应用程序服务器(可存取数据储存库且亦可直接自工作站5045存取的远程服务器5048)。网关计算机5046充当至每个别网络中之入口点。当将一网络连接协议连接至另一网络连接协议时,需要网关。网关5046可较佳借助于通信链路耦接至另一网络(例如,因特网5047)。网关5046亦可使用通信链路直接耦接至一个或多个工作站5041、5042、5043、5044。可利用可购自International Business Machines Corporation之IBM eServerTM服务器来实施网关计算机。Still referring to FIG. 14 , the network may also include mainframe computers or servers, such as a gateway computer (client server 5046) or an application server (a remote server 5048 that can access a data repository and can also be accessed directly from a workstation 5045). The gateway computer 5046 serves as an entry point into each individual network. A gateway is required when connecting one network protocol to another. The gateway 5046 can preferably be coupled to another network (e.g., the Internet 5047) via a communication link. The gateway 5046 can also be directly coupled to one or more workstations 5041, 5042, 5043, 5044 using a communication link. The gateway computer can be implemented using an IBM eServer server available from International Business Machines Corporation.

同时参看图13和图14,可体现本发明的一个或多个方面的软件程序设计码可由系统5020之处理器5026自诸如CD-ROM光驱或硬盘机之长期储存介质5027存取。软件程序设计码可体现于多种已知媒体中之任一者上以供数据处理系统使用,诸如磁盘、硬盘机或CD-ROM。程序代码可散布于这些媒体上,或可自内存散布至用户5050、5051或经由网络自一计算机系统之储存器散布至其他计算机系统以供这些其他系统之用户使用。13 and 14 , software programming code that may embody one or more aspects of the present invention may be accessed by processor 5026 of system 5020 from a long-term storage medium 5027, such as a CD-ROM drive or hard drive. The software programming code may be embodied on any of a variety of known media for use by a data processing system, such as a disk, hard drive, or CD-ROM. The program code may be distributed on these media, or may be distributed from memory to users 5050, 5051, or distributed from the storage of one computer system to other computer systems via a network for use by users of these other systems.

或者,程序设计码可体现于内存5025中,且使用处理器总线由处理器5026来存取。此程序设计码包括控制各种计算机组件和一个或多个应用程序5032之功能和互动的操作系统。程序代码通常自储存介质5027分页至程序代码可用于由处理器5026进行处理的高速内存5025。用于将软件程序设计码体现于内存中、实体媒体上和/或经由网络散布软件程序代码的技术和方法为熟知的,且本文中将不进一步加以论述。程序代码在产生并储存于有形媒体(包括但不限于电子内存模块(RAM)、闪存、光盘(CD)、DVD、磁带以及其类似者)上时常常被称作“计算机程序产品”。计算机程序产品媒体通常可由较佳计算机系统中之处理电路来读取以供处理电路执行。Alternatively, the programming code may be embodied in memory 5025 and accessed by processor 5026 using a processor bus. This programming code includes an operating system that controls the functions and interactions of various computer components and one or more application programs 5032. Program code is typically paged from storage medium 5027 to high-speed memory 5025 where the program code is available for processing by processor 5026. Techniques and methods for embodying software programming code in memory, on physical media, and/or distributing software programming code over a network are well known and will not be discussed further herein. Program code, when generated and stored on tangible media (including but not limited to electronic memory modules (RAM), flash memory, compact disks (CDs), DVDs, magnetic tapes, and the like), is often referred to as a "computer program product." The computer program product media is typically readable by processing circuitry in a preferred computer system for execution by the processing circuitry.

最易于可用于处理器之高速缓存(通常比处理器之其他高速缓存快且小)为最低(L1或层级一)高速缓存,且主储存器(主存储器)为最高层级高速缓存(若存在3个层级,则为L3)。最低层级高速缓存常常被分成保持待执行之机器指令的指令高速缓存(I-高速缓存),以及保持数据操作数之数据高速缓存(D-高速缓存)。The cache most readily available to the processor (usually faster and smaller than the processor's other caches) is the lowest (L1 or level one) cache, with main storage (main memory) being the highest level cache (L3 if there are three levels). The lowest level cache is often divided into an instruction cache (I-cache), which holds machine instructions to be executed, and a data cache (D-cache), which holds data operands.

参看图15,针对处理器5026描绘例示性处理器实施例。通常,高速缓存5053之一个或多个层级用以缓冲存储器区块以便改良处理器效能。高速缓存5053为保持最可能使用之内存数据之快取列的高速缓冲器。典型快取列为64个、128个或256个字节之内存数据。除用于对数据进行快取外,单独高速缓存亦常常用于对指令进行快取。高速缓存连贯性(内存和高速缓存中之列之复本的同步)常常藉由此项技术中熟知之各种“窥探”算法来提供。处理器系统之主存储器储存器5025常常被称作高速缓存。在具有4个层级之高速缓存5053的处理器系统中,主储存器5025有时被称作层级5(L5)高速缓存,此系由于其通常为较快速的,且仅保持可用于计算机系统之非挥发性储存器(DASD、磁带等)之一部分。主储存器5025对由操作系统页入和页出主储存器5025之数据页“进行快取”。Referring to FIG. 15 , an exemplary processor embodiment is depicted for processor 5026. Typically, one or more levels of cache 5053 are used to buffer memory blocks to improve processor performance. Cache 5053 is a high-speed buffer that holds cache lines of memory data that are most likely to be used. Typical cache lines are 64, 128, or 256 bytes of memory data. In addition to being used to cache data, separate caches are often used to cache instructions. Cache coherency (synchronizing copies of lines in memory and cache) is often provided by various "snoop" algorithms well known in the art. The main memory storage 5025 of a processor system is often referred to as a cache. In processor systems with four levels of cache 5053, the main storage 5025 is sometimes referred to as a level 5 (L5) cache because it is typically faster and only holds a portion of the non-volatile storage (DASD, tape, etc.) available to the computer system. Main storage 5025 "caches" pages of data that are paged in and out of main storage 5025 by the operating system.

程序计数器(指令计数器)5061追踪待执行之当前指令的地址。处理器中之程序计数器为64个位,且可截断为31或24个位以支持先前寻址限制。程序计数器通常体现于计算机之程序状态字(PSW)中,使得程序计数器在内容脉络切换期间持续。因此,具有程序计数器值之进行中程序可藉由例如操作系统来中断(自程序环境至操作系统环境之内容脉络切换)。程序之PSW在程序并非作用中的时维持程序计数器值,且在操作系统正执行时使用操作系统之程序计数器(在PSW中)。通常,使程序计数器递增达等于当前指令之字节之数目的量。精简指令集计算(RISC)指令之长度通常为固定的,而复杂指令集计算(CISC)指令之长度通常为可变的。IBM之指令为具有2个、4个或6个字节之长度的CISC指令。举例而言,藉由内容脉络切换操作或分支指令之分支符记操作来修改程序计数器5061。在内容脉络切换操作中,将当前程序计数器值连同关于正执行之程序的其他状态信息(诸如,条件代码)一起保存于程序状态字中,且加载新程序计数器值从而指向待执行之新程序模块的指令。执行分支符记操作以便藉由将分支指令之结果加载至程序计数器5061中来准许程序作出决策或在程序内循环。The program counter (instruction counter) 5061 tracks the address of the current instruction 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 restrictions. The program counter is usually embodied in the computer's program status word (PSW), so that the program counter persists during context switches. Therefore, a running program with a program counter value can be interrupted by, for example, the operating system (context switch from the program environment to the operating system environment). The program's PSW maintains the program counter value when the program is not active, and uses the operating system's program counter (in the PSW) when the operating system is executing. Typically, the program counter is incremented by an amount equal to the number of bytes of the current instruction. Reduced Instruction Set Computing (RISC) instructions are usually fixed in length, while Complex Instruction Set Computing (CISC) instructions are usually variable in length. IBM instructions are CISC instructions with a length of 2, 4, or 6 bytes. For example, the program counter 5061 is modified by a context switch operation or a branch token operation of a branch instruction. In a context switch operation, the current program counter value is saved in the program status word along with other state information about the executing program (such as condition codes), and a new program counter value is loaded to point to the instructions of the new program module to be executed. A branch token operation is 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 5061.

通常,指令提取单元5055用以代表处理器5026提取指令。提取单元在内容脉络切换之后提取“接下来的循序指令”、分支符记指令之目标指令或程序之最初指令。现代指令提取单元常常使用预取技术来基于可能使用预取指令之可能性而推测性地预取指令。举例而言,提取单元可提取包括下一循序指令的指令之16个字节和其他循序指令之额外字节。Typically, the instruction fetch unit 5055 is used to fetch instructions on behalf of the processor 5026. The fetch unit fetches the "next sequential instruction" after a context switch, the target instruction of a branch token instruction, or the first instruction of a program. Modern instruction fetch units often use prefetching techniques to speculatively fetch instructions based on the likelihood that the prefetched instruction will be used. For example, the fetch unit may fetch 16 bytes of the instruction that includes the next sequential instruction and additional bytes for other sequential instructions.

接着由处理器5026执行所提取指令。在一实施例中,将所提取指令传递至提取单元之分派单元5056。分派单元解码指令,且将关于经解码指令之信息转递至适当单元5057、5058、5060。执行单元5057通常将自指令提取单元5055接收关于经解码算术指令之信息,且将根据指令之作业码对操作数执行算术运算。较佳将操作数自内存5025、经建构之寄存器5059或自正执行之指令的实时字段提供至执行单元5057。执行之结果在储存时储存于内存5025、寄存器5059中或其他机器硬件(诸如,控制寄存器、PSW寄存器及其类似者)中。The fetched instruction is then executed by the processor 5026. In one embodiment, the fetched instruction is passed to the dispatch unit 5056 of the fetch unit. The dispatch unit decodes the instruction and passes information about the decoded instruction to the appropriate units 5057, 5058, 5060. The execution unit 5057 will typically receive information about the decoded arithmetic instruction from the instruction fetch unit 5055 and will perform arithmetic operations on the operands according to the instruction's operation code. The operands are preferably provided to the execution unit 5057 from memory 5025, architected registers 5059, or from the immediate fields of the instruction being executed. The results of the execution, when stored, are stored in memory 5025, registers 5059, or other machine hardware (such as control registers, PSW registers, and the like).

处理器5026通常具有一个或多个单元5057、5058、5060以用于执行指令之功能。参看图16A,执行单元5057可借助于介接逻辑5071与经建构通用寄存器5059、解码/分派单元5056、加载储存单元5060和其他处理器单元5065通信。执行单元5057可使用若干个寄存器电路5067、5068、5069以保持算术逻辑单元(ALU)5066将进行运算的信息。ALU执行诸如加法、减法、乘法和除法之算术运算以及诸如与(and)、或(or)和互斥或(XOR)、旋转和移位的逻辑功能。较佳地,ALU支持设计相依性之专用运算。举例而言,其他电路可提供包括条件代码和修复支持逻辑的其他经建构设施5072。通常,ALU运算之结果保持于输出寄存器电路5070中,输出寄存器电路5070可将结果转递至多种其他处理功能。存在处理器单元之许多配置,但本发明描述仅意欲提供对一实施例之代表性理解。The processor 5026 typically has one or more units 5057, 5058, and 5060 for executing instructions. Referring to FIG. 16A , the execution unit 5057 can communicate with architected general registers 5059, the decode/dispatch unit 5056, the load/store unit 5060, and other processor units 5065 via interface logic 5071. The execution unit 5057 can use several register circuits 5067, 5068, and 5069 to hold information for operations to be performed by the arithmetic logic unit (ALU) 5066. The ALU performs arithmetic operations such as addition, subtraction, multiplication, and division, as well as logical functions such as AND, OR, and XOR, rotates, and shifts. Preferably, the ALU supports specialized operations for design dependencies. For example, other circuitry may provide other architected facilities 5072, including conditional codes and repair support logic. Typically, the results of the ALU operations are held in output register circuitry 5070, which can forward the results to various other processing functions. Many configurations of processor units exist, but this description is intended to provide a representative understanding of one embodiment.

例如,加法(ADD)指令将在具有算术和逻辑功能性的执行单元5057中执行,而例如浮点指令将在具有专用浮点能力的浮点执行中执行。较佳地,执行单元藉由对藉由指令识别的操作数执行作业码定义之功能而对操作数进行运算。举例而言,加法(ADD)指令可由执行单元5057对在藉由指令之寄存器字段识别的两个寄存器5059中发现之操作数执行。For example, an add (ADD) instruction will be executed in an execution unit 5057 having arithmetic and logical functionality, while a floating-point instruction, for example, will be executed in a floating-point execution unit having dedicated floating-point capabilities. Preferably, the execution unit operates on operands by performing a function defined by the operation code on the operands identified by the instruction. For example, an add (ADD) instruction may be executed by the execution unit 5057 on operands found in two registers 5059 identified by the register field of the instruction.

执行单元5057对两个操作数执行算术加法,且将结果储存于第三操作数中,其中第三操作数可为第三寄存器或两个源寄存器中的一者。执行单元较佳利用算术逻辑单元(ALU)5066,算术逻辑单元(ALU)5066能够执行诸如移位、旋转、与(And)、或(Or)和互斥或(XOR)之多种逻辑功能,以及包括加法、减法、乘法、除法中之任一者的多种代数函数。一些ALU5066经设计以用于纯量运算且一些ALU5066经设计以用于浮点。取决于架构,数据可为大端序(Big Endian)(其中最低有效字节处于最高字节地址)或小端序(Little Endian)(其中最低有效字节处于最低字节地址)。IBM系大端序。取决于架构,带正负号之字段可为正负号和量值(1之补码或2之补码)。2之补码系有利的,此系因为:ALU并不需要设计减法能力,此系由于2之补码中的负值或正值仅需要ALU内的加法。举例而言,常常以速记法来描述数字,其中12位字段定义4,096字节区块之地址,且通常经描述为4Kbyte(千字节)区块。Execution unit 5057 performs arithmetic addition on two operands and stores the result in a third operand, which may be a third register or one of the two source registers. The execution unit preferably utilizes an arithmetic logic unit (ALU) 5066, which is capable of performing a variety of logical functions such as shifts, rotations, AND, OR, and XOR, as well as a variety of algebraic functions including addition, subtraction, multiplication, and division. Some ALUs 5066 are designed for scalar operations, and some are designed for floating point. Depending on the architecture, data may be in big endian (with the least significant byte at the highest byte address) or little endian (with the least significant byte at the lowest byte address). IBM is big endian. Signed fields may be both sign and magnitude (1's complement or 2's complement), depending on the architecture. Two's complement is advantageous because the ALU does not need to be designed with subtraction capabilities, since negative or positive values in two's complement only require additions within the ALU. For example, numbers are often described using a shorthand notation where a 12-bit field defines the address of a 4,096-byte block, and are typically described as 4Kbyte blocks.

参看图16B,用于执行分支指令之分支指令信息通常发送至分支单元5058,分支单元5058常常使用诸如分支历史表5082之分支预测算法来在其他条件运算完成之前预测分支之结果。将提取当前分支指令之目标,且在条件运算完成之前推测性地执行当前分支指令之目标。当完成条件运算时,基于条件运算之条件和所推测结果而完成或舍弃推测性执行之分支指令。典型分支指令可测试条件代码,且在条件代码满足分支指令之分支要求情况下分支至目标地址,可基于例如在寄存器字段或指令之实时字段中发现之若干数字(包括一)而计算目标地址。分支单元5058可使用ALU5074,ALU5074具有多个输入寄存器电路5075、5076、5077和一输出寄存器电路5080。举例而言,分支单元5058可与通用寄存器5059、解码分派单元5056或其他电路5073通信。Referring to FIG. 16B , branch instruction information for executing a branch instruction is typically sent to a branch unit 5058 . The branch unit 5058 often uses a branch prediction algorithm, such as a branch history table 5082 , to predict the outcome of the branch before other conditional operations are completed. The target of the current branch instruction is extracted and speculatively executed before the conditional operations are completed. When the conditional operations are completed, the speculatively executed branch instruction is either completed or discarded based on the conditional operation and the speculative outcome. A typical branch instruction tests a condition code and branches to a target address if the condition code satisfies the branch instruction's branch requirements. The target address may be calculated based on a number (including one) found in, for example, a register field or a real field of the instruction. The branch unit 5058 may utilize an ALU 5074 having multiple input register circuits 5075 , 5076 , 5077 , and an output register circuit 5080 . For example, the branch unit 5058 may communicate with general registers 5059 , a decode dispatch unit 5056 , or other circuits 5073 .

举例而言,一群指令之执行可由于多种原因而被中断,这些原因包括由操作系统启动之内容脉络切换、引起内容脉络切换之程序异常或错误、引起内容脉络切换之I/O中断信号,或多个程序之多线程活动(在多线程化环境中)。较佳地,内容脉络切换动作保存关于当前正执行之程序的信息,且接着加载关于正调用之另一程序的状态信息。举例而言,状态信息可保存于硬件寄存器中或内存中。状态信息较佳包含指向待执行之下一指令的程序计数器值、条件代码、内存转译信息和经建构之寄存器内容。内容脉络切换活动可单独或组合地藉由硬件电路、应用程序、操作系统程序或固件码(微码、皮码或经授权内码(LIC))来训练。For example, the execution of a group of instructions may be interrupted for a variety of reasons, including a context switch initiated by the operating system, a program exception or error that causes a context switch, an I/O interrupt signal that causes a context switch, or multi-threaded activity of multiple programs (in a multi-threaded environment). Preferably, the context switch action saves information about the currently executing program and then loads state information about the calling program. For example, the state information may be saved in hardware registers or in memory. The state information preferably includes a program counter value pointing to the next instruction to be executed, condition codes, memory translation information, and architected register contents. The context switch activity may be initiated by hardware circuitry, application programs, operating system programs, or firmware code (microcode, picocode, or Licensed Internal Code (LIC)), alone or in combination.

处理器根据指令定义的方法来存取操作数。指令可使用指令之一部分的值来提供实时运算元,可提供明确地指向通用寄存器或专用寄存器(例如,浮点寄存器)的一个或多个寄存器字段。指令可利用藉由作业码字段识别之隐含寄存器作为操作数。指令可将内存位置用于操作数。操作数之内存位置可由寄存器、实时字段或寄存器与实时字段之组合来提供,如藉由长位移设施例证,其中指令定义基础寄存器、索引寄存器和实时字段(位移字段),前述三者相加在一起以提供例如操作数在内存中的地址。除非以其他方式指示,否则位置于本文中通常隐含主存储器(主储存器)中的位置。The processor accesses operands according to the method defined by the instruction. An instruction may use the value of a portion of the instruction to provide a real operand, may provide one or more register fields that explicitly point to general registers or special registers (e.g., floating-point registers). An instruction may utilize an implicit register identified by the operation code field as an operand. An instruction may use a memory location for an operand. The memory location of an operand may be provided by a register, a real field, or a combination of a register and a real field, as exemplified by a long displacement facility, where the instruction defines a base register, an index register, and a real field (displacement field), which are added together to provide, for example, the address of the operand in memory. Unless otherwise indicated, a location herein generally implies a location in main memory (primary storage).

参看图16C,处理器使用加载/储存单元5060来存取储存器。加载/储存单元5060可藉由获得目标操作数在内存5053中之地址且将操作数加载于寄存器5059或另一内存5053之位置而执行加载操作,或可藉由获得目标操作数在内存5053中之地址且将自寄存器5059或另一内存5053之位置获得的数据储存于内存5053中之目标操作数位置中而执行储存操作。加载/储存单元5060可为推测性的,且可以相对于指令序列而言无序的序列存取内存,然而,加载/储存单元5060对于程序维持按次序执行指令的显现。加载/储存单元5060可与通用寄存器5059、解码/分派单元5056、高速缓存/内存接口5053或其他组件5083通信,且包含各种寄存器电路、ALU5085和控制逻辑5090以计算储存地址并提供管线定序以保持操作按次序。一些操作可为无序的,但加载/储存单元提供使得无序操作对于程序显现为已按次序执行的功能性,如此项技术中所熟知的。16C , the processor accesses memory using a load/store unit 5060. The load/store unit 5060 can perform a load operation by obtaining the address of a target operand in memory 5053 and loading the operand into a register 5059 or another memory 5053 location, or can perform a store operation by obtaining the address of a target operand in memory 5053 and storing data obtained from a register 5059 or another memory 5053 location in the target operand location in memory 5053. The load/store unit 5060 can be speculative and can access memory in an out-of-order sequence relative to the instruction sequence; however, the load/store unit 5060 maintains the appearance to the program of executing instructions in order. The load/store unit 5060 can communicate with general registers 5059, decode/dispatch unit 5056, cache/memory interface 5053, or other components 5083, and includes various register circuits, ALU 5085, and control logic 5090 to calculate store addresses and provide pipeline sequencing to keep operations in order. Some operations may be out of order, but the load/store unit provides functionality that makes out-of-order operations appear to the program to have been executed in order, as is well known in the art.

较佳地,应用程序“看见”的地址常常被称作虚拟地址。虚拟地址有时被称作“逻辑地址”和“有效地址”。这些虚拟地址为虚拟的在于:其藉由多种动态地址转译(DAT)技术中之一者而重新导向至物理内存位置,这些动态地址转译(DAT)技术包括(但不限于)简单地对虚拟地址加偏移值作为前缀、经由一个或多个转译表转译虚拟地址,转译表较佳单独或组合地包含至少一个段表和一页表,较佳地,段表具有指向页表之条目。在中,提供转译阶层,包括区第一表、区第二表、区第三表、段表和可选之页表。常常藉由利用转译后备缓冲器(TLB)来改良地址转译之效能,该转译后备缓冲器(TLB)包含将虚拟地址映像至相关联物理内存位置的条目。当DAT使用转译表来转译虚拟地址时,产生这些条目。虚拟地址之后续使用可接着利用快速TLB之条目而非缓慢循序转译表存取。可藉由包括最近最少使用(LRU)之多种替换算法来管理TLB内容。Preferably, the addresses that an application "sees" are often referred to as virtual addresses. Virtual addresses are sometimes referred to as "logical addresses" and "effective addresses." These virtual addresses are virtual in that they are redirected to physical memory locations using one of a variety of dynamic address translation (DAT) techniques, including (but not limited to) simply prefixing the virtual address with an offset value, translating the virtual address through one or more translation tables, the translation tables preferably including, alone or in combination, at least one segment table and a page table, preferably the segment table having entries pointing to the page table. In, a translation hierarchy is provided, including 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 often improved by utilizing a translation lookaside buffer (TLB), which contains entries that map virtual addresses to associated physical memory locations. These entries are generated when the DAT uses the translation tables to translate virtual addresses. Subsequent uses of the virtual address can then utilize an entry of the fast TLB rather than a slow sequential translation table access.The TLB contents can be managed by a variety of replacement algorithms including Least Recently Used (LRU).

在处理器为多处理器系统之处理器的状况下,每个处理器具有保持诸如I/O、高速缓存、TLB和内存之共享资源互锁以达成一致性的责任。通常,“窥探”技术将用于维持高速缓存之一致性中。在窥探环境中,可将每个快取列标示为处于共享状态、互斥状态、改变之状态、无效状态和其类似者中之任一者以便促进共享。In the case where the processor is a processor of a multi-processor system, each processor has the responsibility to keep shared resources such as I/O, cache, TLB, and memory interlocked to achieve consistency. Typically, "snooping" technology will be used to maintain cache coherence. In a snooping environment, each cache line can be marked as being in any of the following states: shared, exclusive, changed, invalid, and the like to facilitate sharing.

举例而言,I/O单元5054(图15)为处理器提供用于附加至包括磁带、光盘、打印机、显示器和网络之周边器件的构件。I/O单元常常由软件驱动程序呈现给计算机程序。在诸如可购自之的大型计算机中,信道配接器和开放系统配接器为大型计算机之提供操作系统与周边器件之间的通信之I/O单元。For example, I/O unit 5054 ( FIG. 15 ) provides the processor with a means for attaching to peripheral devices including tape, optical disks, printers, displays, and networks. I/O units are often presented to computer programs by software drivers. In mainframe computers, such as those available from [ 00155 ], channel adapters and open system adapters are I/O units that provide communication between the mainframe computer's operating system and peripheral devices.

另外,其他类型的计算环境可受益于本发明的一个或多个方面。作为实例,如本文中所提及,环境可包括一仿真器(例如,软件或其他仿真机制),在该仿真器中仿真特定架构(包括例如指令执行、诸如地址转译的经建构之功能,和经建构之寄存器)或其子集(例如,在具有处理器和内存的原生计算机系统上)。在此环境中,仿真器之一个或多个模拟函式可实施本发明的一个或多个方面,即使执行该仿真器之计算机可具有不同于正模拟之能力的架构亦如此。作为一个实例,在仿真模式中,解码特定指令或正仿真之操作,且建置适当模拟函式以实施个别指令或操作。In addition, other types of computing environments may benefit from one or more aspects of the present invention. As an example, as mentioned herein, an environment may include an emulator (e.g., software or other emulation mechanisms) in which a specific architecture (including, for example, instruction execution, constructed functions such as address translation, and constructed registers) or a subset thereof (e.g., on a native computer system with a processor and memory) is emulated. In this environment, one or more emulation functions of the emulator may implement one or more aspects of the present invention, even if the computer executing the emulator may have an architecture different from the capability being emulated. As an example, in emulation mode, a specific instruction or the operation being emulated is decoded, and appropriate emulation functions are set up to implement individual instructions or operations.

在一模拟环境中,主计算机例如包括:内存,其储存指令和数据;指令提取单元,其自内存提取指令且视情况,提供所提取之指令的本端缓冲;指令解码单元,其接收所提取之指令且判定已提取的指令之类型;以及指令执行单元,其执行这些指令。执行可包括:将数据自内存加载至寄存器中;将数据自寄存器储存回至内存;或执行某一类型之算术或逻辑运算(如由解码单元判定)。在一个实例中,以软件来实施每个单元。举例而言,将由这些单元执行之操作实施为仿真器软件内之一个或多个子例程。In an emulation environment, a host computer, for example, includes: a memory that stores instructions and data; an instruction fetch unit that fetches instructions from memory and, if appropriate, provides local buffering of the fetched instructions; an instruction decode unit that receives the fetched instructions and determines the type of instruction fetched; and an instruction execution unit that executes the instructions. Execution may include loading data from memory into registers; storing data from registers back to memory; or performing some type of arithmetic or logical operation (as determined by the decode unit). In one embodiment, each unit is implemented in software. For example, the operations performed by these units are implemented as one or more subroutines within the emulator software.

更特定而言,在大型计算机中,常常借助于编译应用程序而供程序设计师(现今通常为“C”程序设计师)使用经建构之机器指令。储存于储存介质中之这些指令可原生地在服务器中或者在执行其他架构之机器中执行。可在现有和未来之大型计算机服务器中和在之其他机器(例如,电力系统(Power System)服务器和服务器)上仿真指令。可于在使用由AMDTM及其他制造商制造之硬件的广泛多种机器上执行Linux的机器中执行指令。除在依据之该硬件上执行外,亦可使用Linux以及使用由Hercules、UMX或FSI(Fundamental Software,Inc)进行之模拟的机器,其中执行大体上处于仿真模式。在仿真模式中,由原生处理器执行仿真软件以仿真仿真处理器的架构。More specifically, in mainframe computers, constructed machine instructions are often made available to programmers (typically "C" programmers today) by means of compiled applications. These instructions, stored on a storage medium, can be executed natively in a server or in a machine running another architecture. Instructions can be emulated in existing and future mainframe computer servers and on other machines (e.g., Power System servers and servers). Instructions can be executed in machines running Linux on a wide variety of machines using hardware manufactured by AMD and other manufacturers. In addition to executing on this hardware, Linux can also be used and machines using emulations performed by Hercules, UMX, or FSI (Fundamental Software, Inc.), where execution is generally in emulation mode. In emulation mode, emulation software is executed by the native processor to emulate the architecture of the emulated processor.

原生(native)处理器通常执行仿真软件,该仿真软件包含固件或原生操作系统以执行仿真处理器的模拟。仿真软件负责提取并执行仿真处理器架构之指令。仿真软件维护仿真程序计数器以追踪指令边界。仿真软件一次可提取一个或多个仿真机器指令,并将该一个或多个仿真机器指令转换成一群对应原生机器指令以供原生处理器执行。可对这些经转换之指令进行快取,使得可实现较快速转换。尽管如此,仿真软件仍维护仿真处理器架构之架构规则以便确保针对仿真处理器撰写之操作系统和应用程序正确地操作。此外,仿真软件将提供藉由仿真处理器架构识别之资源,使得经设计以在模拟处理器上执行之操作系统或应用程序可在具有仿真软件之原生处理器上执行,这些资源包括(但不限于)控制寄存器、通用寄存器、浮点寄存器、包括例如段表及页表之动态地址转译功能、中断机制、内容脉络切换机制、当日时间(TOD)时钟及至I/O子系统之经建构接口。Native processors typically run emulation software, which includes firmware or a native operating system to perform the simulation of the emulated processor. The emulation software is responsible for extracting and executing instructions of the emulated processor architecture. The emulation software maintains an emulation program counter to track instruction boundaries. The emulation software can extract one or more emulated machine instructions at a time and convert them into a group of corresponding native machine instructions for execution by the native processor. These converted instructions can be cached, allowing for faster conversion. Despite this, the emulation software still maintains the architectural rules of the emulated processor architecture to ensure that operating systems and applications written for the emulated processor operate correctly. In addition, the emulation software will provide resources identified by the emulated processor architecture so that operating systems or applications designed to run on the emulated processor can be executed on the native processor with the emulation software. These resources include (but are not limited to) control registers, general registers, floating-point registers, dynamic address translation functions including, for example, segment tables and page tables, interrupt mechanisms, context switching mechanisms, time of day (TOD) clocks, and constructed interfaces to the I/O subsystem.

解码正仿真之指定指令,且调用子例程以执行个别指令之功能。仿真仿真处理器之功能的仿真软件功能系例如按以下各者来实施:“C”子例程或驱动程序,或在理解较佳实施例之描述之后将在本领域技术人员之技艺内的提供用于指定硬件之驱动程序的某一其他方法。包括(但不限于)以下各者之各种软件及硬件仿真专利说明用以达成针对不同机器进行架构之指令格式用于可用于本领域技术人员的目标机器的仿真的多种已知方式:Beausoleil等人之题为“Multiprocessor for Hardware Emulation”之美国专利证书第5,551,013号;及Scalzi等人之题为“Preprocessing of Stored Target Routines forEmulating Incompatible Instructions on a Target Processor”的美国专利证书第6,009,261号;及Davidian等人之题为“Decoding Guest Instruction to Directly AccessEmulation Routines that Emulate the Guest Instructions”的美国专利证书第5,574,873号;及Gorishek等人之题为“Symmetrical Multiprocessing Bus and Chipset Usedfor Coprocessor Support Allowing Non-Native Code to Run in a System”的美国专利证书第6,308,255号;及Lethin等人之题为“Dynamic Optimizing Object CodeTranslator for Architecture Emulation and Dynamic Optimizing Object CodeTranslation Method”的美国专利证书第6,463,582号;及Eric Traut之题为“Method forEmulating Guest Instructions on a Host Computer Through Dynamic Recompilationof Host Instructions”的美国专利证书第5,790,825号,前述专利证书中之每个者藉此以其全文引用之方式并入本文中;及许多其他专利证书。The specified instruction being emulated is decoded and a subroutine is called to perform the function of the respective instruction. The emulation software function that emulates the function of the emulated processor is implemented, for example, as a "C" subroutine or driver, or some other method of providing a driver for the specified hardware that will be within the skill of those skilled in the art after understanding the description of the preferred embodiment. Various software and hardware emulation patents, including but not limited to, the following, describe known ways to achieve instruction formats for different machine architectures for emulation of target machines that are available to those skilled in the art: U.S. Patent No. 5,551,013 to Beausoleil et al., entitled “Multiprocessor for Hardware Emulation”; and U.S. Patent No. 6,009,261 to Scalzi et al., entitled “Preprocessing of Stored Target Routines for Emulating Incompatible Instructions on a Target Processor”; and U.S. Patent No. 5,574,873 to Davidian et al., entitled “Decoding Guest Instruction to Directly Access Emulation Routines that Emulate the Guest Instructions”; and U.S. Patent No. 6,308,255 to Gorishek et al., entitled “Symmetrical Multiprocessing Bus and Chipset Used for Coprocessor Support Allowing Non-Native Code to Run in a System”; and Lethin et al., entitled “Dynamic Optimizing Object Code Translator for Architecture Emulation and Dynamic Optimizing Object Code Translation Method”; and U.S. Patent No. 5,790,825 to Eric Traut, entitled “Method for Emulating Guest Instructions on a Host Computer Through Dynamic Recompilation of Host Instructions,” each of which is hereby incorporated by reference in its entirety; and numerous other patents.

在图17中,提供仿真主计算机系统5092之实例,其仿真主机架构之主计算机系统5000'。在仿真主计算机系统5092中,主机处理器(CPU)5091为仿真主机处理器(或虚拟主机处理器),且包含具有不同于主计算机5000'之处理器5091之原生指令集架构的原生指令集架构之仿真处理器5093。仿真主计算机系统5092具有仿真处理器5093可存取的内存5094。在实例实施例中,内存5094经分割成主计算机内存5096部分及仿真例程5097部分。主计算机内存5096可用于根据主计算机架构之仿真主计算机5092的程序。模拟处理器5093执行不同于模拟处理器5091之架构的架构之经建构指令集之原生指令,这些原生指令系自仿真例程内存5097获得,且可藉由使用在序列与存取/解码例程中获得之一个或多个指令来自主计算机内存5096中之程序存取主机指令以供执行,序列与存取/解码例程可解码所存取之主机指令以判定用于仿真所存取之主机指令之功能的原生指令执行例程。举例而言,针对主计算机系统5000'之架构定义之其他设施可藉由经建构之设施例程来仿真,包括诸如通用寄存器、控制寄存器、动态地址转译及I/O子系统支持及处理器高速缓存的设施。仿真例程亦可利用在仿真处理器5093中可用之功能(诸如,通用寄存器及虚拟地址之动态转译)以改良仿真例程的效能。亦可提供专用硬件及卸除引擎以协处理器5093仿真主计算机5000'之功能。FIG17 illustrates an example of an emulated host computer system 5092 that emulates a host computer system 5000′ based on a host architecture. In emulated host computer system 5092, host processor (CPU) 5091 is an emulated host processor (or virtual host processor) and includes an emulated processor 5093 having a native instruction set architecture that is different from the native instruction set architecture of processor 5091 of host computer 5000′. Emulated host computer system 5092 has memory 5094 accessible to emulated processor 5093. In the example embodiment, memory 5094 is partitioned into a host computer memory portion 5096 and an emulated routine portion 5097. Host computer memory 5096 is available for programs in emulated host computer 5092 based on the host computer architecture. The emulation processor 5093 executes native instructions of a constructed instruction set for an architecture different from that of the emulation processor 5091. These native instructions are obtained from the emulation routine memory 5097 and can access host instructions for execution from a program in the host computer memory 5096 using one or more instructions obtained in the sequence and access/decode routine. The sequence and access/decode routine can decode the accessed host instructions to determine a native instruction execution routine for emulating the function of the accessed host instructions. For example, other facilities defined for the architecture of the host computer system 5000' can be emulated using the constructed facility routines, including facilities such as general registers, control registers, dynamic address translation, I/O subsystem support, and processor cache. The emulation routine can also utilize functions available in the emulation processor 5093 (such as general registers and dynamic translation of virtual addresses) to improve the performance of the emulation routine. Specialized hardware and offload engines can also be provided to assist the processor 5093 in emulating the functions of the host computer 5000'.

本文所使用之术语仅为了描述特定实施例的目的,且并不意欲为本发明之限制。如本文中所使用,除非上下文另有清楚地指示,否则单数形式“一”及“该”意欲亦包括复数形式。应进一步理解,当术语“包含”用于此说明书中时,其指定所陈述之特征、整数、步骤、操作、组件和/或组件之存在,但并不排除一个或多个其他特征、整数、步骤、操作、组件、组件和/或其群组之存在或添加。The terms used herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms "a," "an," and "the" are intended to include the plural forms as well. It should be further understood that when the term "comprising" is used in this specification, it specifies the presence of the stated features, integers, steps, operations, components, and/or elements, but does not preclude the presence or addition of one or more other features, integers, steps, operations, components, elements, and/or groups thereof.

以下申请专利范围中之所有构件或步骤加功能组件的对应结构、材料、动作及等效物(若有的话)意欲包括用于结合如特别主张之其他所主张组件执行功能的任何结构、材料或动作。出于说明及描述之目的已呈现了本发明的一个或多个方面的描述,但该描述并不意欲为详尽的或以所揭示形式限制本发明。在不偏离本发明之范畴及精神之情况下,许多修改及变化对于一般本领域技术人员将为显而易见的。选择及描述实施例以便最好地解释本发明之原理及实务应用,且使得其他一般本领域技术人员能够针对具有如适合于所预期之特定用途的各种修改之各种实施例来理解本发明。The corresponding structures, materials, actions and equivalents (if any) of all members or step-plus-function components in the scope of the following claims are intended to include any structure, material or action for performing functions in combination with other claimed components as specifically claimed. A description of one or more aspects of the present invention has been presented for the purpose of illustration and description, but the description is not intended to be exhaustive or to limit the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiments are selected and described in order to best explain the principles and practical applications of the invention and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suitable for the specific purposes contemplated.

Claims (17)

1.一种用于有助于促进计算环境中的处理的装置,该装置包含:1. An apparatus for facilitating processing in a computing environment, the apparatus comprising: 由第一程序将警告追踪设施已安装在计算环境内的指示提供给第二程序的模块,该警告追踪设施向该第二程序提供执行第一功能的宽限期;A module of a second program provides an indication that a warning tracking facility has been installed in the computing environment by a first program, and the warning tracking facility provides the second program with a grace period to perform the first function; 由该第一程序通知该第二程序所述宽限期已经开始的模块;以及The module that notifies the second program of the commencement of the grace period described in the first procedure; and 在该宽限期之后,由该第一程序执行第二功能的模块,After the grace period, the module that performs the second function is executed by the first program. 其中该装置还包括:由第一程序从第二程序接收警告追踪注册请求以及启用第二程序来参与警告追踪设施的模块。The device also includes a module that receives a warning tracking registration request from a second program via a first program and enables the second program to participate in the warning tracking facility. 2.根据权利要求1所述的装置,其中执行该第二功能由第一程序向第二程序提供与第一功能在该宽限期内完成相关的状态指示。2. The apparatus of claim 1, wherein the execution of the second function is provided by the first program to the second program with a status indication related to the completion of the first function within the grace period. 3.根据权利要求2所述的装置,其中提供状态指示包括:在该第二程序下一次执行时,由第一程序向第二程序提供该第一功能在该宽限期期间完成的指示。3. The apparatus of claim 2, wherein providing the status indication comprises: when the second program is executed next, the first program provides the second program with an indication that the first function was completed during the grace period. 4.根据权利要求2所述的装置,其中提供状态指示包括:在该第二程序下一次执行时,由第一程序向第二程序提供该第一功能在该宽限期期间没有完成的指示。4. The apparatus of claim 2, wherein providing the status indication comprises: when the second program is executed next, the first program provides the second program with an indication that the first function was not completed during the grace period. 5.根据权利要求1所述的装置,其中该第一程序为主机程序且该第二程序为客户机程序,在提供给其上执行该客户机程序的客户机中央处理单元的时间片期间,该客户机程序存取该计算环境的共享资源,该宽限期有别于该时间片。5. The apparatus of claim 1, wherein the first program is a host program and the second program is a client program, wherein the client program accesses shared resources of the computing environment during a time slice provided to a client central processing unit executing the client program, the grace period being distinct from the time slice. 6.根据权利要求5所述的装置,其中该宽限期使该时间片过早地终止。6. The apparatus of claim 5, wherein the grace period causes the time slice to terminate prematurely. 7.根据权利要求5所述的装置,其中除该时间片外,该宽限期亦提供执行该第一功能的时段。7. The apparatus of claim 5, wherein, in addition to the time slice, the grace period also provides a time period for performing the first function. 8.根据权利要求1所述的装置,其中该第一功能包含以下之一:8. The apparatus of claim 1, wherein the first function comprises one of the following: 完成在其上执行第二程序的处理器上执行的可分派单元;或A dispatchable unit that completes execution on a processor on which a second program is executed; or 使该可分派单元可在该计算环境的另一处理器上重新分派。This allows the dispatchable unit to be reassigned on another processor in the computing environment. 9.根据权利要求1所述的装置,其中所述通知包括导致中断,在该中断中,在该宽限期终止之后释放指派给该第二程序的共享资源。9. The apparatus of claim 1, wherein the notification includes causing an interruption in which shared resources assigned to the second program are released after the grace period expires. 10.一种用于有助于促进计算环境中的处理的计算机系统,该计算机系统包含:10. A computer system for facilitating processing in a computing environment, the computer system comprising: 内存;及Memory; and 与该内存通信的处理器,其中该计算机系统配置为执行一方法,该方法包含:A processor communicating with the memory, wherein the computer system is configured to execute a method comprising: 由第一程序将警告追踪设施已安装在计算环境内的指示提供给第二程序,该警告追踪设施向该第二程序提供执行第一功能的宽限期;The first program provides a second program with an indication that the warning tracking facility has been installed in the computing environment, and the warning tracking facility provides the second program with a grace period to perform the first function; 由该第一程序通知该第二程序该宽限期已经开始;以及The first procedure notifies the second procedure that the grace period has commenced; and 在该宽限期之后,由该第一程序执行第二功能,After the grace period, the first procedure will perform the second function. 其中,由第一程序从第二程序接收警告追踪注册请求以及启用第二程序来参与警告追踪设施。The first procedure receives the warning tracking registration request from the second procedure and activates the second procedure to participate in the warning tracking facility. 11.根据权利要求10所述的计算机系统,其中执行第二功能包括:由第一程序向第二程序提供与第一功能在该宽限期内完成相关的状态指示。11. The computer system of claim 10, wherein performing the second function comprises: providing a status indication from the first program to the second program related to the completion of the first function within the grace period. 12.根据权利要求10所述的计算机系统,其中该第一程序为主机程序且该第二程序为客户机程序,在提供给其上执行该客户机程序的客户机中央处理单元的一时间片期间,该客户机程序能够存取该计算环境的共享资源,该宽限期有别于该时间片。12. The computer system of claim 10, wherein the first program is a host program and the second program is a client program, wherein the client program is able to access shared resources of the computing environment during a time slice provided to a client central processing unit executing the client program, the grace period being different from the time slice. 13.根据权利要求12所述的计算机系统,其中该宽限期使该时间片过早地终止。13. The computer system of claim 12, wherein the grace period causes the time slice to terminate prematurely. 14.根据权利要求12所述的计算机系统,其中除该时间片外,该宽限期亦提供执行该第一功能的时段。14. The computer system of claim 12, wherein, in addition to the time slice, the grace period also provides a time period for performing the first function. 15.根据权利要求10所述的计算机系统,其中该第一功能包含以下之一:15. The computer system of claim 10, wherein the first function comprises one of the following: 完成在其上执行第二程序的处理器上执行的可分派单元;或A dispatchable unit that completes execution on a processor on which a second program is executed; or 使该可分派单元可在该计算环境的另一处理器上重新分派。This allows the dispatchable unit to be reassigned on another processor in the computing environment. 16.一种有助于促进计算环境中的处理的方法,该方法包含:16. A method for facilitating processing in a computing environment, the method comprising: 由第一程序将警告追踪设施已安装在计算环境内的指示提供给第二程序,该警告追踪设施向该第二程序提供执行第一功能的宽限期;The first program provides a second program with an indication that the warning tracking facility has been installed in the computing environment, and the warning tracking facility provides the second program with a grace period to perform the first function; 由该第一程序通知该第二程序该宽限期已经开始;以及The first procedure notifies the second procedure that the grace period has commenced; and 在该宽限期之后,由该第一程序执行第二功能,After the grace period, the first procedure will perform the second function. 所述方法还包括:由第一程序从第二程序接收警告追踪注册请求以及启用第二程序来参与警告追踪设施。The method further includes: receiving a warning tracking registration request from a second program by a first program and activating the second program to participate in the warning tracking facility. 17.根据权利要求16所述的方法,其中该第一程序为主机程序且该第二程序为客户机程序,在提供给其上执行该客户机程序的客户机中央处理单元的时间片期间,该客户机程序能够存取该计算环境的共享资源,该宽限期有别于该时间片。17. The method of claim 16, wherein the first program is a host program and the second program is a client program, wherein the client program is able to access shared resources of the computing environment during a time slice provided to a client central processing unit executing the client program, the grace period being distinct from the time slice.
HK15101778.9A 2012-01-18 2012-11-13 Providing by one program to another program access to a warning track facility HK1201347B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US13/352,518 US9104508B2 (en) 2012-01-18 2012-01-18 Providing by one program to another program access to a warning track facility
US13/352,518 2012-01-18
PCT/IB2012/056372 WO2013108092A1 (en) 2012-01-18 2012-11-13 Providing by one program to another program access to a warning track facility

Publications (2)

Publication Number Publication Date
HK1201347A1 HK1201347A1 (en) 2015-08-28
HK1201347B true HK1201347B (en) 2019-10-11

Family

ID=

Similar Documents

Publication Publication Date Title
US9262236B2 (en) Warning track interruption facility
US9098358B2 (en) Use of a warning track interruption facility by a program
US9104509B2 (en) Providing by one program to another program access to a warning track facility
AU2012366769B2 (en) Warning track interruption facility
HK1201347B (en) Providing by one program to another program access to a warning track facility
HK1201348B (en) Method, system and storage medium for improving processing in computing environment
HK1201350B (en) Method and system for improving processing in computing environment