Technique for tracking modifications to the contents of a region of memory - Patents.com
A hierarchical page table system with state information in last and intermediate descriptors efficiently tracks memory modifications, reducing redundant rendering and conserving resources by detecting unchanged data.
Patent Information
- Application Number
- JP2023540122
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-01-06
- Filing Date
- 2021-12-08
- Publication Date
- 2025-10-09
- Estimated Expiration
- 2041-12-08
AI Technical Summary
Existing systems struggle to efficiently determine whether data in a memory region has been modified since the last processing operation, leading to unnecessary rendering and increased bandwidth and energy consumption.
Implementing a hierarchical page table system with state information maintained in last and intermediate level descriptors, allowing efficient tracking of memory modifications by propagating state information through mid-level descriptors to reduce the need for redundant rendering operations.
This approach significantly reduces processing requirements and energy consumption by avoiding unnecessary rendering operations when no data changes are detected, thereby optimizing performance and resource usage.
Smart Images

Figure 0007752180000001 
Figure 0007752180000002 
Figure 0007752180000003
Abstract
Description
[Technical Field]
[0001] Described herein are techniques 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 can significantly reduce processing requirements 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.
[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 the previous rendering cycle. If so, 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 that the input data be rendered in each rendering cycle, and it is highly desirable to be able to detect, before 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 rendering altogether, thus providing 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 in the memory system by referencing 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 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 at a next level in the hierarchical arrangement; and 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 the contents of an associated region of memory is permitted, the page table update circuit being further configured to maintain the 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 the 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 configuration, a method for tracking modifications of contents of a region of memory includes utilizing address translation circuitry for translating a virtual address specified by a processing circuit into a corresponding physical address in a memory system by referencing 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 at 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 memory is permitted; and configuring the page table update circuit to further maintain state information in mid level descriptors provided in at least a subset of the mid level page tables, wherein for a given mid level descriptor for which state information is maintained, the page table update circuit is configured to update the state information of the given mid level descriptor from a clean state to a dirty state to indicate the 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 mid level descriptor.
[0007] In yet another exemplary configuration, the address translation means includes address translation means for translating a virtual address specified by the processing circuit into a corresponding physical address in the memory system by referencing 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 last 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 at a next level in the hierarchical arrangement; and page table updating means for maintaining state information in page table descriptors, 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, wherein the page table updating means is further configured to 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 the occurrence of the update from clean to dirty in the state information of any last level descriptor being accessed via the intermediate level descriptor. [Brief explanation 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. [Figure 2] FIG. 2 is a diagram illustrating a virtual address to physical address translation process. [Figure 3]1 illustrates a schematic diagram of a multi-level page table walk that includes a single-stage address translation process. [Figure 4A] 10 illustrates schematically 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. [Figure 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 schematically 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 illustrating 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 illustrating 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] FIG. 1 is 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] FIG. 1 is a diagram of a data processing system in accordance with an exemplary implementation. DETAILED DESCRIPTION OF THE INVENTION
[0009] According to one exemplary implementation, an apparatus is provided having address translation circuitry for translating a virtual address specified by a processing circuit into a corresponding physical address in a memory system, the address translation circuitry performing such translation by 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 several last level descriptors, each of which identifies address translation data for an associated region of memory. While the associated region of memory can be defined in various ways, in one exemplary implementation, each region of memory may include a page of memory.
[0011] Each mid-level page table includes several mid-level descriptors, each of which identifies intermediate address translation data used to identify an associated page table at the next level in the hierarchical structure.
[0012] Thus, using the supplied virtual address, the address translation circuitry can be configured to traverse multiple different levels in a hierarchy of page tables, starting with the 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 various forms, but according to the techniques described herein, it provides information regarding whether there have been any modifications 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 for 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 a clean state to a dirty state may vary depending on the implementation. For example, the update to a dirty state may occur before performing a write or as a result of performing a write.
[0014] While the clean state can take various 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. 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, for example, a block of memory that may be referenced by a GPU when attempting to render an image frame, it is possible in principle to traverse the hierarchy of page tables using address translation circuitry to identify each last level descriptor associated with a region of memory within the entire address range of interest. However, traversing the entire hierarchy of page tables to get to a last level descriptor is 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 one 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 descriptors accessed via that mid level descriptor.
[0017] It will be understood that in situations where the mid-level descriptor is at the penultimate level in the hierarchical arrangement and therefore identifies the last-level page table that contains the last-level descriptor, the last-level descriptor may be accessed via the mid-level descriptor. However, the last-level descriptor may also be considered to be accessed via the mid-level descriptor when the mid-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 mid-level descriptor in a given lower-level page table identifies an upper-level intermediate page table, and that upper-level intermediate page table provides an mid-level descriptor that identifies the last-level page table that contains the given last-level descriptor, the given last-level descriptor may still be accessed via the given mid-level descriptor, albeit via one or more intervening levels in the hierarchical arrangement of page tables.
[0018] Propagating this state information through one or more mid-level descriptors significantly increases the speed at which such state information can be referenced to determine whether any data within a specified memory address range has been modified. Considering the previous GPU example in which the GPU is attempting to read input data needed 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 in any of those identified mid-level descriptors does not indicate a clean state. Conversely, however, 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 one 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., the L0 level) may be considered inappropriate because, if an attempt were made to maintain state information at that level, the state information would transition to a dirty state very quickly and therefore may not provide useful information. Thus, the level at which state information is maintained may be tailored to a particular implementation. For example, some implementations may determine to maintain state information at only a single intermediate level, while other implementations may determine 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 a hierarchical configuration, 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 the 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 last 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 the state information in the intermediate level descriptors 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 the 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 when each intermediate level descriptor used to identify the given last 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 the 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 configuration 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, at one or more intermediate levels, no update is required if the associated intermediate level descriptor already indicates a dirty state.
[0023] In one 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 situations where the associated descriptors are already cached in the address translation cache storage, thus avoiding the need to perform a page table walk process in memory to identify the required descriptors. 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 a region of memory associated with a given last-level descriptor.
[0024] In one exemplary implementation, when 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 therefore 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 in which the address translation cache storage does not store 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 in which there is a cached copy of a given last level descriptor, but its state information indicates a clean state. Considering the page table update process performed by the page table update circuit, the presence of a required given last level descriptor in the address translation cache storage triggers the above-described 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 mid-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 last-level descriptors. In some implementations, only the last-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 an 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 intermediate level descriptors are cached in the intermediate descriptor cache, where a 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 various forms, but in one example is either the dirty state or the no-track state described above. The no-track state may occur, for example, when a page in memory is always marked as both readable and writable, and therefore the status information does not identify whether a modification has actually occurred. In particular, because any modification does not change the status information, it is not possible to infer based on the no-track state whether the associated memory page has been modified.
[0031] By referencing an intermediate descriptor cache to attempt to determine whether the intermediate descriptor cache 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 when 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 circuit 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] Once 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, cached copies of descriptors whose state information has been updated are typically updated or invalidated to ensure that the address translation circuitry does not see outdated descriptor information in future references to the contents of the address translation cache. Furthermore, 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 the 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 that 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 can be useful in influencing operations performed by any processing circuit that has access to those descriptors. In one exemplary implementation, the processing circuit is configured to reference the state information maintained in one or more of the intermediate level descriptors when determining the data processing operations to be performed by the processing circuit.
[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 the 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 the 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 when it is possible to avoid performing graphics rendering operations, which also provides 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 circuit may be issued by the processing circuit only if the current rendering cycle meets certain determined criteria. For example, input data to be processed may be considered “indirect state” in that it is not directly known by the processing circuit and must be retrieved from memory before rendering can occur, while other inputs for the current rendering cycle are known to the processing circuit and may be referred to as “direct state.” Such direct state may be specified, for example, by an input command triggering the rendering operation and / or may be provided in a register or command buffer before rendering begins. The division between direct state and indirect state may vary depending on the GPU architecture, but by way of example, such direct state may be information describing how many render targets there are, how many samples there are per pixel, a pointer to a resource table containing 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; therefore, meeting the determined criteria mentioned 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 last level descriptor may further include access flags that are 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 the last level descriptors accessed through that intermediate level descriptor have their 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 that is referenced by the page table update circuitry to determine at which level of the hierarchy the status information is maintained. This therefore 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 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 memory 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 into a corresponding physical address in 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 enables the virtual address to be translated into a physical address, and the full address translation data may be stored in the address translation cache 30. In 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 more detail below, the address translation cache, in one exemplary implementation, may include an additional cache structure that stores partial address translation data (also referred to herein as intermediate address translation data) obtained with reference to one or more intermediate level descriptors.
[0042] As shown generally in FIG. 1, when processing circuitry 10 issues a virtual address to address translation circuitry 20, control circuitry 25 may perform a lookup operation in address translation cache 30 to determine whether a hit is found within one of the address translation cache's entries. In one embodiment, the address translation cache has a set-associative structure, where 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 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 memory system 15 to access the required instruction or data to be manipulated. If a hit is not found within the address translation cache, address translation circuitry 20 may initiate a page table walk process to access the associated page table 35 in the memory system, walking through the sequence of descriptors until the final level descriptor is obtained, at which point the full address translation data may be determined and the 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 address translation data derived from the accessed descriptor, which likely allows subsequently issued virtual addresses to be hit in the address translation cache, thereby reducing access time.
[0043] FIG. 2 is a diagram illustrating the address translation process. A virtual address 50 can be thought of as including a number of bits 55 that identify a virtual page number and several other bits 60 that identify a page offset. The number of bits forming the virtual page number and the number of bits forming the page offset depend on the page size. The address translation operation performed by address translation circuitry 20 is represented diagrammatically by element 65 in FIG. 2 and functions to obtain sufficient address translation information so that the virtual page number bits 55 can be converted into equivalent bits 70 in a physical address 80 that identify a physical page number. The page offset bits are not modified; accordingly, the page offset bits 75 are determined directly from the page offset bits 60 in the virtual address.
[0044] 3 is a diagram illustrating 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, a base register is accessed to identify a base address 110 used to identify a page table 115. The nine bits 105 associated with level 0 of the page table walk process are used to identify an index into that page table 115, thus identifying a mid-level descriptor 117. This mid-level descriptor 117 provides a base address 120 used to identify a further page table 130, and level 1 virtual address bits 125 are used to identify an index into that table. This identifies a mid-level descriptor 132, which provides a further base address 135 for identifying a page table 145. Level 2 virtual address bits 140 are then used to provide an index into that table 145 to identify a mid-level descriptor 147, which in turn provides a base address 150 that identifies a final page table 160. 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 in TLB 30, which allows the virtual page number 55 to be converted to 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, 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 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, with the mid-level descriptor in a level 0 page table being used to identify a level 1 page table, the mid-level descriptor in the level 1 page table being used to identify a level 2 page table, and so on, so that at the penultimate level, the mid-level descriptor in that level's page table is used to identify a last-level page table. The last-level descriptor in such last-level page table then identifies the associated memory region, e.g., a page in memory.
[0048] 4A illustrates information that may be provided within a descriptor. In particular, 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, etc. 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 descriptors. Additionally, 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, if desired, the access state indication, within at least a subset of intermediate page tables within a hierarchy 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 maintain the state information when a particular change is made within the state information within the last-level descriptor, and also to ensure that the change is 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 intermediate level descriptors 147, 132 are configured to maintain that state information, the page table update circuitry will determine whether any updates were required to the corresponding state held in those intermediate level descriptors. This process could, in principle, be repeated all the way down to the level 0 intermediate level descriptors, such as the intermediate 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 the first bit referred to as a dirty bit modified (DBM) bit and the second bit referred to as a permission bit. If the DBM bit is a logic-0 value and the permission bit is a logic-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, if the permission bit is set (i.e., a logic-1 value in this exemplary implementation) and the DBM bit is clear (i.e., a logic-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 next the situation in which 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. Specifically, 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 the 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, its contents are assumed to be modified.
[0053] The above description is made with reference to the meaning of the update state information when provided in association with 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 a last level descriptor may also maintain corresponding state information in intermediate level descriptors provided to at least one of the intermediate levels of the page table hierarchy. Of particular interest are 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 clean to dirty to indicate the occurrence of an update from clean to dirty 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 page table 160 have their state information changed from clean to dirty, the corresponding update state information in page table 147 is updated to indicate the 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 therefore, 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 in 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 a 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 within one or more intermediate level descriptors, and in a manner similar to that described above with reference to update state information, an 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 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 update state information is maintained in the intermediate level descriptor, although it will be understood that similar techniques may also be used to manage the maintenance of access state information in such intermediate level descriptors.
[0057] 1, the address translation circuit 20 includes the aforementioned page table update circuit 35 used to perform updates to page table contents, which updates include update state information and, optionally, updates to 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 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, although 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 initially received from processing circuit 10 by address translation circuit 20, it is typically not known what update state value is stored in the associated last level descriptor. Therefore, a lookup in address translation cache 30, followed by the necessary page table walk process to obtain the last level descriptor for the associated page being accessed, may be performed. 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. However, for purposes of the following discussion, it will be assumed that all such additional checks have passed, and step 250 determines whether the last level descriptor for the associated page indicates a clean state.
[0061] In situations where the last level descriptor indicates a clean state, the process proceeds to step 260. Prior to the present technique, such updated state information would typically exist only in the last level descriptor, and the page table update circuitry would be configured to change the state within 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 configured to maintain state information, the page table update circuitry ensures that state information is set to indicate a dirty state. It will be understood 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 because 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 several ways in which step 260 of Figure 5 can be implemented, and in particular the relative timing at which intermediate level descriptors are updated relative to updates made to 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, and then in step 305, a page table descriptor for level i is identified. As is evident from the above-described Figure 3, 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] Step 310 then determines whether the identified descriptor is configured to track update state information. In one exemplary implementation, such tracking typically does not occur at level L0, but instead may occur only at one or more of the higher levels. Further, it will be appreciated that if the identified descriptor is a last-level descriptor, it is configured to track update state information, but for the various intermediate levels, this may depend on a predetermined 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, for example, is 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, the parameter i is incremented by 1 in step 330 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 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.
[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 clean to dirty.
[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 not-tracked state), step 375 is bypassed. Similarly, if it determines that the identified descriptor is not configured to track update state information, steps 370 and 375 are bypassed.
[0071] Step 380 determines whether the identified descriptor is in the level 0 page table, and if not, step 385 considers the identified descriptor 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 the 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 that is tracking dirty / clean state information, this can be referenced in step 380, and if the identified descriptor is at that lowest level, the yes path from step 380 can be followed, thereby allowing such implementations to exit the process of Figure 7 earlier.
[0072] 6, once all of the page table descriptors have been updated, the original request to update the page in memory can 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 page tables 35 in 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 page tables 35 in memory system 15. As discussed above, use of the address translation cache 30 can speed up the process of performing virtual-to-physical address translations in response to requests from processing circuitry 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 page table update circuitry 35 when attempting to determine which descriptors require their state information to be updated.
[0074] 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 for the identified last level descriptor, i.e., the last level descriptor that points to the memory page seeking to be accessed by the request issued from the processing circuit. If there is a hit, then in step 425 it is determined whether the status information for that 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 necessary. In particular, since the last level descriptor is already in a dirty state, it can be assumed that the necessary updates to the intermediate level descriptors 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, particularly with respect 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 updating 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 descriptor, but also analyze the intermediate level descriptors and update their state accordingly. When performing step 440, any of the techniques discussed above with reference to Figure 6 or Figure 7 can be used.
[0077] However, if step 435 determines that a Walk Cache exists, then the last level descriptor is treated as the current descriptor in step 445. 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, it is determined 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 be considered. Instead, a page table walk process can be used to not only update the state of the last-level descriptor, but also analyze any intermediate-level descriptors between the identified descriptor and the last-level descriptor and update their state 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; if not, then 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 mid-level descriptors and update their state accordingly.
[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 inadvertently 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 technique 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 circuit to affect specific operations being performed. One particular exemplary use case is that of a graphics rendering operation, in which the processing circuit 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. Therefore, it may be considered impractical to perform a page table walk operation to identify each last-level descriptor and attempt to determine whether any of the data within the memory address range has been indicated as modified by referencing the status information maintained in the last-level descriptor. 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 circuit 20 to attempt to determine that information. In particular, the address translation circuit 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, 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 processing that may be performed in an example 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 immediate state for the new graphics rendering cycle is the same as the immediate state used for the last rendering cycle. The immediate state is state that is directly available to the GPU, such as may be provided in one or more registers or a command buffer before rendering begins. Examples of such immediate state may be information describing how many render targets there are, how many samples there are per pixel, etc.
[0086] If the immediate state of the new graphics rendering cycle does not match the immediate state 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 state 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 in step 505, the GPU can issue a request to address translation circuitry 20 specifying a memory address range. In step 510, address translation circuitry 20 can 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 find 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 untracked. 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 result in significant performance benefits by avoiding the need to perform intensive rendering tasks. This also results in 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-buffering 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 common to use many rendering passes (a standardized graphical API concept) within each frame.
[0091] FIG. 11 is a block diagram illustrating an exemplary system including several CPUs 600, 615, and a GPU 620. These components may be coupled via an interconnect 635 to a memory 645, which may include the previously mentioned page table 650. The previously mentioned address translation circuit 20 may take the form of a memory management unit (MMU) located in one or several locations within the system. For example, considering the CPU 600, it may include a processing circuit 605 with an associated MMU 610 for performing address translation on behalf of the processing circuit. The CPU 615 may be similarly configured, although 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 also be configured to incorporate the page table update functionality described 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 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 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, within interconnect 635. The interconnect may also include snoop circuitry, which, in one exemplary implementation, may be considered to form part of shared cache 640 to maintain coherency between cache contents within the various caches of the system.
[0093] As previously mentioned, when updates are made to the state information maintained in the various intermediate and last level descriptors in page table 650, any cached contents of those associated descriptors in any of the MMU's address translation cache components 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 that is capable of performing a defined operation. In this context, "configuration" refers to a method of arranging or interconnecting 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 illustrative 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 skilled 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 structure of page tables, the hierarchical structure 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 the 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 the hierarchical configuration; 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 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 one 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 the 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 the contents of the associated page table at the next level in the hierarchical arrangement is permitted; the page table update circuitry is configured to, upon each intermediate level descriptor for which state information is maintained that is used to identify the given last level descriptor, identify 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. An 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. An apparatus according to any one of claims 1 to 3.
6. further comprising an address translation cache storage for storing copies of one or more descriptors retrieved from said hierarchy 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. An 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 descriptors 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 the 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 last level descriptor whose state information indicates the 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 either a copy of a non-clean state intermediate level descriptor used to identify the given last 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 the 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. The apparatus of claim 1, wherein the region of memory is a memory page.
17. 4. The apparatus of claim 1, wherein the state information in each last level descriptor further includes an access flag that is set to indicate that the associated region of memory has been accessed, and wherein the state information maintained in the given intermediate level descriptor further includes an access flag that is set whenever any last level descriptor accessed through that intermediate level descriptor has its access flag set to indicate an access to the associated region 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 in 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 configuration of page tables, the hierarchical configuration 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; structuring 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 one 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 the 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, the 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; 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 the hierarchical arrangement; page table update means for maintaining state information within each last level descriptor, the page table update 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 one 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 descriptors being accessed via the intermediate level descriptor.
Citation Information
Patent Citations
Memory managing device
JP1993241965A
Allocating physical pages to sparse datasets in virtual memory without page faults
JP2019521453A
Method for locating metadata
US20200242047A1
Methods and systems for translating virtual addresses in a virtual memory based system
US20210165743A1