This invention relates generally to processing within a computing environment and, more particularly, to verification of architectures allowing for self modifying code utilizing a follow the execution path test generator.
In the context of hardware and software systems of, for example, computing environments, formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property. Formal verification can be helpful in proving the correctness of systems, such as cryptographic protocols, combinational circuits, digital circuits with internal memory and software expressed as source code. Verification is one aspect of testing a product's fitness for a particular purpose. Validation is the complementary aspect. Often, one refers to the overall checking process as V & V where validation attempts to answer the question of whether a product specified to a user's actual needs and verification attempts to answer the question of whether the product actually conforms to the specifications.
In accordance with an aspect of the invention, a computer program product for a functional verification operation is provided and includes a tangible storage medium readable by a processing circuit and memory modifying instructions for execution by the processing circuit for performing a method including generating a predefined instruction, initializing a relevant self modifying code (SMC) target memory location to form an SMC trap, binding the SMC trap to the predefined instruction to form an SMC trap source and propagating initialization of instruction code into the SMC trap source.
In accordance with another aspect of the invention, an apparatus for performing verification is provided and includes a microprocessor in communication with a memory unit configured to perform a method including generating a predefined instruction, initializing a relevant self modifying code (SMC) target memory location to form an SMC trap, binding the SMC trap to the predefined instruction to form an SMC trap source and propagating initialization of instruction code into the SMC trap source.
In accordance with yet another aspect of the invention, a computer implemented method of verification is provided and includes generating a first predefined instruction and a second predefined instruction obeying result request, the generating of the first predefined instruction comprising initializing an operand of the first predefined instruction, making a target address a next instruction location, initializing the target address, binding a source operand, which is kept open, to data later to be placed in the target address to create a trap, initializing memory with instruction text and executing the first predefined instruction, and the generating of the second predefined instruction comprising initializing an operand of the second predefined instruction, triggering the trap and initializing an executing the second predefined instruction.
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. For a better understanding of the invention with advantages and features, refer to the description and to the drawings.
Referring now to the drawings wherein like elements are numbered alike in the several FIGURES in which:
In accordance with aspects of the present invention, the creation of functional verification test cases, which are used to verify architecturally correct behavior of processor designs, is provided. These test cases are, typically, generated by an automated generation tool that models the architectural behavior supported by the device under test. These test cases include assembly level language programs with initialization and expected final values of architected facilities (registers, memory, program status word, etc).
Test case generation tools may operate in a “follow the execution path” method which allows for robust user biasing and state space coverage. “Following the execution path” is defined as a process where a generator satisfies the user supplied biases on an instruction by instruction creation process. If the user specifies a branch or jump type instruction, the target of the branch and the fall through path does not necessarily need to be specified, nor does the behavior of the branch. The generator tool just assumes that the next instruction produced satisfies the next instruction bias.
Aspects of the present invention address the creation of such test cases exhibiting behavior referred to as Self Modifying Code (SMC), which is defined when a software program is allowed to create, modify or mutate its own instructions without advanced warning or special interlocks and the behavior of such must be handled correctly. Here, the term “correctly” refers to, e.g., fetching and executing operations in sequential order as dictated by the instruction flow and ordering of the program.
Several architectures support SMC. These include, but are not limited to, Z-Series and x86 processors, which are able to verify the correct architectural SMC behavior of a device under test. Robustly verifying the correct architectural SMC behavior of the device under test requires a level of biasing of the regularly generated instruction also given to SMC initialization and the stored, eventually executed code. Since the latter is being generated as a data store access of one or several instructions, it typically has only a basic level of data biasing.
Creating SMC test cases with a “following the execution path” test generator may be challenging, however, since these tools are designed to avoid previously modified storage and typically employ an escape process that allows them to share instruction and operand memory space without creating ordering conflicts. However, this is often the SMC behavior that is being tested thus creating a conflict. The user can override the conflict created by the escape process but the biasing of the original and final storage value may be limited. Meanwhile, extending support by making the stored data more intricate may lack a required level of control and randomness due to the fact that the stored, executed instruction code can be a combination of several stores and the initialization. Creating partial instruction code extends the level of the required data access biasing and exponentially multiplies an amount of possibly interesting combinations. Also, a gap between the SMC storing instruction and the SMC location may vary.
In accordance with aspects of the present invention, a solution is proposed to answer the verification requirements allowing a same level of bias control to the modified instruction stream as to the regularly generated one. The solution includes use of a trapping mechanism to provide a robust bias to an executed (i.e., modified) instruction path. This trap allows for the late binding of data. The victim of the SMC (i.e., the original instruction) is lightly biased with some predefined values with some randomization or biased data. Advantages of this solution allow for creation of a trap detached from the generation of the stored, executed instruction, the stored, executed instruction gets a same level of biasing as a regularly generated one and, in fact, from a verification scenario writer perspective, control over the stored, executed instruction may be identical or substantially similar to control over the regularly generated instruction, a single instruction can be randomly generated over several traps, several instructions can be generated over a single trap, SMC traps can be created with random distances between before or after the storing instruction and the SMC trap does not have to be used, creating false SMC conditions.
With reference to
The memory or stage units may include a non-transitory computer readable medium having executable instructions stored thereon. When executed, these executable instructions may be configured to cause the CPU to operate in the manner described below with reference to
As shown in
In greater detail, with reference to
As an example, in a tool embodiment, a StoreWord is generated from an uninitialized general purpose register to a predefined memory location, the predefined memory location is initialized, a word is bound in the predefined memory location to a value of the general purpose register and, when an certain instruction is generated in an address of the predefined memory location, a relevant part of the general purpose register is initialized with the certain instruction.
That is, with reference to
After operation 2a whereby instruction “AR E,5” is generated, the source operand includes an Add instruction such that G5: 0XFFFF_FFFF_FFFF_FFFF and GE: 0X0000—0000—0000—0001. After operation 2b, which is the triggering trap operation in which the “AR E,5” instruction text is 1AE5, the Add instruction is applied to the section of the instruction memory previously uninitialized such that G6: 0X1234—5678—9ABC—1AE5. That is, a late bind is triggered to fix the G6 initial data. Finally, after operation 2c, the program counter is set at the ending address of the instruction memory and GE: 0X000—0000—0000—0000.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The corresponding structures, materials, acts, and equivalents of all features in the claims below are intended to include any structure, material or act for performing the operation in combination with other claimed features as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to 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 were described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more non-transitory computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more non-transitory computer readable medium(s) may be utilized. The non-transitory computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but 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 (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc 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 or non-transitory medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, cause execution of the operations/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a non-transitory computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams illustrate architecture, functionality and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.