Abstract:
An address translation apparatus is provided which has an address translation look-aside buffer with an entry composed of a real address field, virtual machine identifier field and space identifier field. For the translation look-aside buffer entry to be used by a general virtual machine which uses a plurality of address spaces, a virtual machine identifier for discrimination of a general virtual machine is stored in the virtual machine identifier field, and information used in discriminating an address space is stored in the space identifier field. For the translation look-aside buffer entry to be used by a dynamic address translation off (DATOFF virtual) machine which uses a single address space, an identifier commonly assigned to a group of DATOFF virtual machines is stored in the virtual machine identifier field, and a control block address used in discriminating a DATOFF virtual machine is stored in the space identifier field.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to an address translation apparatus in a virtual machine system, and more particularly to a control of a translation lookaside buffer suitable for the case where a number of virtual machines run in an address translation OFF mode. 
     In a virtual machine system, a single real machine is used time divisionally by setting virtual hardware information to each time slot so that the single real machine operates as if different machines run for respective time slots. Storage of a virtual machine is located on a virtual storage generated by a program (hereinafter referred to as a host) which supervises the real machine and realizes a virtual machine system. An access by a program (hereinafter referred to as a guest) running on a virtual machine, irrespective of whether it is a real or virtual address access, requires address translation by the host and storage in a translation look-aside buffer (hereinafter referred to as a TLB). A technique relevant to the system of this type is shown in, e.g., U.S. Pat. No. 4,456,954. 
     This conventional technique prepares two types of TLB entries for a host and presently running guest. There is disclosed in JP-B-58-8073 a method whereby the field of the TLB is extended by providing therein a virtual machine identification (hereinafter referred to as a VM identifier) for discrimination of a host and a plurality of guests. According to this method, the entries for both the host and, a plurality of guests are allowed to be present in the TLB at the same time, thus providing effective utilization of the TLB. A logical address stored in the TLB will be present therefore at high probability, thus improving the operation performance. 
     Further, according to JP-B-57-23347, an apparatus is disclosed wherein a space identifier and area identifier corresponding to the VM identifier are provided in a field of the TLB to discriminate among the address spaces of the host and a plurality of guests, thus realizing a multi virtual storage system. 
     The above conventional techniques are available on the assumption that the number of guests running at the same time is smaller than that capable of discrimination by a VM identifier. In the case where the number of guests running at the same time is larger than that a purge process of the TLB is required so that the advantageous performance of the above conventional techniques cannot be afforded. In order to solve such a problem, a sufficient number of bits may be assigned to a VM identifier. However, a VM identifier is a key element for the associative storage function of the TLB so that an increase in the bit number thereof results in an increased hardware cost. 
     Current address translation technology needs of a virtual machine system require an improved address translation operation that overcomes these problems and others to provide an address translation apparatus that has an advanced translation look-aside buffer for handling a number of guests without changing an interface of software and which reduces the overhead of address translation. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to hold the entries of a number of, guests within the TLB without changing the structure of the TLB. 
     In a virtual machine system, guests usually run on both an interactive type processing system using one guest per one terminal and a conventional type system for batch, on-line or other processings. In the former interactive type processing system, several hundreds of guests equal in number to that of terminals will run at the same time. Whereas in the latter conventional type system, the number of guests is several at most. A guest running on the former interactive type processing system is a guest which runs in a mode without address translation in order to reduce the overhead (this guest will be referred to hereinafter as a DATOFF (dynamic address translation off) guest. 
     In this mode, a virtual machine performs an address access by using only a real address for the virtual machine, which real address is a virtual address for the real machine. 
     According to the present invention, with the above fact taken into consideration, a group of DATOFF guests is assigned a single virtual machine, identifier VMID, and a space identifier field in the TLB is used to discriminate among the guests within the group. 
     According to the present invention, in the case of an ordinary or general guest, a VMID stored in the VMID field of the TLB is compared with the VMID of the running guest. 
     In the case of a DATOFF guest, a control block address stored in the space identifier field of the TLB is compared with a control block address of the running guest. In this case, a value common, to DATOFF guests is stored in the VMID field of the TLB. 
     Since a DATOFF guest is discriminated by using a space identifier field more guests can be discriminated. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The invention may take a physical form in certain parts and arrangements of parts which will be described in detail in the specification and illustrated in the accompanying drawings which form a part of this application and wherein: 
     FIG. 1 is a block diagram showing a virtual machine system according to this invention; 
     FIG. 2 is a logic circuit of an address translation apparatus; 
     FIG. 3 is a flow chart illustrating the operation of setting registers upon actuation of a guest; 
     FIG. 4 is a diagram showing values set in registers in various modes; and 
     FIG. 5 is a flow chart illustrating the operation of actuating a guest which is not identified beforehand as to whether it is a DATOFF guest or not. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 is a block diagram showing a virtual machine system according to the present invention. 
     CPU 100 executes a program realizing the virtual machine system. For execution of a guest, CPU 100 outputs a control block address, assigned independently to each guest, onto a line 110, a segment table origin (STO) onto a line 120 if the guest uses a plurality of spaces, information indicating whether the guest is a DATOFF guest, onto a line 130, and information indicating whether the address to be accessed is a real address or virtual address, onto a line 140. 
     VM stack 400 is a storage used for converting a control block address into a VMID which is stored in a TLB described later and used as a key wherein a VMID has less bits number than that of a control block address. If all the VMs are intended, to be discriminated by a VMID, then the number of the bits of VMID increases and hence the number of bits of the key portion in the TLB, accordingly disabling effective utilization of the TLB. For this reason, the control block address having a sufficient number of bits for discrimination of all the guests is converted into VMIDs at a VMID stack 400. VMID stack 400 stores pairs of a control block address and VMIDs assigned thereto. The control block address is used as a key for outputting a VMID. 
     An address translation apparatus 200 will be described later in detail with reference to FIG. 2. The function of the address translation apparatus 200 is to convert a logical address supplied from CPU 100 into an absolute address of a main storage 300. 
     A dynamic address translation (DAT) 500 is actuated by a signal 14 indicating that the address translation apparatus 200 cannot perform address translation. DAT 500 obtains an absolute address by using an address translation table in the main storage 300. An example of DAT 500 is shown in the above-referred U.S. Pat. No. 4,456,954. 
     A selector 600 selects either a control block address or a segment, table origin in accordance with an instruction from the CPU 100 and outputs it onto a line 170. 
     FIG. 2 is a block diagram showing the address translation apparatus 200. 
     An entry of the TLB 1 includes an absolute address field (prefixed address PA) 2 for storing an absolute address, a valid flag (V) 3 for indicating entry validity, a logical address field (LA) 4 for storing a logical address, a VM identifier field (VMID) 5 for storing a VMID, a space identifier field (STO) 6 for storing a space identifier, a common segment field (C) 7 for indicating whether a common area of the main storage is used or not, and a real entry flag (R) 8 for indicating whether an entry is for a real or virtual address. In each field of the entry, a necessary, value is stored at the time of address translation via input leads 50. 
     A real access request flag 9 is set to &#34;1&#34; for a real address request, and to &#34;0&#34; for a virtual address request. 
     An EX-OR gate 17 compares the contents of the real entry flag 8 and real access request flag 9, and outputs &#34;1&#34; if the contents are coincident with each other. 
     A space identifier register 10 is set with the start address (STO) of the segment table in an ordinary case, but is also set with a control block address of the guest in another case. The difference of such operation will be described later. The control block address is assigned independently to each guest so that a different address indicates a different guest. The host manages so as not to change the address while the associated guest is present. 
     An STO comparator 18 compares the contents of the space identifier field 6 and space identifier register 10, and outputs &#34;1&#34; if the contents are coincident with each other. 
     A VM identifier register 12 is set to &#34;0000&#34; while the host is running. In this embodiment, the host is assigned a VMID of &#34;0000&#34;. A VM identifier register 12 is set to &#34;0001&#34; while a DATOFF guest is running, and to another value except &#34;0000&#34; and &#34;0001&#34; assigned independently to each guest, i.e., a value of 2 or more in decimal notation, while the other guest is running. 
     A VMID comparator 19 compares the contents of the VM identifier field 5 and VM identifier register 12, and outputs &#34;1&#34; if the contents are coincident with each other. 
     An LA comparator 20 compares the content of the logical address field 4 with a part of the content of the access request address register 13, and outputs &#34;1&#34; if the contents coincide with each other. 
     A DATOFF guest flag 11 is set to &#34;1&#34; while a DATOFF guest is running, and to &#34;0&#34; while the other guest is running. 
     An AND gate 21 outputs &#34;1&#34; only when the content of the real access request flag 9 is &#34;1&#34; and the content of the DATOFF guest flag 11 is &#34;0&#34;. 
     An AND gate 22 outputs &#34;1&#34; only when the content of the real access request flag 9 is &#34;0&#34; and the content of the DATOFF guest flag 11 is &#34;1&#34;. This output signal &#34;1&#34; is used as a guest mode change signal which will be described later with reference to FIG. 5. 
     An OR gate 23 outputs &#34;1&#34; when one of the outputs from the common segment flag 7, STO comparator 18 and AND gate 21 is &#34;1&#34;. 
     An AND gate 24 outputs &#34;1&#34; when all the outputs from the EX-OR gate 17, OR gate 23, VMID comparator 19 and LA comparator 20 are &#34;1&#34;. This output signal &#34;1&#34; is used as a TLB coincidence signal 14 which causes a TLB output selector 15 to output the content of the absolute address field 2. 
     The operation of the circuit shown in FIG. 1 will be described. The operation including a host mode, general guest mode, and DATOFF guest mode will be described in this order. 
     (1) Host Mode 
     First, the host running operation will be described. Upon issuance of a main, storage access request, address information of represented by bits 10 to 18 in the access request address register 13 is decoded at an address decoder 25 to read out one entry in the TLB and perform coincidence judgement. In this case, the real access request flag 9 takes a value &#34;1&#34; for a real address access request, and &#34;0&#34; for a virtual address access request. The DATOFF guest flag 11 takes a value &#34;0&#34; because the host is running. For an access to the main storage by the host, the VM identifier register 12 takes, a value &#34;0000&#34; for a VMID of &#34;0000&#34;. The space identifier register 10 is set with the start address of the segment table (refer to column 410 of FIG. 4). 
     (1-a) Issuance of Virtual Address by Host 
     In this case, the real address request flag 9 is set with &#34;0&#34;. The values to be later described with reference to FIGS. 3 and 4 are set respectively in the space identifier register 10, DATOFF guest flag 11, VM identifier register 12, and access request address register 13. 
     If the common segment flag 7 takes &#34;0&#34;, since the output from the AND gate 21 takes &#34;0&#34;, whether the output from the AND gate 24 takes &#34;1&#34; or not depends upon the comparison result by the STO comparator 18. If the contents of the space identifier register 10 and space field 6 are not coincident with each other, the output from the OR gate 23 becomes &#34;0&#34; so that a TLB coincidence signal cannot be obtained from the AND gate 24. 
     (1-b) Issuance of Real Address by Host 
     On the other hand, in the case where the host issues a real address request, the real address request flag 9 becomes &#34;1&#34;. Since the output from the DATOFF guest register 11 is &#34;0&#34;, the output from the AND gate 21 becomes &#34;1&#34;, so that the output from the OR gate 23 becomes &#34;1&#34; irrespective of the output from the STO comparator 18. Consequently, if the other inputs the AND gate 24 are &#34;1&#34;, a TLB coincidence is determined irrespective of the comparison result by the STO comparator 18. 
     In both the cases (1-a) and (1-b), if a requested address is not stored in the TLB, address translation is carried out by the dynamic address translation 500 to store the result in the TLB via the line 160 (refer to FIG. 1). Values set to the respective fields are as follows. Namely, an absolute address obtained through address translation is stored in the absolute address field 2, &#34;1&#34; in the valid flag 3, a part of the access request address 13 in the logical address field 4, a value of the VM identifier register 12 in the VM identifier field 5, a value of the space identifier register 10 in the space identifier field 6, a value of the common bits on the segment table entry obtained during address translation in the common segment flag 7, and a value of the real access request flag 9 in the real entry flag 8. 
     (2) General Guest Mode 
     Next, the operation of a general guest which performs address translation will be described. A general guest uses a plurality of address spaces. 
     The DATOFF guest flag 11 takes &#34;0&#34; similar to the case of the host guest. However, the VM identifier register 12 is set with a number (VM identifier) of the currently running guest, excepting &#34;0000&#34; or &#34;0001&#34;. 
     This VM identifier is supervised by the VMID stack 400 (FIG. 1) which is a storage capable of searching a VM identifier representative of the running guest based on the control block address thereof, upon actuation of the guest. 
     The associated TLB search operation is similar to the case of the access request by the host. If the VM identifier meets a coincidence, then only the TLB entry for the guest now concerned, meets a coincidence. If there is no entry in the TLB to produce a coincidence, the contents for the registers and flags are set in the corresponding fields of the TLB in the similar manner as described with the &#34;Host Mode&#34;. 
     (3) DATOFF Guest Mode 
     Next, the DATOFF guest running operation will be described. This mode uses a single address space. 
     The DATOFF guest flag 11 is set with &#34;1&#34;, the VM identifier register with &#34;0001&#34;, and the space identifier register 10 with the control block address of the guest, respectively under control of the host. 
     The guest of this type does not perform address translation so that, only a single real address space is present, and therefore it is not necessary for the guest to change the content of the space identifier register 10. Therefore, if once the control block address of the guest has been set in the space identifier register 10, the values set by the host are retained while the guest is running. Upon issuance of an access request by the guest, an entry is searched from the TLB entries which entry takes &#34;0001&#34; for the VM identifier field 5 and the same control block address of the guest for the space identifier field 6. 
     If an access request is a real address request and the real access request flag 9 takes a value &#34;1&#34;, the output from the AND gate 21 becomes &#34;0&#34; because the DATOFF guest flag 11 takes &#34;1&#34;. However, since the output from the STO comparator 18 becomes &#34;1&#34;, the output from the OR gate 23 becomes &#34;1&#34;, thus posing no problem. 
     If an entry of &#34;1&#34; is present for the common segment flag, the output from the OR gate 23 becomes &#34;1&#34; irrespective of the output from the STO comparator 18 so that even if non coincidence is met with respect to the value of the space identifier field 6, it is determined that the TLB entry is present. If there is no entry in the TLB to produce a coincidence, address translation is carried out and the result is stored in the TLB. In this case, the space identifier field 6 has stored therein a value of the current space identifier register 10, i.e., the guest control block address, and the VM identifier field 5 receives &#34;0001&#34;. The other fields have stored therein those values similar to the case described with the &#34;Host Mode&#34;. As described above, according to this embodiment, the space identifier field receives a control block address for use in discriminating a guest. 
     An initial setting process at the time of actuating a guest for allowing the above-described operation during execution of the guest will be described with reference to FIGS. 3 and 4. For actuation of a general guest (Step 310), a value designated by the guest is set in the space identifier register 10, &#34;0&#34; in the DATOFF guest flag 11, and a VM identifier obtained through search of the VMID stack in the VM identifier register 12 (Step 320, column 420). For actuation of a DATOFF guest (step 330, column 430), a guest control block address is set in the space identifier register 10, &#34;1&#34; in the DATOFF guest flag 11, and &#34;1&#34; in the VM identifier register 11. In this case, the information as to whether a guest is a DATOFF guest or not has been given within the guest control block under control of the host. 
     As seen from the embodiment, even if a TLB having a VM identifier field of a relatively small number of bits is used, address translation information for a number of DATOFF guests can be held in the TLB, thus advantageously improving the operation performance of a virtual machine system. 
     Further, in the above embodiment, the value of the VM identifier register has been fixedly assigned &#34;0&#34; for the host, &#34;1&#34; for the DATOFF guest, and &#34;2 or more&#34; for the general guest. However, as described in U.S. patent application Ser. No. 222767 filed on Jul. 22, 1988 assigned to the assignee of the present application, a new value may be assigned each time the TLB is purged. 
     Furthermore, in the above embodiment, it is necessary to determine beforehand which guest between a general guest and a DATOFF guest is to run. This is because a value should be set beforehand in the DATOFF guest flag 11. However, by using the guest mode change signal 16, the space identifier field can be used for discrimination of a guest even if the type of guest cannot be determined beforehand. 
     In particular, such an operation can be realized by a method whereby a guest is first actuated while considering it as a DATOFF guest, and the mode is changed if a virtual address access request issues during the guest running. The process of actuating a guest in such a case is shown in FIG. 5. The VMID stack 400 is referred to by using a control block address (Step 510). If the guest control block address is not stored in the VMID stack 400 (Step 520) and the guest to be actuated or dispatched is a DATOFF guest (Step 530), then the guest is actuated as the DATOFF guest (Step 540), or in the other case, the guest is actuated as the general guest (Step 550). 
     If the guest continues to run in the DATOFF mode, this operation becomes similar to the case where the mode can be determined beforehand as described previously. If the guest changes to the address translation mode during the course of its operation and issues a virtual address request, then the output from the real access request flag 9 becomes &#34;0&#34;. Since the value of the DATOFF guest flag 11 is &#34;1&#34;, the output from the AND gate 22 becomes &#34;1&#34; and the guest mode change signal 16 becomes &#34;1&#34;. This signal indicating a host address translation exception is sent via the line 16 to CPU 100 so that a host interruption occurs. Upon reception of this interruption by the host, the mode is switched from the DATOFF guest mode to the general guest mode. Therefore, the status of the guest departs from the DATOFF state (Step 530) so that upon re-actuation of the guest, it can be actuated as the general guest as shown in the flow chart of FIG. 5 (Step 550). 
     Thereafter, an instruction which issued the interruption is executed again to allow a mode change without any influence to the guest. According to the present embodiment, it is advantageous in that the space identifier field can be used for discrimination of a guest without the operational restriction that the type of guest is required to be designated beforehand. 
     According to a modification of the above embodiment, a host interruption may not be generated when the guest mode change signal 16 becomes &#34;1&#34;, but the mode change is effected by hardware or microprograms. 
     According to the above embodiment, without using an additional interface with software, a DATOFF guest can be advantageously discriminated. 
     According to the present invention, the entries of a number of guests larger in number than that of guests capable of being determined by a VM identifier can be held in the TLB without changing the interface with software. Therefore, it is advantageous in that the overhead for address translation can be made small, and the system performance can be improved.