Virtual addressing is a memory mapping mechanism that is used by operating systems for purposes such as security based on process isolation. Using virtual addressing, processors can access memory, using physical addresses that are generated from Virtual Address (VA) to Physical Address (PA) translation. To accelerate the VA to PA translation process, processors can use Translation Lookaside Buffers (TLB), which are CAM+RAM structures that cache VA to PA translations.
In conventional systems the actual mapping of virtual addresses to physical addresses is a responsibility of software such as an Operating System (OS). The OS maintains memory resident translation tables (aka page tables) which are accessed by the system processor during the VA to PA translation process. These tables facilitate translation at page boundaries. For example, consecutive 2^12 (e.g., 4K) bytes of VA may be translated to a continuous 4K bytes of PA space, by a single Translation Table Entry (TTE). Many architectures support multiple page sizes.—The following example explains translation at page boundaries where based on a 4K page size, a consecutive of 4K bytes of VA are translated to a continuous 4K bytes of PA space.
Consider the case where an OS provides a single TTE (which is a 32 or 64 bits data structure in main memory) that translates accesses from VA=0x1000 to 0x2000. Because the TTE provides translation at a 4K page boundary, VA[11:0] (the first twelve bits of the VA) are not translated, while VA[31:12] (the last 20 bits of the VA) are translated. In particular, PA[11:0]=VA[11:0], while PA[31:12] can be any value that is provided by the TTE.
For a TTE that provides translation at a 64K page boundary, VA[15:0] are not translated, e.g., PA[15:0]=VA[15:0], while VA[31:16] are translated to arrive at a value for PA[31:16]. The TTE records the page size. If the TTE is cached in TLB, then the processor must use the page size information from the TTE, to decide which bits of the VA are translated and which are not. The TLB is organized and accessed like a cache. For example, it could be direct mapped with 4 entries where each of the entries of the TLB can have any page size.
Further consider a TLB that has cached entries 0-3, where entry 0 is a 4K page TTE, entry 1 is a 64K page TTE, entry 2 is a 1M page TTE and entry 3 is a 16M page TTE. If the aforementioned TLB is a direct mapped cache, when a load/store/instruction fetch request has its VA translated to a PA, two things happen: (1) the request selects one of the 4 entries in TLB to access, and (2) the accessed entry of the TLB provides PA[31:12] and page size. Based on the page size, the VA bits that are to be translated are determined.
Consider further still a request that accesses the TLB for a VA to PA translation that is not provided with the page size that the OS has designated for translation of the VA range associated with the request. Because the request is not provided with the page size, the request can serially access the TLB based on respective page sizes, until one of the page sizes that is used results in a hit. If the request accesses the TLB initially based on a 4K page sized entry, the two bits of the VA that can be used to select one of the 4 entries in the TLB, are VA[13:12]. If there is a miss at the 4K page size, an access can be attempted at the next bigger page size, 64K where the VA bits that can be used to select one of the 4 entries of the TLB are VA[17:16]. If there is a miss at the 64K page size, then an access may be attempted at the 1M page size, where the VA bits that can be used to select one of the 4 entries of the TLB are VA[22:21]. Finally, given misses at the other 3 page sizes, the request can access the TLB based on VA[25:24] in order to check for a translation table entry at the 16M page size.
As is clear from the above discussion, because a conventional TLB can cache TTEs of any page size, situations can arise where a request may be required to examine the TLB for all possible page sizes in order to determine a hit. This is because a request may not always obtain a desired translation from the TLB in its initial accesses. The process of repeating TLB accesses, once for each page size, is a significant performance bottleneck for TLB systems.
Conventional approaches that rely upon a series of accesses to a second level translation lookaside buffer (TLB) using a plurality of different page sizes present significant performance bottlenecks for TLB systems. A page size cache based methodology that addresses such shortcomings by providing a page size upon which a search of the second level TLB can be based is disclosed. However, the claimed embodiments are not limited to implementations that address any or all of the aforementioned shortcomings. As a part of the disclosed methodology, an indicator is received of a level one translation lookaside buffer (L1TLB) miss corresponding to a request for a virtual address to physical address translation, a cache is searched that includes virtual addresses and page sizes that correspond to translation table entries (TTEs) that have been evicted from the L1TLB, where a page size is identified, and the second level TLB is searched and a physical address is identified that is contained in the second level TLB. Access is provided to the identified physical address. Because the location of the TTE corresponding to the translation request can be identified in the second level TLB based on the page size, a TTE corresponding to the translation request can be identified in a single clock cycle and the necessity of conducting a series of searches that are based on a plurality of different page sizes can be avoided. The foregoing is a summary and thus contains, by necessity, simplifications, generalizations and omissions of detail; consequently, those skilled in the art will appreciate that the summary is illustrative only and is not intended to be in any way limiting. Other aspects, inventive features, and advantages of the present invention, as defined solely by the claims, will become apparent in the non-limiting detailed description set forth below.
The invention, together with further advantages thereof, may best be understood by reference to the following description taken in conjunction with the accompanying drawings in which:
It should be noted that like reference numbers refer to like elements in the figures.
Although the present invention has been described in connection with one embodiment, the invention is not intended to be limited to the specific forms set forth herein. On the contrary, it is intended to cover such alternatives, modifications, and equivalents as can be reasonably included within the scope of the invention as defined by the appended claims.
In the following detailed description, numerous specific details such as specific method orders, structures, elements, and connections have been set forth. It is to be understood however that these and other specific details need not be utilized to practice embodiments of the present invention. In other circumstances, well-known structures, elements, or connections have been omitted, or have not been described in particular detail in order to avoid unnecessarily obscuring this description.
References within the specification to “one embodiment” or “an embodiment” are intended to indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. The appearance of the phrase “in one embodiment” in various places within the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Moreover, various features are described which may be exhibited by some embodiments and not by others. Similarly, various requirements are described which may be requirements for some embodiments but not other embodiments.
Some portions of the detailed descriptions, which follow, are presented in terms of procedures, steps, logic blocks, processing, and other symbolic representations of operations on data bits within a computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. A procedure, computer executed step, logic block, process, etc., is here, and generally, conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals of a computer readable storage medium and are capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing terms such as “receiving” or “searching” or “identifying” or “providing” or the like, refer to the action and processes of a computer system, or similar electronic computing device that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories and other computer readable media into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
Referring to
TLB components 105 perform virtual address (VA) to physical address (PA) translation. Referring to
Referring again to
Operating system 111 provides services to application 113 such as providing application 113 with memory space for its own use. Operating system 111 maps this space to virtual addresses.
Operation
Referring to
At B, because the desired TTE is not found in L1LTB 105a, a miss occurs which prompts a search of page size cache 105c to identify a page size upon which a search of L2LTB 105b can be based.
At C, a page size upon which a search of L2LTB 105b (and/or other second level TLB caches) is to be based is identified in the page size cache 105c. In one embodiment, the page size (e.g., 4K, 64K, 1M and 64M) is used to determine which bits of the virtual address (VA) associated with the request are to be used to locate the address in L2LTB 105 (or other second level TLB) where the desired TTE resides. For example, for a 32 bit virtual address (VA), and 4K, 64K, 1M and 64M page sizes, virtual address bits VA[31:12], VA[31:16], VA[31:21] and VA[31:24] respectively may be used.
At D, a search of L2TLB 105b (and/or other second level TLB caches) is commenced based on the page size that was identified in operation C.
At E, the TTE and corresponding physical address corresponding to the virtual address associated with the translation request received by the TLB is identified. As discussed herein the physical address that is identified is provided to the MMU for use in accessing a corresponding location in memory.
As discussed herein, in support of the foregoing operations exemplary embodiments employ a small unified Level 1 TLB (L1TLB), a large unified Level 2 TLB (L2TLB) and a cache of page sizes. In conventional systems, L1TLB is accessed to obtain a physical address before L1 cache is accessed, and, upon a miss in L1TLB, L2TLB is accessed to obtain a physical address before L2 cache is accessed. Moreover, the L1TLB is usually a small and fully associative cache, hence, the loads can access L1TLB at all page sizes in the same clock cycle. However, L2TLB, because of its relatively large size, may not be a fully associative structure. As a result, L2LTB may not be accessed (e.g., searched) for all page sizes in a single clock cycle. However, in exemplary embodiments, if an access misses L1TLB 105a, then a desired TTE in L2TLB 105b (or another second level TLB) can be directly accessed based on a page size identified in a page size cache 105c, so that the system is not forced to repeat the access to L2TLB 105b (and/or other second level TLBs) at each of the possible page sizes until a TLB hit is obtained. In one embodiment, if an access misses L2TLB 105b and/or other secondary level TLBs based on the page size obtained from page size cache 105c, software maintenance to remove stale TTEs is not necessary (in such situations a search of L2TLB 105b and/or other secondary level TLBs using the next page size can be commenced). Accordingly, the overhead incurred from such software maintenance can be avoided.
Miss indication accessor 201 accesses an indication of a level one translation lookaside buffer (L1TLB) miss. In one embodiment, a miss is indicated when a search of the contents of L1TLB for a TTE (and corresponding physical address) that corresponds to virtual address (VA) to physical address (PA) translation request results in the TTE not being found.
Page size identifier 203 searches a page size cache (e.g., 105c in
Physical address identifier 205 uses the page size that is identified in the page size cache to search L2TLB and/or other second level TLBs for a TTE (that contains the desired physical address) that corresponds to the virtual address (VA) translation request. The page size enables the TTE to be directly located such that a search for the TTE can be executed within a single clock cycle.
It should be appreciated that the aforementioned components of system 101 can be implemented in hardware or software or in a combination of both. In one embodiment, components and operations of system 101 can be encompassed by components and operations of one or more computer components or programs (e.g., TLB search algorithm or circuitry). In another embodiment, components and operations of system 101 can be separate from the aforementioned one or more computer components or programs but can operate cooperatively with components and operations thereof.
Referring to
At 303 a search of a page size cache is executed in response to the L1LTB miss indication. In one embodiment, the page size cache stores only virtual addresses and page sizes. In other embodiments, the page size cache can additionally store other information. In one embodiment, the virtual addresses and page sizes that are stored in the page size cache correspond TTEs that have been evicted from the L1TLB.
At 305 a TTE and corresponding physical address is identified from a search of the L2TLB (and/or other second level TLBs) executed based on the page size that is identified in the page size cache.
With regard to exemplary embodiments thereof, systems and methods for accessing a unified translation lookaside buffer (TLB) are disclosed. A method includes receiving an indicator of a level one translation lookaside buffer (L1TLB) miss corresponding to a request for a virtual address to physical address translation, searching a cache that includes virtual addresses and page sizes that correspond to translation table entries (TTEs) that have been evicted from the L1TLB, where a page size is identified, and searching the L2TLB (and/or other second level TLBs) and identifying a physical address that is contained in the L2TLB. Access is provided to the identified physical address.
Although many of the components and processes are described above in the singular for convenience, it will be appreciated by one of skill in the art that multiple components and repeated processes can also be used to practice the techniques of the present invention. Further, while the invention has been particularly shown and described with reference to specific embodiments thereof, it will be understood by those skilled in the art that changes in the form and details of the disclosed embodiments may be made without departing from the spirit or scope of the invention. For example, embodiments of the present invention may be employed with a variety of components and should not be restricted to the ones mentioned above. It is therefore intended that the invention be interpreted to include all variations and equivalents that fall within the true spirit and scope of the present invention.
Number | Name | Date | Kind |
---|---|---|---|
4075704 | O'Leary | Feb 1978 | A |
4245344 | Richter | Jan 1981 | A |
4356550 | Katzman et al. | Oct 1982 | A |
4414624 | Summer, Jr. et al. | Nov 1983 | A |
4524415 | Mills, Jr. et al. | Jun 1985 | A |
4527237 | Frieder et al. | Jul 1985 | A |
4577273 | Hoppert et al. | Mar 1986 | A |
4597061 | Cline et al. | Jun 1986 | A |
4600986 | Scheuneman et al. | Jul 1986 | A |
4633434 | Scheuneman | Dec 1986 | A |
4682281 | Woffinden et al. | Jul 1987 | A |
4816991 | Watanabe et al. | Mar 1989 | A |
4920477 | Colwell et al. | Apr 1990 | A |
5294897 | Notani et al. | Mar 1994 | A |
5317705 | Gannon et al. | May 1994 | A |
5317754 | Blandy et al. | May 1994 | A |
5548742 | Wang et al. | Aug 1996 | A |
5559986 | Alpert et al. | Sep 1996 | A |
5574878 | Onodera et al. | Nov 1996 | A |
5634068 | Nishtala et al. | May 1997 | A |
5752260 | Liu | May 1998 | A |
5754818 | Mohamed | May 1998 | A |
5787494 | DeLano et al. | Jul 1998 | A |
5806085 | Berliner | Sep 1998 | A |
5852738 | Beakowski et al. | Dec 1998 | A |
5860146 | Vishin et al. | Jan 1999 | A |
5872985 | Kimura | Feb 1999 | A |
5905509 | Jones et al. | May 1999 | A |
5918251 | Yamada et al. | Jun 1999 | A |
5956753 | Glew et al. | Sep 1999 | A |
5974506 | Sicola et al. | Oct 1999 | A |
6075938 | Bugnion et al. | Jun 2000 | A |
6088780 | Yamada et al. | Jul 2000 | A |
6092172 | Nishimoto et al. | Jul 2000 | A |
6134634 | Marshall et al. | Oct 2000 | A |
6138226 | Yoshioka et al. | Oct 2000 | A |
6167490 | Levy et al. | Dec 2000 | A |
6212613 | Belair | Apr 2001 | B1 |
6226732 | Pei et al. | May 2001 | B1 |
6260131 | Kikuta et al. | Jul 2001 | B1 |
6272662 | Jadav et al. | Aug 2001 | B1 |
6275917 | Okada | Aug 2001 | B1 |
6341324 | Caulk, Jr. et al. | Jan 2002 | B1 |
6437789 | Tidwell et al. | Aug 2002 | B1 |
6604187 | McGrath et al. | Aug 2003 | B1 |
6658549 | Wilson et al. | Dec 2003 | B2 |
6681395 | Nishi | Jan 2004 | B1 |
6907600 | Neiger et al. | Jun 2005 | B2 |
6912644 | O'Connor et al. | Jun 2005 | B1 |
7111145 | Chen et al. | Sep 2006 | B1 |
7149872 | Rozas et al. | Dec 2006 | B2 |
7278030 | Chen et al. | Oct 2007 | B1 |
7380096 | Rozas et al. | May 2008 | B1 |
7406581 | Southwell | Jul 2008 | B2 |
7546420 | Shar et al. | Jun 2009 | B1 |
7913058 | Rozas et al. | Mar 2011 | B2 |
8145844 | Bruce | Mar 2012 | B2 |
8239656 | Rozas et al. | Aug 2012 | B2 |
8301847 | Dantzig et al. | Oct 2012 | B2 |
8522253 | Rozas et al. | Aug 2013 | B1 |
20020069326 | Richardson et al. | Jun 2002 | A1 |
20020099913 | Steely, Jr. | Jul 2002 | A1 |
20030088752 | Harman | May 2003 | A1 |
20040064668 | Kjos et al. | Apr 2004 | A1 |
20040117593 | Uhlig et al. | Jun 2004 | A1 |
20040117594 | VanderSpek | Jun 2004 | A1 |
20040205296 | Bearden | Oct 2004 | A1 |
20050027961 | Zhang | Feb 2005 | A1 |
20050060457 | Oluktun | Mar 2005 | A1 |
20050108480 | Correale et al. | May 2005 | A1 |
20060026381 | Doi et al. | Feb 2006 | A1 |
20060277365 | Pong | Dec 2006 | A1 |
20080077813 | Keller et al. | Mar 2008 | A1 |
20090138659 | Lauterbach | May 2009 | A1 |
20090157980 | Bruce | Jun 2009 | A1 |
20090164733 | Kim et al. | Jun 2009 | A1 |
20090172344 | Grochowski et al. | Jul 2009 | A1 |
20100169578 | Nychka et al. | Jul 2010 | A1 |
20110010521 | Wang et al. | Jan 2011 | A1 |
20110153955 | Herrenschmidt et al. | Jun 2011 | A1 |
20120042126 | Krick et al. | Feb 2012 | A1 |
20130046934 | Nychka et al. | Feb 2013 | A1 |
20130346699 | Walker | Dec 2013 | A1 |
Number | Date | Country |
---|---|---|
0596636 | May 1994 | EP |
0706133 | Apr 1996 | EP |
0125921 | Apr 2001 | WO |
Entry |
---|
Barham et al., “Xen and the Art of Virtualization,” ACM Symposium on Operating Systems Principles, Oct. 19, 2003, pp. 164-177. |
Number | Date | Country | |
---|---|---|---|
20130238874 A1 | Sep 2013 | US |