Protected memory accessing

Abstract: A method of and a controller for accessing a protected memory which is logically divided into major partitions - pages - which are in turn sub-divided into minor partitions - blocks - by concurrently executing transactions, using virtual block addressing and address translation at the memory controller via an access table, wherein there are provided table entries containing priviledged access control fields relating to the pages and lock fields relating to the individual blocks, by receiving an address of a data block to be accessed by an identifiable transaction; deriving from the address an access table entry corresponding to the data block and testing the data in the page access control field and the lock field governing access to the block; and providing the requested access if permitted by the access control data and the lock data for the type of access concerned, and also providing recorded access, if not permitted but not specifically denied by the lock data, using at least part of the lock field to record such latter type of access.

Description: This invention relates to protected memory accessing. Present data processing applications include the requirement that several tasks be performed concurrently. These tasks require read and write access to data memories in the the data processing systems. Problems occur when these multitask transactions attempt to read and write data in the memory concurrently. These problems arise when the system is attempting to provide transaction concurrency while ensuring that the performance of tasks is performed in a scheduled manner, i.e. that one task is performed before another. These problems are addressed in a paper entitled "Transaction Monitoring ENCOMPASS: Reliable Distributed Transaction Processing", published in the IEEE Proceedings on Very Large Data Bases , September 1981, pages 244-254. Furthermore, a Patent Application (88308752.0) entitled "Concurrent Record Access Database System", also addresses the problems of concurrent transaction processing. A locking protocol provides for concurrent access to data in a memory by multiple transactions in a ordered manner. Locking prevents one transaction from accessing a record that is being modified, or owned, by another transaction. This ensures that one transaction will not read a record that is in the process of being changed by another transaction, thus ensuring an ordered interaction between these transactions. One locking protocol technique is illustrated in US-A-4,680,700 entitled "Virtual Memory Address Translation Mechanism With Combined Hash Address Table And Inverted Page Table". Another patent describing memory protection for concurrent transaction operation is US-A-4,638,426 entitled "Virtual Memory Address Translation Mechanism With Control Data Persistence". These two references address the application of locking protocols to virtual address translation. Regulating the access to protected data can be performed while performing the task of translating between the virtual addresses and the real addresses in a virtual memory system. In performing the virtual to real address translation, each addressable data block includes additional data that describes the accessibility of this data by transactions. In other words, the setting of these data bits will determine whether a transaction can access a data block. The object of the present invention is to provide memory access control that grants access to concurrently executing transactions while protecting the integrity of the data being accessed. The present invention provides a data processing system as claimed in Claim 1. In other words, a form of controlled delegation is provided with retains a record of where it has been exercised. As disclosed hereinafter, in one form of the present invention access to data blocks stored by addresses in a memory and concurrently accessible by several transactions is provided. The method consist of the steps of (a) receiving an address of a data block to be accessed by a first transaction, (b) deriving from the address an access table entry corresponding to the data block, the entry including lock data that governs the access to the data block, and (c) providing the access if permitted by the lock data, or providing the access, if not permitted by the lock data, and recording the occurrence of the access in the lock data. The disclosure is in the form of the decision making flow which can be implemented by software in a branched serial manner or in serial or parallel by logic in the controller since the external results are access, with or without the switching of relatively few selected latches, frequently only one, or the generation of an interrupt signal. The present invention will be described further with reference to an embodiment thereof as illustrated in the accompanying drawings, wherein: Figure 1 is a block diagram of a data processing system; Figure 2 is an illustration of a short address to long address translation; Figure 3 is a highly styalised diagram illustrating an inverted page table address translation; Figure 4A is a flowchart for the memory controller procedure during a read operation; and Figure 4B is a flowchart for the memory controller procedure during a write operation. The disclosed embodiment includes a method and apparatus for regulating the access of several concurrently executing transactions to data blocks in a memory. The preferred embodiment includes a virtual memory system. The regulation of access to the data is performed during the process of virtual to real address translation. Mechanisms for performing access in a virtual memory system are disclosed in the aforementioned US-A-4,680,700 and US-A-4,638,426. Figure 1 is a simplified block diagram of data processing system including a processor 10 connected by a bi-directional bus 12 to a memory controller 20 which is connected by a bi-directional bus 22 to a memory 30. In practice, processor 10 can be a single or several processors that are executing program sequences. These programs sequences will include transactions that are executing concurrently and attempting to concurrently access data stored in the memory 30 through the memory controller 20. In this embodiment, the memory controller 20 further performs the virtual to real memory address translation that is described in detail in the above two patent references. Therefore, a detailed description of virtual address translation will not be discussed. However, certain aspects of the virtual address translation will be described to illustrate the regulation of access to data in the disclosed arrangement. In Figure 2, the generation of a long virtual address from a short address is illustrated. The short address is received from the processor 10 and is to be translated into a real address. In Figure 2, the short address 40 includes two parts. The first part is a four bit designation of the segment register. The second part is a 28 bit designation of an offset in a segment. The segment register 42, contained in the memory controller 20, includes additional data governing the virtual address translation procedure. One portion of the segment register contents is the segment identifier or segment ID. This is a 24 bit segment ID that is concatenated with the 28 bit offset in the segment portion from the short address to make an overall long virtual address 44. The long virtual address is then translated in a manner illustrated in Figure 3. Figure 3 illustrates the operation of the inverted page table. Again, a detailed explanation of the virtual address translation procedure is described in the two patent references previously discussed. The long virtual address 44 includes the segment ID, and the offset in segment. The offset in the segment portion is divided into an offset in the page portion and a virtual page portion. The segment ID and the virtual page portion are EXCLUSIVE ORed to form an index H used to access data in a hash table 46. The output of the hash table 46 is an index I used to access the inverted page table 50. The inverted page table 50 includes entries governing the access to the data blocks in the memory. The vpage field in the Kth entry in the inverted page table 50 is equal to the virtual page associated with the Kth real page of memory, and the real address 48 is formed by concatenation as shown in Figure 3. The memory controller further includes a transaction ID register 52 that contains the identifier of the transaction currently executing on the processor. The entry 54 in the inverted page table includes the segment ID, virtual page designator, the lock bits and several other variables to be discussed. As previously discussed, the lock bits govern the access to the data block J containing the addressed location sought by the transaction. NB - Fig. 3 does not indicated that RPAGE is loaded with J, but that what is loaded in RPAGE is the high order address of a larger partion of storage which contains block J hereinafter referred to as the jth block in the page in question. If an access is to be allowed, the lock bit for the respective data block will be set to a one. If access is not to be allowed, the lock bit will be set to zero. This provides not only a procedure for regulating access to the data blocks in accordance with the lock bits, but also, a more efficient concurrent transaction execution, with concurrent access to some data blocks even though prohibited by the lock bits. This additional access is provided when the integrity of the data can be guaranteed or when the transaction access will not affect any other accesses. The memory controller 20 (Figure 1) will use the real address 48 to access data in the memory 30 in accordance with the accessing procedure that is governed by the lock bits in entry 54. In Figure 3, line 54 includes the variables l, w, r and a. The variable "l" stands for lock type. This is a one-bit indication whether the lock bits (32 lock bits in line 54) represents write locks or read locks for the data blocks on the page. The variable "a" represents the allow read indication. The allow read indication permits any transaction to read data blocks on the page. The "w" and "r" variables represent the grant write locks and the grant read locks indications respectively. When these lock variables are set, the memory controller will automatically provide access to data blocks and record access granted, without intervention by any supervisory software. In operation, a transaction will attempt to access a page by providing the long virtual page address which is converted by the memory controller 20 into a real address 48. A function performed by the memory controller reads the entry 54 in the inverted page table during the conversion of the virtual address to the real address. The function grants or denies access on the basis of the entry 54 in the inverted page table and the transaction identifier register 52 which specifies the currently executing transaction. In doing so, the function will ensure that the lock bits for that transaction are such that the transaction has only access as appropriate for it. In other words, this function by using the lock bits will ensure that a transaction will not be granted access, either read or write, to data blocks where such access is inappropriate. In this embodiment, such a supervisory function is provided. Furthermore, by using the grant read lock and grant write lock indicators, the supervisor may selectively enable an automatic capability for a transaction to access data blocks and automatically record the access in the lock bits. This is accomplished by performing those procedures indicated in the flowcharts in Figures 4A and 4B. These procedures are performed by the memory controller while performing the virtual address to real address translation. In Figure 4A a flowchart representing the read access is illustrated. Referring to Figure 4A, the memory controller first determines whether the transaction is a read or write transaction in step 100. If the transaction is a write transaction, the controller proceeds to connector 102 to the flowchart in Figure 4B. If the transaction is a read transaction, the controller then determines in step 104 if the allow read indicator is set to a zero. If allow read is set to one access granted. If the allow read indicator is a zero, the controller proceeds to step 106 to determine if the transaction ID in the inverted page table 54 matches the transaction ID register 52 contents. If the transaction ID does not match, the controller proceeds to step 118 to deny access and generate an interrupt. If the transaction ID does match, the controller proceeds to step 108 to determine if the lock type equals one or zero. If the lock type equals one indicating that all of the lock bits are write locks, all read accesses are allowed. The controller then proceeds to step 120 to allow the read access. If the lock type is set to zero, the controller proceeds to step 110 to determine the state of the grant read indicator. If the grant read indicator is one, the controller determines in step 112 the status of the lock bit for the data block to be read (in this example the jth data block). If the lock bit is not set, the controller proceeds to step 114 to set the lock bit equal to one for that data block and then proceeds to step 120 to allow access. In step 112, if the lock bit is already set, the controller permits access through step 120. Returning to step 110, if the grant read is set to zero, the controller proceeds to step 116 to determine the state of the lock bit. If the lock bit is set to one, the controller provides access via step 120. If the lock bit is set at zero, the controller proceeds to step 118 to provide an interrupt. Referring to the flow chart in Figure 4B, the controller proceeds to step 140 through connector 102 to determine if the transaction ID in the inverted page table 54 matches the contents of the transaction ID register 52. If not, an interrupt in step 150 is generated. If there is a match, the controller proceeds to step 142 to determine if the grant write indicator is set. If not, the controller proceeds to step 144 to determine if the lock type is equal to zero. If so, the interrupt is generated in step 150. If not, the controller proceeds to step 152 to determine if the lock bit is set to one. If not, the controller proceeds to step 150 to generate an interrupt. If the lock bit is set to one, the controller proceeds to step 158 to grant write access. Returning to step 142, if the grant write is set, then the controller proceeds to step 146 to determine if the lock type is set to one. If so, the controller proceeds to step 154 to determine if the lock bit is set to one. If so, the controller grants access in step 158. If not, the lock bit is then set to one in step 156 and the write access is granted in step 158. Returning to step 146, if the lock type is equal to zero, the controller proceeds to step 160 to set the lock type equal to one. In step 162, the lock bit that is being accessed is set to one and all other lock bits are set to zero. Then in step 158, the write access is granted. In the flow chart in Figure 4A, if a lock bit does not grant access but the grant read is set to one, the access will still be granted and the respective lock bit will be changed to record the access. In accordance with this procedure, this recording of the read access to the data block is done automatically without intervention by any supervisory software function. Likewise, in Figure 4B, if the grant write indicator is set, the write access is allowed even if the lock bits are not set appropriately, and the record of the write access is provided by the automatic setting of these lock bits. Also, if the lock type is not set, the lock type is set to provide write access and thus records the granting of the write access. The decision making flow of Figs 4A and 4B can be implemented by software in a branched serial manner or in serial or parallel by logic in the controller since the external results are access, with or without the switching of relatively few selected latches, frequently only one, or the generation of an interrupt signal. The details of either implementation are not given as they will be obvious to one skilled in this art from the information set forth in the recited Figures.

Claims: A data processing system having processing means (10) connected to a memory controller (20) which controls access to a memory (30), the processing means being operable to execute concurrent transactions attempting to concurrently access data stored in the memory (30), the memory controller (20) being effective to perform virtual address translation of virtual addresses received from the processing means into real addresses by reference to an inverted page table including entries having lock bits governing access to data blocks in the memory and having a transaction identification field (TID), the controller including a transaction register (52) to identify the transaction currently executing on the processing means, characterised in that each entry in the table includes a lock type variable (L) settable to indicate whether the lock bits are write locks or read locks, a read variable (A) settable to indicate allowance by any transaction of a read access, a variable (W) indicating a grant write and a variable (R) indicating a grant read, the controller being effective to provide a read access under the control of the read variable (A), the transaction register (52), the lock type variable (L) and the grant read variable (R), the controller being effective to provide a write access under the control of the transaction register (52), the lock type variable (L) and the grant write variable (W) and the controller being further effective to record in the lock bit data each access granted when the grant read (R) or the grant write (W) variable is set. A system as claimed in claim 1, wherein the access control fields contain entries capable of permitting read access to all blocks in the page and of specifying the identity of the transaction first established for the page since supervisor reset.

Inventors: CHANG ALBERT, COCKE JOHN, MERGEN MARK FREDERICK, OEHLER RICHARD RAPHAEL, CHANG, ALBERT, COCKE, JOHN, MERGEN, MARK FREDERICK, OEHLER, RICHARD RAPHAEL
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1988
Main classification: G06F12
IPC codes: G06F12