Technique for tracking modifications to the contents of a region of memory - Patents.com
Patent Information
- Application Number
- JP2023540122
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-01-06
- Filing Date
- 2021-12-08
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-12-08
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] SUMMARY Techniques are described herein for tracking modifications to the contents of a region of memory.
[0002] There are many situations in which it may be useful to determine whether any modifications have been made to an area of memory when performing data processing operations. For example, a processing circuit may be required to perform a processing operation on data stored within a range of memory addresses, and if it can determine that the data has not been changed since the processing operation was last performed on data values within that memory address range, the processing requirements can be significantly reduced.
[0003] As a specific example, a graphics processing unit (GPU) may be requested to perform a graphics rendering operation on a block of data identified by a memory address range. Such a process may be used to generate one or more image frames for storage in an associated frame buffer. Often, a frame is divided into tiles, and rendering operations are performed on individual tiles. As tiles are rendered, it may be possible to determine whether the rendered tile differs from the corresponding tile rendered in a previous rendering cycle. If different, some bandwidth savings may be achieved by avoiding the need to write the newly rendered tile to the associated frame buffer.
[0004] However, such an approach still requires the input data to be rendered at each rendering cycle, and it is highly desirable to be able to detect, prior to rendering, whether any of the input data has changed since the previous rendering cycle. In particular, if such a determination can be made, in some circumstances it may be possible to avoid performing the rendering altogether, thus resulting in significant performance benefits and / or energy consumption savings. Summary of the Invention
[0005] In one exemplary configuration, the address translation circuitry includes: an address translation circuit for translating a virtual address specified by the processing circuit into a corresponding physical address of the memory system by reference to address translation data obtained from a hierarchical arrangement of page tables, the hierarchical arrangement of page tables including both mid level page tables and last level page tables, each last level page table including a number of last level descriptors, each last level descriptor identifying address translation data for an associated region of the memory, and each mid level page table including a number of mid level descriptors, each mid level descriptor identifying intermediate address translation data used to identify an associated page table in a next level in the hierarchical arrangement; An apparatus is provided comprising: a page table update circuit that maintains state information in last level descriptors, the page table update circuit being configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of contents of an associated region of memory is permitted, the page table update circuit being further configured to maintain state information in intermediate level descriptors provided in at least a subset of the intermediate level page tables, and for a given intermediate level descriptor for which state information is maintained, the page table update circuit is configured to update the state information of the given intermediate level descriptor from a clean state to a dirty state to indicate occurrence of the update from the clean state to the dirty state in the state information of any last level descriptor being accessed via the intermediate level descriptor.
[0006] In another exemplary arrangement, a method of tracking modifications of contents of a region of memory includes utilizing an address translation circuit for translating a virtual address specified by a processing circuit into a corresponding physical address of a memory system with reference to address translation data obtained from a hierarchical arrangement of page tables, the hierarchical arrangement of page tables including both intermediate level page tables and last level page tables; configuring each last level page table to include a number of last level descriptors, each last level descriptor identifying address translation data for an associated region of memory; and configuring each intermediate level page table to include a number of intermediate level descriptors, each intermediate level descriptor identifying intermediate address translation data used to identify an associated page table in a next level in the hierarchical arrangement. and utilizing a page table update circuit that maintains state information in each last level descriptor, the page table update circuit being configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of an associated region of the memory is permitted; and configuring the page table update circuit to further maintain state information in intermediate level descriptors provided in at least a subset of the intermediate level page tables, wherein for a given intermediate level descriptor for which state information is maintained, the page table update circuit is configured to update the state information of the given intermediate level descriptor from a clean state to a dirty state to indicate occurrence of the update from the clean state to the dirty state in the state information of any last level descriptor being accessed via the intermediate level descriptor.
[0007] In yet another exemplary configuration, the address translation means includes: address translation means for translating a virtual address designated by the processing circuitry into a corresponding physical address of the memory system by reference to address translation data obtained from a hierarchical arrangement of page tables, the hierarchical arrangement of page tables being intermediate level page tables and last level page tables, each last level page table including a number of intermediate level descriptors, each last level descriptor identifying address translation data for an associated area of the memory, and each intermediate level page table including a number of intermediate level descriptors, each intermediate level descriptor identifying intermediate address translation data used to identify an associated page table in a next level in the hierarchical arrangement; and page table updating means for maintaining state information in the intermediate level page tables, the page table updating means being configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of the memory is permitted, wherein the page table updating means is further configured to further maintain state information in intermediate level descriptors provided in at least a subset of the intermediate level page tables, and wherein, for a given intermediate level descriptor for which state information is maintained, the page table updating means is configured to update the state information of the given intermediate level descriptor from a clean state to a dirty state to indicate occurrence of the update from the clean state to the dirty state in the state information of any last level descriptor being accessed via the intermediate level descriptor. [Brief description of the drawings]
[0008] The present technique will now be further described, by way of example only, with reference to examples of the technique illustrated in the accompanying drawings, in which: [Figure 1] 1 illustrates a data processing system according to an exemplary configuration. [Diagram 2] FIG. 2 is a diagram illustrating a virtual to physical address translation process. [Diagram 3]1 illustrates a schematic diagram of a multi-level page table walk that includes a single stage address translation process. [Figure 4A] 1 illustrates generally information that may be provided in a descriptor according to one exemplary implementation; [Figure 4B] The updated state information that may be provided within such a descriptor is detailed below. [Diagram 5] FIG. 1 is a flow diagram illustrating a process performed in accordance with the techniques described herein when a request is received to update a page in memory whose associated last level descriptor indicates a clean state. [Figure 6] 6 is a flow diagram illustrating in more detail the steps performed in one exemplary implementation to perform the final step of FIG. 5. [Figure 7] 6 is a flow diagram detailing the steps performed in an exemplary alternative implementation to perform the final step of FIG. 5. [Figure 8] 2A-2C illustrate schematic diagrams of different caching structures that may be provided within the address translation cache of FIG. 1 according to an exemplary implementation; [Figure 9A] A flow diagram is provided that illustrates how cached copies of descriptors provided in an address translation cache may be used when determining which descriptors need to be updated, according to one exemplary implementation. [Figure 9B] A flow diagram is provided that illustrates how cached copies of descriptors provided in an address translation cache may be used when determining which descriptors need to be updated, according to one exemplary implementation. [Figure 10] A flow diagram illustrating how the techniques described herein may be used to help reduce the rendering workload of a graphics processing unit, according to an example implementation. [Figure 11] 1 is an illustration of a data processing system in accordance with an exemplary implementation. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] According to one exemplary implementation, an apparatus is provided having address translation circuitry for translating a virtual address specified by a processing circuitry to a corresponding physical address of a memory system, the address translation circuitry performing such translation with reference to address translation data obtained from a hierarchical arrangement of page tables, the hierarchical arrangement of page tables including both intermediate level page tables and last level page tables.
[0010] Each last level page table includes a number of last level descriptors, each of which identifies address translation data for an associated region of memory. Although the associated region of memory may be defined in a variety of ways, in one exemplary implementation, each region of memory may include a page of memory.
[0011] Each mid level page table includes a number of mid level descriptors, each of which identifies intermediate address translation data that is used to identify an associated page table at the next level in the hierarchical arrangement.
[0012] Thus, using the supplied virtual address, the address translation circuitry can be configured to traverse multiple different levels of a hierarchical arrangement of page tables, starting with a page table at the lowest hierarchical level, often referred to as level L0, and continuing until a last level page table is identified. A portion of the virtual address is used to identify a particular last level descriptor within that last level page table, which in turn identifies a particular region of memory.
[0013] According to the techniques described herein, the page table update circuitry is configured to maintain state information within each last level descriptor. This state information may take a variety of forms, but according to the techniques described herein, it provides information regarding whether there has been any modification to the contents within the associated region of memory identified by the last level descriptor. The page table update circuitry is configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of memory is permitted. The update of the state information to a dirty state may be performed, for example, when a write is permitted to occur within the associated region of memory, and the exact timing of the update from the clean state to the dirty state may vary depending on the implementation. For example, the update to the dirty state may occur before performing a write or as a result of performing a write.
[0014] While the clean state may take a variety of forms, in one exemplary implementation, when the state information indicates a clean state, this indicates that the associated region of memory is currently read-only, but may be modified to allow writing to that associated region of memory upon request from the processing circuitry, and thus, when such a request is received, this may be used to trigger a transition of the state information from a clean state to a dirty state.
[0015] Returning to the aforementioned problem of how to determine when modifications have been made to the contents within a block of memory, e.g., a block of memory that may be referenced by a GPU when attempting to render an image frame, it is in principle possible to utilize address translation circuitry to traverse the page table hierarchy to identify each last level descriptor associated with a region of memory within the entire address range of interest. However, traversing the entire page table hierarchy to get to the last level descriptors may be time consuming, and there may be a significant number of last level descriptors that need to be accessed to cover the entire address range of interest and determine whether any of them have state information indicating a dirty state.
[0016] However, in accordance with the techniques described herein, the page table update circuitry is further configured to maintain state information in mid level descriptors provided in at least a subset of the mid level page tables. In particular, for a given mid level descriptor for which state information is maintained, the page table update circuitry may be configured to update the state information of the given mid level descriptor from a clean state to a dirty state to indicate that an update from a clean state to a dirty state has occurred in the state information of any final level descriptor accessed via that mid level descriptor.
[0017] It will be appreciated that in situations where an intermediate level descriptor is at the penultimate level in a hierarchical arrangement and thus identifies a last level page table that contains the last level descriptor, the last level descriptor may be accessed via the intermediate level descriptor. However, the last level descriptor may also be considered to be accessed via the intermediate level descriptor when the intermediate level descriptor is at another lower level in the hierarchy separated from the last level by one or more intervening levels. By way of example only, if a given intermediate level descriptor in a given lower level page table identifies an upper level intermediate page table that provides an intermediate level descriptor that identifies a last level page table that contains the given last level descriptor, the given last level descriptor may still be accessed via the given intermediate level descriptor, albeit via one or more intervening levels of the hierarchical arrangement of page tables.
[0018] By propagating this state information through one or more mid-level descriptors, the speed at which such state information can be referenced to determine whether any data within a specified memory address range has been modified is greatly increased. Considering the previous GPU example in which the GPU is attempting to read input data required to render one or more image frames during a current rendering cycle, a relatively large address range (comprising multiple pages in memory) may need to be reviewed. However, by propagating state information through a certain number of mid-level descriptors, it may be possible to identify a relatively small number of mid-level descriptors that require review, and in particular, determine that rendering is required if the state information of any of those identified mid-level descriptors does not indicate a clean state. However, conversely, if all of the relevant mid-level descriptors covering the specified address range indicate a clean state, it may be known that no updates have been performed within the specified memory address range, and in such a case, it may be possible to avoid performing a rendering operation.
[0019] Thus, we have found that by propagating state information through one or more mid-level descriptors, this can provide an efficient mechanism for checking whether content within a relatively wide address range has changed, thus making reference to such state information a practical proposition in various exemplary scenarios when attempting to detect whether content within a range of memory addresses has changed.
[0020] In an exemplary implementation, the hierarchical arrangement of page tables includes multiple levels of page tables, and at least one subset of the intermediate level page tables for which the page table update circuitry is configured to maintain state information includes intermediate level page tables at at least one level of the hierarchical arrangement. Thus, in such an implementation, the page table update circuitry may be configured to maintain state information at certain intermediate levels in the hierarchy, but not necessarily at all such levels. In some examples, for example, maintaining state information at the lowest level (i.e., L0 level) may not be considered appropriate because if an attempt was made to maintain the state information at that level, the state information may transition to a dirty state very quickly and thus not provide useful information. Thus, the level at which the state information is maintained may be tailored to a particular implementation. For example, in some implementations, it may be determined to maintain state information only at a single intermediate level, while in other implementations, it may be determined to maintain state information at multiple intermediate levels, but not necessarily at all intermediate levels. If state information is maintained at multiple intermediate levels, these multiple intermediate levels may be adjacent levels in the hierarchical arrangement, although non-adjacent levels may alternatively be selected.
[0021] There are several different ways in which the page table update circuitry may determine when to transition state information in an intermediate level descriptor from a clean state to a dirty state, particularly with respect to the timing relative to when an associated final level descriptor is updated from a clean state to a dirty state. According to a first exemplary implementation, sometimes referred to as a top-down approach, the page table update circuitry may be configured to maintain state information in an intermediate level descriptor such that an identification of a dirty state in the state information of a given intermediate level descriptor indicates that modification of the contents of the associated page table at the next level in the hierarchical configuration is permitted. As a result, the page table update circuitry is configured to update the state information of a given final level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of memory is permitted when each intermediate level descriptor used to identify the given final level descriptor for which the state information is maintained identifies a dirty state in its state information. Thus, according to such an approach, it will be understood that setting a dirty state in a given intermediate level descriptor is a prerequisite for enabling a transition from a clean state to a dirty state in any descriptor at a higher level in the hierarchy, including the associated final level descriptor and any intervening level descriptors between a given intermediate level descriptor and that final level descriptor.
[0022] However, according to an alternative implementation, sometimes referred to as a bottom-up approach, the page table update circuitry may be configured, in response to updating the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of memory is permitted, to trace back up the levels in the hierarchical arrangement to identify each intermediate level descriptor used to identify that last level descriptor, and to update the state information as necessary to indicate a dirty state for each identified intermediate level descriptor for which state information is maintained. It will be appreciated that, in one or more intermediate levels, no updating is required if the associated intermediate level descriptor already indicates a dirty state.
[0023] In an exemplary implementation, the apparatus may further comprise an address translation cache storage for storing copies of one or more descriptors retrieved from the hierarchical arrangement of page tables. This may improve performance when attempting to perform an address translation operation in a situation where the relevant descriptor is already cached in the address translation cache storage, and thus may avoid the need to perform a page table walk process in memory to identify the required descriptor. In such an implementation, the page table update circuitry may be configured to reference the address translation cache storage when determining which page table descriptors require updating when attempting to update the contents in the region of memory associated with a given last level descriptor.
[0024] In one exemplary implementation, if the address translation cache storage stores a copy of a given last level descriptor whose state information indicates a dirty state, the page table update circuitry is configured to determine that no update is required for the page table descriptor in the hierarchical arrangement of page tables. In particular, updates to the state information in the associated intermediate level descriptor are performed when the last level descriptor is transitioned from a clean state to a dirty state, and thus no update is required when a last level descriptor that is already in a dirty state is encountered.
[0025] However, if there is no address translation cache storage that stores a copy of a given final level descriptor whose state information indicates a dirty state, the page table update circuitry may be configured to determine that an analysis operation is required with respect to the intermediate level descriptors used to identify the given final level descriptor to determine whether state information maintained for any of those intermediate level descriptors needs to be updated in addition to updating the state information of the given final level descriptor from a clean state to a dirty state.
[0026] It will be appreciated that there are various situations where there is no address translation cache storage that stores a copy of a given last level descriptor whose state information indicates a dirty state. For example, there may be no cached copy of a given last level descriptor stored in the address translation cache storage at all. However, in addition, there may be cases where there is a cached copy of a given last level descriptor, but whose state information indicates a clean state. Considering the page table update process performed by the page table update circuit, the presence in the address translation cache storage of a required given last level descriptor triggers the above-mentioned analysis operation, since its state information is indicated as clean, but is effectively treated as a miss in the address translation cache storage.
[0027] Performing the analysis operation may require performing a page table walk process to access the necessary intermediate level descriptors in memory, but in some cases it may be possible to perform at least a portion of the analysis operation using information maintained in the address translation cache storage.
[0028] In one exemplary implementation, the address translation cache storage comprises a translation lookaside buffer that stores copies of one or more final level descriptors. In some implementations, only the final level descriptors may be cached, but in alternative implementations, the address translation cache storage may further include an intermediate descriptor cache (also referred to as a walk cache) that stores copies of intermediate level descriptors from page tables at one or more intermediate levels in the hierarchical arrangement of page tables. When the address translation cache storage includes an intermediate descriptor cache, at least some of the analysis operations described above may be performed with reference to the contents of the address translation cache storage.
[0029] In particular, in one exemplary implementation, if there is no translation lookaside buffer storing a copy of a given final level descriptor whose state information indicates a dirty state, the page table update circuit is configured to perform a lookup operation in the intermediate descriptor cache to attempt to trace back the levels in the hierarchical configuration until a copy of a non-clean state intermediate level descriptor used to identify the given final level descriptor is found or a lookup operation has been performed for all levels in the hierarchical configuration for which the intermediate level descriptor is cached in the intermediate descriptor cache, where the non-clean state intermediate level descriptor is an intermediate level descriptor whose state information indicates a non-clean state.
[0030] The not-clean state can take a variety of forms, but in one example is either the dirty state or the not-tracked state described above. The not-tracked state may arise, for example, when a page in memory is always marked as both readable and writeable, and thus the status information does not identify whether a modification has actually occurred. In particular, it is not possible to infer based on the not-tracked state whether the associated memory page has been modified, since any modification does not change the status information.
[0031] By referencing an intermediate descriptor cache to attempt to determine whether it stores an associated intermediate level descriptor in a non-clean state, this can be used to reduce the number of levels that need to be considered in determining which intermediate level descriptors require an update of their state information. In particular, if during a lookup operation a copy of a non-clean state intermediate level descriptor used to identify a given final level descriptor is detected, the page table update circuitry is configured to identify any intermediate level descriptors used to identify the given final level descriptor that exist at a level between the level containing the non-clean state intermediate level descriptor and the final level containing the given final level descriptor, and then identify a dirty state in the state information maintained by any of those identified intermediate level descriptors.
[0032] When the contents of the address translation cache are used as described above to attempt to identify which intermediate level descriptors need to be updated in addition to the final level descriptors, typically cached copies of the descriptors whose status information has been updated are updated or invalidated to ensure that the address translation circuitry does not see stale descriptor information in future references to the contents of the address translation cache. Additionally, known coherency / synchronization techniques may also be used to ensure that cached copies of associated descriptors maintained elsewhere in the system are updated or invalidated when the page table update circuitry updates status information for those descriptors. According to one exemplary scheme, the local cached copy of each updated descriptor (i.e., the copy in the address translation cache referenced by the page table update circuitry) is updated. Additionally, each updated descriptor is written to memory and any other cached copies of each updated descriptor held elsewhere in the system are invalidated so that the next time the descriptor is needed, the updated version is read from memory. The coherency protocol is configured to enforce strict ordering between steps to ensure that the updated descriptor is used in all instances.
[0033] As previously mentioned, by maintaining status information in the intermediate level descriptors, this may be useful in influencing operations performed by any processing circuitry that may have access to those descriptors. In one exemplary implementation, when determining data processing operations to be performed by the processing circuitry, the processing circuitry is configured to reference the status information maintained in one or more of the intermediate level descriptors.
[0034] As a particular example, the processing circuit may be configured to periodically perform graphics rendering operations on a block of data identified by a memory address range. In such an implementation, the processing circuit may be configured to issue a request to the address translation circuit to cause the address translation circuit to identify a set of regions of memory covered by the memory address range if at least a current rendering cycle satisfies a determined criterion, determine one or more intermediate level descriptors to be used to identify a final level descriptor for the set of regions of memory, and reference state information stored in the determined one or more intermediate level descriptors to determine whether an update to the block of data has occurred since the previous rendering cycle. If it is determined that no update to the block of data has occurred since the previous rendering cycle, the processing circuit is configured to use an output of the graphics rendering operation in the previous rendering cycle instead of re-performing the graphics rendering operation.
[0035] It will be appreciated that such an approach can provide significant performance and energy consumption benefits, particularly where it is possible to avoid performing graphics rendering operations, which may also provide additional benefits, for example, by avoiding the need to read input data that would otherwise be required for the current graphics rendering cycle.
[0036] As mentioned above, in some implementations, a request to the address translation circuitry may be issued by the processing circuitry only if the current rendering cycle meets certain determined criteria. For example, the input data to be processed may be considered an "indirect state" in that it is not directly known by the processing circuitry and must be retrieved from memory before rendering can occur, whereas other inputs for the current rendering cycle are known to the processing circuitry and may be referred to as a "direct state". Such direct states may be specified, for example, by input commands triggering the rendering operation and / or provided in a register or command buffer before rendering begins. The division between direct and indirect states may vary depending on the GPU architecture, but by way of example, such direct states may be information describing how many render targets there are, how many samples there are per pixel, pointers to resource tables that contain pointers to buffers, etc. In one exemplary implementation, this direct state must match the direct state in the previous rendering cycle before the current rendering cycle is a candidate for skipping the rendering operation, and thus meeting the determined criteria referred to above involves determining that this direct state matched the direct state of the previous rendering cycle.
[0037] The state information described above may also include additional items of state. For example, the state information in each final level descriptor may further include an access flag that is set to indicate that the associated region of memory has been accessed, and the state information maintained in a given intermediate level descriptor may further include access flags that are set whenever a final level descriptor accessed through that intermediate level descriptor has its access flags set to indicate an access to the associated region of memory. In some instances, it may be useful to propagate such access flag information through the intermediate level descriptors.
[0038] Which level of the page table hierarchy is used to maintain the status information may be fixed or configurable. In one exemplary implementation, the device further comprises storage that maintains control information referenced by the page table update circuitry to determine which level of the hierarchy to maintain the status information at. This thus allows for configurability of the mechanism.
[0039] A specific example will now be described with reference to the figures.
[0040] 1 shows a schematic diagram of a data processing system comprising a processing circuit 10 (which may be, for example, a central processing unit (CPU) or a graphics processing unit (GPU)) for executing program instructions and performing data accesses (both instruction fetches and accesses to data to be operated on) using virtual addresses VA. These virtual addresses undergo address translation by an address translation circuit 20 into physical addresses PA. The physical addresses are used to control access to instructions and data in a memory system 15. The memory system 15 may comprise a memory hierarchy such as multiple levels of cache memories and main memory or other non-volatile storage.
[0041] As shown in FIG. 1, the address translation circuit 20 includes an address translation cache 30, which in one example may include at least a translation lookaside buffer (TLB). The address translation cache 30 has a plurality of entries, each of which stores address translation data used in translating a virtual address to a corresponding physical address of the memory system. The address translation data is determined by performing a page table walk operation on a page table 35 stored in the memory system 15. As described below with reference to FIG. 3, a multi-level page table walk process may be used to obtain full address translation data that allows the virtual address to be translated into a physical address by referring to a final level descriptor, and the full address translation data may be stored in the address translation cache 30. Taking the example where the address translation cache is a TLB, the TLB is typically used to store such full address translation data. However, as described in detail below, the address translation cache may include a further cache structure that stores partial address translation data (also referred to herein as intermediate address translation data) obtained by referring to one or more intermediate level descriptors in an exemplary implementation.
[0042] As shown generally in FIG. 1, when the processing circuitry 10 issues a virtual address to the address translation circuitry 20, the control circuitry 25 may perform a lookup operation in the address translation cache 30 to determine whether a hit is found within one of the entries of the address translation cache. In one embodiment, the address translation cache has a set associative structure, and certain bits of the virtual address may be used as an index into the address translation cache to identify a set, and the entries within that set are reviewed to determine whether a hit is found. If a hit is found, a translation response may be returned directly to the processor core 10, including the physical address bits and associated attributes stored within the hit entry in the address translation cache. Based on this information, the core may then generate and output a physical address to the memory system 15 to access the required instruction or data to be manipulated. If a hit is not found within the address translation cache, the address translation circuitry 20 may begin a page table walk process to access the associated page table 35 in the memory system, walking through the sequence of descriptors until a final level descriptor is obtained, at which point the full address translation data may be determined and an appropriate translation response may be returned to the core. During this process, one or more entries in the address translation cache 30 may be allocated to store the address translation data derived from the accessed descriptor, which likely allows a subsequently issued virtual address to be hit in the address translation cache, thereby reducing access time.
[0043] FIG. 2 is a schematic diagram of the address translation process. A virtual address 50 can be considered to include a number of bits 55 that identify a virtual page number and a number of other bits 60 that identify a page offset. The number of bits that form the virtual page number and the number of bits that form the page offset depend on the page size. The address translation operation performed by the address translation circuitry 20 is shown diagrammatically by element 65 in FIG. 2 and serves to obtain sufficient address translation information so that the virtual page number bits 55 can be translated into equivalent bits 70 in a physical address 80 that identify a physical page number. The page offset bits are not modified and accordingly the page offset bits 75 are determined directly from the page offset bits 60 in the virtual address.
[0044] 3 is a schematic diagram of a page table walk operation assuming there is a single stage address translation mechanism in use. In this example, the virtual address is assumed to be 48 bits, so virtual address 100 has a series of 9-bit portions associated with different levels of the page table walk process, with the 12 least significant bits indicating the page offset.
[0045] At the start of the page table walk process, the base register is accessed to identify a base address 110 used to identify a page table 115. The 9 bits 105 associated with level 0 of the page table walk process are used to identify an index into that page table 115, and thus an intermediate level descriptor 117. This intermediate level descriptor 117 provides a base address 120 used to identify a further page table 130, and the level 1 virtual address bits 125 are used to identify an index into that table. This identifies an intermediate level descriptor 132, which provides a further base address 135 to identify a page table 145. The level 2 virtual address bits 140 are then used to provide an index into that table 145 to identify an intermediate level descriptor 147, which in turn provides a base address 150 that identifies a final page table 160. The level 3 virtual address bits 155 then provide an index into that table 160, which identifies a final level descriptor 162, also referred to as a page descriptor or leaf descriptor. Using the information provided by the page descriptor, address translation data can be generated for storage in one of the entries of TLB 30, which allows the virtual page number 55 to be translated into a physical page number 70, and therefore the required page in memory to be identified. This allows the particular data item (or instruction) corresponding to the virtual address to be accessed by core 10, which issues the required physical address to memory system 15.
[0046] Note that in some implementations, the last level descriptor can be specified at an earlier level in the page table walk process. For example, the descriptor 147 can have a block field that, when set, indicates that the descriptor is a block descriptor, which is a type of last level descriptor, rather than an intermediate level descriptor. Thus, in such a situation, the information in the descriptor 147 can be used to generate the full address translation data.
[0047] From the above description, it will be seen that page tables are organized in a hierarchical configuration, where an intermediate level descriptor in a level 0 page table is used to identify a level 1 page table, an intermediate level descriptor in the level 1 page table is used to identify a level 2 page table, and so on, until the penultimate level, an intermediate level descriptor in that level's page table is used to identify a last level page table. A last level descriptor in such last level page table then identifies an associated memory region, e.g., a page in memory.
[0048] 4A illustrates information that may be provided within a descriptor. In particular, the descriptor 200 may include a valid field 205 that identifies whether the contents of the descriptor are valid, various attribute fields 210, and an address translation data field 230. In the case of an end-level descriptor, the address translation data 230 identifies an associated region in memory, e.g., an associated page in memory. In the case of an intermediate level descriptor, the address translation data is instead intermediate address translation data that may be used to identify an associated page table at the next level in the hierarchy of page tables.
[0049] Within the last level descriptor, the attributes 210 in one exemplary implementation include update state information 215, access state indications or flags 220, and one or more other attributes 225, such as access permissions, memory type attributes, and the like. In one exemplary implementation, the attributes 225 may be provided only in the last level descriptor, or only a subset thereof may be replicated in the intermediate level descriptor. In addition, in accordance with the techniques described herein, a page table update circuit 35 (see FIG. 1) is provided that can maintain at least the update state information, and also the access state indication if desired, within at least a subset of intermediate page tables in a hierarchical arrangement of page tables, e.g., within intermediate level descriptors provided within page tables at one or more intermediate levels. In particular, the page table update circuit is configured to ensure that when a particular change is made within that state information within the last level descriptor, the change is also reflected in any intermediate level descriptors used when accessing the last level descriptor, such that the change is configured to maintain the state information and is also reflected in any intermediate level descriptors used when accessing the last level descriptor.
[0050] Thus, by way of example only, if the page table update circuitry determines that it is appropriate to update particular state information in the last level descriptor 162, then if either or both of the mid level descriptors 147, 132 are configured to maintain that state information, then the page table update circuitry will determine whether any updates were required to the corresponding state held in those mid level descriptors. This process could in principle be repeated all the way up to the level 0 mid level descriptors, such as the mid level descriptor 117, although in some implementations it may be deemed inappropriate to attempt to replicate such state information at such a lower level in the hierarchy.
[0051] 4B illustrates the form of update status information 215 used in one particular exemplary implementation. As illustrated, update status information 215 includes a two-bit field, with a first bit referred to as a dirty bit modified (DBM) bit and a second bit referred to as a permission bit. When the DBM bit is a logical 0 value and the permission bit is a logical 0 value, this means that the associated memory region pointed to by the last level descriptor containing that update status information is read-only. Conversely, when the permission bit is set (i.e., a logical 1 value in this exemplary implementation) and the DBM bit is clear (i.e., a logical 0 value in this exemplary implementation), this means that the associated region of memory is readable and writable, but no tracking is performed as to whether a write was actually performed.
[0052] Considering now the situation where the DBM bit is set, if the permission bit is 0, this means that the associated memory region is read-only and is considered to be in a clean state. In particular, when the update state information has this form, it means that the contents of the associated memory region have not been written. However, in contrast to the "00" read-only state of the update state information, the clean state indicates a state in which the associated memory region is permitted to transition to a read-write state in response to an appropriate request to transition to a read-write state, for example by a request issued by a processing circuit seeking to write to the associated memory region. In this case, the DBM bit remains set, but the permission bit transitions from a clear state to a set state, thereby indicating that the memory page is currently in a dirty state, and the memory page is both readable and writable. Thus, the transition from the clean state to the dirty state indicates that modification of the contents of the associated region of memory is currently permitted, and when the associated memory region is in a dirty state, it is assumed that its contents have been modified.
[0053] The above description is made with reference to the meaning of the update state information when provided in relation to a last level descriptor. As previously mentioned, in accordance with the techniques described herein, the page table update circuitry used to manage the update state information in the last level descriptor may also maintain corresponding state information in an intermediate level descriptor provided to at least one of the intermediate levels of the page table hierarchy. Of particular interest are the clean and dirty states, and in particular, the page table update circuitry is configured to update the state information in a given intermediate level descriptor from a clean state to a dirty state to indicate the occurrence of an update from the clean state to the dirty state in the state information of any last level descriptor accessed via that intermediate level descriptor.
[0054] Thus, considering as an example an intermediate level descriptor 147 that is used to point to a page table 160 and is therefore used when accessing any of the last level descriptors in that page table 160, if any of the last level descriptors in the page table 160 have their state information changed from a clean state to a dirty state, the corresponding update state information in the page table 147 is updated to indicate a dirty state.
[0055] This process can be repeated throughout any desired levels in the hierarchical configuration. Thus, considering mid level descriptor 132, it is used to identify page table 145, and thus, if the state information of any of the mid level descriptors in page table 145 is updated from a clean state to a dirty state, then its updated state information of mid level descriptor 132 will also be changed from a clean state to a dirty state, assuming it is not already in a dirty state.
[0056] Considering the access state flag 220 that may be maintained in association with the final level descriptor, this access state flag may be set to indicate that the associated region of memory has been accessed. If desired, this state information may be maintained in the intermediate level descriptors of one or more intermediate levels, and in a manner similar to that described above with reference to the update state information, the access flag in a given intermediate level descriptor may be set whenever any final level descriptor accessed through that intermediate level descriptor sets an access flag indicating an access to the associated region of memory. In some instances, it may be useful to maintain the access state information in the intermediate level descriptor in addition to the update state information, while in other implementations only the update state information may be duplicated in the intermediate level descriptor. The following description describes in more detail how the update state information is maintained in the intermediate level descriptor, although it will be appreciated that similar techniques may also be used to manage the maintenance of access state information in such intermediate level descriptors.
[0057] Returning to Figure 1, the address translation circuit 20 includes the aforementioned page table update circuit 35 that is used to perform updates to the page table contents, including updates to update state information and, optionally, access state information. The access state information is maintained in the final level descriptor and in intermediate level descriptors at any level at which such information is replicated. In one exemplary implementation, the intermediate level at which the update state information is replicated may be fixed, but in other examples, this intermediate level may be configurable, for example, with reference to control information 40 stored within the system that identifies at which intermediate level the page table update circuit should maintain update state information.
[0058] For purposes of discussion herein, it is assumed that the page table update circuitry 35 is a component located within the address translation circuitry 20, however, in alternative implementations it may be possible to provide the page table update circuitry as a separate component from the address translation circuitry. However, it may be more efficient to provide the page table update circuitry 35 within the address translation circuitry 20 because the page table update circuitry is typically activated in response to a write operation to a page, and the address translation circuitry 20 receives requests from the processing circuitry 10 related to the write operation that may be used to trigger activation of the page table update circuitry 35.
[0059] FIG. 5 is a flow diagram illustrating a state information update process performed in accordance with the techniques described herein. Step 250 detects whether a request has been received from a processing circuit attempting to update a page whose associated last level descriptor indicates a clean state. Such a request may be issued, for example, due to software executing on the processing circuit, and when the request is first received by the address translation circuit 20 from the processing circuit 10, it is typically not known what update state value is stored in the associated last level descriptor. Thus, a lookup in the address translation cache 30 may be performed, followed by the necessary page table walk process to obtain the last level descriptor of the associated page being accessed. Once the last level descriptor is accessed, the update state information may be checked to determine whether the last level descriptor indicates a clean state.
[0060] It should also be noted that other checks may also be performed at this stage to check that the received write request is permitted to proceed in relation to the identified memory page, and thus, for example, to check that the processing circuitry in the current execution mode is permitted to access the identified memory address, but for purposes of the following discussion, it will be assumed that all such additional checks have been passed, and step 250 determines whether the last level descriptor for the associated page indicates a clean state.
[0061] In the situation where the last level descriptor indicates a clean state, the process proceeds to step 260. Prior to the present technique, such update state information would typically only exist in the last level descriptor, and the page table update circuitry would be configured to change the state in that last level descriptor from clean to dirty. However, as shown in step 260, in addition to such an update to the last level descriptor, the page table update circuitry is also configured to identify the intermediate level descriptor used to identify that last level descriptor. For each of those intermediate level descriptors that are configured to maintain state information, the page table update circuitry ensures that state information is set to indicate a dirty state. It will be appreciated that while this may involve transitioning the state from clean to dirty for some intermediate level descriptors, for some intermediate level descriptors no update may be required since they may already indicate a dirty state due to a different last level descriptor accessed using that intermediate level descriptor that previously transitioned from clean to dirty.
[0062] There are a number of ways in which step 260 of FIG. 5 can be implemented, and in particular the relative timing at which the intermediate level descriptors are updated relative to updates made to the final level descriptors may be varied.
[0063] Figure 6 is a flow diagram illustrating a first option for implementing the final step of Figure 5, which may also be referred to as a top-down approach. In step 300, a parameter i is set equal to 0, then in step 305, a page table descriptor for level i is identified. As is evident from Figure 3 described above, this identification of the page table descriptor is performed using the base address of the page table for level i and the portion of the provided virtual address specified by the request received in step 250 of Figure 5.
[0064] Thereafter, step 310 determines whether the identified descriptor is configured to track update state information. In one exemplary implementation, such tracking may not typically occur at level L0, but instead may occur only at one or more of the higher levels. Further, it will be appreciated that while if the identified descriptor is a last level descriptor, it is configured to track update state information, for the various intermediate levels this may depend on a predefined configuration of the page table hierarchy, or may depend on control data such as specified by control information 40 shown in FIG. 1.
[0065] If, in step 310, it is determined that the identified descriptor is configured to track update state information, then in step 315 it is determined whether the update state information currently indicates a clean state. If so, then in step 320 the update state information is updated to indicate a dirty state. Conversely, if the update state information does not currently indicate a clean state, and thus is, for example, already marked as dirty or in a not-tracking state, then the state is not changed and step 320 is bypassed. Similarly, if, in step 310, it is determined that the identified descriptor is not tracking update state information, then steps 315 and 320 are bypassed.
[0066] In step 325 it is determined whether there are more levels to consider, and if so, in step 330 the parameter i is incremented by 1 and the process returns to step 305 .
[0067] Once all levels have been considered, the page table descriptor update process is determined to be complete in step 335. In one exemplary implementation, once all of the page table descriptors have been updated, the original request to update the page in memory is allowed to proceed. In some implementations, to avoid the occurrence of a race condition, it may be possible to start the update of the page in memory earlier while ensuring that the update of the page table descriptors is completed before the page update is considered complete.
[0068] Figure 7 is a flow diagram illustrating an alternative approach, also referred to herein as a bottom-up approach, that may be used to implement the final step of Figure 5. Step 350 updates the state in the last level descriptor from a clean state to a dirty state.
[0069] Following step 350, in step 355, the last level descriptor is considered to be the current descriptor. In step 360, the page table update circuitry is then configured to identify the next lowest level descriptor that points to the page table containing the current descriptor. Thus, as an example, if the last level descriptor whose state was changed from clean to dirty in step 350 is descriptor 162, then step 360 is used to identify intermediate level descriptor 147 that points to page table 160 containing last level descriptor 162.
[0070] Step 365 determines whether the identified descriptor is configured to track update state information, and if so, step 370 determines whether the update state information in that descriptor currently indicates a clean state. If so, step 375 updates the state to a dirty state. Similar to Figure 6 described above, if step 370 determines that the update state information does not currently indicate a clean state (e.g., because it is already in a dirty or non-tracking state), then step 375 is bypassed. Similarly, if it is determined that the identified descriptor is not configured to track update state information, then steps 370 and 375 are bypassed.
[0071] Step 380 determines whether the identified descriptor is in a level 0 page table, and if not, then in step 385 the identified descriptor is considered to be the current descriptor, after which the process returns to step 360. However, if step 380 determines that the currently identified descriptor is in a level 0 page table, the process proceeds to step 390 and the page table descriptor update process is considered complete. In an alternative implementation, if configuration information is available to indicate the lowest level at which dirty / clean state information is being tracked, this can be referenced in step 380, and if the identified descriptor is at that lowest level, then a yes path out of step 380 can be followed, thereby allowing an earlier exit from the process of FIG. 7 in such an implementation.
[0072] Similar to the description of Figure 6, once all of the page table descriptors have been updated, the original request to update the page in memory is allowed to proceed. In some implementations, to avoid a race condition occurring, it may be possible to start updating the page in memory earlier while ensuring that the page table descriptor updates are completed before the page update is considered complete.
[0073] FIG. 8 illustrates the configuration of the address translation cache 30 of FIG. 1 in one exemplary implementation. As shown in FIG. 8, the address translation cache includes a TLB 400 that is used to cache last level descriptors obtained from the page tables 35 in the memory system 15. However, optionally, the address translation cache 30 may also include an intermediate descriptor cache 410, also referred to herein as a walk cache, that is used to cache intermediate level descriptors retrieved from the page tables 35 in the memory system 15. As discussed above, the use of the address translation cache 30 may speed up the process of performing virtual to physical address translations in response to requests from the processing circuit 10. In addition, as will be described in more detail with reference to FIGS. 9A and 9B, the address translation cache may also be used by the page table update circuit 35 when attempting to determine which descriptors require their state information to be updated.
[0074] As shown in FIG. 9A, the page table update circuit 35 may perform a lookup in the address translation cache, particularly the TLB 400, to determine whether there is a hit on the identified last level descriptor, i.e., the last level descriptor pointing to the memory page seeking to be accessed by the request issued by the processing circuit. If there is a hit, then in step 425 it is determined whether the status information of the cached copy indicates dirty. If so, the process proceeds to step 430, where it is determined that no update of the page table descriptor is required. In particular, since the last level descriptor is already in a dirty state, it may be assumed that the necessary updates to the intermediate level descriptor have already been performed.
[0075] However, if the cached copy is determined not to indicate a dirty state in step 425 or there is no hit in the TLB found in step 420, the process proceeds to step 435. Note that with particular reference to the "no" path from step 425, if a cached copy of the last level descriptor is found but its state indicates a clean state, this is effectively treated as a miss for purposes of the page table update process, since it must be determined whether any intermediate level descriptors may also require an update of their state information to a dirty state in addition to the updates performed for the last level descriptor.
[0076] In step 435 it is determined whether a walk cache exists, and if not the process proceeds to step 440 where the page table walk process described above is used to not only update the state of the final level descriptors, but also analyze the intermediate level descriptors and update their state accordingly. In performing step 440, any of the techniques discussed above with reference to Figure 6 or Figure 7 may be used.
[0077] However, if in step 435 it is determined that a Walk Cache exists, then in step 445 the last level descriptor is treated as the current descriptor. Then in step 450 a lookup is performed in the Walk Cache to see if there is a copy of the next lowest level descriptor that points to the page table containing the current descriptor. This next lowest level descriptor is referred to herein as the identified descriptor.
[0078] Following step 450, as shown in FIG. 9B, in step 455, it is determined whether there was a hit in step 450, and if there was a hit, whether the identified descriptor has a status indicating a dirty or untracked state. If so, the process can proceed to step 460, where it is determined that no lower level descriptors need to be considered. Instead, a page table walk process can be used to not only update the state of the final level descriptor, but also to analyze any intermediate level descriptors between the identified and the final level descriptor and update their states accordingly. As with step 440, the process of FIG. 6 or FIG. 7 described above can be used at this point.
[0079] If in step 455 the identified descriptor does not have a state indicating a dirty or untracked state, then in step 465 it is determined whether the identified descriptor is in a level 0 page table, and if not, in step 470 the identified descriptor is considered to be the current descriptor, after which the process returns to step 450.
[0080] However, if the identified descriptor is in a level 0 page table, the process proceeds to step 475, where the process proceeds to step 440 of Figure 9A. Notably, at this point a full page table walk is required to analyze the intermediate level descriptors and update their state appropriately.
[0081] From the above discussion, it can be seen that by referencing the address translation cache, the page table update circuit 35 can reduce the amount of analysis required to determine which intermediate level descriptors need to be updated, and therefore reduce the number of levels that need to be traversed during a page table walk to update the associated descriptors.
[0082] When the address translation cache contents are used in this manner to attempt to identify which intermediate level descriptors need to be updated in addition to the final level descriptors, in one exemplary implementation, cached copies of descriptors whose state information is being updated can be updated or invalidated to ensure that the address translation circuitry does not erroneously reference stale descriptor information when performing future address translations, and to ensure that the page table update circuitry 35 does not reference stale cached information when attempting to determine the required updates to subsequent page table descriptors.
[0083] Furthermore, it will be appreciated that in some systems such address translation information may be cached by multiple entities within the system, and in such situations any suitable coherency techniques may be used to ensure that cached copies of associated descriptors that may be stored elsewhere within the system are updated or invalidated when the page table update circuitry updates the status information for those descriptors.
[0084] By maintaining status information in the mid-level descriptors, coherency techniques can be used by the processing circuitry to affect certain operations being performed. One particular exemplary use case is that of a graphics rendering operation, where the processing circuitry may be a GPU and may be configured to periodically perform graphics rendering operations on blocks of data identified by memory address ranges. The memory address ranges may be relatively large, and in particular may span a significant number of memory pages. Thus, it may be considered impractical to perform a page table walk operation to identify each final level descriptor and to attempt to determine whether any of the data within the memory address range is indicated as modified by referencing the status information maintained in the final level descriptors. However, by maintaining such information in the mid-level descriptors in the manner described herein, it becomes economically feasible for the graphics processing unit to issue requests to the address translation circuitry 20 to attempt to determine that information. In particular, the address translation circuitry may be able to identify a relatively small number of mid-level descriptors that cover the address range of interest and check the updated status information maintained in those mid-level descriptors. If the update state information in all relevant intermediate descriptors indicates a clean state, then it is known that no updates have been performed, and in some instances this makes it possible to avoid rendering operations instead of utilizing the rendering output from the previous rendering cycle.
[0085] 10 is a flow diagram illustrating a process that may be performed in an exemplary implementation when a new graphics rendering cycle is encountered. In step 500, when a new graphics rendering cycle is encountered, the graphics processing unit determines in step 505 whether the direct state of the new graphics rendering cycle is the same as the direct state used for the last rendering cycle. The direct state is the state that is directly available to the GPU, for example, as may be provided in one or more registers or a command buffer before rendering begins. An example of such direct state may be information describing how many render targets there are, how many samples there are per pixel, etc.
[0086] If the immediate states of the new graphics rendering cycle do not match the immediate states of the last cycle, regardless of whether the input data to be processed is different, the process instead proceeds to step 530, where it is determined that rendering needs to be performed in the current graphics rendering cycle for the memory address range of interest. Thus, the required data is read from memory and then rendering is performed on that data using the immediate states to control the operations to be performed.
[0087] However, if the immediate state of the new graphics rendering cycle is the same as the last cycle, then the new graphics rendering cycle becomes a candidate for avoiding rendering if it can be determined that none of the data to be processed has changed since the last rendering cycle.
[0088] Thus, if the direct conditions match at step 505, the GPU may issue a request to the address translation circuitry 20 specifying the memory address range. At step 510, the address translation circuitry 20 may then identify a set of regions of memory that cover the memory address range. Note that in one exemplary implementation, there may be only one input buffer used in a graphics rendering cycle, but in some implementations, there may be multiple input buffers. Typically, a contiguous address range is associated with each input buffer, and thus step 510 may be performed for the memory address range associated with each input buffer.
[0089] In step 515, the address translation circuit 20 can determine the mid-level descriptors that cover the set of identified regions, and in particular can look for the lowest level mid-level descriptor that maintains state information and covers the set of identified regions. Next, in step 520, the mid-level descriptors can be retrieved and their state information can be referenced. Next, in step 525, it can be determined whether any of the state information in these mid-level descriptors is marked as dirty or not tracked. If so, the process proceeds to step 530, where it is determined that rendering needs to be performed in the current graphics rendering cycle for the associated memory address range. However, if instead all of the state information in the associated mid-level descriptors is marked as clean, then in step 535, it is determined that no rendering is required in the current graphics rendering cycle for the memory address range of interest. This can provide significant performance benefits by avoiding the need to perform intensive rendering tasks. This also provides energy consumption benefits. Furthermore, in addition to avoiding rendering in such situations, data may not need to be read from memory, providing further efficiency savings.
[0090] Note that the number of frames processed in each rendering cycle can vary depending on the implementation. For example, each rendering cycle may perform rendering for one frame, but modern operating systems may allow double- or triple-buffering of the display output, so that a rendering cycle may process two frames in a double-buffered system, or three frames in a triple-buffered system. Furthermore, it is also common to use many rendering passes (a standardized graphical API concept) within each frame.
[0091] FIG. 11 is a block diagram illustrating one exemplary system including several CPUs 600, 615 and a GPU 620. These components may be coupled via an interconnect 635 to a memory 645 that may include the page table 650 mentioned above. The address translation circuitry 20 mentioned above may take the form of a memory management unit (MMU) located at one or several locations in the system. Considering the CPU 600 for example, this may include a processing circuit 605 having an associated MMU 610 for performing address translation on behalf of the processing circuitry. The CPU 615 may be similarly configured, but for simplicity, the internal details of the CPU 615 have been omitted. The GPU 620, on the other hand, may utilize a system MMU (SMMU) 625, which may again be configured to incorporate the page table update functionality discussed above. In some implementations, the GPU may also include its own internal MMU 630, which may be used in combination with the SMMU 625 to perform address translation on behalf of the GPU. For example, the GPU may use a multi-stage address translation process where each stage includes multiple levels, in which case a stage 1 address translation may be performed by MMU 630 to convert a virtual address to an intermediate physical address, and then SMMU 625 may be used to perform a stage 2 address translation to convert the intermediate physical address to a final physical address in memory 645.
[0092] 11, some of the components may have their own local caches, such as caches 612, 617 associated with CPUs 600, 615, respectively, and in addition, one or more shared caches 640 may also be provided, for example, in the interconnect 635. The interconnect may also include snoop circuitry, which in one exemplary implementation may be considered to form part of the shared cache 640, to maintain coherency between cache contents in the various caches of the system.
[0093] As previously mentioned, when updates are made to state information maintained in the various intermediate and last level descriptors in page table 650, any cached contents of their associated descriptors in any address translation cache component of the MMU may need to be invalidated or updated to ensure that stale descriptor information is not erroneously referenced. Any suitable coherency mechanism may be used to implement such functionality.
[0094] In this application, the term "configured to..." is used to mean that an element of an apparatus has a configuration capable of performing a defined operation. In this context, "configuration" refers to a method of arrangement or interconnection of hardware or software. For example, an apparatus may have dedicated hardware that provides the defined operation, or a processor or other processing device may be programmed to perform the function. "Configured to" does not imply that an apparatus element needs to be modified in any way to provide the defined operation.
[0095] Although exemplary embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it will be understood that the invention is not limited to those precise embodiments, and that various changes, additions, and modifications may be made by those of ordinary skill in the art without departing from the scope and spirit of the invention as defined by the appended claims. For example, various combinations of the features of the following dependent claims may be made with the features of the independent claims without departing from the scope of the invention.
Claims
1. An address translation circuit for translating a virtual address designated by a processing circuit into a corresponding physical address of a memory system by referring to address translation data obtained from a hierarchical configuration of page tables, the hierarchical configuration of the page tables being an intermediate level page table and a final level page table, each last level page table includes a number of last level descriptors, each last level descriptor identifying said address translation data for an associated region of memory; an address translation circuit including both an intermediate level page table and a final level page table, each intermediate level page table including a number of intermediate level descriptors, each intermediate level descriptor identifying intermediate address translation data used to identify an associated page table at a next level in said hierarchical arrangement; a page table update circuit for maintaining state information in each last level descriptor, the page table update circuit being configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of memory is permitted; the page table update circuitry is further configured to maintain the state information in the mid level descriptors provided in at least a subset of the mid level page tables, and for a given mid level descriptor for which the state information is maintained, the page table update circuitry is configured to update the state information of the given mid level descriptor from the clean state to the dirty state to indicate occurrence of an update from the clean state to the dirty state in the state information of any final level descriptor accessed via the mid level descriptor.
2. 2. The apparatus of claim 1, wherein the hierarchical arrangement of page tables includes multiple levels of page tables, and the at least one subset of the mid-level page tables for which the page table update circuitry is configured to maintain the state information includes the mid-level page tables of at least one level of the hierarchical arrangement.
3. 3. The apparatus of claim 2, wherein the at least one subset of the mid-level page tables includes the mid-level page tables in one or more adjacent levels of the hierarchical configuration.
4. the page table update circuitry is configured to maintain the state information in the mid level descriptors such that an identification of the dirty state in the state information of the given mid level descriptor indicates that modification of contents of the associated page table of the next level in the hierarchical arrangement is permitted; the page table update circuitry is configured to, upon each intermediate level descriptor maintaining the state information used to identify the given last level descriptor identifying the dirty state in the state information, update the state information of the given last level descriptor from the clean state to the dirty state to indicate that modification of the contents of the associated region of memory is permitted.
4. Apparatus according to any one of claims 1 to 3.
5. the page table update circuitry is configured, in response to updating the state information of the given last level descriptor from the clean state to the dirty state to indicate that modification of the contents of the associated region of memory is permitted, to trace back through the levels in the hierarchical arrangement to identify each intermediate level descriptor used to identify the last level descriptor, and to update the state information as necessary to indicate the dirty state for each identified intermediate level descriptor for which state information is maintained.
4. Apparatus according to any one of claims 1 to 3.
6. an address translation cache storage for storing copies of one or more descriptors retrieved from said hierarchical arrangement of page tables; the page table update circuitry is configured to reference the address translation cache storage when determining which page table descriptors need to be updated when attempting to update contents within the memory region associated with the given last level descriptor; 4. Apparatus according to any one of claims 1 to 3.
7. 7. The apparatus of claim 6, wherein when the address translation cache storage stores a copy of the given last level descriptor whose state information indicates the dirty state, the page table update circuitry is configured to determine that no update is required for the page table descriptor in the hierarchical arrangement of page tables.
8. 7. The apparatus of claim 6, wherein if there is no address translation cache storage storing a copy of the given last level descriptor whose state information indicates the dirty state, the page table update circuitry is configured to determine that an analysis operation is required with respect to the intermediate level descriptor used to identify the given last level descriptor to determine whether state information maintained for any of those intermediate level descriptors needs to be updated in addition to updating the state information of the given last level descriptor from the clean state to the dirty state.
9. 7. The apparatus of claim 6, wherein the address translation cache storage includes a translation lookaside buffer for storing copies of one or more last level descriptors.
10. 10. The apparatus of claim 9, wherein the address translation cache storage further comprises an intermediate descriptor cache that stores copies of intermediate level descriptors from page tables at one or more intermediate levels in a hierarchical arrangement of page tables.
11. 11. The apparatus of claim 10, wherein if there is no translation lookaside buffer storing a copy of the given final level descriptor whose state information indicates the dirty state, the page table update circuitry is configured to perform a lookup operation in the intermediate descriptor cache to attempt to trace back the levels in the hierarchical configuration until either a copy of a non-clean state intermediate level descriptor used to identify the given final level descriptor is found or the lookup operation is performed for all levels in the hierarchical configuration for which an intermediate level descriptor is cached in the intermediate descriptor cache and a non-clean state intermediate level descriptor is an intermediate level descriptor whose state information indicates a non-clean state.
12. The apparatus of claim 11 , wherein the non-clean state is one of a dirty state or a no-track state.
13. 12. The apparatus of claim 11, wherein if during the lookup operation a copy of a non-clean state intermediate level descriptor used to identify the given final level descriptor is detected, the page table update circuitry is configured to identify any intermediate level descriptors used to identify the given final level descriptor that exist at a level between the level containing the non-clean state intermediate level descriptor and the final level containing the given final level descriptor, and then identify the dirty state in the state information maintained by any of those identified intermediate level descriptors.
14. 2. The apparatus of claim 1, wherein the processing circuitry is configured to reference the state information maintained in one or more of the intermediate level descriptors when determining data processing operations to be performed by the processing circuitry.
15. the processing circuitry is configured to periodically perform graphics rendering operations on blocks of data identified by memory address ranges; the processing circuitry is configured, if at least a current rendering cycle satisfies a determined criterion, to issue a request to the address translation circuitry to cause the address translation circuitry to identify a set of regions of memory covered by the memory address range, to determine one or more intermediate level descriptors to be used to identify the final level descriptor for the set of regions of memory, and to reference the state information stored in the determined one or more intermediate level descriptors to determine whether an update to the block of data has occurred since a previous rendering cycle; if it is determined that no update of the block of data has occurred since the previous rendering cycle, the processing circuitry is configured to use an output of the graphics rendering operation in the previous rendering cycle instead of re-performing the graphics rendering operation.
15. The apparatus of claim 14.
16. 4. Apparatus according to claim 1, wherein the region of memory is a memory page.
17. 4. The apparatus of claim 1, wherein the state information in each final level descriptor further includes an access flag that is set to indicate that the associated area of memory has been accessed, and the state information maintained in the given intermediate level descriptor further includes an access flag that is set whenever any final level descriptor accessed through that intermediate level descriptor has their access flag set to indicate an access to the associated area of memory.
18. 4. The apparatus of claim 3, further comprising storage for maintaining control information referenced by said page table update circuitry to determine at which level of said hierarchy said state information is maintained.
19. 1. A method for tracking modifications to the contents of a memory region, comprising: utilizing an address translation circuit for translating a virtual address designated by a processing circuit into a corresponding physical address of a memory system by referring to address translation data obtained from a hierarchical arrangement of page tables, the hierarchical arrangement of page tables including both an intermediate level page table and a last level page table; configuring each last level page table to include a number of last level descriptors, each last level descriptor identifying said address translation data for an associated region of memory; configuring each intermediate level page table to include a number of intermediate level descriptors, each intermediate level descriptor identifying intermediate address translation data used to identify an associated page table at a next level in said hierarchical arrangement; utilizing a page table update circuit that maintains state information within each last level descriptor, the page table update circuit being configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of memory is permitted; and further configuring the page table update circuitry to maintain the state information in the mid level descriptors provided in at least a subset of the mid level page tables, wherein for a given mid level descriptor for which the state information is maintained, the page table update circuitry is configured to update the state information of the given mid level descriptor from the clean state to the dirty state to indicate occurrence of an update from the clean state to the dirty state in the state information of any final level descriptor accessed via the mid level descriptor.
20. an address translation means for translating a virtual address designated by a processing circuit into a corresponding physical address of a memory system by referring to address translation data obtained from a hierarchical arrangement of page tables, said hierarchical arrangement of page tables being intermediate level page tables and last level page tables; each last level page table includes a number of last level descriptors, each last level descriptor identifying said address translation data for an associated region of memory; an address translation means including both intermediate level page tables and final level page tables, each intermediate level page table including a number of intermediate level descriptors, each intermediate level descriptor identifying intermediate address translation data used to identify an associated page table at a next level in said hierarchical arrangement; a page table updating means for maintaining state information within each last level descriptor, the page table updating means being configured to update the state information of a given last level descriptor from a clean state to a dirty state to indicate that modification of the contents of the associated region of memory is permitted; the page table updating means is further configured to further maintain the state information in the intermediate level descriptors provided in at least a subset of the intermediate level page tables, and for a given intermediate level descriptor for which the state information is maintained, the page table updating means is configured to update the state information of the given intermediate level descriptor from the clean state to the dirty state to indicate occurrence of an update from the clean state to the dirty state in the state information of any final level descriptor being accessed via the intermediate level descriptor.
