Methods used to locate metadata
By using the combination of spare bits in the page table structure to form metadata table pointers, the problems of low metadata positioning efficiency and large storage requirements in the existing technology are solved, and more efficient metadata positioning and storage are achieved, reducing the number of memory accesses .
Patent Information
- Application Number
- CN201880069004.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-11-02
- Filing Date
- 2018-10-11
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2039-04-21
AI Technical Summary
When locating metadata associated with addresses, the prior art needs to build an independent metadata tree structure, resulting in frequent memory access, large delay and increased storage requirements, and the spare bits in the page table entry are not enough to directly store metadata. Or a pointer to the address where metadata is stored.
The existing page table structure extracts the parts of at least two page table entries, combines or connects to form a pointer to the metadata table, thereby positioning the target metadata associated with a given address during the address conversion process, reducing memory access, Improve cache efficiency and increase metadata storage capacity.
By merging the parts of the page table entries to form metadata table pointers, the memory requirement is reduced, the overhead of traversing independent metadata trees is reduced, the efficiency of positioning metadata and cache efficiency is improved, and the additional overhead of building independent metadata trees is avoided.
Smart Images

Figure CN111279324B_ABST
Abstract
Description
Technical Field
[0001] The present technology relates to data processing. More specifically, the present technology relates to locating metadata associated with an address. Background Art
[0002] A location may be identified by an address. Some addresses corresponding to a location may be converted from a first address to a second address. For a software provider, it may be desirable to associate metadata with an address. Summary of the invention
[0003] At least some examples provide a method for locating metadata associated with a first address, the method comprising: accessing a page table structure, a page table entry of the page table structure providing address translation data for use in an address translation process to convert the first address to a second address; extracting portions of at least two page table entries in the page table structure; determining a pointer to a metadata table from the portions of the at least two page table entries; and locating target metadata associated with the first address from the metadata table using the pointer.
[0004] At least some examples provide a method for associating metadata with a first address, the method comprising: storing the metadata in a metadata table; determining a pointer to the metadata table, the pointer comprising two or more parts; and storing each of the two or more parts in a corresponding one of a first set of two or more page table entries of a page table structure, the page table entries of the page table structure providing address translation data for use in an address translation process to convert the first address to a second address.
[0005] At least some examples provide a computer program comprising instructions which, when executed, cause a data processing apparatus to perform any of the methods described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] The present invention will be further described, by way of illustration only, with reference to embodiments of the invention as shown in the accompanying drawings, in which:
[0007] Figure 1 An example of a data processing apparatus is schematically shown;
[0008] Figure 2 An example of a page table structure is shown, the page table structure including a page table with an associated metadata table;
[0009] Figure 3 An example of a page table walk performed to obtain a physical address from a virtual address is shown;
[0010] Figure 4An example of the format of a page table entry is shown;
[0011] Figure 5 shows how to extract a pointer to the metadata table from a page table entry;
[0012] Figure 6 An example is shown of how to extract a pointer from one of multiple blocks of a page table entry;
[0013] Figure 7 An example is shown of how to locate a page table entry of a portion storing a pointer from a first address;
[0014] Figure 8 An example of increasing the capacity of metadata associated with a page table is shown;
[0015] Fig. 9 A flow chart for extracting a pointer to a metadata table is shown;
[0016] Fig.10 A flow chart for storing a pointer to a metadata table in a page table is shown. DETAILED DESCRIPTION
[0017] Some specific examples will be discussed below. It will be understood that the present technology is not limited to these specific examples.
[0018] It may be desirable to associate metadata with an address. For example, metadata may include, for example, statistics related to accesses to a particular address (e.g., volume of accesses, access frequency, or access latency), and may be stored in a metadata storage structure. Another example of metadata may be cache hints annotated by software to aid in caching decisions. For example, metadata may be recorded on a per-page basis.
[0019] A method for locating metadata associated with a specific address in a metadata storage structure may be for performing a walkthrough of a metadata tree structure so that a location in the metadata storage structure where metadata for the specific address is stored may be found. The metadata tree structure may be independent of a page table used for address translation and may be traversed based on a specific address in a manner similar to a page table walkthrough. However, maintaining an independent tree structure for locating metadata in this manner is cumbersome and may cause significant delays when performing a traversal of the tree.
[0020] The present technology recognizes that, in examples that include address translation, an existing page table structure used for address translation can also be used to locate address-associated metadata for a given address in a metadata storage structure, even if the spare bits available in the page table entry for additional information (which is not directly used for address translation) are insufficient to store the metadata itself or an address pointer to another location where the metadata is stored.
[0021] The page table structure can store address translation data in a page table entry. When a given address is to be translated, the page table entry corresponding to the given address can be accessed to obtain address translation data for the address. The given address is then translated into another address using the address translation data. In some cases, the address translation data can be stored in several page tables organized in a hierarchy, each of which includes a plurality of page table entries. In this case, when a given address is to be translated, a page table walkthrough for the hierarchy can be performed, wherein the page table entries of each page table are accessed sequentially to obtain a pointer to a subsequent page table at the next level of the hierarchy. This process is repeated until the last level of the hierarchy is reached, in which the page table entry stores the translation data for the given address.
[0022] In one example, the present technology provides a method for locating metadata associated with a first address, the method comprising: accessing a page table structure, a page table entry of the page table structure providing address translation data for use in an address translation process to convert the first address to a second address; extracting a portion of at least two page table entries in the page table structure; determining a pointer to a metadata table from the portion; and locating target metadata associated with the first address from the metadata table using the pointer.
[0023] In order to exploit the properties of the page table structure to provide a more efficient method for locating metadata, the present technology extracts portions of at least two page table entries of the page table structure and determines a pointer for locating a metadata table from the portions. For example, the pointer may be determined by combining portions of at least two page table entries or by concatenating portions of at least two page table entries. Referencing the metadata table from the page table structure may be more efficient than constructing an independent metadata tree because metadata associated with the first address may be required when converting the first address to the second address, and thus some of the memory / cache accesses required to locate the relevant page table entries of the page table structure may have occurred for processing the address translation itself, rather than requiring a large number of memory accesses unrelated to the translation accesses to traverse the metadata tree structure, and also because of the possibility that the required items are stored in the cache, so that they can be retrieved more quickly. In addition, because the existing page table structure is used to locate a pointer to the metadata table from the first address, the present technology also reduces memory requirements because there is no need to allocate memory space for the upper layer of a separate metadata tree structure (although the leaf nodes of the metadata tree can still be provided and referenced from the page table structure using pointers, the non-leaf nodes of the metadata tree become redundant because the existing page table structure can be used to provide pointers identifying the location of the metadata table for a given address region).
[0024] This allows the metadata table to be referenced from the page table structure by merging parts extracted from multiple page table entries to form a metadata table pointer, even if there is little spare bit space available in each page table entry. This approach is unusual because typically each page table entry provides data that is independent of data stored in other page table entries in the page table, rather than breaking a single data value (the pointer) into multiple parts and storing them in multiple page table entries. While this may require accessing some page table entries corresponding to addresses other than the first address (these other addresses are not needed for address translation of the first address itself), the overhead may still be less than traversing a separate metadata tree.
[0025] In some examples, the using step also includes determining a target metadata location within the metadata table storing the target metadata from the pointer and the first address. For example, the determining step may include: determining a base location of the metadata table from the pointer; and determining a target metadata index from the first address, the target metadata index being used to index into the metadata table to access the target metadata location. In some examples, the page table structure includes multiple page tables at multiple levels, and the target metadata index is determined based on a target page table index of a target page table entry corresponding to the first address within a given page table at a given level. In this arrangement, there is a natural association between the index provided by the first address and the metadata at an equivalent location in the metadata table. Therefore, processing can be further simplified because two independent indexing processes are not required to index into the page table and the metadata table.
[0026] In some examples, the offset of the target metadata location relative to the metadata table is determined as a multiple of a portion of the target page table index. For example, the offset can be a multiple of the least significant portion of the target page table index. Since the physical memory space between indexes can be increased, this increases the capacity of metadata that can be stored in association with a given page table entry while also maintaining a one-to-one mapping between the metadata table and the index of the page table.
[0027] In some examples, the at least two page table entries correspond to a contiguous region of the first address space corresponding to the first address. This helps to reduce the number of memory accesses required to locate the at least two page tables containing the portion of the pointer and improve cache efficiency. For example, a cache line may be large and include multiple page table entries, so when a single page table entry is to be retrieved from memory and stored in a cache or TLB, many surrounding page table entries are also automatically retrieved and cached, even though there may not be an explicit indication. Therefore, when at least two page table entries correspond to a contiguous region of the address space, it is more likely that when one of the page table entries is cached, the other page table entries will also be cached. Even if caching is not performed, the number of memory accesses may still be reduced when using contiguous page table entries to store portions of a pointer.
[0028] In some examples, the page table structure includes multiple page tables, and the at least two page table entries and the target page table entry corresponding to the first address are within the same page table of the page table structure. In many cases, metadata associated with the target page table entry will be required at or about the same time as the access to the target page table entry is performed. Therefore, storing the at least two page table entries and the target entry in the same page table reduces the number of accesses to different page tables required to access the conversion data and the associated metadata. In some cases, the target page table entry itself may be one of the at least two page table entries accessed to obtain the pointer, but this may not be guaranteed to be the case for all first addresses.
[0029] In some examples, regardless of the relative position of the target page table entry within a given page table, the same entry is selected as the at least two page table entries. This simplifies processing because whenever the metadata table is to be located, the same at least two page table entries can be accessed by default.
[0030] In some other examples, depending on the relative position of the target page table entry within a given page table, at least two entries of different groups are selected as the at least two page table entries. Thus, multiple groups of at least two page table entries (and therefore multiple instances of metadata table pointers) may be included in a page table. Storing pointers in multiple different locations in the page table increases the likelihood that the pointer can be determined from a cached page table entry, thereby reducing the chance that additional memory access is required. In some cases, at least two page table entries of different groups may all point to the same metadata storage structure, where redundancy achieves improved cacheability. Alternatively, each group of at least two page table entries may each point to a different metadata storage structure, thereby allowing an entire metadata storage area of any size to be associated with any number of page table entries.
[0031] In some examples, a given page table includes multiple blocks of consecutive page table entries, and at least two entries are selected from the same block as the target page table entry. Therefore, the at least two entries and the target entry will be closer in the address space, which improves cache efficiency because it is more likely that the at least two entries and the target entry will be accessed at a relatively close point in time, and this chain effect makes it more likely that the at least two entries and the target entry will be cached together.
[0032] In some examples, the method further includes: determining an index indicating a location of a target page table entry in a given page table of the page table structure from the first address; and determining the location of the at least two page table entries in the given page table from the index. This provides a simple and efficient method of locating the target page table entry and the at least two page table entries from a single index of the first address.
[0033] In some examples, the index is rounded at an intermediate bit position of the index to identify the location of the at least two page table entries in the given page table. Assuming that the indices provided by different addresses will correspond to different blocks of the page table, rounding the index at the intermediate bit position will provide a rounded index corresponding to one of the blocks of the page table. The at least two page table entries can then be those at the least significant end of the block. In this way, multiple sets of pointer locations (one for each block) can be provided in the table so that redundant versions of the same pointer can be provided in each block to improve cacheability, or multiple independent pointers can be provided for each block to increase the capacity of the metadata storage device.
[0034] In some examples, the page table structure includes a plurality of page tables organized in levels, the at least two page table entries including a page table entry of a last level page table of the page table structure, the last level page table providing address mapping information for identifying the second address corresponding to the first address. In such an arrangement, a higher level page table entry provides a pointer to a subsequent page table until a last level page table is reached, in which a pointer to a page in a memory is provided. Thus, a higher level page table is associated with a plurality of pages in a memory, and a specific page corresponding to a given address is determined based on how the subsequent page table is indexed. However, the page table entry of the last level page table has a one-to-one correspondence with a page in a memory. Therefore, by locating a pointer from the last level page table, it can be assumed that there is a per-page association between a first address and metadata subsequently accessed.
[0035] Metadata can be stored in a page table entry of a page table structure. However, in a typical page table entry format, only a few spare bits are available for this purpose. Therefore, the capacity for storing metadata in this manner is quite limited. In some examples, the portion is extracted from a reserved software field of the at least two page table entries, so that when the software field of the page table entry provides insufficient capacity for metadata, the present technology identifies portions of these bits of at least two page table entries that can be used to store a pointer to a metadata table.
[0036] In another example, the present technology provides a method for associating metadata with a first address, the method comprising: storing the metadata in a metadata table; determining a pointer to the metadata table, the pointer comprising two or more parts; and storing each of the two or more parts in a corresponding one of a first set of two or more page table entries of a page table structure, the page table entry of the page table structure providing address translation data for use in an address translation process to convert the first address to a second address. Associating metadata with page table entries in this manner avoids the additional overhead of building a unique tree or table dedicated to locating metadata associated with the page table entry (relative to building the page table structure itself). In addition, in this case, the present technology allows the metadata associated with the target page table entry to be accessed faster and with fewer memory accesses (compared to the memory accesses required to implement the parallel structure).
[0037] In some examples, the method further includes storing each of the two or more portions in a corresponding one of a second set of two or more page table entries of the page table structure. Storing the pointer in the first set and the second set of two or more page table entries improves caching because when a pointer entry is needed, it is more likely that at least one of the sets will already be cached.
[0038] In some examples, the method further includes: determining a second pointer to a second metadata table, the second pointer including two or more additional parts; and storing each of the two or more additional parts in a corresponding one of the second set of two or more page table entries of the page table structure. In this way, additional metadata can be associated with the page table entry of the page table structure, and the capacity of the metadata is less constrained.
[0039] In some examples, a computer program includes instructions that, when executed, cause a data processing apparatus to perform any of the methods of the present technology discussed above.
[0040] In some examples, a computer-readable storage medium stores a computer program. The computer-readable storage medium may be a non-transitory storage medium.
[0041] Some specific embodiments will now be described with reference to the accompanying drawings.
[0042] Figure 1 An example of an apparatus 100 is shown. For example, the apparatus 100 includes a processing logic 102 for performing data processing operations, such as arithmetic or floating point operations. The processing logic 102 is coupled to a general register 104, which is arranged to store data and instructions to be used by the processing logic 102 when performing data processing operations, and a load / store unit 106 for retrieving data from / sending data to a memory 110. A data cache 108 is coupled between the load / store unit 106 and the memory 110 to cache data expected to be needed by the processing logic 102 in the near future. The data cache 108 can be accessed faster than the memory 110. An instruction decoder 112 decodes instructions to generate control signals for controlling other elements of the apparatus 100 (e.g., the processing logic 102 or the load / store unit 106). The instruction decoder 112 is coupled to an instruction cache 114, which stores instructions for faster access by the instruction decoder 112.
[0043] The device 100 is also configured to implement a virtual addressing scheme in which virtual address spaces can be allocated to various programs that may be executed by the processing logic. Each virtual address space includes a series of virtually addressed pages that can be remapped to physical memory so that consecutive pages in the virtual address space do not need to be consecutive in the physical address space. For this implementation, the device 100 also includes a memory management unit (MMU) 116, which is configured to handle conversions between virtual addresses referenced by programs and physical addresses representing physical locations in the memory 110. The MMU can locally store mappings between some virtual addresses and their corresponding physical addresses in a translation lookaside buffer (TLB) 118, in which case the physical address can be returned relatively quickly. When the required mapping is not stored in the TLB 118, the page table walk unit 120 is configured to perform a page table walk to reference the page table stored in the memory 110 to obtain the required conversion data.
[0044] In some examples, the address translation process may include multiple stages, in which a virtual address is first translated into an intermediate physical address using address translation data from a stage 1 page table, and then the intermediate physical address is translated into a corresponding physical address using address translation data from a stage 2 page table. This arrangement is suitable for systems using virtualization, in which the stage 1 page table may be controlled by a virtual machine or client operating system, and the stage 2 page table is controlled by a hypervisor. Although for ease of illustration, in the examples shown in subsequent embodiments, the translation data provided by the page table structure is used to translate a virtual address into a physical address, more generally, a metadata pointer may be provided in any page table structure that translates a first address into a second address.
[0045] Figure 2 An example of a page table structure 200 is shown. As can be seen, the page table structure 200 includes multiple levels Level0, Level1 and Level2. When a given virtual address is to be translated and the required address translation data is not in the TLB 118, a page table walk is performed for each level of the page table structure. Starting from the Level0 table, the virtual address is used to determine which page table of the subsequent level to reference until the Level2 table is reached, which stores the physical address data required to translate the virtual address to the corresponding virtual address. Each of the Level2 page table and the Level1 page table is associated with a corresponding metadata table. However, it will be appreciated that this arrangement is implementation specific, and in other examples, more or less page tables will be associated with corresponding metadata tables.
[0046] Figure 3 A more detailed illustration of how a page table walk may be performed to retrieve an address translation mapping (eg, to provide physical address data) from the page table structure 200 is provided. Figure 3 In the example of , the virtual address 302 includes: four indexes, Index0, Index1, Index2, and Index3, which are used to index into various levels of the page table to find the address mapping of the target page identified by the index portion; and an offset, which is used to identify a specific address within the target page. Figure 3In the example shown, the index portion is used as is to index into the page table level, but a hash can also be applied to the index portion of the address to find the corresponding page table index. When a virtual address 302 is to be translated and the required address translation data is not yet cached in the TLB, the MMU references the Level0 base address register to determine the base location of the Level0 page table, and Index0 of the virtual address 302 is used to determine the offset from the base address, where the next level pointer is stored in the page table entry of the page table 304. The pointer can be used to determine which Level1 page table should be accessed for the next translation stage for this particular virtual address 302. In this example, the pointer points to the Level1 table 306. Then by indexing into the Level1 table based on the index 1 of the virtual address, another pointer to the base address of one of the Level2 page tables can be obtained. Then, the Level2 and Level3 tables are indexed in the same manner as the Level0 and Level1 tables. However, instead of including a pointer to a page table of a subsequent stage, the index page table entry of the Level3 table stores physical address data that can be used to access the physical address corresponding to the virtual address 302. The physical address data may be combined with the offset of the virtual address to form a corresponding physical address to be accessed for the virtual address.
[0047] Figure 4 An example page table entry format is shown. Figure 4 As can be seen, the OUT field includes: a pointer that defines the base address of the next level page table to be accessed during a page table walk for a given address; or translation address data (when the page table entry is in the last level page table), which defines the address mapping corresponding to the virtual address. A read / write permission indicator is also included, which indicates whether a specific page table entry can be overwritten or read. The accessed / dirty indicator indicates whether the page table entry has been accessed, or whether the page table entry has become dirty and needs to be invalidated. Another subset of these bits is reserved for software and can be used by the programmer or compiler as needed.
[0048] The present technology recognizes that while reserved software bits of a page table entry can be used to directly store metadata associated with the page table entry, this may not always provide sufficient storage. In addition, the present technology recognizes that the reserved software bits can instead be used to provide a pointer to a supplemental metadata storage table, thereby not only providing greater capacity for storing metadata, but also providing the metadata storage table in a manner that enables efficient access. For example, software bits of a set of page table entries can be used to store a pointer to a metadata table associated with a given page table. This allows implementations such as Figure 2 An arrangement is shown in which a metadata table is associated with a page table, wherein only spare bits of a page table entry are required to locate the associated metadata table.
[0049] Figure 5 An example of how a set of software bits of a page table entry may be used to store a pointer to a metadata table associated with the page table is shown. The base address of the 4kB last level page table 502 is located based on the pointer read from the page table entry of the previous level. When locating the table, the software determines that there is a metadata table associated with the page table entry and that there is a pointer to the metadata table, which is embedded in bit portions B0-B8 of page table entries P[0]-P[8], respectively (where each bit portion B x Corresponding to the software reserved field of the corresponding page table entry P[x], which may include multiple bits). Since the bit portions B0-B8 are fields reserved for software, the implementation of this example does not require any modification to the hardware of the device. B0-B8 are extracted from the page table entries P[0]-P[8] and concatenated to form a pointer Q 504, which can be used to locate the base address of the 4KB metadata table 506 associated with the page table 502. It should be understood that the exact number of page table entries required to form a complete pointer using the concatenated bit portion B will depend on the size of the pointer and the number of spare software reserved bits available for each page table entry (for example, in this example, if the pointer has 36 bits and the software reserved field has 4 bits, then 9 page table entries are required).
[0050] In some examples, the present technique operates under the assumption that any metadata stored in the metadata table 506 is generally associated with a 4kB block of addresses corresponding to one page table 502 , where the association is determined based on the pointer Q 504 .
[0051] However, in other examples, metadata may be more specifically associated with individual page table entries of page table 502. For example, when metadata element Q[x] is specifically associated with page table entry P[x], it may be stored and accessed from metadata table 506 based on an offset corresponding to the offset of P[x] relative to the base address of page table 502. Figure 5 , P[x] is located at Index2 based on the virtual address in page table 502, and thus Index2 can also be used to locate metadata associated with P[x] (i.e., Q[x]) in metadata table 506. Organizing and accessing metadata in this manner allows metadata elements to be specifically associated with individual page table entries without the need to implement any other indexing or lookup techniques other than the technique used to locate P[x] in page table 502.
[0052] Likewise Figure 5As shown, P[x] may also be accessed to obtain the physical address data of the virtual address, thereby completing the conversion process. However, it will be appreciated that the target page table entry need not be accessed when obtaining metadata associated with the target page table entry. For example, in other cases, Q[x] may be obtained without accessing P[x].
[0053] Although from Figure 5 As can be seen in , in addition to accessing the target page table entry P[x] itself, some additional memory accesses are required to access the page table entries (PTEs) required to obtain all parts of the metadata pointer, but in practice, because the pointer parts B0-B8 are stored in consecutive PTEs (the consecutive PTEs are stored in a consecutive region of the address space and correspond to a consecutive region of the memory address space), the number of additional memory accesses can be limited. In many implementations, the size of the cache line corresponds to a fixed size of data that can be loaded from the memory and stored in the cache, which can be larger than the size of one page table entry. Therefore, when a request is made to the memory for a given page table entry, some other page table entries may also be loaded from the memory and may also be cached (e.g., cached in the TLB 118 or the data cache 108). By using consecutive PTEs to store the pointer, this reduces the number of memory accesses required. Similarly, because the pointer is stored in the same page table as the target page table entry, and the access pattern to the memory tends to be localized, there is a reasonable opportunity to make the additional PTEs required for the pointer also cached in the data cache 108 so that the pointer can be extracted relatively efficiently.
[0054] Figure 6 An example of how the present technology can exploit cache locality properties to further improve efficiency is shown. Multiple instances (e.g., 4 instances) of a pointer Q can be embedded in page table entries of different pointer groups. For example, for a 4kB page table including 512 8-byte PTEs, the pointer groups can be separated by intervals of 128 entries. That is, each page table entry of the pointer groups: P[0]-P[9], P
[128] -P
[136] , P
[256] -P
[264] , and P
[384] -P
[392] stores a portion of Q in their reserved software bits, so that Q can be reconstructed from any group. Therefore, a group of PTEs storing pointers that are closest to the target PTE corresponding to the target address can be selected to obtain a metadata pointer so that when the target page table entry is in the cache, there is the greatest chance that the closest group of PTEs storing pointers will also be in the cache, because when the target page table entry is needed, page table entries with addresses located near the target page table entry in the address space are typically also cached. For example, when accessing P
[278] , P
[256] -P
[264] are more likely to be cached (eg, compared to P[0]-P[8]).
[0055] It is relatively simple to locate the relevant pointer group for the target page table entry. Figure 7 As shown, the page table 702 can be divided into two blocks C0 and C1, each of which stores a pointer group of page table entries 704 and 706. Therefore, the index to be used to index into the page table 702 to locate the target page table entry (not shown) can be rounded down to the nearest multiple of 2K to locate the base address of the pointer group. The pointer items of the pointer group can then be located in the following manner: starting from the base address, increase by a number equal to the number of pointer items in the group, which is 8 in this case, because 9 page table entries include portions of pointers. Similarly, when more blocks include pointer groups (for example, the case of page table 708), the index is rounded to a smaller base. For example, the page table 708 is divided into 16 blocks C0-C1, each of which stores a pointer group. Therefore, the index is rounded down to the nearest multiple of 256 bytes to locate the base address of the pointer group.
[0056] Figure 8 Another example of how embedding multiple pointer groups in a page table can increase the capacity of metadata to be associated with a page table entry is shown. Figure 6 As in the example, Figure 8 The page table 702 includes four pointer groups, each pointer group includes 9 page table entries. However, different pointers are embedded in each pointer group. For example, the bit portions B0-B8 of items P[0]-P[8] can be connected to form a pointer Q0 pointing to metadata table 0 710, while the bit portions C0-C8 of items P
[128] -P
[136] can be connected to form a pointer Q1 pointing to metadata table 1 708. In this way, each of the 128 item blocks in page table 702 can be associated with its own 4KB metadata table, thereby significantly increasing the capacity of metadata to be associated with the page table entries of page table 702. In addition, locating metadata specific to a specific page table entry can be achieved by simply multiplying part of the index of the target page table entry by a constant. Figure 8 In the example of , the capacity for storing metadata is four times that for storing page table entries. Therefore, the offset corresponding to 128 entries B can be multiplied by 4 to offset into metadata table 0. For item blocks: C, D, and E, the most significant bit portion of the index indicating the offset must be ignored so that the base address of the item block corresponds to the base address of the corresponding metadata table, with the remaining least significant bits multiplied by 4 to index into the relevant metadata table.
[0057] Fig. 9 A method for locating metadata associated with an address is shown. First, in step 904, a pointer entry in a portion of a page table structure storing a pointer to a metadata table is identified. For example, this can be accomplished by referring to Figure 7The described rounding technique is implemented by applying the index portion of the address (which is used for the page table at the corresponding level in the page table structure). In step 906, portions of the pointer item are extracted and concatenated to determine a pointer, and in step 908, a metadata table storing associated metadata is located based on the pointer. In other examples, a pointer can be formed by combining portions of the pointer item in a manner other than concatenation (e.g., some additional bits can be inserted between the extracted portions in the assembled pointer). In addition, in order to identify the metadata specifically associated with the address, in step 910, an index of the target page table item provided by the address is used to generate an index into the metadata table to locate the associated metadata (e.g., the metadata index can be the same as the target page table index, or the metadata can be derived by multiplying the least significant portion of the target page table index by a multiplier corresponding to the number of separate metadata pages corresponding to a page table in the page table structure).
[0058] Fig.10 A method for associating metadata with an address is shown. First, in step 1004, Fig. 9 The metadata is stored in a metadata table at a location based on the address index in a manner corresponding to step 910. In step 1006, a pointer to a base address of the metadata is determined and divided into multiple parts in step 1008. In step 1010, these parts are stored in entries of the page table that will be accessed when translating the corresponding address.
[0059] In this application, the words "configured to ..." or "arranged to" are used to indicate that elements of a device have a configuration that enables the performance of a defined operation. In this context, "configuration" means the arrangement or manner of interconnection of hardware or software. For example, the device may have dedicated hardware that provides the defined operation, or a processor or other processing device that can be programmed to perform the function. "Configured to" or "arranged to" does not mean that the device elements need to be changed in any way to provide the defined operation.
[0060] Although illustrative embodiments have been described in detail herein with reference to the accompanying drawings, it will be appreciated that the invention is not limited to those precise embodiments and that various changes, additions and modifications may be made therein by those skilled in the art without departing from the scope of the invention as defined by the appended claims. For example, the features of the dependent claims may be variously combined with the features of the independent claims without departing from the scope of the invention.
Claims
1. A method for locating metadata associated with a first address, the method comprising: accessing a page table structure, a page table entry of the page table structure providing address translation data for use in an address translation process to translate the first address into a second address; extracting a portion of at least two page table entries in the page table structure; determining a pointer to a metadata table from the portion of the at least two page table entries; as well as The target metadata associated with the first address is located from the metadata table using the pointer.
2. The method according to claim 1, wherein: The using the pointer to locate the target metadata associated with the first address from the metadata table further comprises: A target metadata location storing the target metadata is determined within the metadata table from the pointer and the first address.
3. The method according to claim 2, wherein: Determining the target metadata location storing the target metadata in the metadata table from the pointer and the first address comprises: determining a base position of the metadata table from the pointer; and A target metadata index is determined from the first address, the target metadata index being used to index into the metadata table to access the target metadata location.
4. The method according to claim 3, wherein: The page table structure includes a plurality of page tables at a plurality of levels, and the target metadata index is determined based on a target page table index of a target page table entry corresponding to the first address within a given page table at a given level.
5. The method according to claim 4, wherein: The offset of the target metadata location relative to the base location of the metadata table is determined as a multiple of a portion of the target page table index.
6. The method according to any one of claims 1 to 5, wherein: The at least two page table entries correspond to a continuous region of a first address space corresponding to the first address.
7. The method according to any one of claims 1 to 5, wherein: The page table structure includes a plurality of page tables, and the at least two page table entries and a target page table entry corresponding to the first address are within a same page table of the page table structure.
8. The method according to claim 7, wherein: Regardless of the relative position of the target page table entries within a given page table, the same entry is selected as the at least two page table entries.
9. The method according to claim 7, wherein: Depending on the relative position of the target page table entry within a given page table, different groups of at least two entries are selected as the at least two page table entries.
10. The method according to claim 9, wherein: The given page table includes a plurality of blocks of consecutive page table entries, and the at least two page table entries are selected from the same block as the target page table entry.
11. The method according to any one of claims 1 to 5, comprising: determining, from the first address, an index indicating a location of a target page table entry corresponding to the first address in a given page table of the page table structure; as well as The locations of the at least two page table entries in the given page table are determined from the index.
12. The method according to claim 11, wherein: The index is rounded at a middle bit position of the index to identify a position of the at least two page table entries in the given page table.
13. The method according to any one of claims 1 to 5, wherein: The page table structure includes a plurality of page tables organized in levels, and the at least two page table entries include page table entries of a last level page table of the page table structure, the last level page table providing address mapping information for identifying the second address corresponding to the first address.
14. The method according to any one of claims 1 to 5, wherein: The portion is extracted from a reserved software field of the at least two page table entries.
15. A method for associating metadata with a first address, the method comprising: storing the metadata in a metadata table; determining a pointer to the metadata table, the pointer comprising two or more parts; as well as Each of the two or more portions is stored in a corresponding one of a first set of two or more page table entries of a page table structure, the page table entries of the page table structure providing address translation data for use in an address translation process for translating the first address into a second address.
16. The method according to claim 15, comprising: Each of the two or more portions is stored in a respective one of a second set of two or more page table entries of the page table structure.
17. The method according to claim 15, further comprising: determining a second pointer to a second metadata table, the second pointer comprising two or more further parts; as well as Each of the two or more additional portions is stored in a respective one of a second set of two or more page table entries of the page table structure.
18. A computer program comprising instructions which, when executed, cause data processing apparatus to perform a method according to any preceding claim.
19. A computer-readable storage medium storing the computer program according to claim 18.
