Variable nesting control parameters for a table structure providing access control information for controlling access to a memory system
Variable nesting control parameters in multi-level access control tables optimize memory usage and access performance by dynamically adjusting offset sizes based on address space requirements, addressing inefficiencies in existing memory management systems.
Patent Information
- Application Number
- JP2022561020
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-04-20
- Filing Date
- 2021-04-14
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2041-04-14
AI Technical Summary
Existing memory management systems using multi-level access control tables face inefficiencies in memory usage and performance due to fixed nesting of table levels, which can lead to increased memory footprint and slower access times as they traverse multiple levels to obtain access control information.
Implementing variable nesting control parameters in higher-level access control tables to dynamically adjust the size of the offset portion used to select entries, allowing for a flexible trade-off between memory footprint and performance by varying the number of levels traversed and the size of offset portions based on specific address space requirements.
This approach reduces memory usage and improves access performance by optimizing the table structure to accommodate varying access control needs, ensuring efficient memory allocation and faster access to access control information.
Smart Images

Figure 0007801241000005 
Figure 0007801241000006 
Figure 0007801241000007
Abstract
Description
[Technical Field]
[0001] The present technique relates to the field of data processing, and more particularly to memory management.
[0002] The data processing system may have memory management circuitry for controlling access to the memory system based on access control information defined in table entries of the table structure.
[0003] At least some examples provide an apparatus including: a memory management circuit that controls access to a memory system based on access control information defined in table entries of a table structure including multiple levels of access control tables; and a table access circuit for accessing the table structure to obtain access control information corresponding to a target address, wherein for a given access control table at a given level of the table structure other than a starting level, the table access circuit is configured to select a selected table entry of the given access control table corresponding to the target address based on an offset portion of the target address, the selected table entry providing either a pointer to an access control table at a next lower level of the table structure or the access control information corresponding to the target address, and the table access circuit is configured to determine a size of the offset portion of the target address based on a variable nesting control parameter specified in a table entry of a higher-level access control table in a table structure at a higher level than the given access control table.
[0004] At least some examples provide a method that includes controlling access to a memory system based on access control information defined in table entries of a table structure including multiple levels of access control tables, and accessing the table structure to obtain access control information corresponding to a target address, wherein for a given access control table at a given level of the table structure other than a starting level, a selected table entry of the given access control table corresponding to the target address is selected based on an offset portion of the target address, the selected table entry providing either a pointer to an access control table at a next lower level of the table structure or access control information corresponding to the target address, and wherein a size of the offset portion of the target address is determined based on a variable nesting control parameter specified in a table entry of a higher-level access control table in a table structure at a higher level than the given access control table.
[0005] At least some examples provide a computer program comprising instructions that, when executed on a host data processing apparatus, control the host data processing apparatus to provide an instruction execution environment for executing target code, the computer program including: memory management program logic that controls access to simulated memory based on access control information defined in table entries of a table structure including multiple levels of access control tables; and table access program logic for accessing the table structure to obtain access control information corresponding to a target simulated address, wherein for a given access control table at a given level of the table structure other than a starting level, the table access program logic is configured to select a selected table entry of the given access control table corresponding to the target simulated address based on an offset portion of the target simulated address, the selected table entry providing either a pointer to an access control table at a next lower level of the table structure or access control information corresponding to the target simulated address, and the table access program logic is configured to determine a size of the offset portion of the target simulated address based on a variable nesting control parameter specified in a table entry of a higher-level access control table in a table structure at a higher level than the given access control table.
[0006] At least some examples provide a computer-readable storage medium that stores the above-described computer program. The storage medium may be a non-transitory storage medium. [Brief explanation of the drawings]
[0007] Further aspects, features, and advantages of the present technology will become apparent from the following description of examples, read in conjunction with the accompanying drawings. [Figure 1] 1 illustrates a schematic example of a data processing device; [Figure 2]1 illustrates some areas in which the processing circuitry can operate. [Figure 3] 1 illustrates an example processing system that supports granular protection lookup. [Figure 4] 1 illustrates schematically the aliasing of several physical address spaces onto a system physical address space that identifies locations within a memory system. [Figure 5] An example is given of partitioning the effective hardware physical address space so that different architectural physical address spaces have access to respective portions of the system physical address space. [Figure 6] FIG. 1 is a flow diagram illustrating a method for determining a current operating region of a processing circuit. [Figure 7] FIG. 2 illustrates an example page table entry format for a page table entry used to translate a virtual address to a physical address. [Figure 8] FIG. 1 illustrates an example of a multi-level page table structure with fixed nesting of page tables. [Figure 9] FIG. 1 is a flow diagram illustrating a method for selecting a physical address space to be accessed by a given memory access request. [Figure 10] FIG. 10 is a flow diagram illustrating a method for filtering memory access requests based on whether a selected physical address space associated with the request is defined as an allowed physical address space in the granule protection information that corresponds to the target physical address defined in the granule protection table structure. [Figure 11] FIG. 2 illustrates an example of table entries for a granule protection table, including table descriptor entries and block descriptor entries. [Figure 12] FIG. 1 illustrates an example conceptual layout of a multi-level granule protected cable, showing an example with variable nesting based on nesting control parameters defined in higher level table entries. [Figure 13]FIG. 10 is a flow diagram illustrating a method for accessing a granule protection table to obtain access control information for a particular target address based on a variable nesting control parameter. [Figure 14] FIG. 10 illustrates an example of using a shared set of access control information to represent access control information for adjacent blocks of adjacent granules of addresses. [Figure 15] FIG. 1 illustrates an example of a simulator. DETAILED DESCRIPTION OF THE INVENTION
[0008] The data processing system may include a memory management circuit that controls access to a memory system based on access control information defined in table entries of a table structure having two or more levels of access control tables, and a table access circuit that accesses the table structure to obtain access control information corresponding to a target address. The access control information may be any information used to control how accesses to given ranges of addresses are performed or whether accesses to those ranges are permitted. While it is possible to define such access control information in a single level of access control tables that are linearly indexed based on the target address, as the size of the address space over which the access control information is to be defined becomes large, such a linearly indexed table may be inefficient in terms of memory usage for the table data itself, requiring a single contiguous memory area to be reserved for the table whose size is proportional to the size of the address range to be protected by the table.
[0009] To use address space more efficiently (reducing the amount of memory storage allocated to the table), it is known to define a multi-level access control table, where at each level, some of the offset bits extracted from the target address select an entry in the current level table. If the current level is not the final level, the entry in the current level provides a pointer to the access control table in the next lower level of the table structure. Finally, after traversing various levels of the table structure, the final level of the table is reached, and an entry selected based on the offset portion of the target address at that level provides the access control information corresponding to the target address. This approach, compared to the above approach using a single linearly indexed flat table, allows access control information for a specific number of regions of addresses distributed over a wider address space range to be protected to be implemented using a smaller memory footprint for the table data itself. However, multi-level tables can degrade performance because obtaining access control information for a specific target address may require multiple accesses to memory to traverse various levels of the table structure to obtain several pointers to next-level access control tables before finally identifying the access control information.
[0010] Typically, for multi-level access control tables, the way in which the nesting of different levels of tables within the table structure is controlled is fixed by design, so that the maximum number of levels traversed to reach the entry providing the actual access control information, the size of the table at each level, and the size of the offset portion of the target address used to index into each level are all fixed.
[0011] In contrast, in the example described below, a variable nesting control parameter may be specified in a table entry of a higher-level access control table that provides variable control over how the offset portion of a lower level of the table structure is formed. Thus, for a given access control table at a given level of the table structure other than the starting level, the table access circuit selects a selected table entry of the given access control table that corresponds to the target address based on the offset portion of the target address (the selected table entry provides either a pointer to an access control table at the next lower level of the table structure or access control information corresponding to the target address), and the table access circuit determines the size of the offset portion of the target address based on the variable nesting control parameter specified in the table entry of the higher-level access control table in the table structure at a higher level than the given access control table.
[0012] This technique provides flexibility to trade off the table's memory footprint against performance when accessing the table by allowing the size of the offset portion used to select an entry from a given level of the access control table to be dynamically changed based on parameters specified in higher-level table entries (which are accessed earlier in the path taken to traverse the table structure to reach the given access control table). Thus, rather than using a fixed-size offset that depends only on the level of the table structure, the offset portion size also depends on parameters read from the previous access control table. Thus, if performance is more important than memory storage efficiency, the nesting can be adjusted to use a larger offset portion for a given level of the table structure, resulting in fewer levels of target address bits being consumed and allowing the target address's access control information to be placed in fewer memory accesses. On the other hand, if the priority is to provide a more efficient memory storage footprint for the table, nesting control parameters can be defined in higher-level access control tables to control the table access circuitry to select a smaller offset for a given level of the table, resulting in traversing more levels of the table structure to reach the target address's access control information and allowing for a more fragmented allocation of memory for table data with a smaller overall table footprint in memory.
[0013] The variable nesting control parameter may be specified separately in each table entry of a higher-level access control table. This means that different table entries of a higher-level access control table may specify different values for the variable nesting control parameter. Thus, if there are different table entries in a higher-level access control table that specify different values for the variable nesting control parameter, when selecting an entry from an access control table at a given level of the table structure, the table access circuitry may use offset portions of different sizes for different access control tables at the same level of the table structure. This is particularly useful because different regions of the address space may have different requirements regarding whether performance or memory footprint is more important. Some portions of the address space may require the fastest possible access, while other portions may have looser performance requirements, and this may provide an opportunity to conserve table space. By allowing the size of the offset portion used to select an entry from an access control table to be determined based on parameters extracted from previous entries at a higher level of the table structure, this provides flexibility for this trade-off.
[0014] The table structure can be thought of as a tree structure, with the start level table at the start level forming the root of the tree, and each node in the tree branching off into separate paths based on the respective pointers in the table entries, ultimately reaching leaf nodes that provide access control information. The offset portion of each level extracted from the target address can be thought of as selecting a particular path through the tree structure to reach the appropriate leaf node for that target address.
[0015] Based on the variable nesting control parameters, different portions of the tree structure can have different numbers of levels and different characteristics, rather than having a uniform pattern of nesting of access control tables throughout the table structure as is typically the case. Various characteristics of the table structure can be controlled based on the variable nesting control parameters.
[0016] For example, the maximum number of levels of a table structure traversed to reach a table entry providing access control information for a target address may be variable depending on a variable nesting control parameter. This may be controlled based on the size of the offset portion selected at each level of the table, based on the variable nesting control parameter. By dividing a given set of offset bits into fewer, larger portions, the maximum number of levels of the table structure may be less than if that set of offset bits were divided into a greater number of smaller portions. Again, because different upper-level table entries may specify different values for the variable nesting control parameter, the maximum number of levels of the table structure may be different for different subtrees within the overall tree structure represented by the table structure. Note that while the variable nesting control parameter may define the maximum number of levels of a table structure to be traversed, this does not necessarily mean that the table access circuitry must always traverse the specified maximum number of levels to reach the access control information. Entries at levels other than the final level corresponding to the specified maximum number of levels may be defined as block descriptor entries providing access control information for blocks of addresses that may be larger in size than the block of addresses for which the block descriptor table entry at the final level of the table structure defined access control information.
[0017] Additionally, the table size occupied by the table data of a given access control table at a given level of the table structure may vary depending on the variable nesting control parameter obtained from the higher-level access control table. Again, the table size depends on the size of the offset portion of the target address. The table size corresponds to the product of the size of one table entry and a power of two corresponding to the number of bits used for the offset portion selected for a given level based on the variable nesting control parameter. When the device is running software and in use, the software must allocate an address range corresponding to the table size for storing the table data of each table entry of the given access control table. Note that when a given access control table has a specific table size, this does not necessarily mean that a valid table entry is allocated for each entry within the portion of memory allocated for that specific table size. Nevertheless, an area of memory of the defined table size must be reserved for the access control table because if other data were stored within that range, it could potentially be read as the table access circuitry walks the table structure to identify access control information for a particular target address, potentially resulting in erroneous processing of a memory access request if the data stored in that entry were misinterpreted as access control information.The variable nesting control allows for trading off the size of tables in a given portion of the table structure so that in areas of memory where it is possible to allocate relatively large chunks of memory in contiguous blocks, a given access control table in that portion of the table tree can be made larger, improving performance by requiring fewer hops between levels, while in other portions of the memory space where the memory is more fragmented and there is not much space to allocate a single large table (or where the number of address granules at which access control information needs to be defined is too small to justify allocating a large table in memory), the variable nesting control parameters can be adjusted to provide a smaller table that requires more levels to traverse.
[0018] For a given access control table at a given level of the table structure, each table entry of the given access control table can define information applicable to a range of addresses in a given address range size. That is, the given address range size refers to the size of the given address range of target addresses for which the given access control table is accessed when traversing the table structure to find access control information for any target address within the given address range. The given address range size can also be variable depending on variable nesting control parameters specified in the table entry of a higher-level access control table. That is, for a given level of the table structure, the size of the range of addresses to which a single table entry of the access control table is applicable can vary depending on parameters read from the higher-level access control table. This is unconventional, because typically, each level of a table defines table entries that apply to a single, fixed address range size per level. Again, with variable nesting control, one access control table at a given level of the table structure can define table entries applicable to a given address range size that is different from the given address range size for each entry of another access control table at the same given level of the table structure.
[0019] In some examples, variable nesting control parameters can be specified at any level of the table structure other than the final level, such that access control tables at levels other than the starting level of the table structure can change how access control tables at subsequent levels are nested.
[0020] However, in other examples, the setting of the variable nesting control parameter may be limited to the starting level of the table structure. Thus, the variable nesting control parameter may be specified in a table entry of a starting-level access control table at the starting level of the table structure, and this parameter may define how tables in the subtree below that particular starting-level table entry are nested for all subsequent levels. Subsequent levels of the table structure may not have additional parameters that change the nesting from that defined at the starting level. This approach may be more efficient for implementing the control hardware logic circuit of the table access circuit because the selection of the size and location of the offset portion for a given level may depend on fewer parameters (there is no need to combine nesting control parameters read from multiple levels of the table).
[0021] Table entries in the table structure can be classified as block descriptor table entries, which provide access control information for the corresponding block of the target address, or as table descriptor entries, which provide a pointer to an access control table at the next level in the table structure. As described above, it is possible to define block descriptor table entries at any level in the table structure. If a block descriptor table entry is at a level other than the maximum allowed level defined by the variable nesting control parameter, this means that a shared definition of access control information is shared by blocks of larger memory addresses than if the block descriptor table entry were at the last level corresponding to the maximum number of levels indicated based on the variable nesting control parameter.
[0022] In one example, a block descriptor table entry can include multiple access control information fields, each indicating access control information for a different address granule. Thus, when a block descriptor table entry for a particular target address is reached, the access control information for that particular target address can be extracted from a specific one of two or more access control information fields in the block descriptor table entry. This technique can be useful when the amount of access control information that needs to be defined per granule is relatively small, allowing multiple sets of access control information to be packed into a single memory location addressable with a single memory access translation. Packing multiple access control information for different granules into a single block descriptor table entry can reduce the overall size of the table structure.
[0023] In one example, the table format may support the ability to specify a contiguity indication in a block descriptor table entry. If the block descriptor table entry specifies a contiguity indication, the table access circuitry may determine that access control information for two or more different granules of addresses, including the target granule corresponding to the requested target address, is represented by a shared set of access control information shared between the two or more different granules. This may be useful if the system supports caching of table entries in a translation lookaside buffer or other type of cache (e.g., a granule protection information cache, described further below), because if the shared set of access control information can represent information for two or more granules, this may mean that the cache does not need to store separate cache entries for different granules. Instead, a single cache entry may indicate the shared set of access control information used for more granules. This may allow for more efficient utilization of cached storage capacity, effectively allowing the cache to store information for a greater number of granules than would be expected given the actual hardware storage provided.
[0024] The number of granules that share a shared set of access control information when a contiguity indication is specified can be variable based on the contiguity size parameter specified in the block descriptor table entry, which provides flexibility to change the size of contiguous block addresses that can be "fused" to share the same set of access control information.
[0025] The adjacency indication can be represented in different ways. In some cases, a dedicated adjacency indication field can be provided, separate from the field for indicating the access control information itself. However, in the example described above where a block descriptor table entry has several separate access control information fields defining access control information for multiple granules, an efficient encoding of the adjacency indication may be to define a predetermined encoding of the access control information field that cannot be used to indicate any valid option of access control information, and to interpret the predetermined encoding of the access control information field as representing the adjacency indication. In this case, when a predetermined one of the access control information fields in a block descriptor table entry has the predetermined encoding, this means that the table access circuit determines that a shared set of access control information is indicated by one or more of the other access control information fields in that block descriptor table entry, or that the shared set of access control information may be represented in a block descriptor table entry that is entirely different from the one corresponding to the target address. By using an otherwise invalid encoding of the access control information field as a contiguity indication and taking advantage of the fact that other parts of the same block descriptor table entry can represent shared access control information, this avoids the need to allocate a separate field for the contiguity indication and provides a more efficient storage format for the table data.
[0026] The techniques described above can be used for different types of table structures used by memory management circuitry to control access to memory.
[0027] The technique of using variable nesting control parameters can be particularly useful for table structures indexed by physical addresses rather than virtual addresses. When a table structure is indexed by a physical address, this means that the target address used to look up the table structure (from which the offset portion is extracted to index into each level of the table) will be a physical address. Because physical address space tends to exhibit greater memory linearity than virtual address space, the use of variable nesting control parameters is particularly useful for physically indexed access control table structures. That is, because physical addresses correspond more closely to physical regions of hardware-implemented storage than virtual addresses, a relatively large block of contiguous physical addresses is likely to have similar performance / memory footprint efficiency needs than a block of contiguous virtual addresses of the same size. In contrast, a reasonably large block of contiguous virtual addresses is likely to be fragmented across a combination of different physical storage units or peripheral devices with different performance / memory footprint tradeoff needs. A table structure indexed by physical addresses rather than virtual addresses may also be referred to as an inverted page table, and the technique discussed herein is particularly useful for such inverted page tables that provide information defined for each granule of physical address.
[0028] A specific example of a physically indexed table structure may be a table used to separate respective physical address spaces. For example, the memory management circuit may include: an address translation circuit that translates a target virtual address specified by a memory access request into a target physical address associated with a selected physical address space selected from among the plurality of physical address spaces; and a filtering circuit that determines whether the memory access request should be permitted to access the target physical address based on whether the access control information obtained from the table structure indicates that the selected physical address space is a permitted physical address space for the target physical address.
[0029] A data processing system may support the use of virtual memory, and address translation circuitry is provided to translate a virtual address specified by a memory access request into a physical address associated with a location in the memory system being accessed. The mapping between the virtual address and the physical address may be defined in one or more page table structures. Page table entries in the page table structures may also define certain access permission information that may control whether a given software process executing on the processing circuitry can access a particular virtual address.
[0030] In some processing systems, all virtual addresses may be mapped by address translation circuitry onto a single physical address space that is used by the memory system to identify locations in memory to be accessed. In such systems, control over whether a particular software process can access a particular address is provided solely based on a page table structure used to provide the virtual-to-physical address translation mapping. However, such page table structures may typically be defined by the operating system and / or hypervisor. Compromise of the operating system or hypervisor could result in a security breach that could allow an attacker to access sensitive information.
[0031] Thus, in some systems where certain processes need to be executed securely in isolation from other processes, the system may support several separate physical address spaces, and for at least some components of the memory system, memory access requests where a virtual address is translated to a physical address in a different physical address space are treated as if they were accessing entirely different addresses in memory, even if the physical addresses in each physical address space actually correspond to the same location in memory. Isolating accesses to the separate physical address spaces from different operating domains of the processing circuitry, as is the case for some memory system components, can provide stronger security guarantees that are not dependent on page table permission information set by an operating system or hypervisor.
[0032] In systems where the virtual address of a memory access request can be mapped to a physical address in one of two or more separate physical address spaces, granule protection information can be used to restrict which physical addresses are accessible within a particular physical address space. This can be useful to ensure that access to a particular physical memory location, implemented in either on-chip or off-chip hardware, can be restricted to a particular physical address space, or to a particular subset of the physical address space, if desired.
[0033] Therefore, the technique of varying the size of the offset portion of the target address based on variable nesting control parameters defined in a higher-level table can be applied to tables defining granule protection information used to restrict which physical addresses are accessible within a particular physical address space selected for a given memory access. Thus, the access control information described above can be granule protection information that defines the physical address space of a corresponding granule of physical addresses that is allowed.
[0034] However, the variable nesting techniques described above may also be used for table structures indexed by virtual addresses, such as page tables, which provide address translation mappings used by address translation circuitry to translate target virtual addresses into target physical addresses.
[0035] Because virtual memory allocations tend to be more fragmented, using a fixed, larger number of table levels is likely more efficient for reducing the table footprint in memory. Nevertheless, there may be some areas where a larger table footprint can be tolerated to improve performance for certain areas that store fast-accessed, performance-critical data. Therefore, the techniques described above can be used to trade off the table's memory footprint against performance in traversing the table for areas of virtual address space that are linear enough to allow the number of levels to be reduced. Therefore, defining a variable-sized offset portion of a given level based on a variable nesting control parameter in a higher-level access control table can also be applied to page tables or any other access control table structure indexed by a virtual address. The access control information described above can include addressing mapping information from the page table used for address translation, and can also include other access permission information defined in the page table, such as information defining whether a region of the virtual address should be read / write or read-only, or information restricting which privilege / exception levels are allowed to access the region.
[0036] The above-described techniques can be implemented in a hardware device having hardware circuit logic for implementing the functions described above. Thus, the memory management circuitry and table access circuitry can comprise hardware circuit logic. However, in other examples, a computer program for controlling a host data processing device to provide an instruction execution environment for executing target code may comprise memory management program logic and table access program logic that performs, in software, functions equivalent to the memory management circuitry and table access circuitry described above. This can be useful, for example, to allow target code written for a particular instruction set architecture to be executed on a host computer that may not support that instruction set architecture.
[0037] Thus, functionality expected by an instruction set architecture not provided by the host computer can be emulated by having the simulation software instead provide an equivalent instruction execution environment for the target code, as would be expected if the target code were executed on a hardware device that actually supports the instruction set architecture. Thus, the computer program providing the simulation can include memory management program logic that controls access to the simulated memory based on access control information defined in table entries of the table structure, and table access program logic for accessing the table structure (stored in the memory of the host data processing device but accessed by accesses that specify addresses in the simulated memory that simulates the memory of an actual target processing device that supports the simulated instruction set architecture). As with a hardware device, the nesting of the table structure can be controlled based on variable nesting control parameters to vary the size of the offset used at a given level of the table structure. In the manner in which the architecture simulation is provided, the physical addresses resulting from any address translation and indexing into the physically indexed table structure do not actually correspond to the physical address space identified by the hardware components of the host computer, but rather may be physical addresses within the simulated physical address space, as they are mapped to addresses within the host's virtual address space.
[0038] Providing such a simulation can be useful for a variety of purposes, such as enabling older code written for one instruction set architecture to run on a different platform that supports a different instruction set architecture, or to assist in software development of new software that runs for a new version of an instruction set architecture when hardware devices that support that version are not yet available (thereby allowing development of software for the new version of the architecture to begin in parallel with development of hardware devices that support the new version of the architecture).
[0039] FIG. 1 schematically illustrates an example data processing system 2 having at least one requester device 4 and at least one completer device 6. An interconnect 8 provides communication between the requester device 4 and the completer device 6. A requester device can issue memory access requests requesting memory access to specific addressable memory system locations. The completer device 6 is a device responsible for processing memory access requests directed to it. Although not shown in FIG. 1, some devices may be capable of functioning as both a requester device and a completer device. The requester device 4 may include processing elements such as a central processing unit (CPU) or a graphics processing unit (GPU) or other master devices such as bus master devices, network interface controllers, display controllers, etc. The completer device may include a memory controller responsible for controlling access to corresponding memory storage units, a peripheral controller for controlling access to peripheral devices, etc. While FIG. 1 illustrates one example configuration of the requester device 4 in more detail, it should be understood that other requester devices 4 may have similar configurations. Alternatively, other requestor devices may have a different configuration than requestor device 4 shown on the left side of FIG.
[0040] Requester device 4 has processing circuitry 10 for performing data processing responsive to instructions by referencing data stored in registers 12. Registers 12 may include general-purpose registers for storing operands and results of processed instructions, as well as control registers for storing control data for configuring how processing is performed by the processing circuitry. For example, the control data may include a current domain indication 14 used to select which operating domain is the current domain, and a current exception level indication 15 indicating which exception level is the current exception level at which processing circuit 10 is operating.
[0041] Processing circuit 10 may be capable of issuing memory access requests specifying a virtual address (VA) that identifies the addressable location to be accessed and a region identifier (region ID or “security state”) that identifies the current region. Address translation circuit 16 (e.g., a memory management unit (MMU)) translates the virtual address into a physical address (PA) through one of many stages of address translation based on page table data defined in a page table structure stored in the memory system. Page table walk circuit 17 controls the issuance of page table walk memory access requests to request page table entries from the memory system, including generating the address of a page table entry based on a table base address defined in a base address register or based on a table base address provided by a pointer from a higher-level table entry and an offset portion extracted from the target address to be translated. Translation lookaside buffer (TLB) 18 functions as a lookup cache to cache a portion of the page table information for faster access than if the page table information had to be fetched from memory each time an address translation is needed. In this example, in addition to generating the physical address, address translation circuitry 16 also selects one of several physical address spaces associated with the physical address and outputs a physical address space (PAS) identifier that identifies the selected physical address space. PAS selection is discussed in more detail below.
[0042] The PAS filter 20 functions as a requester filtering circuit to determine whether the physical address is permitted to be accessed within the specified physical address space identified by the PAS identifier based on the translated physical address and the PAS identifier. This lookup is based on granule protection information stored in a granule protection table structure stored within the memory system. The granule protection table (GPT) walk circuit 23 controls access to entries in the granule protection table structure within memory. Similar to the page table walk circuit 17, the GPT walk circuit 23 controls the issuance of GPT walk memory access requests to request GPT entries from the memory system, including generating the address of the GPT entry based on a table base address defined in a base address register or based on a table base address provided by a pointer from an upper-level table entry and an offset portion extracted from the translated target address. Granule protection information may be cached in a granule protection information cache 22, similar to the caching of page table data within the TLB 18. 1, granule protection information cache 22 is shown as a separate structure from TLB 18, but in other examples, these types of lookup caches may be combined into a single lookup cache structure, such that a single lookup of an entry in the combined structure provides both page table information and granule protection information. Granule protection information restricts the physical address space in which a given physical address may be accessed, and based on this lookup, defines information by which PAS filter 20 determines whether to allow a memory access request to proceed being issued to one or more caches 24 and / or interconnect 8. If the designated PAS for a memory access request is not permitted to access the designated physical address, PAS filter 20 may block the transaction and signal a fault.
[0043] The address translation circuit 16 and the PAS filter 20 are examples of a memory management circuit. The page table walk circuit 17 and the GPT walk circuit 23 are examples of a table access circuit.
[0044] While Figure 1 shows an example of a system having multiple requestor devices 4, the features shown for the single requestor device on the left side of Figure 1 may also be included in systems where there is only one requestor device, such as a single-core processor.
[0045] While FIG. 1 shows an example in which the selection of a PAS for a given request is performed by the address translation circuit 16, in other examples, information for determining which PAS to select along with the PA can be output by the address translation circuit 16 to the PAS filter 20, which can select a PAS and verify whether the PA can be accessed within the selected PAS.
[0046] The provision of PAS filter 20 helps support a system that can operate in several operating domains, each associated with its own isolated physical address space, where, for at least a portion of the memory system (e.g., for some caches or coherency enforcement mechanisms such as snoop filters), separate physical address spaces are treated as if they refer to separate sets of addresses that identify entirely separate memory system locations, even if the addresses within those address spaces actually refer to the same physical location within the memory system. This can be useful for security purposes.
[0047] FIG. 2 shows examples of different operating states and domains in which processing circuitry 10 can operate, as well as examples of the types of software that may run at different exception levels and domains (it will, of course, be understood that the particular software installed on a system is selected by the party managing that system and is therefore not an essential feature of the hardware architecture).
[0048] Processing circuit 10 is capable of operating at several different exception levels 80, in this example four exception levels labeled EL0, EL1, EL2, and EL3, where EL3 refers to the most privileged exception level and EL0 refers to the least privileged exception level. It will be appreciated that other architectures may choose the reverse numbering, with the exception level with the highest number being considered to be the least privileged. In this example, the least privileged exception level EL0 is for application-level code, the next most privileged exception level EL1 is used for operating system-level code, the next most privileged exception level EL2 is used for hypervisor-level code that manages switching between several virtual operating systems, and the most privileged exception level EL3 is used for monitor code that manages switching between the respective domains and the allocation of physical addresses to the physical address space, as will be described below.
[0049] When an exception occurs at a particular exception level while processing software, for some types of exceptions, the exception is accepted to a higher (more privileged) exception level, and the particular exception level at which the exception is accepted is selected based on attributes of the particular exception that occurred. However, in some circumstances, other types of exceptions may be accepted at the same exception level as the exception level associated with the code that was being processed when the exception was accepted. When an exception is accepted, information characterizing the state of the processor at the time the exception was accepted can be saved, including, for example, the current exception level at the time the exception was accepted. Thus, once an exception handler is processed to address the exception, processing can return to the previous processing and the saved information can be used to identify the exception level to which processing should return.
[0050] In addition to different exception levels, the processing circuit also supports several operating regions, including a root region 82, a secure (S) region 84, a less-secure region 86, and a realm region 88. For ease of reference, the less-secure region is described below as a “non-secure” (NS) region, although it will be understood that this is not intended to imply a particular level (or lack thereof) of security. Instead, “non-secure” simply indicates that the non-secure region is intended for code that is less secure than code operating in the secure region. The root region 82 is selected when the processing circuit 10 is at the highest exception level, EL3. When the processing circuit is at one of the other exception levels, EL0-EL2, the current region is selected based on a current region indicator 14, which indicates which of the other regions 84, 86, 88 is active. For each of the other regions 84, 86, 88, the processing circuit can be at either exception level, EL0, EL1, or EL2.
[0051] At power-up, some boot code (e.g., BL1, BL2, OEM boot) may execute within, for example, the more privileged exception levels EL3 or EL2. Boot code BL1, BL2 may be associated with, for example, the root region, and OEM boot code may operate in the secure region. However, once the system is booted, during execution, processing circuit 10 may be considered to operate in one of regions 82, 84, 86, and 88 at a time. Each of regions 82-88 is associated with its own associated physical address space (PAS). This allows for isolation of data from different regions within at least a portion of the memory system, as will be described in more detail below.
[0052] Non-secure region 86 may be used for normal application level processing and operating system and hypervisor activity for managing such applications. Thus, within non-secure region 86 there may be application code 30 running at EL0, operating system (OS) code 32 running at EL1, and hypervisor code 34 running at EL2.
[0053] The secure region 84 allows certain system-on-chip security, media, or system services to be isolated in a physical address space separate from the physical address space used for non-secure processing. The secure and non-secure regions are not equivalent in the sense that non-secure region code cannot access resources associated with the secure region 84, while the secure region can access both secure and non-secure resources. An example of a system that supports such a division of secure and non-secure regions 84, 86 is a system based on the TrustZone® architecture offered by Arm® Limited. The secure region can run trusted applications 36 at EL0, trusted operating systems 38 at EL1, and optionally a secure partition manager 40 at EL2. EL2, when secure partitioning is supported, can use two page tables to support isolation between different trusted operating systems 38 running within the secure region 84, in a manner similar to how the hypervisor 34 can manage isolation between virtual machines or guest operating systems 32 running within the non-secure region 86.
[0054] Extending systems to support secure domains 84 has become common in recent years because it allows a single hardware processor to support isolated secure processing and avoids the need for processing to occur on a separate hardware processor. However, as the use of secure domains has grown in popularity, many practical systems with such secure domains now support a relatively high degree of heterogeneity of services within the secure domain provided by a wide range of different software providers. For example, the code running within secure domain 84 may include different software providers, including (among other providers) silicon providers that fabricate integrated circuits, original equipment manufacturers (OEMs) that assemble integrated circuits provided by the silicon providers into electronic devices such as mobile phones, operating system vendors (OSVs) that provide operating systems 32 for devices, and / or cloud platform providers that manage cloud servers that support services for many different customers via the cloud.
[0055] However, there is a growing demand for providers of user-level code (which might typically be expected to run as applications 30 in non-secure world 86) to be provided with a secure computing environment that can be trusted not to leak information to other parties running code on the same physical platform. It may be desirable for such a secure computing environment to be dynamically allocable during runtime and to be guaranteed and provable, allowing users to verify whether sufficient security guarantees are provided on the physical platform before entrusting the device with processing potentially sensitive code or data. Users of such software may not want to trust providers of feature-rich operating systems 32 or hypervisors 34 that might typically run in non-secure world 86 (or, even if those providers themselves are trustworthy, users may want to protect themselves from unauthorized access to the operating systems 32 or hypervisors 34 by attackers). While secure world 84 can be used for such user-provided applications requiring secure processing, in practice this creates problems for both users who provide code requiring a secure computing environment and providers of existing code running in secure world 84. For providers of existing code running in secure area 84, the attack surface for potential attacks against their code increases with the addition of arbitrary user-provided code within the secure area. This may be undesirable, and users may therefore be strongly discouraged from allowing code to be added to secure area 84. On the other hand, users who provide code that requires a secure computing environment may be reluctant to trust access to their data or code to all of the different code providers running in secure area 84, as it may be difficult to audit and certify all of the separate code provided by different software providers running in secure area 84 if assurances and certifications of the code running in a particular area are required as a prerequisite for the user-provided code to perform operations.This may limit opportunities for third parties to offer more secure services.
[0056] Thus, as shown in FIG. 2, an additional realm 88, called a realm realm, is provided and can be used by such user-introduced code to provide a secure computing environment orthogonal to any secure computing environment associated with components operating in the secure realm 24. In the realm realm, the executing software can include several realms, each of which can be isolated from other realms by a realm management module (RMM) 46 operating at exception level EL2. The RMM 46 can control the isolation between the respective realms 42, 44 executing in the realm realm 88 by defining access permissions and address mappings within page table structures, for example, similar to how the hypervisor 34 manages the isolation between different components operating in the non-secure realm 86. In this example, the realms include an application-level realm 42 running at EL0 and an encapsulated application / operating system realm 44 running across exception levels EL0 and EL1. It will be appreciated that supporting both EL0 and EL0 / EL1 type realms is not required, and multiple realms of the same type can be established by the RMM 46.
[0057] The realm region 88 has its own physical address space assigned to it, just like the secure region 84. However, the realm region is orthogonal to the secure region 84 in the sense that while the realm region and the secure region 88, 84 each have access to the non-secure PAS associated with the non-secure region 86, the realm region 88 and the secure region 84 do not have access to each other's physical address space. This means that code running in the realm region 88 and the secure region 84 have no dependencies on each other. Code within the realm region only needs to trust the hardware, the RMM 46, and the code running in the root region 82, which manages switching between regions, meaning that attestation and certification are more feasible. Attestation allows given software to request verification that code installed on a device matches certain expected characteristics. This can be done by checking whether a hash of program code installed on the device matches an expected value signed by a trusted party using a cryptographic protocol. The RMM 46 and monitor code 29 may be attested by, for example, checking whether a hash of this software matches an expected value signed by a trusted party, such as the silicon provider that manufactured the integrated circuit that includes the processing system 2, or the architecture provider that designed the processor architecture that supports region-based memory access control. This allows the user-provided code 42, 44 to verify that the integrity of the region-based architecture can be trusted before performing any secure or sensitive functions.
[0058] Thus, as shown by the dotted lines indicating gaps in the non-secure realm where these processes would previously have executed, it can be seen that code associated with realms 42, 44 that would previously have executed in the non-secure realm 86 can now be moved to the realm realm where they may have stronger security guarantees because their data and code cannot be accessed by other code running in the non-secure realm 86. However, due to the fact that the realm realm 88 and the secure realm 84 are orthogonal and therefore cannot see each other's physical address space, this means that providers of code in the realm realm do not need to trust providers of code in the secure realm, and vice versa. Code in the realm realm can simply trust the firmware that provides the root realm 82 and the monitor code 29 of the RMM 46, which may be provided by the silicon provider or the provider of the instruction set architecture supported by the processor. These providers may need to be inherently trusted from the start when code is running on their device, so that no additional trust relationships with other operating system vendors, OEMs, or cloud hosts are required by users in order for them to be provided with a secure computing environment.
[0059] This is useful for a variety of purpose applications and use cases, including, for example, mobile wallet and payment applications, fraud and piracy prevention mechanisms in games, operating system platform security extensions, secure virtual machine hosting, confidential computing, networking, or gatewaying for the Internet of Things. Users will appreciate that they may find many other applications in which Realm support is useful.
[0060] To support the security assurances provided to a Realm, a processing system may support an attestation reporting function, whereby firmware images and configurations, e.g., monitor code images and configurations, or RMM code images and configurations are measured at boot time or during runtime. During runtime, the contents and configurations of the Realm are measured, allowing the Realm Owner to trace back relevant attestation reports to known implementations and assurances and make trust decisions about whether to operate on that system.
[0061] As shown in FIG. 2, a separate root region 82 is provided to manage region switching, with the root region having its own isolated root physical address space. Creating a root region and isolating resources from the secure region allows for a more robust implementation, even in systems with only non-secure and secure regions 86 and 84 and no realm region 88, but it can also be used in implementations that support the realm region 88. The root region 82 can be implemented using monitor software 29 provided (or certified) by the silicon provider or architecture designer and can be used to provide secure boot functionality, trusted boot measurements, system-on-chip configuration, debug control, and firmware update management for firmware components provided by other parties, such as the OEM. Code in the root region can be developed, certified, and deployed by the silicon provider or architecture designer without dependency on the final device. In contrast, the secure region 84 can be managed by the OEM to implement specific platform and security services. Management of the non-secure realm 86 may be controlled by the operating system 32, which provides operating system services, while the realm realm 88 is mutually isolated from existing secure software environments in the secure realm 84 while allowing the development of new forms of trusted execution environments that may be dedicated to user or third-party applications.
[0062] FIG. 3 schematically illustrates another example of a processing system 2 for supporting these techniques. Elements that are the same as in FIG. 1 are designated by the same reference numerals. FIG. 3 illustrates address translation circuitry 16 in greater detail, including a stage 1 memory management unit 50 and a stage 2 memory management unit 52. Stage 1 MMU 50 can be involved in translating either virtual addresses to physical addresses (if the translation is triggered by EL2 or EL3 code) or to intermediate addresses (if the translation is triggered by EL0 or EL1 code, with further stage 2 translation by Stage 2 MMU 52 being necessary). Stage 2 MMU can translate the intermediate addresses to physical addresses. Stage 1 MMU can be based on page tables controlled by the operating system for translations starting from EL0 or EL1, page tables controlled by the hypervisor for translations from EL2, or page tables controlled by monitor code 29 for translations from EL3. Stage 2 MMU 52, on the other hand, can be based on page table structures defined by the hypervisor 34, RMM 46, or secure partition manager 14, depending on which region is being used. Separating the translation into two stages in this manner allows operating systems to manage address translation for themselves and for applications, assuming they are the only operating systems running on the system, while RMM 46, hypervisor 34, or SPM 40 can manage isolation between different operating systems running within the same realm.
[0063] 3, the address translation process using address translation circuitry 16 can return security attributes 54 that, in combination with the current exception level 15 and the current region 14 (or security state), allow a particular section of physical address space (identified by a PAS identifier or "PAS TAG") to be accessed in response to a given memory access request. The physical address and PAS identifier can be looked up in a granular protection table 56, which provides the granular protection information described above. In this example, PAS filter 20 is shown as a granular memory protection unit (GMPU) that verifies whether the selected PAS can access the requested physical address and, if so, allows the transaction to be passed to any caches 24 or interconnects 8 that are part of the system fabric of the memory system.
[0064] The GMPU 20 allows memory to be allocated to separate address spaces while at the same time providing strong hardware-based isolation guarantees, providing spatial and temporal flexibility in how physical memory is allocated to these address spaces, as well as an efficient sharing scheme. As previously mentioned, the execution units in the system are logically divided into virtual execution states (regions or "worlds"), with one execution state (root world) located at the highest exception level (EL3), called the "root world," and the root world manages the allocation of physical memory to these worlds.
[0065] A single system physical address space is virtualized into multiple "logical" or "architectural" physical address spaces (PAS), where each such PAS is an orthogonal address space with independent coherency properties. A system physical address is mapped into a single "logical" physical address space by extending it with a PAS tag.
[0066] A given world is allowed access to a subset of the logical-physical address space. This is enforced by a hardware filter 20 that can be attached to the output of the memory management unit 16.
[0067] The world defines the security attributes (PAS tags) of the access using fields in the translation table descriptor of the page table used for address translation. The hardware filter 20 has access to a table (Granule Protection Table 56, or GPT) that defines granule protection information (GPI) for each page in the system physical address space, which indicates the PASTAG with which it is associated, and (optionally) other granule protection attributes.
[0068] The hardware filter 20 checks the world ID and security attributes for the GPI of the granule to determine whether access can be granted, thus forming a Granular Memory Protection Unit (GMPU).
[0069] GPT56 can reside, for example, in on-chip SRAM or off-chip DRAM. If stored off-chip, GPT56 can be integrity protected by an on-chip memory protection engine, which can use encryption, integrity, and freshness mechanisms to maintain the security of GPT56.
[0070] Locating GMPU 20 on the requester side of the system (e.g., on the MMU output) rather than on the completer side allows Interconnect 8 to assign access permissions at page granularity while allowing continuous hashing / striping of pages across multiple DRAM ports.
[0071] The transaction remains tagged with the PAS TAG as it propagates throughout the system fabric 24, 8 until it reaches a location defined as a physical aliasing point 60. This allows filters to be placed on the master side without weakening security guarantees compared to slave-side filtering. As transactions propagate throughout the system, the PAS TAG can be used as a fine-grained security mechanism for address isolation. For example, a cache may add a PAS TAG to the address tag in the cache to prevent incorrect PAS entries for the same PAS. It can prevent accesses made using the TAG from hitting the cache, thereby improving side-channel resistance. The PAS TAG can also be used as a context selector for a protection engine attached to a memory controller that encrypts data before it is written to external DRAM.
[0072] The Point of Physical Aliasing (PoPA) is the location in the system where the PAS TAG is stripped and addresses change from logical physical addresses back to system physical addresses. The PoPA can be located below the cache on the completer side of the system, where accesses to physical DRAM are made (using the cryptographic context resolved via the PAS TAG). Alternatively, it may be located above the cache to simplify system implementation at the expense of weakened security.
[0073] At any point, a world can request that a page be transitioned from one PAS to another. The request is made at EL3 to monitor code 29, which examines the current state of the GPI. EL3 may allow only a specific set of transitions to occur (e.g., non-secure PAS to secure PAS, but not realm PAS to secure PAS). To provide a clean transition, a new instruction, "Delete Data and Invalidate to Physical Aliasing Point," is supported by the system and can be submitted by EL3 before transitioning the page to the new PAS. This ensures that any residual state associated with the previous PAS is flushed from any caches upstream of PoPA 60 (closer to the requester).
[0074] Another property that can be achieved by attaching the GMPU 20 to the master side is efficient sharing of memory between worlds. It may be desirable to allow a subset of N worlds shared access to a physical granule while preventing other worlds from accessing it. This can be achieved by adding a "limited sharing" semantic to the granule protection information and enforcing it to use a specific PAS TAG. As an example, a GPI can indicate that a physical granule can only be accessed by the "realm world" 88 and the "secure world" 84 while tagged with the PAS TAG of the secure PAS 84.
[0075] The example properties above result in rapid changes in the visibility characteristics of a particular physical granule. Consider the case where each world is assigned a private PAS accessible only to that world. For a particular granule, a world can request that it become visible to the non-secure world at any time, without changing its PAS association, by changing its GPI from "exclusive" to "limitedly shared with non-secure world." In this way, the visibility of that granule can be increased without requiring costly cache maintenance or data copy operations.
[0076] 4 illustrates the concept of aliasing the respective physical address spaces on the physical memory provided in the hardware. As previously mentioned, each of the regions 82, 84, 86, 88 has its own respective physical address space 61.
[0077] At the time a physical address is generated by address translation circuitry 16, the physical address has a value within a particular numeric range 62 supported by the system, which is the same regardless of which physical address space is selected. However, in addition to generating the physical address, address translation circuitry 16 may also select a particular physical address space (PAS) based on information in the current region 14 and / or the page table entry used to derive the physical address. Alternatively, instead of address translation circuitry 16 performing the PAS selection, the address translation circuitry (e.g., an MMU) can output a physical address and information derived from a page table entry (PTE) that is used to select the PAS, and this information can then be used by the PAS filter or GMPU 20 to select the PAS.
[0078] The selection of a PAS for a given memory access request may be limited depending on the current domain in which processing circuit 10 operates when issuing the memory access request, according to the rules defined in the table below.
[0079] [Table 1] For regions where there are multiple physical address spaces available to choose from, information from the accessed page table entry used to provide the physical address is used to select between the available PAS options.
[0080] Thus, by the time the PAS filter 20 outputs a memory access request to the system fabric 24, 8 (assuming it passes any filtering checks), the memory access request is associated with a physical address (PA) and a selected physical address space (PAS).
[0081] From the perspective of memory system components (caches, interconnects, snoop filters, etc.) operating before the physical aliasing (PoPA) point 60, each physical address space 61 is seen as an entirely separate address range corresponding to a different system location in memory. This means that from the perspective of the pre-PoPA memory system components, the address range identified by a memory access request is actually four times the size of the range 62 that may be output in the address translation. This is because the PAS identifier is effectively treated as additional address bits alongside the physical address itself, so that the same physical address PAx may be mapped to several aliased physical addresses 63 within the separate physical address spaces 61, depending on the PAS selected. These aliased physical addresses 63 all actually correspond to the same memory system location implemented in physical hardware, but the pre-PoPA memory system components treat the aliased addresses 63 as separate addresses. Therefore, if there is a pre-PoPA cache or snoop filter that allocates entries to such addresses, the aliased addresses 63 will be mapped to different entries with separate cache hit / miss determinations and separate coherency management. This reduces the likelihood or effectiveness of an attacker using cache or coherency side channels as a mechanism to probe the behavior of other domains.
[0082] A system can include multiple PoPAs 60. In each PoPA 60, aliased physical addresses are folded into a single unaliased address 65 within the system physical address space 64. The unaliased address 65 is provided to any downstream post-PoPA components, so that the system physical address space 64 that actually identifies a memory system location is again the same size as the range of physical addresses that can be output in the address translation performed on the requester side. For example, in a PoPA 60, the PAS identifier can be stripped from the address, and for downstream components, the address can be identified simply using the physical address value without specifying a PAS. Alternatively, if some completer-side filtering of memory access requests is desired, the PAS identifier can still be provided downstream of the PoPA 60, but it may not be interpreted as part of the address. As a result, the same physical address appearing in different physical address spaces 60 will be interpreted downstream of the PoPA to point to the same memory system location. However, the provided PAS identifier can still be used to perform completer-side security checks.
[0083] 5 illustrates how system physical address space 64 can be divided into chunks allocated for access within a particular architectural physical address space 61 using a granule protection table 56. Granule protection table (GPT) 56 defines which portions of system physical address space 65 are accessible from each architectural physical address space 61. For example, GPT 56 may contain several entries, each corresponding to a particular size granule of physical addresses (e.g., 4K pages), and may define the granule's assigned PAS, which may be selected from among non-secure, secure, realm, and root regions. By design, if a particular granule or set of granules is assigned to a PAS associated with one of the regions, it can only be accessed within the PAS associated with that region and cannot be accessed within the PASs of other regions. However, note that even though (for example) granules allocated to the secure PAS are not accessible from within the root PAS, the root region 82 can still access that granule of physical addresses by specifying PAS selection information in its page table to ensure that virtual addresses associated with pages mapped to that area of physically addressed memory are translated to physical addresses in the secure PAS instead of the root PAS. Thus, data sharing between regions (to the extent permitted by the accessibility rules defined in the table above) can be controlled at the time of selecting a PAS for a given memory access request.
[0084] However, in some implementations, in addition to enabling access to granules of physical addresses within the assigned PAS defined by the GPT, the GPT can use other GPT attributes to mark a region of address space (e.g., an address space associated with a region of lower or orthogonal privilege that would not normally be permitted to select the assigned PAS for access requests for that region) as shared with another address space. This can facilitate temporary sharing of data without having to change the assigned PAS for a given granule. For example, in FIG. 5 , realm PAS region 70 is defined in the GPT to be assigned to the realm region and is normally inaccessible from non-secure region 86 because non-secure region 86 cannot select the realm PAS for its access requests. Because non-secure region 26 does not have access to the realm PAS, non-secure code would not normally be able to see data in region 70. However, if a realm wants to temporarily share some of its data in its allocated region of memory with a non-secure region, it can request that monitor code 29 running in root region 82 update GPT 56 to indicate that region 70 is shared with non-secure region 86, thereby making region 70 accessible from the non-secure PAS shown on the left side of FIG. 5 without having to change which regions are allocated to region 70. When a realm region indicates a region of its address space as shared with a non-secure region, a memory access request issued from the non-secure region and targeting that region may initially specify a non-secure PAS, but PAS filter 20 can remap the request's PAS identifier to instead specify a realm PAS. Downstream memory system components then treat the request as if it had originally issued from the realm region. This sharing can improve performance because the operations to assign a different region to a particular memory region may be more performance-intensive, involving a higher degree of cache / TLB invalidation and / or data zeroing in memory or copying data between memory regions.This may not be justifiable if the sharing is expected to be only temporary.
[0085] 6 is a flow diagram illustrating how to determine the current operating region, which may be performed by the processing circuit 10, or by the address translation circuit 16 or the PAS filter 20. In step 100, it is determined whether the current exception level 15 is EL3. If so, then in step 102, it is determined that the current region is the root region 82. If the current exception level is not EL3, then in step 104, it is determined that the current region is one of the non-secure, secure, and realm regions 86, 84, 88, as indicated by at least two region indicator bits 14 in the processor's EL3 control register. (Because a root region is indicated by the current exception level being EL3, it may not be necessary to have a code in the region indicator bits 14 corresponding to the root region, and therefore the code in at least one region indicator bit may be reserved for another purpose.) The EL3 control register is writable when operating at EL3 and cannot be written from the other exception levels EL2-EL0.
[0086] 7 illustrates example page table entries (PTEs) that can be used by address translation circuitry 16 for page table entries in a page table structure used for virtual-to-physical address mapping, virtual-to-intermediate address mapping, or intermediate-to-physical address mapping (depending on whether the translation is occurring in an operational state that requires a stage 2 translation at all, and if a stage 2 translation is required, whether the translation is stage 1 or stage 2). In general, a given page table structure may be defined as a multi-level table structure implemented as a page table tree where the first level of the page table is identified based on a base address stored in a translation table base address register of the processor, and the index that selects a particular level 1 page table entry in the page table is derived from a subset of bits of the input address against which the translation lookup is performed (the input address may be the virtual address for the stage 1 translation of the intermediate address for the stage 2 translation). The level 1 page table entry may be a “table descriptor” 110 that provides a pointer 112 to the next level page table, from which further page table entries may be selected based on further subsets of bits of the input address. Finally, after one or more lookups into successive levels of page tables, a block or page descriptor PTE 114, 116, 118 can be identified that provides an output address 120 corresponding to the input address. The output address may be an intermediate address (for stage 1 translations performed in operational states where a further stage 2 translation is also performed) or a physical address (for stage 2 translations, or for stage 1 translations when stage 2 is not required).
[0087] To support the separate physical address spaces described above, the page table entry format may specify some additional state for use in physical address space selection, in addition to the next level page table pointer 112 or output address 120, and optional attributes 122 for controlling access to the corresponding block of memory.
[0088] For table descriptors 110, PTEs used by any region other than non-secure region 86 include a non-secure table indicator 124 that indicates whether the next-level page table should be accessed from the non-secure physical address space or the current region's physical address space. This helps facilitate more efficient management of page tables. In many cases, the page table structure used by the root, realm, or secure region 24 may need to define special page table entries for only a portion of its virtual address space, and the same page table entries used by the non-secure region 26 can be used for other portions. Thus, by providing the non-secure table indicator 124, realm / secure-only table descriptors can be provided at higher levels of the page table structure, while at some point in the page table tree, the root realm or secure region can switch to using page table entries from the non-secure region for portions of its address space where the higher security is not required. Other page table descriptors in other portions of the page table tree can still be fetched from the associated physical address space associated with the root, realm, or secure region.
[0089] On the other hand, block / page descriptors 114, 116, 118 may include physical address space selection information 126 depending on which region they are associated with. The non-secure block / page descriptor 118 used within the non-secure region 86 does not include any PAS selection information because the non-secure region has access only to the non-secure PAS. However, for other regions, the block / page descriptors 114, 116 include PAS selection information 126 used to select the PAS to translate the input address. For the root region 22, the EL3 page table entry may have PAS selection information 126 including at least two bits to indicate the PAS associated with any of the four regions 82, 84, 86, 88 as the selected PAS to which the corresponding physical address will be translated. In contrast, for the realm and secure regions, the corresponding block / page descriptor 116 need only include one bit of PAS selection information 126, which selects between the realm and non-secure PAS for the realm region and between the secure and non-secure PAS for the secure region. To improve the efficiency of circuit implementation and avoid increasing the size of the page table entry, for realm and secure regions, the block / page descriptor 116 can share the PAS selection information 126 because the PAS selection information 126 can be coded in the same location in the PTE regardless of whether the current region is realm or secure.
[0090] As shown in FIG. 8, a page table structure may be implemented using multiple levels of page tables 150, 152, 154, 156 that may be traversed in a page table walk operation to identify the address mapping of a particular target address. As shown in FIG. 8, a given set of index bits L0I may be used to index into a level 0 (L0) page table 150, whose location in memory is identified by a level 0 base address 151. The indexed entry in the L0 table 150 identifies a pointer that provides an L1 base address that identifies a location in memory of an L1 page table 152. A different subset of the index bits L1I from the target address selects one of the entries in the L1 page table 152, which in turn identifies an L2 base address that identifies a memory location in an L2 page table 154. Another subset of the index bits L2I from the target address table is indexed into an L2 page table 156 to identify an L3 base address that identifies a location in an L3 page table 154. A further subset of bits L3I of the target address then selects a particular entry in L3 page table 156 that provides the actual address mapping for mapping the target address to a translation address, such as a physical address (as well as any associated access permission and / or PAS selection information). Thus, L3 page table 156 is the final page table, providing leaf page table entries that provide the actual address mapping information, while higher level page tables 150, 152, 154 provide intermediate entries that identify the base addresses of the next level page tables.
[0091] It will be understood that providing four levels of page tables is merely an example, and others may use different numbers of levels of page tables. Also, if larger blocks of address space share the same translation mappings and other information, one of the entries in a higher-level page table 150, 152, 154 may specify that it is a leaf entry that directly provides the address mapping, so that there is no need to further step through subsequent levels (while other entries in the same higher-level page table 150, 152, 154 can still function as branch entries that contain base addresses that point to lower-level page tables).
[0092] Dividing the page table into different levels in this manner can reduce the total amount of memory storage required to store the entire page table structure by not having to locate address mappings for translating a given amount of address space in a region of memory whose size is proportional to the size of the addresses being mapped, but rather by taking advantage of the fact that often large chunks of address space do not yet have mappings defined by the operating system or other process that sets up address translation data. While Figure 8 shows an example in which index bits L0I, L1I, etc. are used directly as an index to select the corresponding page table entry, the index may also be the result of a hash function applied to the index bits.
[0093] In some systems, the TLB 18 may include separate cache structures for caching translation entries from different levels of page tables. For example, the TLB 18 may include a main TLB structure for caching leaf entries from the last-level page table 156, as well as a walk cache structure for caching higher-level page table entries from the page tables 150, 152, and 154. Meanwhile, other embodiments may provide a TLB that caches address translation data from multiple levels of page tables using a shared cache structure. Other embodiments may cache only leaf entries that may be looked up to provide an address mapping corresponding to a given VA, but may not carry branch entries from the higher-level page tables 150, 152, and 154. Any of these approaches may be used. While FIG. 1 shows a single TLB 18, some implementations may include multiple levels of TLB cache structures in the cache hierarchy to trade off capacity for access latency (e.g., fewer entries stored in the level 0 TLB for faster access, and more entries stored in the level 1 TLB for slower access in case of a level 0 TLB miss).
[0094] In some operating states of processor 10, the address translation process may also include multiple stages of address translation (whether one or two stages of address translation are required may depend on the current exception level 15 and / or configuration information set in register 12). For example, a VA used to identify a memory location by instructions executed by an application or operating system running on CPU 4 may be translated to an intermediate physical address (IPA) in stage 1 translation. A stage 1 address translation structure for controlling stage 1 address translation may be set, for example, by the operating system or another process operating at EL1. From the operating system's perspective, the IPA generated in stage 1 address translation can be assumed to be the physical address of the actual memory location being accessed. However, to support virtualization and prevent conflicts between identical IPAs used by different operating systems coexisting on the same device, a hypervisor or other process operating at EL2 may provide the memory system with an additional, second-stage address translation between IPA and PA. As described above with reference to FIGS. 4 and 5, these PAs may be PAs within selected physical address spaces, and some pre-PoPA memory system components may treat identical PA values in different physical address spaces as if they point to different physical locations. Thus, there may be a second stage translation table structure defined by code running in EL2 to control stage 2 address translation.
[0095] Note that each of the two stages of address translation can use multiple levels of page tables, as shown in Figure 8. Thus, a full page table walk to identify the address mapping of a given block of addresses identified by the target VA may require that each base address of a page table used in the Stage 1 address translation pass through a Stage 2 address translation before accessing the corresponding level of the Stage 1 page table. That is, in an example where both the Stage 1 and Stage 2 tables include four levels of page tables, as shown in Figure 8, the full page table walk process may include accessing the multiple levels of page tables in the following order: ● Stage 2 translation of the Stage 1 Level 0 page table base address 121 to PA (because the Stage 1 translation structure is constructed by code running at EL1, the Stage 1 Level 0 base address can be an IPA address). The Stage 2 translation involves four lookups (Stage 2, Level 0; Stage 2 Level 1; Stage 2 Level 2; Stage 2 Level 3). ● Stage 1 level 0 lookup based on the level 0 index portion L0I of the target VA to identify the stage 1 level 1 base address (IPA). ● Stage 2 translation of Stage 1 level 1 base address to PA (again, involving four lookups). ●Stage 1 Level 1 lookup based on the Level 1 index portion L1I of the target VA to identify the Stage 1 Level 2 base address (IPA) Stage 2 translation of stage 1 level 2 base address to PA (also involves 4 lookups) ● Stage 1 Level 2 lookup based on the Level 2 index portion L2I of the target VA to identify the Stage 1 Level 3 base address (IPA). ● Stage 2 translation of Stage 1 level 3 base address to PA (again involving four lookups). ● Stage 1 level 3 lookup based on the level 3 index portion L3I of the target virtual address to identify the target IPA corresponding to the target VA. Stage 2 translation of the target IPA to a target PA that can be returned as the translated address corresponding to the original target VA (again, involving four lookups).
[0096] Thus, without caching, the translation involves a total of 24 lookups. As can be seen from the above sequence, performing the entire page table walk process can be very slow, as it may require numerous accesses to memory to step through each level of the page tables for each stage of the address translation. This is why it is often desirable to cache not only the last-level address mapping, but also information from entries from the upper-level page tables of the Stage 1 and Stage 2 tables in the TLB 18. This allows at least some steps of the full page table walk to be bypassed even if the last-level address mapping for a given target address is not currently in the address translation cache.
[0097] In systems that support two stages of address translation, some TLBs 18 may be implemented as split TLBs, with separate cache structures provided for caching information from the stage 1 and stage 2 page table structures, respectively. In this case, two separate TLB lookups may be required to process a translation request that specifies a VA: one lookup in the stage 1 TLB to identify the corresponding IPA, and one lookup in the stage 2 TLB to identify the PA corresponding to that IPA. Alternatively, a page table walk operation for an address request that undergoes two stages of address translation may require separate lookups in the stage 1 and stage 2 page table structures to first identify the mapping of the VA to the IPA and then the mapping of the IPA to the PA; once this is done, the combined stage 1 and stage 2 TLBs may be populated with an entry that directly maps the VA to the PA, so that future accesses to the same VA can retrieve the PA from TLB 18 without having to perform two separate lookups.
[0098] In a typical page table structure having multiple levels, such as that shown in Figure 8, the maximum number of levels in the structure is fixed (e.g., four levels in the example of Figure 8), and the table size of the table at a given level of the table structure, the size of the region of address space to which individual table entries at a given level are applicable, and the position / size of the offset bits are typically either fixed and not variable at all, or variable based on global parameters set for the table structure as a whole.
[0099] For example, a four-level page table structure may be implemented with a variable granule size selectable from among a number of options (e.g., 4, 16, or 64 kB), where the size per entry, offset bit position / size, and table size may be as follows in one exemplary implementation: (Note: ● "Size per entry" indicates the size of the address range to which the information in a given page table entry at a given level is applicable (not the size of the table data for that entry itself, "Granule size" refers to the size per entry of a level 3 block descriptor entry. ● "Offset bits" refers to the bits extracted from the input address (VA for stage 1, IPA for stage 2) to select a particular entry from the table at a given level of the table structure; ● "Table size" refers to the minimum table size that can be allocated to a table, which is the size of the table data for one table entry plus 2 X where x corresponds to the product of x and x, and x is the number of offset bits used to index into that level of the table. This particular example assumes table entries with 64 bits of table data per entry, i.e., 8 bytes, but other examples may use different entry sizes.
[0100] [Table 2] In this particular example, there is a restriction to the use of 52-bit addresses, and if the selected granule size is 4kB or 16kB, the maximum virtual address region size is 48 bits. Similarly, output addresses are limited to 48 bits. 52-bit addresses can only be used if 64kB granules are used in this example. Of course, other examples may define addresses of other sizes.
[0101] It will be understood that the above table shows the offset portions used for each level for one particular example, and that the size / location of the particular offset portion is not required. However, it serves to illustrate that in a typical page table, the location / size from which the offset portion for a given table level is extracted will be the same for all tables at that level within the entire table structure (they do not vary between different tables at the same level), fixed for that level (if only fixed granule sizes are supported), or variable based on global parameters defined for the table structure as a whole.
[0102] Also note that when a block descriptor entry is defined at a level other than level 3, it defines access control information applicable to regions of the size indicated by the "size per entry" at that level. For example, for a 4kB granule size, any entry (table descriptor or block descriptor) at level 1 is applicable to a region of size 1GB, so a block descriptor can be defined at level 1 only if all addresses within a contiguous 1GB region share the same access control attributes (address mapping, associated permissions indicated in the page table, and PAS selection information). If 4kB regions with different access control attributes are to be defined, block descriptor entries must be provided at level 3, requiring a traversal of all four levels of the page table structure.
[0103] 9 is a flow diagram illustrating a method for selecting a PAS based on information 124, 126 from the current region and block / page PTEs used in generating a physical address for a given memory access request. The PAS selection may be performed by the address translation circuitry 16, or by a combination of the address translation circuitry 16 and the PAS filter 20 if the address translation circuitry sends PAS selection information 126 to the PAS filter 20.
[0104] In step 130 of FIG. 8 , processing circuit 10 issues a memory access request specifying a given virtual address (VA) as the target VA. In step 132, address translation circuit 16 looks up any page table entries (or cache information derived from such page table entries) in its TLB 18. If any necessary page table information is not available, address translation circuit 16 initiates a page table walk to memory to fetch the necessary PTE (potentially requiring a series of memory accesses to step through each level of the page table structure and / or multiple stages of address translation to obtain the mapping from VA to intermediate address (IPA) and from IPA to PA). Any memory access request issued by address translation circuit 16 in a page table walk operation may itself be subject to address translation and PAS filtering. Note that the request received in step 130 may therefore be a memory access request issued to request a page table entry from memory. Once the relevant page table information is identified, the virtual address is translated to a physical address (possibly in two stages via the IPA). In step 134, the address translation circuit 16 or PAS filter 20 determines which region is the current region using the technique shown in FIG.
[0105] If the current region is a non-secure region, then in step 136 the output PAS selected for this memory access request is a non-secure PAS.
[0106] If the current region is a secure region, then in step 138 the output PAS is selected based on the PAS selection information 126 contained in the block / page descriptor PTE that provided the physical address, and the output PAS is selected as either a secure PAS or a non-secure PAS.
[0107] If the current region is a realm region, then in step 140, the output PAS is selected based on the PAS selection information 126 contained in the block / page descriptor PTE from which the physical address was derived, in which case the output PAS is selected as either a realm PAS or a non-secure PAS.
[0108] If step 134 determines that the current region is a root region, then step 142 selects an output PAS based on the PAS selection information 126 in the root block / page descriptor PTE 114 from which the physical address was derived. In this case, the output PAS is selected as one of the physical address spaces associated with the root, realm, secure, and non-secure regions.
[0109] 10 is a flow diagram illustrating filtering of memory access requests by filtering circuitry 20. In step 170, a memory access request is received from address translation circuitry 16 (assuming that the permission checks performed by the address translation circuitry have already passed). The received memory access request specifies a target PA and is associated with a selected output PAS (also referred to as a "selected PAS") as described above with respect to FIG. 9. As discussed above, the output PAS may be indicated by address translation circuitry 16 providing an explicit identifier indicating the selected PAS, or by address translation circuitry 16 forwarding PAS selection information 126 read from a page table to filtering circuitry 20, which can be used, along with an indication of the current domain of processing circuitry 10, to determine the output PAS in filtering circuitry 20.
[0110] In step 172, filtering circuit 20 obtains granule protection information (GPI) corresponding to the target PA. This may be done by obtaining the GPI from granule protection information cache 22 if it is already in the cache, or by having GPI walk circuit 23 obtain the GPI from memory by performing a granule protection table walk. A method for performing a GPI walk is further described below with respect to FIG. 13.
[0111] Once the GPI corresponding to the target PA is obtained, in step 174, the filtering circuit 20 determines whether the output PAS is indicated as an allowed PAS by the GPI associated with the target PA. If the output PAS is not indicated as an allowed PAS by the GPI of the target PA, in step 178, the memory access request is blocked and a fault is signaled. The signaled fault may be associated with a fault type that identifies that the fault is handled by program code executed in the root domain in EL3, and may be associated with fault syndrome / status information that indicates the cause of the fault, such as identifying the target PA that was being accessed by the memory access request that caused the fault. On the other hand, if the output PAS of the memory access request is indicated by the GPI as an allowed PAS, in step 176, the memory access request is allowed to be passed to the cache 24 or interconnect 8 so that the memory access request can be processed by the underlying memory system. The memory access request is passed to the cache 24 and / or interconnect 8 along with an indication of the target PA and PAS associated with the memory access request. Thus, filtering circuitry 20 can monitor whether the target PA of a memory access request is permitted to be accessed as part of the physical address space selected for the request, to implement the separation and division of the physical address space as described above with respect to Figures 4 and 5.
[0112] The granule protection table accessed by the GPT walk circuit 23 may use a table structure such as that shown in Figure 8, with multiple levels, each level storing a pointer to the start of the next level table, where the full table is traversed by extracting offsets from static locations in the input address, these locations being defined by the granule size, and the maximum number of levels of nested tables is fixed. A typical way to manage protection tables is to use such nested structures based on the constraint that the maximum memory available to hold a "branch table" (a table that is not the last level) or a "leaf table" (a table at the last level) is a certain size, such as a single page.
[0113] However, because the GMPU 20 is managed by a root of trust, it can exist in a carve-out to take advantage of more memory linearity. We propose a new table format that leverages this property and allows for the creation of page tables that can combine different numbers of levels in each "subtree" of the page table. Thus, the example described below provides a method for efficiently storing protection information at physical page granularity. This is achieved through a novel form of inverted page table. In its basic form, an inverted page table is indexed by the address of a physical page (or "physical granule") and stores information related to that page. The granular protection table format introduced here has a structure that allows for more trade-off space between the following parameters: the address range covered by the table, the maximum number of lookups required to traverse the table, and the static cost (table size) that must be paid by leveraging linear range and localized parameters. The observation used is that there are locations in the physical address space that require the fastest possible access, while other locations may have looser performance requirements, thus providing an opportunity to save table space. This is achieved by allowing offsets to have their size / location calculated based on parameters extracted from entries within the table itself.
[0114] By applying "hybrid nesting" to the GPT, each entry in the first level of the table can span "subtrees" with different maximum lookup numbers, called nesting levels (NL). ● The size of the table at any level other than the last is defined by a set of constants that are specific to each {NL,Level}. • The size of the table at the last level of the subtree is calculated based on the remaining range that has to be covered after considering all previous levels. The size / location of the offset used to index a table at a given level in the table structure depends on the NL and the level of that table.
[0115] Therefore, we present an efficient nested page table format in which the size of the table at each level is not necessarily a fixed size (as is common practice in the state of the art), and the maximum number of levels of each "subtree" within a nested page table is not necessarily a global constant.
[0116] The Granule Protection Table describes the permission properties of physical pages within the system's address space. Because not all address ranges within the system address space contain pages requiring protection, the basic structure of the table can be a two-level table, with first-level (L0GPT) entries describing properties of memory blocks or containing pointers to second-level (L1GPT) tables. However, such a structure can be further developed to have "dense subtrees" that are quickly traversed and utilize large linear memory, and "sparse subtrees" that take longer to traverse but have moderate memory allocation requirements.
[0117] FIG. 11 shows an example of the format of a GPT entry. A GPT entry can be either a table descriptor entry 180 that points to a next-level GPT entry, or a block descriptor entry 200 that provides granule protection information (GPI) that specifies the protection characteristics of the corresponding granule or physical address. As shown in FIG. 11, a block descriptor GPT entry 200 includes several GPI fields 194, each of which provides information related to a corresponding granule of a physical address. Because only a few bits are required to define the permissions associated with a page, a single block descriptor table entry 200 can include the GPI properties of multiple granules. As an example, a last-level block descriptor entry 200 in the protection table is 8 bytes in size and can accommodate 16 4-bit fields 194, with each field (granule protection information or GPI) 194 specifying the protection characteristics of a single physical granule.
[0118] For example, the protected properties described by a GPI may be: The physical address space (PAS) with which the granule is associated (identifying that PAS as an authorized PAS and all other PAS as unauthorized PAS). • An encoding that specifies that the granule is not associated with any PAS (and therefore cannot be accessed - i.e., a PAS that is not authorized by any PAS). • An encoding that specifies that a granule can be associated with any PAS, i.e., all PASs are permitted PASs. ●In examples that support restrictive sharing as described above, other encodings may identify PASs in which two or more subsets of the PASs are permitted, but at least one other PAS is not permitted.
[0119] The mapping of which particular encodings in GPI field 194 identify each different protection property can be chosen arbitrarily for a particular instruction set architecture. For example, different properties selected from the above list can be assigned different 4-bit encodings 0000, 0001, 0010, etc.
[0120] Thus, each GPI field 194 provides information identifying one or more allowed physical address spaces of zero associated with the corresponding physical address granule. GPI encodings can also be assigned to indicate other information, and therefore it is not required that each GPI field be 4 bits as in the specific example of FIG. 11. Not all encodings of a GPI field are valid. There may be some invalid encodings that are reserved for future expansion or remain after encoding all GPI options that are deemed necessary. Other invalid encodings can be used to represent other information other than the valid options of a GPI attribute, such as the adjacency indicator 300, described further below.
[0121] A table descriptor GPT entry 180 contains a number of pieces of information, including a nesting level (NL) parameter 190, a next-level table pointer 193 that provides an address marking the start of the granule protection table at the next level in the table structure, and a type identifier field 196 that distinguishes the table descriptor entry 180 from a block descriptor entry 200. Note that when the GPI field is set in the corresponding portion of the block descriptor entry used to encode the type ID field 196 in the table descriptor entry 200, the type ID field 196 in the table descriptor entry 180 can be selected to have a value that does not occur for a valid GPI encoding, so the block descriptor entry 180 itself need not have a type ID field 196. For example, the type ID field 196 in the table descriptor entry 180 could be recorded in the location of a particular GPT field 194 in the block descriptor entry and set to one of the invalid encodings for that GPT field 194. This allows for more efficient use of the encoding space of the block descriptor entry 200 by avoiding the need for an explicit type ID field.
[0122] Optionally, the table descriptor entry 180 may also specify one or more attributes 192, whose attributes may provide other information related to the address region represented by the subtree underlying the table structure. Although not shown in Figure 11, it will be understood that each GPE 180, 200 may also include unspecified information. Also, the particular order of fields 190, 192, 193, 196 shown in Figure 11 is merely an example, and other examples may have fields in a different order.
[0123] The variable nesting level parameter 190, NL, controls several aspects related to the nesting of multiple levels of tables within the GPT table structure. In particular, by changing the NL specified in the table descriptor entry 180 accessed for a particular address within the starting level granule protection table (e.g., an L0 granule protection table accessed based on a stored GPT base address, similar to the L0 table 150 accessed based on the L0 base address 151 shown in FIG. 8 for a page table walk), the GPT walk circuitry 23 changes the size and location of each offset portion of the target physical address used to index into each level of tables within the multi-level GPT structure. The NL parameter 190 also controls the maximum number of levels traversed to reach a block descriptor entry 200 for a given physical address, the table size (memory footprint) associated with tables at a given level of the table structure, and the "size per entry," which indicates the size of the address range to which the information in a given table entry of a given entry is applicable.
[0124] In this example, the NL field 190 is ignored for table descriptors accessed at levels of the table structure other than the starting level, so that the NL parameter 190 in the starting level of the table structure controls how all tables in the corresponding subtree below that starting level's table descriptor entry 180 are accessed.
[0125] In this example, the following global parameters are specified for the table: PGS[1:0] - Physical granule size (e.g., PGS=0 indicates a 4KB granule size, PGS=1 indicates a 16KB granule size, and PGS=2 indicates a 64KB granule size). SL[1:0] - Starting level (0 - level 0, 1 - level 1, 2 - level 2, 3 - level 3). The starting level is level 0 for a table that may be 4 levels deep, level 1 for a table that may be 3 levels deep, etc. ● SLBS[5:0] - Start level block size - exponent of the block size described by the start level entry (block size = 2^SLBS). TSZ[5:0], the exponent of the total size of the memory described by the table (total size = 2^TSZ)
[0126] For each entry in the starting level, the following parameters are specified: Entry type 196 (block / descriptor) Nesting Level (NL) 190 - The nesting level defines the maximum number of levels a subtree can be constructed at (1 = 2 levels, 2 = 3 levels, etc.). The NL defines which bits of the input address are used as an offset to access the next level table.
[0127] The table size is defined as follows: ●The size of the starting level table is defined by the Total Size and Block size. ●The size of the table at any other level that is not the last level is a constant defined per {NL,Level}, where NL is taken from the starting level table entry accessed on the path traversing the tree structure to reach the table at that other level. • The size of the table at the last level of the subtree is calculated based on the remaining range that has to be covered after considering all previous levels.
[0128] Below is an example of how NL can be used to calculate the offsets used to traverse each subtree in a hybrid table. This example is based on the following principles (obviously these can be modified for other examples): ●The size of a table entry (TES) is 8 bytes. ●Granule size (GS) is 2^(12+PGS) ●An entry in the last level table has 16 GPI fields, each describing the characteristics of a single granule. The GPI Size (GPIS) is 4 bits. The entry in the start-level table describes a block size (BS) of size 2^SLBS, and therefore the table itself is (2^TSZ / BS) * It has a table size of TES. ●For StartLevel, NestingLevel indicates a subtree consisting of two levels, and the second level table is (BS / GS) * It has the table size of GPIS. ●For StartLevel, NestingLevel indicates a subtree consisting of three levels, then ○ The second level table has a table size of GS ○The third level table is ((BS / (GS / TES)) / GS) * Has the table size of GPIS ●For StartLevel, NestingLevel indicates a subtree consisting of four levels, then ○ The second level table has a table size of GS ○The third level table has a table size of GS ○The fourth level table is ((BS / (GS / TES) / (GS / TES)) / GS) * Has the table size of GPIS
[0129] The offset can be derived from the NL parameter and the global parameter as follows (where SL refers to the starting level of the table and SL.NL refers to the NL parameter specified by the entry in the starting level table selected based on the starting level offset portion of the target address):
[0130] [Table 3] Note that when SL.NL=1, tables at levels SL+2 or SL+3 cannot be accessed because the maximum number of tables including the starting level is 2. Similarly, when SL.NL=2, tables at level SL+3 cannot be accessed. Therefore, tables at level SL+3 can only be accessed when SL.NL=3. Also, for tables at SL+1, the size of the table is larger (and indexed based on a larger offset portion) when SL.NL=1 than when SL.NL=2 or 3. Similarly, for tables at SL+2, the size of the table is larger (and indexed based on a larger offset portion) when SL.NL=2 than when SL.NL=3.
[0131] Also, in this example, the lower bit of the final level table is bit 12 + PGS * 2+4(12+PGS * Note that in the example of Figure 11, 16 GPI entries for each of the 16 granules of the physical address are packed into a single block descriptor entry, so bits 15:12 of the target PA are used to select which particular GPI in the block descriptor entry corresponds to the target PA, and therefore are not needed as offset bits to select the table entry.
[0132] As a specific example, if PGS=0 (4kB granules), SL=0, SLBS=39 (starting level block size 512GB) and TSZ=48:
[0133] [Table 4]
[0134] It will be understood that providing the flexibility to vary the above-mentioned global parameters PGS, SL, SLBS, and TSZ is optional, and thus any of these parameters may be fixed for a given implementation. The global parameters PGS, SL, SLBS, or TSZ need not be variable and selectable by software at run time. Alternatively, other approaches may support variable definition of these global parameters. Regardless of whether the global parameters are variable or fixed, by defining a variable nesting level NL in the start-level entry of the GPT structure, this allows a trade-off between performance in identifying the GPI for a given target address and the size of the range of addresses in memory that must be allocated for table data to protect the granule of that target address.
[0135] Figure 12 shows a specific example of a GPT layout with variable nesting controlled by the NL parameter 190 in the L0 table descriptor entry. In this example, for a region of PA space allocated to dynamic random access memory (DRAM), it may be preferable to reduce the maximum number of levels of tables that need to be accessed to find the corresponding GPI for a given physical address within that region, because the region is more likely to store performance-critical data that may need to be accessed quickly by the processor. Thus, the L0 GPT entries corresponding to physical addresses within the DRAM region are set with NL=1, so that they together point to one or more larger L1 tables of sufficient size to accommodate GPI fields with 4 kB granularity that span the DRAM region. For example, this could be achieved by using two L1 tables, each with 2 23 The number of 64MB tables containing L1 table entries, each providing 16 GPIs for each 4kB granule, can be 16. Note that the reduction in the number of table levels (2 instead of the usual 4) comes at the expense of having to allocate a contiguous memory block of larger size (64MB instead of 4kB) for each individual L1 table.
[0136] In contrast, regions of physical address space mapped to memory-mapped input / output (MMIO) devices may require only a few 4K granules to define the mapping, and performance may not be critical for such accesses in these regions. For such regions, allocating a 64MB L1 table may be considered a waste of memory space if only a few entries in that table are expected to contain valid GPIs. Therefore, by setting NL=3 in the L0 table descriptor entry corresponding to an address in the MMIO region, a subtree of the MMIO region can be implemented more efficiently in memory by providing four levels of page tables, each with a table of size 4kB. As a result, a subtree providing a chain of level 1 through 3 entries to access a particular 4kB granule contains 12kB of table data instead of 64MB of data as in the DRAM region. While a more memory-efficient subtree will be slower to access than a subtree in the DRAM region, this is not an issue for MMIO regions, where performance may not be critical.
[0137] Of course, while Figure 12 shows one example where DRAM and MMIO regions sacrifice performance for memory footprint in different subtrees of the same table structure, users can find many other use cases for utilizing various levels of nesting within the same table. For example, some level 0 table entries may specify a nesting level of 2 to indicate that the maximum number of levels is 3, but this is not shown in the example of Figure 12.
[0138] Note that while NL indicates the maximum number of levels of a table required to find the GPI of the corresponding physical address granule, this does not preclude the possibility that block descriptor entries 200 may still be defined at earlier levels in the table structure to define unified attributes of larger memory blocks. Thus, while the variable parameter NL defines the maximum number of levels of a table to be traversed for a particular subtree of the structure below the L0 table descriptor entry 180 that specifies the NL parameter 190, this does not necessarily mean that each level up to that maximum must be accessed, and a walk of the table structure may encounter block descriptor entries 200 at earlier levels.
[0139] While the page table structure of Figure 8 also allows for a reduction in the number of table levels to reach a block descriptor entry by defining block descriptor entries 200 at levels other than the final level of the table to reduce the number of steps required to traverse the structure to reach a block descriptor entry, this approach is only suitable when there are larger sized regions of physical addresses that must all share the same GPI characteristics. This is because in a conventional multi-level table structure with fixed size offsets similar to the approach shown in Figure 8 for a page table, in the example of a 4 kB granule size, a given entry in level 1 is indexed using, for example, L1I offset bits 38:30, and each L1 entry is applicable to an address range of size 1 GB, so all addresses that share the same value for their L1I offset bits 38:30 must have the same access control attributes if they share a single block descriptor entry defined at level 1.
[0140] In contrast, in the approach shown in FIG. 12 where the level 1 table is indexed to the DRAM region of the physical address space, when NL=1, this indexing is based on a larger offset portion that includes bits 38:16 (in the particular example above), covering all remaining offset bits not already used to index the level 0 table. This means that each entry corresponds to an individual address block of smaller size (64 kB, providing individual GPI fields for sixteen 4 kB granules), and as a result, only a two-level table is provided, but more fine-grained control over the protection attributes can be achieved than is possible using the L1 block descriptor entries indexed with the fixed offset definition described above with respect to FIG. 8.
[0141] Figure 13 is a flow diagram illustrating a method for performing a GPT walk to obtain the GPI of a given target PA from memory. The GPT walk may be performed as part of step 172 of Figure 10. For implementations with a granule protection information cache 22 (or a combined TLB / granule protection information cache 22), the method of Figure 13 may be performed when a memory access request is not in the granule protection information cache 22. For implementations that do not support caching of granule protection data, the method may be performed for each memory access. The GPT walk method of Figure 13 is performed by GPT walk circuitry 23.
[0142] In step 240, the size and location of the start level (SL) offset portion within the target PA is determined based on the start level block size SLBS and total memory size TSZ described above. In implementations where both the start level block size and total memory size are fixed, the start level offset size and location can be hardwired to a fixed size and location, and step 240 can be omitted. However, if one or both of SLBS, TSZ are variable, there may be some circuitry for determining the start level offset using control parameters that define one or both of SLBS, TSZ according to PA[TSZ-1:SLBS] as described above.
[0143] In step 242, GPT walk circuitry 23 obtains the start-level GPT entry corresponding to the target PA by reading an address determined by adding a multiple of the SL offset portion of the PA (having the size and location determined in step 240) to the SL base address stored in the GPT base address register. Once the start-level GPT entry is returned from memory, in step 244 GPT walk circuitry 23 determines whether the start-level GPT entry is a block descriptor or a table descriptor (if type ID field 196 has a value indicating a table descriptor entry 180, then the entry is a table descriptor entry 180; otherwise, the entry is a block descriptor entry 200). If the starting level GPT entry is a block descriptor entry 200, then in step 246, the GPI of the target PA is extracted from the GPI field 194 at the position corresponding to the target PA (e.g., some bits PA[15:12] of the target PA can be used to select which GPI field to use), and then the extracted GPI is returned to the PAS filtering circuit 20 to perform a check whether the memory access request is allowed, as described in step 174 of FIG. 10 .
[0144] If the starting-level GPT entry is a table descriptor, then in step 248, the variable nesting control parameter NL 190 and next-level table pointer 193 are extracted from the starting-level GPT entry obtained in step 242. In step 250, the next level of the table structure becomes the "current level" for purposes of the subsequent steps in Figure 13. Thus, if step 250 is reached after step 248, the next level would be one level beyond the starting level, e.g., level 1 in the example of Figure 12 where the starting level is level 0. This begins a loop of steps 252 through 260, which are executed for each subsequent level of the table structure reached in the traversal, until eventually a block descriptor entry 200 is identified and the traversal terminates.
[0145] In step 252, the size and location of the current level offset portion used to index into the current level of the GPT is determined based on the variable nesting control parameter NL 190 and the current level. This is done according to the offset equations shown in the table above for each of levels SL+1, SL+2, and SL+3. Thus, the size and condition of the offset portion for a given level will vary depending on the variable nesting control parameters specified at earlier levels in the table, and may be different for different subtrees depending on which physical address is being accessed.
[0146] In step 254, the current level GPT entry is read from memory following an address determined by adding the pointer 193 read from the previous level of the table and a multiple (the multiple is based on the size of one GPT entry) of the current level offset portion of the target physical address determined in step 252. In step 256, when the current level GPT entry is returned from the memory system, the GPT walk circuitry determines whether the current level GPT entry is a block descriptor entry 200 or a table descriptor entry 180. Again, if it is a block descriptor entry, in step 258, the GPI of the target PA is returned as in step 246. However, if the current level GPT entry is a table descriptor entry 180, in step 260, the next level pointer 193 is obtained from the current level GPT entry, and the method returns to step 250 to proceed to the next level of the table structure, and again loops through steps 252 through 256 for the next level of the table structure. The method continues until a final block descriptor entry 200 is identified, at which point the method ends at step 258 .
[0147] 13, the GPT walk circuitry 23 may also have circuitry for identifying errors in the GPT walk, such as an invalidly coded GPT entry, or if level 3 of the table is reached and the entry read from the indexed location in the level 3 table is still not a block descriptor entry. If such an error is identified, a failure may be signaled and handled by the root domain code in EL3.
[0148] Figure 14 shows how several GPT entries can be grouped together by specifying a contiguous indicator 300 so that the GPI information for all granules of physical addresses represented by two or more different GPT entries 200 can be cached as a single entry in the granule protection information cache 22 to increase cache coverage and therefore cache hit rate and therefore performance. In the example of Figure 14, the block descriptor entries 200 for granules that are not grouped as contiguous entries have the same format as shown in Figure 11. However, the GPI field in the least significant bits [3:0] of the block descriptor entry serves as a "pivot" GPI, which can have a special encoding value to specify a unified entry that provides common properties for all granules that map to that entry using a 64-bit entry. The format of the consolidated neighbor entry is shown at the bottom of Figure 14, and in addition to the adjacency indicator 300 at the pivot GPI position and having an encoding that would otherwise be invalid for other GPIs, the contiguous GPT block descriptor format also specifies the adjacency size parameter 202 and GPI information 304 of the neighbor entry.
[0149] The contiguous indication 300 allows multiple table entries to be aggregated to form larger blocks. The size parameter 302 specifies the size of the contiguous block of physical addresses that the entry is part of. The GPI protection attributes of the contiguous block are specified in the remaining bits 304 of the block descriptor entry 200.
[0150] For example, in the above embodiment, the block descriptor entry for the maximum allowed table level (L1 if NL=1, L2 if NL=2, or L3 if NL=3) typically specifies attributes for 64 KB of physical address space. However, with a contiguity indicator set, this 64 KB block can be defined as being part of a 512 MB contiguous block with a single set of GPI attributes. Thus, all 8192 individual block descriptor entries for the 512 MB contiguous block can have their GPT entries in the Memory Set to specify contiguity entry 300, with contiguity size parameter 302 identifying the 512 MB size and the same GPI information in GPI field 304. This means that no matter which address within the 512 MB is accessed first, the corresponding GPT entry can be subsequently cached, and the cache lookup mechanism of the granule protection information cache 22 ensures that any address within that 512 MB block is considered to hit a single cached entry, returning the shared protection attribute from the GPI field 304 when any address within the 512 MB is accessed, even though only a single cache entry is occupied in the granule protection information cache 22. This frees up many other cache entries for caching GPT entries for other addresses, improving cache utilization.
[0151] The example of Figure 14 shows a technique in which the adjacency indicator 300 is indicated using an invalid encoding of a particular GPI field 194 in the block descriptor table entry 200 (e.g., the GPI field in the least significant bit of a blocked descriptor table entry). However, this is not required, and other techniques could provide a dedicated field in the block descriptor table entry 200 to specify whether the entry is part of a contiguous block. Therefore, it is not required to represent the adjacency indication in the manner shown in Figure 14.
[0152] 11-14 illustrate properties of the GPT structure, including variable nesting controlled by a nesting level parameter NL in the starting level table entry and a contiguity indication 300 that allows large blocks of entries to be merged together. While these are particularly useful for GPTs, they can also be applied to other types of access control tables for controlling access to memory, such as the page table structure used by address translation circuit 16. Thus, the techniques illustrated in FIGS. 11-13 can also be used by page table walk circuit 17 when performing a page table walk to identify address translation mappings. Page table walk circuit 17 can use a variably defined offset portion to index into each level of the table structure, depending on the variable nesting control parameter NL defined in an access control table at a higher level than the table for which the offset portion is determined. While the GPT is an inverted page table indexed by a physical address, similar techniques can also be used for non-inverted page tables indexed by a virtual address to trade off the size of the table data itself against the number of memory accesses required to reach the protection information associated with a particular address.
[0153] FIG. 15 illustrates a simulator implementation that may be used. While the above embodiments implement the present invention in terms of apparatus and methods for operating specific processing hardware supporting the technology, it is also possible to provide an instruction execution environment according to the embodiments described herein implemented using a computer program. Such computer programs are often referred to as simulators, insofar as they provide a software-based implementation of a hardware architecture. Various simulator computer programs include emulators, virtual machines, models, and binary translators, including dynamic binary translators. Typically, simulator implementations may run on a host processor 430, optionally running a host operating system 420 that supports the simulator program 410. In some configurations, there may be multiple layers of simulation between the hardware and the provided instruction execution environment, and / or there may be multiple different instruction execution environments provided on the same host processor. Historically, powerful processors have been required to provide simulator implementations that run at reasonable speeds, but such an approach may be justified in certain situations, such as when it is desirable to execute code native to another processor for compatibility or reuse reasons. For example, a simulator implementation may provide an instruction execution environment with additional features not supported by the host processor hardware, or may provide an instruction execution environment typically associated with a different hardware architecture. An overview of simulation is given in "Some Efficient Architecture Simulation Techniques," Robert Bedichek, Winter 1990 USENIX Conference, pp. 53-63.
[0154] While embodiments have been described above with reference to particular hardware configurations or features, equivalent functionality may be provided in the simulated embodiments through appropriate software configurations or features. For example, particular circuits may be implemented as computer program logic in the simulated embodiments. Similarly, memory hardware such as registers or caches may be implemented as software data structures in the simulated embodiments. In configurations where one or more of the hardware elements referenced in the foregoing embodiments reside in host hardware (e.g., host processor 430), some simulated embodiments may use the host hardware where appropriate.
[0155] Simulator program 410 may be stored on a computer-readable storage medium (which may be a non-transitory medium) and provides a program interface (an instruction execution environment) for target code 400 (which may include applications, an operating system, and a hypervisor), which is the same as the interface of the hardware architecture modeled by simulator program 410. Thus, program instructions of target code 400 may be executed from within the instruction execution environment using simulator program 410, so that a host computer 430 that does not actually have the hardware features of device 2 described above can emulate these features. This may be useful, for example, to enable testing of target code 400 being developed for a new version of a processor architecture before hardware devices that actually support that architecture are available, since the target code can be tested by running it within a simulator that runs on a host device that does not support the new version of the processor architecture.
[0156] The simulator code includes processor program logic 412 that emulates the behavior of processing circuit 10, including, for example, instruction decode program logic that decodes instructions in target code 400, maps the instructions to a sequence of corresponding instructions in a native instruction set supported by host hardware 430, and performs functions equivalent to the decoded instructions. Processor program logic 412 also simulates the processing of code at different exception levels and domains, as described above. Register emulation program logic 413 maintains data structures in the host address space of the host processor that emulate architectural register state defined according to the target instruction set architecture associated with target code 400. Thus, rather than being stored in hardware registers 12 as in the embodiment of FIG. 1, such architectural state is instead stored in the memory of host processor 430, and register emulation program logic 413 maps register references in instructions in target code 400 to corresponding addresses for retrieving simulated architectural state data from host memory. This architectural state may include the aforementioned current domain indication 14 and current exception level indication 15.
[0157] The simulation code includes address translation program logic 414 and filtering program logic 416 (both examples of memory management program logic 419) that emulate the functions of the address translation circuit 16 and PAS filter 20, respectively, referencing the same page table structure and GPT 56 as described above. Thus, the address translation program logic 414 translates virtual addresses specified by the target code 400 into simulated physical addresses (pointing to physical locations in memory from the perspective of the target code) in one of the PASs, but these simulated physical addresses are actually mapped onto the (virtual) address space of the host processor by address space mapping program logic 415. Similar to the PAS filter described above, the filtering program logic 416 performs a lookup of granule protection information to determine whether a memory access triggered by the target code is allowed to proceed.
[0158] Table access program logic 418 emulates the functions of page table walk circuit 17 and GPT walk circuit 23 to control the loading of page table entries and GPT entries from simulated memory (mapped into the host processor's virtual address space by address space mapping program logic 415). However, in the case of a simulator, TLB 18 and granule protection information cache 22 may not be simulated, so simulator embodiments operate similarly to a hardware device without TLB 18 or GPT cache 22. Thus, a page table walk and / or GPT walk may be required for each memory access, because each memory access request is treated as if it missed in the cache. As in hardware embodiments, in simulated embodiments, page table and / or GPT structures may be implemented with variable nesting, with the size / location of the offset portion selected based on the NL parameter 190 specified in the upper-level table entry.
[0159] In this application, the term "configured to..." is used to mean that elements of an apparatus have a configuration that is capable of performing a defined operation. In this context, "configuration" refers to a way 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 the apparatus elements need to be modified in any way to provide the defined operation.
[0160] Although exemplary embodiments of the present invention are described in detail herein with reference to the accompanying drawings, it will be understood that the invention is not limited to these precise embodiments, and that various changes and modifications can be made to the embodiments by those skilled in the art without departing from the scope of the invention as defined by the appended claims.
Claims
1. 1. An apparatus comprising: a memory management circuit that controls access to the memory system based on access control information defined in table entries of a table structure that includes a multi-level access control table; a table access circuit for accessing the table structure to obtain the access control information corresponding to a target address; Equipped with For a given access control table at a given level of said table structure other than the starting level: the table access circuitry is configured to select a selected table entry in the given access control table corresponding to the target address based on an offset portion of the target address, the selected table entry providing either a pointer to an access control table at a next lower level in the table structure or the access control information corresponding to the target address; the table access circuitry is configured to determine the size of the offset portion of the target address based on a variable nesting control parameter specified in a table entry of a higher-level access control table in the table structure at a higher level than the given access control table.
2. The apparatus of claim 1 , wherein the variable nesting control parameters are specified separately in each table entry of the higher-level access control table.
3. 3. The apparatus of claim 2, wherein if different table entries of the higher-level access control table specify different values of the variable nesting control parameter, the size of the offset portion used by the table access circuitry to select the selected table entry is different for different access control tables at the given level of the table structure.
4. 4. The apparatus of claim 1, wherein the maximum number of levels of the table structure traversed to reach the table entry providing the access control information corresponding to the target address is variable according to the variable nesting control parameter.
5. The apparatus of claim 1 , wherein the table size of the given access control table is variable depending on the variable nesting control parameter.
6. For the given access control table at the given level of the table structure: Each table entry defines information applicable to a range of addresses of a given address range size; 6. The apparatus of claim 1, wherein the given address range size is variable depending on the variable nesting control parameter specified in the table entry of the higher-level access control table.
7. The apparatus of claim 1 , wherein the variable nesting control parameter is specified in a table entry of a start-level access control table at the start level of the table structure.
8. 8. The apparatus of claim 1, wherein the table access circuitry is configured to obtain the access control information corresponding to the target address from a block descriptor table entry in an access control table at a final level of the table structure reached in the traversal of the table structure, the block descriptor table entry specifying the access control information for an address of a target granule that includes the target address.
9. 9. The apparatus of claim 8, wherein the block descriptor table entry includes multiple access control information fields, each for indicating the access control information for an address of a different granule.
10. 10. The apparatus of claim 8 or 9, wherein if the block descriptor table entry specifies a contiguous indication, the table access circuitry is configured to determine that the access control information for two or more different granules of an address that includes the target granule is represented by a shared set of access control information shared between the two or more different granules.
11. 11. The apparatus of claim 10, wherein if the block descriptor table entry specifies a contiguity indication, the table access circuitry is configured to identify how many granules share the shared set of access control information based on a contiguity size parameter specified in the block descriptor table entry.
12. the block descriptor table entry includes a plurality of access control information fields, each for indicating the access control information for a respective granule address; the block descriptor table entry specifies the adjacency indication if a given one of the plurality of access control information fields has a given encoding other than an encoding in a set of valid encodings for indicating valid options for the access control information; 12. The apparatus of claim 10, wherein if the predetermined one of the plurality of access control information fields has the predetermined encoding, then the shared set of access control information is indicated by one or more other access control information fields in the block descriptor table entry or another block descriptor table entry that corresponds to the target address.
13. 13. The apparatus of claim 1, wherein the table structure is indexed by a physical address.
14. The memory management circuitry includes: an address translation circuit that translates a target virtual address specified by a memory access request into a target physical address associated with a physical address space selected from a plurality of physical address spaces; a filtering circuit for determining whether the memory access request should be permitted to access the target physical address based on whether the access control information obtained from the table structure indicates that the physical address space selected from a plurality of physical address spaces is a permitted physical address space for the target physical address; and 14. The apparatus of claim 1, comprising:
15. 13. The apparatus of claim 1, wherein the table structure is indexed by a virtual address.
16. 16. The apparatus of claim 1, wherein the memory management circuitry comprises an address translation circuitry that translates a target virtual address specified by a memory access request into a target physical address based on the address translation mapping indicated by the access control information obtained from the table structure.
17. 1. A method comprising: controlling, by a memory management circuit, access to the memory system based on access control information defined in table entries of a table structure including a multi-level access control table; accessing, by a table access circuit, the table structure to obtain the access control information corresponding to the target address; Including, For a given access control table at a given level of said table structure other than the starting level: a selected table entry in the given access control table corresponding to the target address is selected by the table access circuit based on an offset portion of the target address, the selected table entry providing either a pointer to an access control table at a next lower level in the table structure or the access control information corresponding to the target address; wherein the table access circuit determines a size of the offset portion of the target address based on a variable nesting control parameter specified in a table entry of a higher-level access control table in the table structure at a higher level than the given access control table.
18. 1. A computer program comprising instructions that, when executed on a host data processing apparatus, cause the host data processing apparatus to control the host data processing apparatus to provide an instruction execution environment for executing target code, the computer program comprising: The computer program memory management program logic that controls access to the simulated memory based on access control information defined in table entries of a table structure that includes multiple levels of access control tables; table access program logic for accessing the table structure to obtain the access control information corresponding to a target simulated address; Equipped with For a given access control table at a given level of said table structure other than the starting level: the table access program logic is configured to select a selected table entry in the given access control table corresponding to the target simulated address based on an offset portion of the target simulated address, the selected table entry providing either a pointer to an access control table at a next lower level in the table structure or the access control information corresponding to the target simulated address; the table access program logic is configured to determine a size of the offset portion of the target simulated address based on a variable nesting control parameter specified in a table entry of a higher-level access control table in the table structure at a higher level than the given access control table.
19. 20. A computer-readable storage medium storing the computer program of claim 18.
Citation Information
Patent Citations
Improved performance of address translation using a translation table with large address capacity
JP2008515093A
Symmetrical multiprocessor fault-tolerant computer system
JP2008542878A
Efficient memory and resource management
JP2015500524A
Hardware-based pre-page walk virtual address transformation
US20140281353A1
Processor including a translation unit for selectively translating virtual addresses of different sizes using a plurality of paging tables and mapping mechanisms
US6671791B1