INFORMATION PROCESSING APPARATUS
A memory stores therein a program status word containing an address of data that is to be read when an interrupt process is executed a processor determines whether or not the program status word stored in the memory is available, controls the memory to stores a determination result in the memory in association with the program status word, acquires the program status word and the determination result from the memory when the interrupt process occurs, and reads data on the basis of the address contained in the acquired program status word when the acquired determination result indicates that the program status word is available.
This application a divisional of application Ser. No. 13/196,965, filed Aug. 3, 2011, which is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2010-179561, filed on Aug. 10, 2010, the entire contents of which are incorporated herein by reference.
FIELDThe embodiments discussed herein are directed to an information processing apparatus and an interrupt control program.
BACKGROUNDConventionally, an information processing apparatus, such as a server, emulates a CPU (Central Processing Unit) that has architecture different from that of a physical CPU installed in the information processing apparatus. The information processing apparatus also emulates, in addition to the CPU, an OS (Operating System) that is different from an OS installed in the information processing apparatus.
For example, a server equipped with an open source OS, such as LINUX (registered trademark), reproduces a general-purpose OS, which is installed in mainframe, within the own server and runs application or the like for the general-purpose OS.
Such an information processing apparatus not only executes instruction emulation for reproducing an instruction for a different architecture but also executes an interrupt process when any exception occurs. Regarding the interrupt process, for example, Japanese Laid-open Patent Publication No. 58-117059 discloses a technology, in which a status monitoring function, which has been reset every time an interrupt process occurs, is reset only when the reset is needed. Furthermore, Japanese Laid-open Patent Publication No. 62-043737 discloses a technology, in which a PSW (Program Status Word) corresponding to an interrupt process is fixedly stored in a buffer memory that is different form a general buffer memory so that time taken to load the PSW at the time of the interrupt process can be shortened.
When a CPU executes an instruction, information may be overwritten in a PSA (Program Save Area) that is an area of a memory for storing information, such as a PSW corresponding to an interrupt process. Even if the PSA is locked in order to prevent overwriting, when information in the PSA needs to be updated, the lock is released, so that a PSW may be overwritten at the time of the update. In particular, when a memory is shared by a plurality of CPUs, a CPU may overwrite a PSA that is reserved by another CPU.
In this case, a PSW stored in the PSA is rewritten; therefore, a conventional information processing apparatus executes a determination process for determining whether or not a PSW corresponding to an interrupt process contains an error every time an interrupt process occurs. Because the determination process is executed every time an interrupt process occurs, there is a problem in that time taken to execute the interrupt process increases.
In the determination process, whether or not a PSW contains an error is determined by checking values in a plurality of fields in the PSW of 64 bits. For example, when emulating an OS in a 31-bit address mode, an information processing apparatus determines whether bits 24 to 31 are 1 or not. The information processing apparatus also checks a value of each of bit 0, bits 2 and 3, a bit 12, a bit 16, and a bit 17. When all of the bits have normal values, the information processing apparatus executes an interrupt process.
Because the information processing apparatus executes the above determination process every time an interrupt process occurs, when interrupt processes occur frequently, the determination process on the PSW becomes a bottleneck. Therefore, overhead in the interrupt process increases and time taken before a start of the interrupt process increases, resulting in increasing time taken to the interrupt process as a whole.
SUMMARYAccording to an aspect of an embodiment of the invention, an information processing apparatus includes a memory that stores therein a program status word containing an address of data that is to be read when an interrupt process is executed; and a processor determines whether or not the program status word stored in the memory is available, controls the memory to stores a determination result in the memory in association with the program status word, acquires the program status word and the determination result from the memory when the interrupt process occurs, and reads data on the basis of the address contained in the acquired program status word when the acquired determination result indicates that the program status word is available.
The object and advantages of the embodiment will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the embodiment, as claimed.
Preferred embodiments of the present invention will be explained with reference to accompanying drawings. The present invention is not limited by the embodiments.
[a] First EmbodimentThe program status word is also referred to as a PSW (Program Status Word). The program status word corresponding to an interrupt process contains an instruction address (IA) indicating a storage destination of data, in which an execution content (an instruction) of the interrupt process is defined, and contains data that is determined in advance in accordance with a data format of the PSW. The CPU reads an instruction address from a program status word corresponding to an interrupt process in response to occurrence of an interrupt and reads an instruction for the interrupt process on the basis of the read instruction address.
The CPU 3 is an arithmetic processing device that does not execute various processes, such as a normal arithmetic process and an interrupt process, and includes a determining unit 3a and a result storing unit 3b. The determining unit 3a determines whether or not a program status word corresponding to an interrupt process contains an error, that is, whether or not the program status word can be used as a header of an instruction address. The determination of the program status word is performed by determining whether data, which is determined in advance in accordance with a data format and which is contained in the program status word, matches a data format. The result storing unit 3b stores the program status word that is determined by the determining unit 3a and a determination result in the memory 2 in an associated manner.
The CPU 4 is an arithmetic processing device that executes various processes, such as a normal arithmetic process and an interrupt process, and includes a result acquiring unit 4a and a process executing unit 4b. For example, the CPU 4 executes a process for emulating a CPU or an OS (Operating System) having architecture that is different from that of a CPU or an OS installed on the information processing apparatus 1. The result acquiring unit 4a acquires, when an interrupt process occurs, a determination result of a program status word corresponding to the interrupt process from the memory 2. When the determination result acquired by the result acquiring unit 4a is normal, the process executing unit 4b acquires the program status word associated with the determination result from the memory 2 and executes the interrupt process by using an instruction address of the acquired program status word.
As described above, the information processing apparatus 1 causes the CPU 3, which does not execute various processes, such as an interrupt process, to check a PSW before occurrence of an interrupt. When the CPU 4 executes an interrupt process, the information processing apparatus 1 starts the interrupt process without checking the PSW. Therefore, it is possible to shorten a process time of the interrupt process. The CPU 4 may include the determining unit 3a and the result storing unit 3b in addition to the result acquiring unit 4a and the process executing unit 4b. By executing the determination process between various processes, such as a normal arithmetic process and an interrupt process, the CPU 4 can execute the interrupt process without performing a format check of a PSW.
[b] Second EmbodimentAn information processing apparatus according to a second embodiment will be explained below. In the second embodiment, the configuration of the information processing apparatus, the flow of processes, and advantages of the second embodiment will be explained in this order. In the second embodiment, a PSW (Program Status Word) corresponding to an interrupt process is described as a “new PSW” and a PSW that is maintained in a register by the CPU at the time of occurrence of the interrupt process is described as an “old PSW”.
Configuration of the Information Processing Apparatus
The communication control I/F 11 is an interface, such as a network card, that controls communication with other devices. The communication control I/F 11 receives various requests from the other devices and transmits results of processes or the like to the other devices.
The input-output I/F 12 is, for example, an input device, such as a keyboard or a mouse, and an output device, such as a display or a speaker. For example, the input-output I/F 12 receives a transaction execution instruction from an administrator or the like and displays a result of execution. The storage device 13 is a storage device, such as a hard disk drive, for storing various types of data to be used by the instruction executing CPU 15 for executing instructions.
The main memory 14 is a main memory or the like for storing various types of data or programs to be used by the instruction executing CPU 15 for executing instructions. The main memory 14 includes an emulation area 14a, a new-PSW storage area 14c, and a configuration-information storage area 14d.
The emulation area 14a is an area representing a memory space for an OS or the like to be emulated by the instruction executing CPU 15. The emulation area 14a includes a PSA (Program Save Area) area 14b. For example, when the information processing apparatus 10 emulates a general-purpose OS used for mainframe while running LINUX (registered trademark), the emulation area 14a represents a memory space for the general-purpose OS.
The PSA area 14b is an area that is reserved in advance within the emulation area 14a and that stores therein a new PSW, which is loaded at the time of occurrence of an interrupt, and an old PSW, which is maintained by the instruction executing CPU 15 at the time of occurrence of the interrupt. The PSA area 14b also stores therein interrupt related information, such as contents of a register at the time of occurrence of an interrupt, or an interrupt code.
As illustrated in
An old PSW that is maintained in a register or the like by the instruction executing CPU 15 at the time of occurrence of a program interrupt is stored in “40 bytes to 47 bytes”. An old PSW that is maintained in a register or the like by the instruction executing CPU 15 at the time of occurrence of machine check is stored in “48 bytes to 55 bytes”. An old PSW that is maintained in a register or the like by the instruction executing CPU 15 at the time of occurrence of an input-output interrupt is stored in “56 bytes to 63 bytes”.
A new PSW that is to be loaded by the instruction executing CPU 15 when an external interrupt occurs is stored in “88 bytes to 95 bytes”. A new PSW that is to be loaded by the instruction executing CPU 15 when an SVC interrupt occurs is stored in “96 bytes to 103 bytes”. A new PSW that is to be loaded by the instruction executing CPU 15 when a program interrupt occurs is stored in “104 bytes to 111 bytes”. A new PSW that is to be loaded by the instruction executing CPU 15 when machine check occurs is stored in “112 bytes to 119 bytes”. A new PSW that is to be loaded by the instruction executing CPU 15 when an input-output interrupt occurs is stored in “120 bytes to 127 bytes”. Interrupt related information, control information used by the information processing apparatus 10 at the time of execution of various processes, and the like are stored in “128 bytes to 512 bytes”.
The new-PSW storage area 14c is an area for sharing information, which is used when an interrupt occurs, between the instruction executing CPU 15 and the checking CPU 16. The new-PSW storage area 14c stores therein “a new PSW, an available flag, and a check result” in association with each “interrupt type”.
The “interrupt type” indicates a type of an interrupt, such as an external interrupt, an input-output interrupt, or a program interrupt. The “new PSW” is, for example, a 64-bit PSW to be loaded when an interrupt occurs, and is written in a format according to specifications of an emulation operating mechanism or the like included in the information processing apparatus 10. The “available flag” is a 2-bit flag used for determining whether or not a new PSW is available. A “bit 0 of the available flag” is a flag indicating whether or not a new PSW in the PSA area 14b is rewritten. When the new PSW is rewritten, “1” is stored in this flag, and when the new PSW is not rewritten, “0” is stored in this flag. A “bit 1 of the available flag” is a flag indicating whether or not the checking CPU 16 has completed a format check of a new PSW. When the format check is completed, “1” is stored in this flag, and when the format check is not completed, “0” is stored in this flag.
An example of determination of the available flag will be described below. The instruction executing CPU 15 determines whether or not a new PSW is available on the basis of values illustrated in
The “check result” is 2-bit information indicating a result of determination that is performed by the checking CPU 16 to determine whether or not a PSW contains an error, for example, a result of the format check of a new PSW.
Referring back to
The instruction executing CPU 15 is a CPU that executes an interrupt process except for the format check of a new PSW and that executes an instruction emulation process. The instruction executing CPU 15 includes an instruction-emulation executing unit 15a, an interrupt executing unit 15b, and a new-PSW updating unit 15c. The instruction executing CPU 15 executes a normal arithmetic process or the like in addition to a process for emulating an OS or a CPU that has architecture different from architecture of an OS or a CPU included in the information processing apparatus 10.
The instruction-emulation executing unit 15a emulates an OS or a CPU and executes an instruction from the emulated OS or the emulated CPU. For example, the instruction-emulation executing unit 15a executes an instruction from the emulated OS or the emulated CPU by using the emulation area 14a represented in the main memory 14, thereby executing an instruction emulation process.
When an interrupt process occurs, the interrupt executing unit 15b acquires a determination result of a new PSW corresponding to the interrupt process from the new-PSW storage area 14c. When the acquired determination result is normal, the interrupt executing unit 15b acquires, from the new-PSW storage area 14c, the new PSW that is associated with the determination result and executes the interrupt process by using an instruction address of the acquired new PSW.
For example, when an external interrupt occurs, the interrupt executing unit 15b stores an old PSW, which is maintained in a register or the like at the time of occurrence of the external interrupt, in the PSA area 14b. Subsequently, the interrupt executing unit 15b acquires, from the new-PSW storage area 14c, an “available flag” associated with a new PSW of the external interrupt. When the acquired “available flag” is “0, 0”, “1, 0”, or “1, 1”, the interrupt executing unit 15b determines that the new PSW is unavailable, and monitors the “available flag” until the “available flag” becomes “0, 1” or executes exception handling. When the “available flag” is “0, 1”, the interrupt executing unit 15b determines that the new PSW is available and acquires a “check result” associated with the new PSW from the new-PSW storage area 14c. The interrupt executing unit 15b clears the available flag after the exception handling is completed. Or the available flag is cleared by the exception handling after the exception handling is completed.
When the acquired “check result” is “00”, the interrupt executing unit 15b determines that a format of the new PSW is correct and acquires the new PSW from the new-PSW storage area 14c. Subsequently, the interrupt executing unit 15b ends the external interrupt process by using an instruction address of the acquired new PSW. On the other hand, when the acquired “check result” is “01”, the interrupt executing unit 15b determines that the format of the new PSW is incorrect and ends the process or executes exception handling. Similarly, when the acquired “check result” is “10”, the interrupt executing unit 15b determines that the instruction address of the new PSW is an odd number and ends the process or executes exception handling.
When the executed interrupt process is completed, the interrupt executing unit 15b notifies the instruction-emulation executing unit 15a of completion of the interrupt process. The instruction-emulation executing unit 15a that has received the notice loads the old PSW that has been stored in the PSA area 14b upon occurrence of the interrupt, and resumes a process that has been interrupted due to the occurrence of the interrupt by using an instruction address of the old PSW.
Referring back to
As an example of a synchronization method, the new-PSW updating unit 15c executes a trap for detecting update of a new PSW, and when detecting the update of the new PSW, sends a notice to a kernel. The kernel that has received the notice excludes an access to the corresponding new PSW. The new-PSW updating unit 15c updates a value of the “bit 0” of the “available flag” corresponding to the new PSW to “1”. In this manner, the new-PSW updating unit 15c can synchronize the update of the new PSW with the update of the “available flag”. Furthermore, it is possible to prevent the new PSW from being loaded during a time period from the update of the new PSW to the update of the “available flag”.
The checking CPU 16 is a CPU that determines whether a format of a new PSW has an error or not. The checking CPU 16 includes a check processing unit 16a and a check-result storing unit 16b. The checking CPU 16 is a CPU that does not execute various processes, such as a normal arithmetic process and an interrupt process. The type of an interrupt for which a format check is to be executed can be arbitrarily specified.
The check processing unit 16a executes a format check for determining whether or not a new PSW corresponding to an interrupt process has an error, at a predetermined time interval. For example, when a new PSW is newly stored in the PSA area 14b through operation of an OS or the like or when it is detected that the “bit 0” of the “available flag” in the new-PSW storage area is changed to “1”, the check processing unit 16a loads a corresponding new PSW from the PSA area 14b and executes a format check.
A method of the format check executed by the check processing unit 16a is specified by an address mode of a CPU or the like or a bit width. Because the information processing apparatus 10 can arbitrarily use a CPU and an address mode, any check methods that correspond to the address mode can be used.
For example, when the address mode has 31 bits, the check processing unit 16a checks whether all of values of bits 24 to 32 are 0 and whether a value of a bit 0 is 0, among a new PSW of 64 bits. Furthermore, the check processing unit 16a checks whether values of bits 2 and 3 are 0, whether a value of a bit 12 is 1, whether a value of a bit 16 is 0, whether a value of a bit 17 is 1, and whether an instruction address of the new PSW is not an odd number. Then, the check processing unit 16a outputs a check result to the check-result storing unit 16b.
The check-result storing unit 16b stores the new PSW, for which whether there is an error or not has been determined by the check processing unit 16a, and a determination result in the new-PSW storage area 14c in an associated manner. For example, assuming that the check-result storing unit 16b receives, from the check processing unit 16a, a notice indicating that “a format of the new PSW is correct” as a check result of the new PSW for an input-output interrupt, the check-result storing unit 16b stores “the new PSW for the input-output interrupt” and the check result of “00” in the new-PSW storage area 14c in an associated manner, and stores “1” in the bit 1 of the “available flag”.
Furthermore, assuming that the check-result storing unit 16b receives, from the check processing unit 16a, a notice indicating that “an instruction address of the new PSW is an odd number” as a check result of the new PSW for an external interrupt, the check-result storing unit 16b stores “the new PSW for the external interrupt” and the check result of “10” in the new-PSW storage area 14c in an associated manner, and stores “1” in the bit 1 of the “available flag”.
Similarly, assuming that the check-result storing unit 16b receives, from the check processing unit 16a, a notice indicating that “a format of the new PSW is incorrect” as a check result of the new PSW for a program interrupt, the check-result storing unit 16b stores “the new PSW for the program interrupt” and the check result of “01” in the new-PSW storage area 14c in an associated manner, and stores “1” in the bit 1 of the “available flag”.
Relationship between a format check of a new PSW and an interrupt process
A relationship between a format check of a new PSW and an interrupt process will be described below.
In this state, the checking CPU 16 periodically or continuously monitors the “available flag” that is stored in the new-PSW storage area 14c in association with a new PSW corresponding to the input-output interrupt (hereinafter, this PSW is described as a new PSW (input output)). When detecting that the new PSW (input output) is rewritten or when determining that the new PSW has not been checked, the checking CPU 16 loads the new PSW (input output) from the PSA area 14b. Subsequently, the checking CPU 16 executes a format check on the loaded new PSW (input output). The checking CPU 16 stores the new PSW (input output) and a check result in the new-PSW storage area 14c and updates the available flag.
Thereafter, the checking CPU 16, which has stored the check result, periodically or continuously monitors the available flag associated with the new PSW (input output). When detecting, from the available flag, that the new PSW (input output) is updated, the checking CPU 16 loads the new PSW (input output) from the PSA area 14b again. Subsequently, the checking CPU 16 executes the above format check, stores a result of the format check and the new PSW (input output) in the new-PSW storage area 14c, and updates the available flag.
Similarly, the checking CPU 16 periodically or continuously monitors the “available flag” that is stored in the new-PSW storage area 14c in association with a new PSW corresponding to a program interrupt (hereinafter, this PSW is described as a new PSW (program)). When detecting that the new PSW is rewritten or when determining that the new PSW has not been checked, the checking CPU 16 loads the new PSW (program) from the PSA area 14b. Subsequently, the checking CPU 16 executes a format check on the loaded new PSW (program). The checking CPU 16 stores the new PSW (program) and a check result in the new-PSW storage area 14c and updates the available flag.
Thereafter, the checking CPU 16, which has stored the check result, periodically or continuously monitors the available flag associated with the new PSW (program). When detecting, from the available flag, that the new PSW (program) is updated, the checking CPU 16 loads the new PSW (program) from the PSA area 14b again. Subsequently, the checking CPU 16 executes the above format check, stores a result of the format check and the new PSW (program) in the new-PSW storage area 14c, and updates the available flag.
On the other hand, when an input-output interrupt occurs, the instruction executing CPU 15 stores a PSW, which is maintained in a register or the like at the time of occurrence of the interrupt, in the PSA area 14b as an old PSW. Subsequently, the instruction executing CPU 15 acquires an available flag and a check result, which are stored in the new-PSW storage area 14c in association with the new PSW (input output). When determining that the new PSW (input output) is available, the instruction executing CPU 15 loads the new PSW (input output) from the new-PSW storage area 14c and executes the input-output interrupt by using an instruction address of the new PSW (input output).
Similarly, when a program interrupt occurs, the instruction executing CPU 15 stores a PSW, which is maintained in a register or the like at the time of occurrence of the interrupt, in the PSA area 14b as an old PSW. Subsequently, the instruction executing CPU 15 acquires an available flag and a check result that are stored in the new-PSW storage area 14c in association with the new PSW (program). When determining that the new PSW (program) is available, the instruction executing CPU 15 loads the new PSW (program) from the new-PSW storage area 14c and executes the program interrupt by using an instruction address of the new PSW (program).
When rewriting a new PSW (input output) stored in the PSA area 14b, the instruction executing CPU 15 updates the available flag, which is stored in the new-PSW storage area 14c in association with the new PSW (input output), at the same time of the rewriting. As a result, the checking CPU 16 can detect update of the new PSW (input output) and execute the format check again.
Similarly, when rewriting a new PSW (program) stored in the PSA area 14b, the instruction executing CPU 15 updates the available flag, which is stored in the new-PSW storage area 14c in association with the new PSW (program), at the same time of the rewriting. As a result, the checking CPU 16 can detect update of the new PSW (program) and execute the format check again.
The instruction executing CPU 15 may include the check processing unit 16a and the check-result storing unit 16b in addition to the instruction-emulation executing unit 15a, the interrupt executing unit 15b, and the new-PSW updating unit 15c. By executing the determination process between various processes, such as a normal arithmetic process and an interrupt process, the CPU 4 can execute the interrupt process without performing a format check of a new PSW.
Flow of Processes
The flow of processes performed by the information processing apparatus 10 will be explained below with reference to
Flow of the Format Check of New PSW
As illustrated in
When “bit 0, bit 1” of the “available flag” is “0, 1”, the checking CPU 16 determines that the new PSW is available (YES at S102) and ends the process. On the other hand, when “bit 0, bit 1” of the “available flag” is other than “0, 1”, the checking CPU 16 determines that the new PSW is unavailable (NO at S102) and updates “bit 0, bit 1” of the “available flag” to “0, 0” (S103).
The checking CPU 16 acquires a corresponding new PSW from the PSA area 14b (S104), checks an address mode used in the information processing apparatus 10 (S105), and determines whether the address mode is a 31-bit mode or not (S106).
When the address mode is the 31-bit mode (YES at S106), the checking CPU 16 determines whether or not any of the bits 24 to 32 of the new PSW is 1 (S107 and S108). When any of the bits 24 to 32 of the new PSW is 1 (YES at S108), the checking CPU 16 executes a process at S125. That is, the checking CPU 16 stores “01” in a check result of a new PSW to be subjected to a format check. When all of the bits 24 to 32 of the new PSW is 0 (NO at S108), the checking CPU 16 checks a bit 0 (S109).
On the other hand, when the address mode is not the 31-bit mode, that is, when the address mode is a 24-bit mode (NO at S106), the checking CPU 16 determines whether or not any of the bits 24 to 39 of the new PSW is 1 (S110 and S111). When any of the bits 24 to 39 of the new PSW is 1 (YES at S111), the checking CPU 16 executes the process at S125. When all of the bits 24 to 39 are 0 (NO at S111), the checking CPU 16 checks a bit 0 of the new PSW (S109).
Thereafter, when determining that the bit 0 of the new PSW is 1 (YES at S112), the checking CPU 16 executes the process at S125. On the other hand, as illustrated in
When any of the bits 2 and 3 of the new PSW is 1 (YES at S114), the checking CPU 16 executes the process at S125. On the other hand, when both of the bits 2 and 3 of the new PSW are 0 (NO at S114), the checking CPU 16 checks a bit 12 of the new PSW (S115). Because the instruction executing CPU 15 operates in an extended control mode, 1 is set to the bit 12 of the new PSW.
Subsequently, when the bit 12 of the new PSW is 0 (YES at S116), the checking CPU 16 executes the process at S125. On the other hand, when the bit 12 of the new PSW is 1 (NO at S116), the checking CPU 16 checks a bit 16 of the new PSW (S117).
When the bit 16 of the new PSW is 1 (YES at S118), the checking CPU 16 executes the process at S125. On the other hand, when the bit 16 of the new PSW is 0 (NO at S118), the checking CPU 16 checks a bit 17 of the new PSW (S119).
When the bit 17 of the new PSW is 1 (YES at S120), the checking CPU 16 executes the process at S125. On the other hand, when the bit 17 of the new PSW is 0 (NO at S120), the checking CPU 16 checks an instruction address of the new PSW (S121).
When the instruction address of the new PSW is an odd number (YES at S122), the checking CPU 16 stores “10” in a check result (S123). On the other hand, when the instruction address of the new PSW is an even number (NO at S122), the checking CPU 16 stores “00” in the check result (S124).
When determining YES at S108, S112, S114, S116, S118, and S120, that is, when it is determined that the new PSW causes early specification exception, the checking CPU 16 stores “01” in the check result (S125).
Thereafter, the checking CPU 16 stores the new PSW, for which the format check has been completed, and the check result in a predetermined area of the new-PSW storage area 14c in an association manner (S126), and changes a bit 1 of the available flag to 1 (S127). At this time, a bit 0 of the available flag is 0 until the new PSW is rewritten. Thereafter, the process returns to S101 and the above processes are repeated.
Flow of the Interrupt Process
As illustrated in
Thereafter, the instruction executing CPU 15 acquires, from the new-PSW storage area 14c, an available flag of a new PSW corresponding to the interrupt that has occurred (S204) and determines whether or not the new PSW is available (S205).
When determining that the new PSW is available (YES at S205), the instruction executing CPU 15 acquires a check result of the new PSW from the new-PSW storage area 14c (S206).
When the check result of the new PSW is normal (YES at S207), the instruction executing CPU 15 executes the interrupt process by using an instruction address of the new PSW (S208).
On the other hand, when the check result of the new PSW is not normal (NO at S207), the instruction executing CPU 15 determines that exception handling has occurred and repeats the process at S201. When determining that the new PSW is unavailable (NO at S205), the instruction executing CPU 15 repeats the process at S204.
Advantages of the Second EmbodimentAccording to the second embodiment, the checking CPU 16 determines whether or not a new PSW corresponding to an interrupt process contains an error. The checking CPU 16 stores the new PSW, for which whether an error is contained or not has been determined, and a determination result in the new-PSW storage area 14c in an associated manner. When an interrupt process occurs, the instruction executing CPU 15 acquires a determination result of a new PSW corresponding to the interrupt process from the new-PSW storage area 14c. When the acquired determination result is normal, the instruction executing CPU 15 executes the interrupt process by using an instruction address of the new PSW associated with the determination result.
That is, the checking CPU 16 executes a format check of a new PSW and stores the result of the format check in advance of an interrupt process. Consequently, the instruction executing CPU 15, which executes an interrupt process, need not check the new PSW when executing the interrupt process. Therefore, even when an interrupt process occurs a number of times, it is possible to reduce overhead of the interrupt process. As a result, it is possible to reduce process time of the interrupt process.
Furthermore, a format check is executed when a new PSW is rewritten, so that it is possible to synchronize update of the new PSW with the check result. Therefore, it is possible to prevent inconsistency, in which, for example, an old check result for which a format check has not been executed is maintained even after the new PSW is updated.
[c] Third EmbodimentIn the second embodiment, an example is explained in which one checking CPU and one instruction executing CPU are used. However, the present invention is not limited to this example. For example, it is possible to use two checking CPUs and one instruction executing CPU or it is possible to use one checking CPU and two instruction executing CPUs. In a third embodiment, an example will be explained in which a plurality of checking CPUs and a plurality of instruction executing CPUs are used.
When a plurality of checking CPUs and one instruction executing CPU are used
The main memory is the same as the main memory 14 explained in the second embodiment and the instruction executing CPU is the same as the instruction executing CPU 15 explained in the second embodiment; therefore, detailed explanation will not be repeated.
The checking CPU 30 is a CPU that executes a format check of a new PSW (input output) corresponding to an input-output interrupt. For example, the checking CPU 30 periodically or continuously monitors an “available flag” that is stored in the new-PSW storage area 14c in association with a new PSW (input output). When detecting that the new PSW (input output) is rewritten or when determining that the new PSW has not been checked, the checking CPU 30 loads the new PSW (input output) from the PSA area 14b. Subsequently, the checking CPU 30 executes a format check of the loaded new PSW (input output). Then, the checking CPU 30 stores the new PSW (input output) and a check result in the new-PSW storage area 14c and updates the available flag.
Thereafter, the checking CPU 30, which has stored the check result, periodically or continuously monitors the available flag associated with the new PSW (input output). When detecting, from the available flag, that the new PSW (input output) is updated, the checking CPU 30 loads the new PSW (input output) from the PSA area 14b. Subsequently, the checking CPU 30 executes the above format check, stores the result of the format check and the new PSW (input output) in the new-PSW storage area 14c , and updates the available flag.
The checking CPU 40 is a CPU that executes a format check of a new PSW (program) corresponding to a program interrupt. For example, the checking CPU 40 periodically or continuously monitors an “available flag” that is stored in the new-PSW storage area 14c in association with a new PSW (program). When detecting that the new PSW (program) is rewritten or when determining that the new PSW has not been checked, the checking CPU 40 loads the new PSW (program) from the PSA area 14b. Subsequently, the checking CPU 40 executes a format check of the loaded new PSW (program). Then, the checking CPU 40 stores the new PSW (program) and a check result in the new-PSW storage area 14c and updates the available flag.
Thereafter, the checking CPU 40, which has stored the check result, periodically or continuously monitors the available flag associated with the new PSW (program). When detecting, from the available flag, that the new PSW (program) is updated, the checking CPU 40 loads the new PSW (program) from the PSA area 14b. Subsequently, the checking CPU 40 executes the above format check, stores the result of the format check and the new PSW (program) in the new-PSW storage area 14c, and updates the available flag.
When one checking CPU and a plurality of instruction executing CPUs are used
The memory (A) is a storage unit representing a memory space for architecture to be emulated by the instruction executing CPU 50, and includes a PSA area and a new-PSW storage area. The PSA area stores therein a new PSW corresponding to a type of an interrupt. The new-PSW storage area stores therein a new PSW, an available flag, and a check result for each type of an interrupt, in an associated manner.
The memory (B) is a storage unit representing a memory space for architecture to be emulated by the instruction executing CPU 60, and includes a PSA area and a new-PSW storage area. The PSA area stores therein a new PSW corresponding to a type of an interrupt. The new-PSW storage area stores therein a new PSW, an available flag, and a check result for each type of an interrupt, in an associated manner.
The instruction executing CPU 50 is a CPU that executes an interrupt process except for a format check of a new PSW and executes an instruction emulation process. The instruction executing CPU 50 has the same functions as those of the instruction executing CPU 15 explained in the second embodiment. The instruction executing CPU 50 refers to the storage area (A) that stores therein information related to architecture to be emulated, and executes an interrupt process or the like by using various types of information on the new PSW stored in the memory (A).
For example, when an input-output interrupt occurs, the instruction executing CPU 50 stores a PSW, which is maintained in a register or the like at the time of occurrence of the interrupt, in the memory (A) as an old PSW. Thereafter, the instruction executing CPU 50 acquires an available flag and a check result, which are stored in the memory (A) in association with the new PSW (input output). When determining that the new PSW (input output) is available, the instruction executing CPU 50 loads the new PSW (input output) from the memory (A) and executes the input-output interrupt by using an instruction address of the new PSW (input output).
The instruction executing CPU 60 is a CPU that executes an interrupt process except for a format check of a new PSW and executes an instruction emulation process. The instruction executing CPU 60 has the same functions as those of the instruction executing CPU 15 explained in the second embodiment. The instruction executing CPU 60 refers to the memory (B) that stores therein information related to architecture to be emulated, and executes an interrupt process or the like by using various types of information on the new PSW stored in the memory (B).
For example, when an input-output interrupt occurs, the instruction executing CPU 60 stores a PSW, which is maintained in a register or the like at the time of occurrence of the interrupt, in the memory (B) as an old PSW. Thereafter, the instruction executing CPU 60 acquires an available flag and a check result, which are stored in the memory (B) in association with the new PSW (input output). When determining that the new PSW (input output) is available, the instruction executing CPU 60 loads the new PSW (input output) from the memory (B) and executes the input-output interrupt by using an instruction address of the new PSW (input output).
The checking CPU 45 is a CPU that executes a format check of a new PSW (program) corresponding to a program interrupt. The checking CPU 45 executes a format check of the new PSW stored in each of the memory (A) and the memory (B) and stores a check result or the like in the memory (A) and the memory (B).
For example, the checking CPU 45 periodically or continuously monitors an “available flag” that is stored in the memory (A) in association with a new PSW (program). When detecting that the new PSW (program) is rewritten or when determining that the new PSW has not been checked, the checking CPU 45 loads the new PSW (program) from the memory (A). Subsequently, the checking CPU 45 executes a format check of the loaded new PSW (program). The checking CPU 45 stores the new PSW (program) and a check result in the memory (A) and updates the available flag.
Thereafter, the checking CPU 45, which has stored the check result, periodically or continuously monitors the available flag that is associated with the new PSW (program). When detecting, from the available flag, that the new PSW (program) is updated, the checking CPU 45 loads the new PSW (program) from the memory (A) again. Subsequently, the checking CPU 45 executes the above format check, stores a result of the format check and the new PSW (program) in the memory (A), and updates the available flag.
Similarly, the checking CPU 45 periodically or continuously monitors an “available flag” that is stored in the memory (B) in association with a new PSW (program). When detecting that the new PSW (program) is rewritten or when determining that the new PSW has not been checked, the checking CPU 45 loads the new PSW (program) from the memory (B). Subsequently, the checking CPU 45 executes a format check of the loaded new PSW (program). The checking CPU 45 stores the new PSW (program) and a check result in the memory (B) and updates the available flag.
Thereafter, the checking CPU 45, which has stored the check result, periodically or continuously monitors the available flag that is associated with the new PSW (program). When detecting, from the available flag, that the new PSW (program) is updated, the checking CPU 45 loads the new PSW (program) from the memory (B) again. Subsequently, the checking CPU 45 executes the above format check, stores a result of the format check and the new PSW (program) in the memory (B), and updates the available flag.
Advantages of the Third EmbodimentAccording to the third embodiment, when a plurality of extra CPUs, in other words, a plurality of CPUs that is not executing a process, is present, it is possible to cause each of the CPUs to execute a format check of a new PSW of a different type of an interrupt. Therefore, it is possible to reduce loads on the checking CPU. Furthermore, it is possible to prevent delay in the format check of a new PSW, enabling to increase a process speed. Moreover, even when a plurality of architectures is in operation, it is possible to separately execute a format check of a new PSW by generating memory spaces corresponding to the respective architectures.
[d] Fourth EmbodimentWhile the embodiments of the present invention have been described above, the present invention may be embodied in various forms other than the embodiments described above. Different embodiments will be explained below.
Method of Allocating a Checking CPU
The information processing apparatus explained in the first to the third embodiments can determine how to allocate a checking CPU in accordance with information stored in the configuration-information storage area 14d. For example, when “the number of instruction executing CPUs” stored in the configuration-information storage area 14d is smaller than “the number of extra CPUs”, the information processing apparatus performs allocation so that a format check of a new PSW for one instruction executing CPU is executed by using one or more extra CPUs. At this time, the number of types of interrupts for which the format check is performed by each checking CPU is made uniform.
When “the number of instruction executing CPUs” stored in the configuration-information storage area 14d is equal to “the number of extra CPUs”, the information processing apparatus performs allocation so that a format check of a new PSW corresponding to one instruction executing CPU is executed by using one extra CPU. When “the number of instruction executing CPUs” stored in the configuration-information storage area 14d is greater than “the number of extra CPUs”, the information processing apparatus performs allocation so that a format check of a new PSW corresponding to one or more instruction executing CPUs is executed by using one extra CPU. The configuration-information storage area 14d may be monitored by using a configuration in which rewrite of a specific area is detected and notified or may be monitored by allocating a process of monitoring a configuration-information storage area to another CPU.
Logical CPU
While an example of an information processing apparatus that includes a plurality of CPUs is explained in the first to the third embodiments, the present invention is not limited to this example. For example, it is possible to use a multi-core that includes a plurality of processor cores in one processor package. In this case, a core that executes a process is caused to function as an instruction executing CPU and a core that is not executing the process is caused to function as a checking CPU described above so that the same processes as those of the first to the third embodiments can be executed.
Application to an Apparatus that does not Perform Emulation
While an information processing apparatus that emulates architecture that is not physically mounted is explained in the first to the third embodiment, the present invention is not limited to this example. For example, any information processing apparatuses that do not emulate architecture and that include a plurality of CPUs or a multi-core can execute the same processes as those of the first to the third embodiments.
Check Method
While an example is explained in the first to the third embodiments, in which a format check of a new PSW is executed by using a 31-bit mode or a 24-bit mode as an address mode, the present invention is not limited to this example. For example, it is possible to use arbitrary check methods that are specified in accordance with an address mode of a CPU or the like or a bit width.
System Configuration
Among the processes described in the present embodiments, all or a part of the processes explained to be automatically performed can be manually performed, or all or a part of the processes explained to be manually performed can be automatically performed with any known methods. Also, process procedures, control procedures, concrete titles, and information including, for example, various types of data and parameters illustrated in
The components of each device illustrated in the drawings are only for conceptually illustrating the functions thereof and are not necessarily physically configured as illustrated in the drawings. In other words, the specific forms of separate or integrated devices, for example, the check processing unit 16a and the check-result storing unit 16b, are not limited to those illustrated in the drawings. All or part of the device can be configured by functionally or physically separating or integrating any of the units depending on various loads or use conditions. Furthermore, all or any part of the process functions performed by each device can be implemented by a CPU and by programs analyzed and executed by the CPU or implemented as hardware by wired logic.
Program
The various processes described in the above embodiments may be realized by causing a computer system, such as a personal computer or a workstation, to execute a computer program that is prepared in advance. An example of a computer system that executes a computer program having the same functions as those of the above embodiments will be explained below.
The CPU 104 and the CPU 105 read and execute the programs 103a to 103e, so that processes are loaded as illustrated in
The instruction-emulation execution process 104a corresponds to the instruction-emulation executing unit 15a illustrated in
A PSA-area table 101a, a new-PSW-storage-area table 101b, and a configuration-information-storage-area table 101c are provided in the RAM 101. The PSA-area table 101a corresponds to the PSA area 14b illustrated in
The programs 103a to 103e described above are not necessarily stored in the ROM 103. For example, the programs 103a to 103e may be stored in a “portable physical medium”, such as a flexible disk (FD), a CD-ROM, an MO disk, a DVD disk, a magnet-optical disk, or an IC card, that are inserted into the computer system 100; a “fixed physical medium”, such as a hard disk drive (HDD) that is provided inside or outside the computer system 100; or “another computer system (or a server)” that is connected to the computer system 100 via a public line, the Internet, LAN, WAN, or the like, so that the computer system 100 can read out and execute the programs from these media.
That is, the programs in the other embodiments are recorded in a computer-readable manner in a recording medium, such as the above “portable physical medium”, the “fixed physical medium”, or the “computer medium”. The computer system 100 reads and executes the programs from the recording medium to thereby implement the same functions as those of the above embodiments. The programs in the other embodiments are not necessarily executed by the computer system 100. For example, even when other computer systems or servers execute the programs or even when these systems or the servers execute the programs in cooperation with each other, the present invention can be applied.
According to one aspect of the information processing apparatus and the interrupt control program, it is possible to shorten process time of an interrupt process.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Claims
1. An information processing apparatus comprising:
- a memory configured to store therein a program status word containing an address of data that is to be read when an interrupt process is executed;
- a first processor configured to determine whether or not the program status word stored in the memory is available, and to control the memory to store a determination result in association with the program status word; and
- a second processor configured to acquire the program status word and the determination result from the memory when the interrupt process occurs, and to read data on the basis of the address contained in the acquired program status word when the acquired determination result indicates that the program status word is available.
2. The information processing apparatus according to claim 1, wherein
- when the program status word is rewritten, the second processor controls the memory to store update information, which indicates that the program status word is rewritten, in the memory in association with the rewritten program status word, and
- when detecting, based on the update information stored in the memory, that the program status word is rewritten, the first processor determines whether or not the program status word is available.
3. The information processing apparatus according to claim 1, wherein
- the second processor emulates architecture different from the information processing apparatus and executes various processes of the architecture, and
- the first processor does not execute the various processes of the architecture.
4. The information processing apparatus according to claim 3, wherein
- the memory stores therein the program status word in a reproduced area that is a reproduction of a memory space of the architecture,
- the first processor determines whether the program status word stored in the reproduced area of the memory is available,
- the memory stores the program status word and a determination result in a predetermined area of the memory in an associated manner,
- the second processor acquires the program status word and the determination result from the predetermined area of the memory when the interrupt process occurs, and
- the second processor acquires, from the predetermined area of the memory, the program status word and reads data by using an address contained in the acquired program status word when the determination result indicates that the program status word is available.
5. The information processing apparatus according to claim 1, further comprising:
- a plurality of processors, wherein
- that the memory stores therein the number of processors that execute various processes in the information processing apparatus and the number of processors that do not execute the various processes in the information processing apparatus, in an associated manner; and
- that the specifies whether a processor of the plurality of processors not executing the various processes is to be allocated as the first processor or the second processor, on the basis of the number of the processors that execute the various processes and the number of the processors that do not execute the various processes, with reference to the memory.
6. The information processing apparatus according to claim 5, wherein
- when there is a plurality of types of interrupt processes, the plurality of processors, which do not execute the various processes and which are specified in the memory, are assigned to interrupt processes that are to be determination objects for which whether or not the program status word has an error is determined.
Type: Application
Filed: Mar 10, 2015
Publication Date: Jun 25, 2015
Inventors: Naoto TAKEISHI (Kawasaki), Kazuyoshi WATANABE (Kawasaki)
Application Number: 14/642,888