Patent GB-1483282-A (GB)
Title: Apparatus for protecting the information in a virtual memory system in programmed data processing apparatus
IPC: G06F13/00
Filed: 1974-12-02
Abstract: 1483282 Data processing COMPAGNIE INTERNATIONALE POUR L'INFORMATIQUE CII-HONEYWELL BULL 2 Dec 1974 [30 Nov 1973] 52131/74 Heading G4A In a data processing system in which a CPU processes information under the control of procedures, each procedure has associated maximum ring numbers RD, WD, MAXR representing a minimum level of privilege required to read and write and process information respectively, the maximum of these being determined to derive an effective address ring number. The system includes a central processing unit with a virtual memory system in which information is stored in variable size segments, with protection of the stored information, access to a segment is effected using segment tables having, for each segment, a segment descriptor of predetermined format containing an access information element specifying the minimum level of privilege required for the possible types of access (read, write, execute) and a base address element for locating the start of the associated segment, the segment table being accessed using an address having a first portion SEG, having a section STN identifying a segment table and a section STE identifying the descriptor within the table, and a second portion containing the offset from the base address of the first byte of the required word within the segment, the base address, offset and a displacement for locating the required byte within the word being combined to form the absolute address to access required information if the level of privilege permits access to be made. A procedure in an inner ring has full access to data in an outer ring. Procedure in an outer ring cannot access data in an inner ring without incurring a protection violation exception. A segment may have 3 ring numbers in its segment descriptor, one WR for "write" access, one MAXR for "execute" access and one RD for "read" access, an effective address ring number EAR representing the maximum of these being generated. Typically ring zero includes those operating segments critical to the operation of the system, e.g. the system base, exception supervisor. Ring 1 includes system segments from which recovery is possible after failure, e.g. language translators, job and process management. Rings 2 and 3 are allotted to users. Each time a procedure instruction is executed the procedure's number EAR is checked against the ring numbers assigned to the accessed data. A procedure in an outer ring can only branch to a procedure in an inner ring using a special "procedure call" instruction. Procedures are entered only at a gate, information regarding the gates being stored at the beginning of a segment. Basic system (Fig. 1, not shown).-The hardware includes a central processing unit (100), four MOS memory modules (101) interfaced with peripheral sub-system (magnetic tape, disc) and the central processing unit via a main store sequencer (102). Operations of the CPU are controlled by a read-only control store unit (110). A buffer store (104) is used for most frequently or most recently used information, a data management unit (106) providing an interface between the processor and buffer store or main memory. Instruction counter (118) holds a 32 bit instruction, containing a 2 bit tag field, the ring number of the current process (2 bits), the next instruction address (12 or 6 bit segment number and a 16 or 22 bit offset field defining the address within the segment). Segment descriptors are 2 words long, the first word of a direct descriptor including a presence bit (indicating that the segment is in main store, a missing segment exception occurring otherwise), and availability bits (indicating that the segment may be accessed), an indirect bit, a used bit, a written bit, 2 gating-semaphore bits (accessed during the procedure call) and a 24 bit base field. The second word includes a 2 bit read access field, the effective address ring number, a 2 bit write access field, a 2 bit maximum ring number which specifies the maximum process ring number at which the segment may be executed, a 1 bit write permission bit, a 1 bit execute permission bit and a size of segment field. In an indirect segment descriptor the first word includes a 28 bit location field defining the absolute address of a direct segment descriptor. One of 8 base registers (602, Fig. 6, not shown) are addressed using an instruction address syllable. The base register contains a tag, a base register ring number BRN, segment table number STN and entry STE and an offset, writing in being under micro operation control. An associative store (600) includes an associator (609), the contents of which are compared with the segment number read from the base register. In the event of a match an encoder (610) provides a four bit address for buffer (611) from which the 2 word segment descriptor is read. Two bit registers (501, 503, 504, Fig. 5, not shown) are used to store ring numbers. The effective address ring number EAR (which for direct addressing and addressing the first descriptor in an indirect word is the maximum of the base register ring number and the current process number and for indirect addressing for accessing the nth descriptor is the maximum of EAR N-1 , the ring number in the n - 1th descriptor, if addressing is indirect with respect to segment, and the ring number from the base register if addressing is indirect with respect to segment descriptor) is stored in a first 2 bit register (501) the base register number, maximum ring number and the write ring and read ring numbers are transferable to a second register (503). A third register (504) may receive the read ring number or the write ring number. The contents of these registers are compared to determine whether the required type of access to a segment may be made. For example for a procedure to be able to execute in a given segment the maximum ring number must be greater or equal to the effective address ring number which must be greater or equal to the write ring number, a violation exception being generated otherwise. Exceptions are also generated when the execute permission or write permission bits of a segment descriptor are not set. However if the EAR number is equal to the process ring number of the currently executing process a read violation exception may be over-written. The procedure call results in a stack frame within a segment being formed, there being one stack segment corresponding to each protection ring per process, each process control block containing three stack base words which point to the start of the stack segment procedures executed in rings 0, 1, 2. Each stack frame includes a working area (1003, Fig. 10, not shown), a saving area (1013) and a communication area (1016), the latter being used to pass parameters between procedures. When a procedure is called, an enter procedure instruction (format given in Fig. 11a, not shown) is executed, a gating procedure descriptor (Fig. 11c, not shown) being obligatorily accessed if a ring crossing is required (indicated by the gate bit of the segment descriptor being set to 01). The gating procedure descriptor includes a caller's maximum ring number (CMRN), an exception being generated if the caller's ring number is greater than this.  Access is effected using bits (AS) of the enter procedure instruction to access the required procedure instruction (format, Fig. 11b, not shown). This comprises a 2 bit tag (00-direct addressing, 01-an extended descriptor, i.e. it is two words, 10-indirect addressing and an illegal procedure descriptor exception occurring, 11-a fault procedure descriptor and an exception occurring), an entry point ring number (EPRN) and a segmented address. The second word when present holds the segmented address of a linkage section. To effect ring crossing the segmented part of the base register contents are compared with the segmented part of the address of the head of stack register and if they are not equal an illegal stack base register is indicated. Otherwise a check is made that bits 30, 31 of the base register are zero and if they are a check is made that the tag bits of the base register are zero. If these conditions are satisfied access is effected. The caller's right to call the callee is then determined by fetching the maximum ring number, a write ring number and the execute permission bit of the segment pointed to by the procedure word. The minimum number from the write field is then compared with the ring number from the maximum ring number field MAXR. If WR is greater than MAXR or if WR is less than or equal to MAXR and the execute permission bit is not set, an execute violation exception occurs. Otherwise the effective address ring number is generated and compared with the maximum ring number the MAXR segment descriptor address and if EAR is greater than MAXR the call is an inward call requiring the procedure be entered at a valid entry point. To effect this, a checking is made as to whether the segment containing the procedure descriptor is a gate segment (i.e. the gate field of the segment descriptor is 10). If it is not an exception occurs otherwise the gating procedure descriptor is fetched and checks are made for example that the address of the procedure descriptor is within the address boundary of the gated procedure descriptor. When necessary conditions are satisfied the effective ring number is compared with the caller's maximum ring number in the gating procedure descriptor and provided it is less than or equal to it and that the process ring number is less than MAXR of the segment accessed by the procedure descriptor calling is permitted and after execution of the desired operation an exit instruction is effected.