Multiple stage memory management

A multiple stage memory management unit (MMU) comprises a first MMU stage configured to translate an input virtual memory address to a corresponding intermediate memory address, the first MMU stage generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address; and a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address, the second MMU stage providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage; the first MMU stage being configured to provide to the second MMU stage for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU stage will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

BACKGROUND

This disclosure relates to memory management.

Memory management units (MMUs) attend to the translation of virtual memory addresses into physical memory addresses.

A data processing apparatus typically provides each running program with access to a virtual address space defined by virtual memory addresses. Each program sees its own virtual address space which contains instructions and data for use by that program. Amongst other established advantages, the use of virtual addressing allows the operating system to control memory access by inhibiting one program from accessing or corrupting information used by another program.

When an access is required to a virtual memory address, it is first necessary to translate the virtual memory address to a physical memory address so that the required information can be obtained from or written to the physical memory or a physical memory cache.

A cache known as a translation lookaside buffer (TLB) may be used as part of the address translation process. The TLB stores recently or commonly used translations between virtual and physical memory addresses. So, as a first step in an address translation process, the TLB is consulted to detect whether the TLB already contains the required address translation. If not, then a more involved translation process may be used, for example involving consulting so-called page tables holding address translation information, typically resulting in the TLB being populated with the required translation.

Multiple stage MMUs are used in some situations. In this arrangement, two levels of translation are in fact used. A virtual address (VA) required by an executing program or other system module such as a graphics processing unit (GPU) is translated to an intermediate physical address (IPA) by a first MMU stage. The IPA is translated to a physical address (PA) by a second MMU stage. One reason why multiple stage translation is used is for security of information handling when multiple operating systems (OS) may be in use on respective “virtual machines” running on the same processor. A particular OS is exposed to the VA to IPA translation, whereas only a hypervisor (software which oversees the running of the virtual machines) has oversight of the stage 2 (IPA to PA) translation.

SUMMARY

In an example arrangement there is provided a multiple stage memory management unit (MMU) comprising:

a first MMU stage configured to translate an input virtual memory address to a corresponding intermediate memory address, the first MMU stage generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address; and

a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address, the second MMU stage providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage;

the first MMU stage being configured to provide to the second MMU stage for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU stage will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

In another example arrangement there is provided a multiple stage memory management unit (MMU) comprising:

a first MMU stage configured to translate an input virtual memory address to an intermediate memory address;

a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address; and

an address translation cache associated with the first MMU stage, the address translation cache being configured to store, for a set of virtual memory addresses, address translation information comprising:information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; andflag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address.

In another example arrangement there is provided a multiple stage memory management unit (MMU) comprising:

a first MMU translation means for translating an input virtual memory address to a corresponding intermediate memory address, the first MMU translation means generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address; and

a second MMU translation means for translating an intermediate memory address provided by the first MMU stage to a physical memory address, the second MMU translation means providing, in response to an intermediate memory address received from the first MMU translation means, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU translation means; in which the first MMU translation means is configured to provide to the second MMU translation means for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU translation means will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

In another example arrangement there is provided a multiple stage memory management unit (MMU) comprising:

a first MMU translation means for translating an input virtual memory address to an intermediate memory address;

a second MMU translation means for translating an intermediate memory address provided by the first MMU translation means to a physical memory address; and

means associated with the first MMU translation means for caching, for a set of virtual memory addresses, address translation information comprising:information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; andflag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address.

In another example arrangement there is provided a method of operation of a multiple stage memory management unit (MMU, the method comprising:

translating, at a first MMU stage, an input virtual memory address to a corresponding intermediate memory address, the translating step generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address;

translating, at a second MMU stage, an intermediate memory address provided by the first MMU stage to a physical memory address, comprising providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage; and

the first MMU stage providing to the second MMU stage for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU stage will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

In another example arrangement there is provided a method of operation of a multiple stage memory management unit (MMU), the method comprising:

translating, at a first MMU stage, an input virtual memory address to an intermediate memory address;

translating, at a second MMU stage, an intermediate memory address provided by the first MMU stage to a physical memory address; and

caching, in association with the first MMU stage and for a set of virtual memory addresses, address translation information comprising:information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; andflag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address.

Further respective aspects and features of the present technology are defined by the appended claims.

DESCRIPTION OF EMBODIMENTS

An example embodiment provides a multiple stage memory management unit (MMU) comprising:

a first MMU stage configured to translate an input virtual memory address to a corresponding intermediate memory address, the first MMU stage generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address; and

a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address, the second MMU stage providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage;

the first MMU stage being configured to provide to the second MMU stage for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU stage will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

In this example arrangement, techniques are provided for detecting (and avoiding having to make) certain types of stage 2 translation in an MMU, by elegantly re-using data returned in response to other stage 2 MMU translations. This arrangement can in some examples provide an improved throughput of data at the MMU, and can provide a reduction in the processing time taken to provide a response from the MMU and/or a reduction in the power consumption of the MMU to provide such a response.

In example embodiments, the memory management unit comprises a buffer configured to store at least those of the set of two or more physical memory addresses received from the second MMU stage which correspond to intermediate memory addresses in the set of two or more intermediate memory addresses.

In example embodiments, the first MMU stage is configured to translate an input virtual memory address with reference to a page table; and the set of two or more (for example, 8) intermediate memory addresses comprises: the intermediate memory address corresponding to the input virtual memory address; and one or more other intermediate memory addresses representing entries adjacent, in the page table, to the entry holding the corresponding intermediate memory address (for example, being those entries in the same cache line). In example embodiments the set of two or more (for example, 4) physical memory addresses comprises: the physical memory address corresponding to the intermediate memory address provided to the second MMU stage; and one or more other physical memory addresses corresponding to intermediate memory addresses adjacent, in the intermediate memory address space, to the intermediate memory address provided to the second MMU stage.

As an example of a test to detect whether an intermediate memory address requires stage 2 translation, control logic can be configured to control transmission of intermediate memory addresses by the first MMU stage to the second MMU stage for translation, and the control logic can be configured to detect whether two or more intermediate memory addresses in the set of two or more intermediate memory addresses are within a threshold separation of one another in the intermediate memory address space.

In example embodiments, only a subset of intermediate memory addresses is passed for stage 2 translation as a result of the procedures set out here, so that the control logic is configured to control the providing of one or more of the intermediate memory addresses in the set of two or more intermediate memory addresses to the second MMU stage so as to obtain physical memory addresses corresponding to each of the intermediate memory addresses in the set of two or more intermediate memory addresses.

To avoid generating error responses in respect of intermediate memory addresses which do not actually correspond to the virtual address for which translation was requested, in example embodiments for any one of the intermediate memory addresses in the set of two or more intermediate memory addresses apart from or other than the intermediate memory address corresponding to the input virtual memory address, the control logic is configured to control the transmission of that intermediate memory address to the second MMU stage for translation in a speculative translation mode so that an error message is not generated if the translation of that intermediate memory address fails.

In some examples, the one or more intermediate memory addresses provided to the second MMU stage includes at least the intermediate memory address corresponding to the input virtual memory address. However, in other examples, the one or more intermediate memory addresses supplied to the second MMU stage could omit the intermediate memory address corresponding to the input virtual memory address if a translation of that input virtual memory address is provided by a set of physical addresses returned in response to another intermediate memory address.

Although other types of translation could be used, in example embodiments the first MMU stage is configured to access a hierarchy of page tables, such that a page table higher in the hierarchy provides information for address translation by the second stage MMU to point to a page table next lower in the hierarchy. For example, a lowest page table in the hierarchy can provide the set of two or more intermediate memory addresses including the corresponding intermediate memory address.

To provide further potential savings of processing cycles and/or power, in example embodiments the memory management unit comprises an address translation cache associated with the first MMU stage, the address translation cache being configured to store, for a set of virtual memory addresses, address translation information comprising: information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; and flag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address. In this way, VA to PA translations can be cached at the MMU for a more rapid supply to the requesting TLB.

An example embodiment using such a technique provides a multiple stage memory management unit (MMU) comprising:

a first MMU stage configured to translate an input virtual memory address to an intermediate memory address;

a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address; and

an address translation cache associated with the first MMU stage, the address translation cache being configured to store, for a set of virtual memory addresses, address translation information comprising:information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; andflag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address.

Another example embodiment provides a method of operation of a multiple stage memory management unit (MMU, the method comprising:

translating, at a first MMU stage, an input virtual memory address to a corresponding intermediate memory address, the translating step generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address;

translating, at a second MMU stage, an intermediate memory address provided by the first MMU stage to a physical memory address, comprising providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage; and

the first MMU stage providing to the second MMU stage for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU stage will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

Another example embodiment provides a method of operation of a multiple stage memory management unit (MMU), the method comprising:

translating, at a first MMU stage, an input virtual memory address to an intermediate memory address;

translating, at a second MMU stage, an intermediate memory address provided by the first MMU stage to a physical memory address; and

caching, in association with the first MMU stage and for a set of virtual memory addresses, address translation information comprising:information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; andflag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address.

Referring now to the accompanying drawings,FIG. 1is a schematic diagram of a memory management arrangement, in the context of the operation of a graphics processing unit (GPU), although the present techniques relating to memory management and address translation are more generally applicable to general-purpose data processing. A memory management unit (MMU)10is connected via an MMU ASN bridge20to an asynchronous switch network (ASN)30. Elements of a GPU40and a level 2 cache memory50are also connected to the ASN. The ASN therefore acts to pass information to and from each of the units or modules connected to the ASN.

In connection with the techniques being described here, in the context of a GPU, throughput of data is very important, perhaps (in at least some instances) more so than latency. The present techniques can provide an improved throughput in at least some instances.

Example modules of the GPU40are illustrated, including one or more shader cores60each including a bus interface module62and a load-store cache module64, a hierarchical tiler70, a job manager80and performance monitor blocks90. In general terms, these modules operate in accordance with established principles of GPU operation and further specific details of their internal operation will not be given except where they are relevant to the present discussion.

Each of the modules of the GPU is associated with a respective micro translation lookaside buffer (μTLB)100. During the operation of the modules, there is a routine need to access system memory. Memory addresses are expressed for the purposes of internal processing within the modules of the GPU as virtual addresses (VAs). In order to proceed with an actual access to system memory, a VA needs to be translated to a physical address (PA) by which the system memory is addressed at an electrical level. This translation is carried out by each of the μTLBs, so that an address translation relating to a particular module is carried out by the μTLB associated with that module. In this way, address translation is, to an extent, distributed throughout the system. The operation of an μTLB will be discussed further with reference toFIGS. 2 and 3.

The μTLBs are connected to the ASN30by a respective μTLB ASN bridge110. In some cases this is via a further multiplexing stage120, while in another case two of the modules may be connected via a multiplexer130to a single μTLB100.

The level 2 cache50provides a local, and generally somewhat faster, storage area for selected contents of a main system memory (not shown inFIG. 1). Recently or frequently accessed portions of the main system memory, or portions of the main system memory which are expected to be required in the near future such as portions adjacent to recently accessed portions, are replicated in the level 2 cache50so that those portions can be accessed quickly when needed. If a required portion is not currently held in the level 2 cache50, then that portion is fetched from the main system memory when access to that portion is required. In these respects, the level 2 cache50operates according to established principles associated with such cache memories and so details of its operation will not be described except where they are relevant to the present discussion. It is noted that the contents of the level 2 cache memory50are accessed according to their physical address.

The MMU10is a two-stage MMU (as an example of a multiple stage MMU), comprising a stage 1 MMU12and a stage 2 MMU14. A virtual address (VA) required by an executing program or other system module such as the GPU40is translated to an intermediate physical address (IPA) by the stage 1 MMU. The IPA is translated to a physical address (PA) by the stage 2 MMU. As mentioned earlier, one reason why multiple stage translation is used is for security of information handling when multiple operating systems (OS) may be in use on respective “virtual machines” running on the same processor. A particular OS is exposed to the VA to IPA translation, whereas only a hypervisor (software which oversees the running of the virtual machines) has oversight of the stage 2 (IPA to PA) translation.

A main reason why the MMU10is required is that it handles address translations which are not currently stored locally in the respective μTLB. The way in which this is carried out will be discussed further with reference toFIG. 2below. In handling these matters, the MMU10receives requests140from the μTLBs via the ASN and returns responses150to the μTLBs, again via the ASN. Optionally, the MMU10can also interact with the job manager80via a JCB (job control bus) interface160.

The internal operation of the MMU10will be discussed in more detail with reference toFIGS. 7-10below.

FIG. 2schematically illustrates the use of a micro translation lookaside buffer (μTLB)100. For the purposes ofFIG. 2, other items relating to the data communication between the μTLB and the MMU10are omitted for clarity of the diagram.

As part of the operation of the module or other arrangement with which the μTLB100is associated, the μTLB100receives a VA102relating to a required memory access. This could of course be a read or a write memory access; it is immaterial to the present discussion which type of memory access is underway. Referring also toFIG. 3(which is a schematic flowchart illustrating operations of a μTLB), supply of a VA102to the μTLB100forms a request for a corresponding PA104(shown inFIG. 3as a step200).

The μTLB contains a cache or store of translations between VA and PA. The criteria by which the μTLB stores particular VA to PA translations can be established according to known techniques for the operation of a μTLB. The cached translations might include recently used translations, frequently used translations and/or translations which are expected to be required soon (such as translations relating to VAs which are close to recently-accessed VAs). Overall, the situation is that the μTLB contains a cache of a subset of the set of all possible VA to PA translations, such that when a particular VA to PA translation is required, it may be found that the translation is already held in the cache at the μTLB, or it may not.

Accordingly, at a next step210, the μTLB detects whether the required translation is indeed currently cached by the μTLB. If the answer is yes, then control passes to a step240to be discussed below. If the answer is no, then control passes to a step220at which the μTLB100sends a request, comprising the required VA222, to the MMU10. The MMU10derives the required VA to PA translation (using techniques to be discussed below) and sends at least the PA232corresponding to the VA222back to the μTLB100where it is stored at a step230.

Finally, at the step240, the μTLB100applies the translation stored at the μTLB100to provide an output PA104.

It can therefore be seen that in the distributed system described with reference toFIG. 1, in which multiple μTLBs are used, the translation of a VA to a PA takes effect at the appropriate μTLB100. The MMU10provides translation information for storage at the μTLB100, but even with the involvement of the MMU10in obtaining a required translation, the actual translation still takes place at the μTLB100. Similar principles may also apply in a non-distributed system having only one TLB.

Aspects of the operation of the MMU10will now be described with reference toFIG. 4, which provides an example of a multiple stage memory management unit (MMU) in which an input virtual memory address is translated to a physical memory address via a corresponding intermediate memory address, the memory management unit comprising: a first MMU stage, for example configured to translate the input virtual memory address to the corresponding intermediate memory address by reference to a page table, the page table providing a set of two or more intermediate memory addresses including the corresponding intermediate memory address; and a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address, the second MMU stage providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage. These arrangements therefore provide examples of a first MMU stage configured to translate an input virtual memory address to a corresponding intermediate memory address, the first MMU stage generating a set of two or more intermediate memory addresses including the corresponding intermediate memory address; and a second MMU stage configured to translate an intermediate memory address provided by the first MMU stage to a physical memory address, the second MMU stage providing, in response to an intermediate memory address received from the first MMU stage, a set of two or more physical memory addresses including the physical memory address corresponding to the intermediate memory address received from the first MMU stage.

The arrangement ofFIG. 4, when operated as discussed here, provides an example of features of a method of operation of a memory management unit.

InFIG. 4, the μTLB100is shown in the same manner as inFIG. 2described above. However, the operation of the MMU10is split into stage 1 and stage 2 operations.

The stage 1 MMU12is responsible for translating the VA222into an intermediate physical address (IPA)250. The stage 2 MMU14is responsible for translating the IPA250into a PA260. As part of the translation process, the stage 1 MMU12and the stage 2 MMU14may need to access so-called page tables which are stored in physical memory (for example, in the level 2 cache50).

The stage 1 MMU comprises its own TLB270. The TLB270provides a cache or buffer of address translations272relevant to the stage 1 MMU. Given that the task of the stage 1 MMU is to translate an incoming VA to an IPA, the TLB270can store VA to IPA translations so that if an incoming VA222has a translation to the corresponding IPA stored in the TLB270, this avoids the need for a full operation of the stage 1 translation process and the buffered IPA274can be provided directly to the stage 2 MMU as the IPA250.

However, the TLB270provides further information, and in particular the address translations272which are cached at the TLB270may in fact provide a cached VA to PA translation. To indicate the nature of the address translations272cached at the TLB270, a flag276is provided in respect of each cached address translation272to indicate whether that cached address translation272relates to a VA to IPA translation or to a VA to PA translation. If, for an incoming VA222, there exists a cached address translation272for which the flag276indicates that the cached address translation is a VA to PA translation, then the TLB270simply provides the cached PA as the PA232to be returned to the μTLB100and the MMU operation (in respect of that particular translation request) is complete.

Assume now that the TLB270did not contain a cached translation (whether VA to IPA or VA to PA) in respect of the incoming VA222. In this case, the VA222is passed to a stage 1 translation unit280. The stage 1 translation unit280consults so-called page tables, for example in a so-called page table walk (PTW) process to derive a VA to IPA translation. An example of a PTW process will be discussed below. The page tables are held in physical memory, for example the level 2 cache50or a main system memory, and are arranged as a hierarchy of page tables such that one page table in the hierarchy provides information which points to a location in a next page table in the hierarchy until a final page table is reached. But in respect of the stage 1 translation, the contents of the page tables are provided as IPAs rather than as PAs so that each time a page table is accessed as part of the stage 1 translation process, a stage 2 translation of the IPA returned as the page table contents is required before the physical address needed to access the next page table in the hierarchy can be obtained.

The stage 1 TLB270therefore provides an example of an address translation cache associated with the first MMU stage, the address translation cache being configured to store, for a set of virtual memory addresses, address translation information comprising: information defining address translations from those virtual memory addresses to respective mapped addresses, the mapped addresses being intermediate memory addresses or physical memory addresses; and flag information indicating, for each virtual memory address in the set of virtual memory addresses, whether the mapped address corresponding to that virtual memory address is an intermediate memory address or a physical memory address.

FIG. 5schematically illustrates an example of a stage 1 page table walk (PTW) process, andFIG. 6is a schematic flowchart illustrating a PTW process.

In this example, a VA222which requires translation is formed as a 48-bit value. Different portions of the VA222are used at different stages in the PTW process.

To obtain a first entry in the page table hierarchy, in a “level 0 table”310, a base address stored in a base address register300(FIG. 5) is obtained at a step400(FIG. 6). A first portion312of the VA222, being the 9 most significant bits, is added to the base address as an offset, at a step410so as to provide the IPA314of an entry in the table310. But in order to access the entry314, a PA indicating the location of the entry314in physical memory is needed. Therefore, at a step420, the IPA314of the page table entry is supplied to the stage 2 translation process for translation into a corresponding PA. When the corresponding PA is received, the relevant page table entry is looked up in physical memory or in the level 2 cache50(if the relevant page is cached) at a step430.

At a step440, a detection is made as to whether “level 3” has been reached in the page table hierarchy. If not, as in the present case, control passes to a step450at which the retrieved page table entry is used as a base address of a next table in the hierarchy. The page table entry corresponding to the IPA314therefore provides a base address to the next level table in the hierarchy, a “level 1 table”320. Control returns to the step410.

At the second iteration of the step410, a further part322of the VA222, being the next 9 bits [38:30] of the VA222, forms an offset from the base address of the table320in order to provide the IPA of an entry324in the table320. Once again, this IPA is subjected to stage 2 translation to provide a PA which can be looked up to obtain the base address of a “level 2 table”330which in turn (by the same process) provides the base address of a “level 3 table”340.

When the steps430and440are carried out in respect of a page table entry defined by an IPA344in the table340, the answer to the detection at the step440is “yes”. The page table entry indicated by the IPA344provides a page address and access permissions relating to a physical memory page. The remaining portion352of the VA222, namely the least significant 12 bits [11:0] provides a page offset within the memory page defined by the page table entry at the IPA344, though in an example system which stores information as successive four byte (for example 32 bit) portions, it may be that the portion [11:2] provides the required offset to the address of the appropriate 32 bit word. Therefore, the combination (at a step460) of the least significant portion of the VA222and the final page table entry (in this case, from the “level 3 table”340) provides (at a step470) the IPA250as a translation of the VA222. Note that a PTW process as described here returns an IPA in respect of the PTW carried out by the stage 1 MMU, and returns a PA in respect of the PTW carried out by the stage 2 MMU.

In example embodiments, including some to be discussed below, the first MMU stage is configured to access a hierarchy of page tables, such that a page table higher in the hierarchy provides information for address translation by the second stage MMU to point to a page table next lower in the hierarchy, and a lowest page table in the hierarchy provides the set of two or more intermediate memory addresses including the corresponding intermediate memory address.

A request manager buffer500receives requests from the μTLBs, buffers them and provides them to the stage 1 MMU12in an appropriate order for handling. Successive requests502are passed from the request manager buffer to the stage 1 MMU12.

As discussed above, the stage 1 MMU may respond with a PA from its own cache, in which case the PA response510is supplied as a response output back to the μTLB which made the request. If however the stage 1 MMU responds with an IPA512, this is passed to a response handler520which interacts with the stage 2 MMU to obtain a PA corresponding to that IPA, which in turn is then passed back to the requesting μTLB as a PA response.

As part of the operations of the stage 1 MMU and the stage 2 MMU, a PTW process is performed. In the case of the stage 1 MMU, as discussed above each PTW step involves a stage 2 translation of the IPA obtained by that a step, in order to retrieve the respective page table entry. At a PTW stage, an IPA532representing a read address for a page table entry requires translation to a corresponding PA. A PTW μTLB530provides a cache of IPA to PA translations relevant to PTW operations. If the required translation is held in the PTW μTLB530, then the PTW μTLB outputs the corresponding PA534. If not, then the PTW μTLB530makes a translation request to the stage 2 MMU14and, when it receives a response, caches the response and provides the translated PA534based on the cached response.

The PTW PA534is passed to an interface540to the ASN and via the ASN to the level 2 cache50(or the main system memory) from where page table data536is read according to the PA534.

The page table data536is passed to a PTW sequencer550. Details of the operation of this module will be provided below. The PTW sequencer550receives details of translation requests from the stage 1 MMU and communicates with the stage 1 MMU to return a TLB entry552(a requested translation or another translation). The PTW sequencer550also communicates with the stage 2 MMU to obtain and handle IPA to PA translations.

At stage 2, a PTW process is similarly used, but here the addresses generated for each page table entry are PAs.

FIG. 8schematically illustrates data flow between part of an MMU and a cache memory.

In particular,FIG. 8relates to communications between the stage 1 MMU and the level 2 cache memory (or, in the case of a cache miss, the main memory52) in respect of the final stage (level 3 table) a PTW process. Note that references by the stage 1 MMU12to physical memory are made via a stage 2 translation from IPA to PA, but that translation is not shown inFIG. 8for clarity of the diagram. Nevertheless, it should be assumed that memory address information and534sent from the stage 1 MMU is in the form of a PA, having been translated by the PTW μTLB530.

The response from the level 2 cache50to a data access by the stage 1 MMU12is in fact a group or “burst”600of 8 responses. The reason for this is that the level 2 cache50stores information as so-called cache lines of 8 values corresponding to 8 successive memory addresses. Whenever a single memory access is made to the level 2 cache50, then assuming a cache hit occurs, all 8 values in the cache line containing the required memory address are returned as the read data536. Note that the MMU routinely obtains a translation in respect of all 8 of these 8 values.

The group of 8 responses600can be referred to as a “burst” because in some arrangements, the 8 responses are returned successively, which is to say, one after another over (say) 8 successive clock cycles. However, it is recognised that in other example embodiments, the 8 responses could be returned simultaneously, or in sub-groups (for example, 2 sub-groups of 4 responses each), and so on. Similarly, it is recognised that the group600could comprise fewer than, or more than, 8 responses (for example, the group600could comprise 4 responses). The size of the group600can depend upon the extent of a single cache line or on other factors relating to the internal organisation of the level 2 cache50.

In the case of level 0, level 1 and level 2 table accesses in the PTW arrangement ofFIG. 5, it may be that only one of the group600of responses is relevant, because only a single pointer is needed to the next table in the PTW hierarchy. In these cases, the relevant one of the group600of responses is identified by the least significant bits of the PA used to access that cache line. For example, if each cache line comprises 8 data values of 32 bits each, so that the group or burst600of responses comprises 8 data values, the group or burst600of responses have in common all but their address bits [4:2], and the required data value from within that group or burst600is identified by the address bits [4:2] (Note that the address bits [1:0] are not relevant in a 32 bit word length system). The other responses represent data stored at adjacent entries in the page table. Note that the entries in the same cache line are considered as an example of a set of adjacent entries.

So in general, the level 2 cache50provides, in response to a single memory access by the stage 1 MMU, response data representing a set of two or more intermediate memory addresses comprising the intermediate memory address corresponding to the input virtual memory address; and one or more other intermediate memory addresses representing entries adjacent, in the page table, to the entry holding the corresponding intermediate memory address.

But at the level 3 table in the PTW process ofFIG. 5, the situation is a little different in that others of the group600of 8 responses may in fact be relevant and useful. This may or may not be the case; simply being adjacent in the page table does not mean that the page table entries are related, but nevertheless it may in fact be that the entries are related. This situation will be discussed in more detail below.

FIG. 9schematically illustrates data flow at a stage 2 address translation.

A block labelled PTW control610schematically represents operations of the PTW μTLB530and the PTW sequencer550, each of which can refer IPAs to the stage 2 MMU14for translation to PAs, and receive back the relevant PA as a response. The PTW control block610is therefore an example of control logic associated with the first MMU stage, and controls the provision of IPAs from the first MMU stage to the second MMU stage. The first MMU stage can therefore be referred to as being configured to provide IPAs to the second MMU stage in a particular way, which is to say, as controlled by the PTW control610. In terms of a method of operation, a step of the first MMU stage providing one or more IPAs to the second MMU stage relates to the provision of one or more IPAs as controlled by the PTW control610.

In fact, the stage 2 MMU provides more than one response to a request for translation of a single IPA. The stage 2 MMU provides a set of two or more physical memory addresses comprising the physical memory address corresponding to the intermediate memory address provided to the stage 2 MMU; and one or more other physical memory addresses corresponding to intermediate memory addresses adjacent, in the intermediate memory address space, to the intermediate memory address provided to the stage 2 MMU.

In other words, for a stage 2 translation request relating to a particular IPA, the stage 2 MMU returns not only the PA translation of that IPA, but also other PA translations of adjacent IPAs. In the present example, the stage 2 MMU returns a group or burst620of 4 translated PAs which include the required PA along with three other PAs relating to IPAs adjacent to the requested IPA.

The PA corresponding to the requested IPA may be any of the four PAs in the group620. It is identified, from within the group, by the least significant bits of the requested IPA. So, in the example of a group or burst620comprising four PAs, all four PAs correspond to four respective IPAs which share all but the bits [3:2] of their intermediate physical address (assuming, as before, that the bits [1:0] are not relevant in a 32 bit word system). The bits [3:2] of the IPA indicate which of the four responses in the group or burst620corresponds to each respective IPA.

FIG. 10schematically illustrates a part of an MMU. In particular,FIG. 10schematically illustrates the PTW sequencer550in more detail.

The PTW sequencer550comprises: a main PTE buffer700, a translation request driver710, a response processing unit720, a pre-processor730, an original PTE information buffer740and a PTE despatch unit750.

The main PTE buffer700stores translation information, for example in a format described below with reference toFIGS. 12 and/or 13. IPAs are provided from the main PTE buffer700, via the translation request driver710, to the stage 2 MMU. Burst responses of groups of 4 PAs are returned from the stage 2 MMU14, via the response processing unit720, to the main PTE buffer700, where they are stored prior to being despatched to the stage 1 MMU12by the PTE despatch unit750.

The pre-processor controls the supply of IPAs to the stage 2 MMU from the main PTE buffer700and the writing of flag information (discussed below) and translated PAs into the main PTE buffer700. As part of its operation, the pre-processor730refers to information relating to the PTW requests being handled which is stored in the original PTE information buffer740.

A more detailed description of the operation of these various components of the PTW sequencer550will be provided below. As discussed below, the PTW sequencer550provides an example of control logic associated with the first MMU stage and configured to control transmission (or provision) of intermediate memory addresses to the second MMU stage for translation, the control logic being configured to detect whether, in response to one of the intermediate memory addresses in the set of two or more intermediate memory addresses, the second MMU stage will provide a physical memory address corresponding to another intermediate memory address in the set of two or more intermediate memory addresses; and if so, to control the first MMU stage: (i) not to provide that other intermediate memory address to the second MMU stage for translation; and (ii) to associate one of the physical memory addresses in the set of two or more physical memory addresses provided by the second MMU stage with that intermediate memory address. Accordingly, in embodiments, the first MMU stage is configured to provide to the second MMU stage for translation, intermediate memory addresses in the set other than any intermediate memory addresses in the set for which the second MMU stage will provide a physical memory address as a response to translation of one of the other intermediate memory addresses in the set.

FIG. 11is a schematic flowchart illustrating operations of an MMU in respect of level 3 table PTW operations as an example of features of a method of operation of a memory management unit as referred to above.

At a step800, the PTW sequencer550receives a burst response of 8 values from the level 2 cache50during the stage 1 PTW process.

At a step810, the PTW sequencer550(for example, the pre-processor730of the PTW sequencer) detects dependencies amongst the burst response of 8 values. The aim here is to detect which of the 8 IPAs in the burst response may not in fact need a separate stage 2 translation operation, on the grounds that a PA corresponding to one or more of the IPAs may in fact be returned as part of the burst response from the stage 2 MMU made in response to another request for IPA to PA translation. This process will be discussed in more detail below.

At a step820, all 8 IPAs are stored in the main PTE buffer700, and at a step830the PTW sequencer550(in particular, the pre-processor730) flags those IPAs which need stage 2 translation (that is to say, which are to be provided from the stage 1 MMU to the stage 2 MMU), taking into account the dependencies detected at the step810. In this way, the main PTE buffer700provides an example of a buffer configured to store at least those of the set of two or more physical memory addresses received from the second MMU stage which correspond to intermediate memory addresses in the set of two or more intermediate memory addresses.

Amongst those IPAs which do need translation, for the IPA corresponding to the original request made by the stage 1 MMU and/or another IPA request within a threshold address separation (in the IPA address space) of that IPA, stage 2 translation is initiated at a step840. For another IPA which is flagged for translation but did not correspond to the original request, a so-called speculative stage 2 translation is initiated at a step850. Speculative translation is similar in most respects to non-speculative translation except that if the translation fails, an error code is not generated. Accordingly, in example embodiments, for any one of the intermediate memory addresses in the set of two or more intermediate memory addresses other than the intermediate memory address corresponding to the input virtual memory address, the control logic is configured to control the transmission of that intermediate memory address to the second MMU stage for translation in a speculative translation mode so that an error message is not generated if the translation of that intermediate memory address fails.

The translation responses are stored in the main PTE buffer700at a step860. Note that the response from the stage 2 MMU is a burst of 4 responses representing not only the requested IPA but also IPAs having adjacent intermediate physical addresses. In instances at which dependencies have been detected at the step810, one or more of these other responses may be relevant to IPAs awaiting translation in the main PTE buffer700. in such cases, the PA corresponding to one or more IPAs in the main PTE buffer700can be stored as a PA translation relating to that IPA. In this way, the 8 PA translations required for the 8 IPAs in the main PTE buffer700can be populated in fewer than 8 stage 2 MMU translation requests, by detecting whether any PA translations will be obtained as part of burst responses relating to other IPA translation requests, and re-using those additional PA translations to populate the main PTE buffer700. The step860therefore includes, for a non-flagged IPA which is not provided to the second MMU stage for translation, the step of associating one of the PAs in the set of two or more PAs provided by the second MMU stage with that IPA.

If there remain more flagged IPAs require translation (at a step870) then control returns to the steps840,850. Otherwise, all of the 8 IPAs in the main PTE buffer700now have a corresponding PA and the eight PAs are returned as a burst response to the stage 1 MMU at a step880. Finally, at a step890, the PAs are cached at the stage 1 TLB270.

FIGS. 12 and 13schematically illustrate data storage in a data buffer (in particular, the main PTE buffer700) of an MMU.

InFIG. 12, 8 IPAs900corresponding to the burst response from the level 2 cache50at the level 3 table stage of the stage 1 PTW operation are stored, along with respective flags910derived at the steps810,830ofFIG. 11. The flags910indicate whether a translation is required for each respective IPA900. Corresponding PAs920are populated at the step860ofFIG. 11in response to burst responses from the stage 2 MMU.

InFIG. 13, a single storage location930is provided for each respective IPA, such that the IPA is overwritten by the corresponding PA value in response to a translation being obtained for that IPA. A flag940can operate similarly to the flag910inFIG. 12, indicating whether a translation operation is required for each IPA.

FIG. 14is a schematic flowchart illustrating operations of an MMU, as an example of features of a method of operation of a memory management unit as referred to above. In this example, the burst of 8 responses from the level 2 cache50(to the stage 1 MMU) is obtained as successive responses over a period of, for example, 8 successive clock cycles. So, in this example, each IPA in the burst of eight responses is considered in turn.

At a step1000, a first IPA of the burst of eight IPAs is received and at a step1010it is flagged for stage 2 translation. The remaining seven IPAs are then handled. A next IPA is obtained at a step1020. At a step1030, a detection is made as to whether the IPA obtained at the step1020is within a range of a previously flagged IPA in the current burst such that a PA translation for the IPA obtained at the step1020will already be obtained by a stage 2 translation of the previously flagged IPA. The test applied here is whether all except the least significant 12 bits of the IPA are the same as the corresponding bits of the previously flagged IPA. The test of all but the most significant 12 bits (that is to say, a comparison of bits [47:12]) indicates whether the IPA relates to the same memory page (in the IPA address domain) as the previously flagged IPA. The test is therefore an example of one in which control logic, configured to control transmission of intermediate memory addresses by the first MMU stage to the second MMU stage for translation, is configured to detect whether two or more intermediate memory addresses in the set of two or more intermediate memory addresses are within a threshold separation of one another in the intermediate memory address space.

In some embodiments, the one or more IPAs provided from the first MMU stage to the second MMU stage includes at least the IPA corresponding to the original request, that is to say, the original input VA.

This test can be carried out in respect of all previously flagged IPAs in the current group under consideration, or (for example) just the most-recently flagged IPA.

If the answer is no, then at a step1040the IPA obtained at the step1020is flagged for stage 2 translation. If the answer is yes then control passes to a step1050, at which either no flag is set or (depending on the syntax being used for the flags) a flag is set to indicate that stage 2 translation should not take place. Control passes to a step1060.

At the step1060, a detection is made as to whether the IPA obtained at the step1020was the fourth or the eighth IPA in the current burst response of eight IPAs. If the IPA obtained at the step1020was neither the fourth nor the eighth IPA then control returns to the step1020to get another IPA. If the IPA was the eighth IPA then the burst response has been fully handled and the process ends. If the IPA was the fourth IPA then control returns to the step1000.

The flagged IPAs are sent for stage 2 translation to provide one or more of the intermediate memory addresses in the set of two or more intermediate memory addresses to the second MMU stage so as to obtain physical memory addresses corresponding to each of the intermediate memory addresses in the set of two or more intermediate memory addresses. The burst responses received from the stage 2 MMU in response to those IPAs sent for stage 2 translation provide sufficient information (because of the dependency test mentioned above) to populate all eight entries in the main PTE buffer700.

Although illustrative embodiments of the present techniques have been described in detail herein with reference to the accompanying drawings, it is to be understood that the present techniques are not limited to those precise embodiments, and that various changes, additions and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the techniques as defined by the appended claims. For example, various combinations of the features of the dependent claims could be made with the features of the independent claims without departing from the scope of the present techniques.