JP2000122928A - Access method for page table - Google Patents
Access method for page tableInfo
- Publication number
- JP2000122928A JP2000122928A JP11286661A JP28666199A JP2000122928A JP 2000122928 A JP2000122928 A JP 2000122928A JP 11286661 A JP11286661 A JP 11286661A JP 28666199 A JP28666199 A JP 28666199A JP 2000122928 A JP2000122928 A JP 2000122928A
- Authority
- JP
- Japan
- Prior art keywords
- page
- hash
- virtual
- tag
- instruction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 19
- 238000013519 translation Methods 0.000 claims description 36
- 230000006870 function Effects 0.000 abstract description 62
- 238000006243 chemical reaction Methods 0.000 abstract description 6
- 238000012545 processing Methods 0.000 abstract description 4
- 230000014616 translation Effects 0.000 description 34
- 230000008569 process Effects 0.000 description 7
- 239000000872 buffer Substances 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 238000013507 mapping Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- HVANFPMHKAMILB-XKNCWEQSSA-N 2-[(8s,9s,10s,11s,13s,14s,17r)-13-formyl-11-hydroxy-10-methyl-3-oxo-1,2,4,5,6,7,8,9,11,12,14,15,16,17-tetradecahydrocyclopenta[a]phenanthren-17-yl]ethyl hydrogen sulfate Chemical compound C([C@@]1([C@@H](CCOS(O)(=O)=O)CC[C@H]1[C@@H]1CC2)C=O)[C@H](O)[C@@H]1[C@]1(C)C2CC(=O)CC1 HVANFPMHKAMILB-XKNCWEQSSA-N 0.000 description 1
- 101000653005 Homo sapiens Thromboxane-A synthase Proteins 0.000 description 1
- 102100030973 Thromboxane-A synthase Human genes 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、コンピュータ・シ
ステムにおけるメモリ編成に関する。より具体的には、
本発明は、ハッシュ関数によってアクセスされるページ
・テーブルを有する仮想メモリ・システムに関する。The present invention relates to memory organization in a computer system. More specifically,
The present invention relates to a virtual memory system having a page table accessed by a hash function.
【0002】[0002]
【従来の技術】従来のコンピュータ・システムは、実際
に存在する物理メモリよりも多くの論理メモリをシミュ
レートし、コンピュータがいくつかのプログラムをその
サイズに関係なく並列に実行できるようにする仮想メモ
リと呼ばれる技術を使用する。並列のユーザ・プログラ
ムは、オペレーティング・システムによって割り当てら
れた仮想アドレスによって物理メイン・メモリ・アドレ
スにアクセスする。物理メイン・メモリ・アドレスへの
仮想アドレスのマッピングは、仮想アドレス変換として
知られるプロセスである。仮想メモリ変換は、いくつか
の技法により達成することができ、プロセッサは、メイ
ン・メモリ内の所望の情報にアクセスすることができ
る。2. Description of the Related Art Conventional computer systems simulate more logical memory than physical memory actually exists, allowing virtual memory to allow a computer to execute several programs in parallel regardless of their size. Use a technology called. Parallel user programs access physical main memory addresses through virtual addresses assigned by the operating system. Mapping virtual addresses to physical main memory addresses is a process known as virtual address translation. Virtual memory translation can be accomplished by a number of techniques, and the processor can access the desired information in main memory.
【0003】仮想アドレス空間と物理アドレス空間は、
一般に、ページと呼ばれる等しいサイズのメモリ・ブロ
ックに分割され、ページ・テーブルは、仮想アドレスと
物理アドレスの間の変換を実現する。各ページ・テーブ
ルのエントリは、一般に、仮想アドレスおよび/または
物理アドレス、ならびにページに関する保護情報と状況
情報を含む。状況は、一般に、ページが受けたアクセス
のタイプに関する情報を含む。たとえば、ダーティ・ビ
ットは、ページ内のデータに修正があったことを示す。
通常、ページ・テーブルは、大きいためメモリに記憶さ
れる。したがって、通常のメモリ・アクセスはそれぞ
れ、変換を達成するためのアクセスと、物理メモリ・ロ
ケーションにアクセスする別のアクセスとの少なくとも
2つのアクセスを必要とすることがある。[0003] The virtual address space and the physical address space are:
Divided into equal sized memory blocks, commonly called pages, the page tables provide translation between virtual and physical addresses. Each page table entry generally includes virtual and / or physical addresses, as well as protection and status information about the page. The context generally includes information about the type of access the page has received. For example, a dirty bit indicates that the data in the page has been modified.
Typically, the page table is stored in memory because it is large. Thus, each of the normal memory accesses may require at least two accesses, one to accomplish the translation and another to access the physical memory location.
【0004】仮想アドレス変換を支援する多くのコンピ
ュータ・システムは、変換参照バッファ(TLB、Tabl
e Lookaside Buffer)を使用する。TLBは、一般に、
処理装置上またはそのすぐ近くに通常配置され、最近使
用された仮想アドレスと物理アドレスの対を記憶する小
型の高速連想メモリである。TLBは、ページ・テーブ
ルに変換のサブセットを含み、きわめて迅速にアクセス
することができる。処理装置がメイン・メモリから情報
を必要とするとき、処理装置は、仮想アドレスをTLB
に送る。TLBは、仮想アドレスのページ番号を受け取
り、物理ページ番号を返す。物理ページ番号は、下位ア
ドレス情報と組み合わされ、メイン・メモリ内の所望の
バイトまたはワードがアクセスされる。[0004] Many computer systems that support virtual address translation include translation reference buffers (TLB, Tabl).
e Lookaside Buffer). TLB is generally
A small, fast associative memory, typically located on or near the processing unit, that stores recently used virtual and physical address pairs. The TLB contains a subset of the translations in the page table and can be accessed very quickly. When the processing unit needs information from main memory, the processing unit sets the virtual address to TLB
Send to The TLB receives the page number of the virtual address and returns the physical page number. The physical page number is combined with the lower address information to access the desired byte or word in main memory.
【0005】ほとんどの場合、TLBは、ページ・テー
ブル全体を含むことができず、そのためTLBを更新す
る手順を実施しなければならない。仮想ページがアクセ
スされ、TLB内に変換がないときは、ページ・テーブ
ルがアクセスされてこの仮想ページ番号の物理ページ番
号への変換が決定され、その情報がTLBに入力され
る。ページ・テーブルのアクセスは、TLBのアクセス
の20倍時間がかかり、したがって、プログラムの実行
速度は、変換をTLB内で利用するように維持すること
によって最適化される。[0005] In most cases, the TLB cannot contain the entire page table, so a procedure must be implemented to update the TLB. If the virtual page is accessed and there is no translation in the TLB, the page table is accessed to determine the translation of this virtual page number to a physical page number and that information is entered into the TLB. Accessing the page table takes 20 times longer than accessing the TLB, and thus the speed of execution of the program is optimized by keeping the translations utilized within the TLB.
【0006】今日のほとんどのコンピュータ・システム
は、コンピュータ内の物理ランダム・アクセス(RA
M)メモリを増大させるために、ある種の大容量記憶装
置、代表的にディスクを使用する。メイン・メモリのこ
の強化により、メイン・メモリしか使用できない場合よ
りも大きなプログラムを実行することができる。また、
ディスク・メモリは、RAMよりもはるかに安価である
が、かなり低速である。プログラムの長さやその他のプ
ログラムとの競合により、プログラムの一部分がメイン
・メモリ内にあり、一部分がディスク上にあることもあ
る。プログラムのすぐにアクセスしなければならない部
分は、メイン・メモリに送られ、一方そのとき使用され
ていない部分はディスク上に残される。[0006] Most computer systems today have physical random access (RA) in the computer.
M) To increase memory, some mass storage, typically disks, is used. This enhancement of main memory allows larger programs to be executed than would be possible if only main memory were available. Also,
Disk memory is much cheaper than RAM, but much slower. Depending on the length of the program and contention with other programs, a portion of the program may be in main memory and a portion may be on disk. Immediately accessible parts of the program are sent to main memory, while those parts which are not being used are left on disk.
【0007】たとえば、1つのプログラムが2メガバイ
トの長さで、1メガバイトのメイン・メモリを有するコ
ンピュータに使用される場合、そのプログラムは、2メ
ガバイトの仮想アドレスを使用する。メイン・メモリが
1メガバイトの情報しか保持できないため、残りの1メ
ガバイトのプログラム情報は、ディスク上に記憶され
る。任意のある時間において、プログラムの半分が利用
可能な物理メモリを占めるため、仮想アドレスの半分は
プログラム情報にマッピングすることができ、また残り
の半分はマッピングすることができない。メイン・メモ
リ内の情報へのアクセスは正常に行われる。すなわち、
まず、変換を含むかどうかを確認するためにTLBが参
照され、変換がない場合は、TLBがページ・テーブル
内の情報により更新され、変換情報を得るためにTLB
が再び参照される。For example, if a program is used on a computer that is 2 megabytes long and has 1 megabyte of main memory, the program uses 2 megabytes of virtual addresses. Since the main memory can only hold one megabyte of information, the remaining one megabyte of program information is stored on disk. At any one time, half of the program occupies the available physical memory, so half of the virtual addresses can be mapped to program information and the other half cannot. Access to information in the main memory is performed normally. That is,
First, the TLB is referenced to see if it contains a translation, and if there is no translation, the TLB is updated with the information in the page table and the TLB is
Is referred to again.
【0008】メイン・メモリ内にない情報にアクセスす
る場合、そのメモリ内にない変換のために最初にTLB
が参照される。次に、TLBを更新する変換情報を得る
ためにページ・テーブルが参照される。しかしながら、
ページ・テーブルには、メイン・メモリ内の情報の変換
しかなく、したがって必要な変換情報がない。この状態
は、ページ・フォルト(page fault)と呼ばれる。ペー
ジ・フォルトに応答して、参照する仮想ページに物理ペ
ージが割り当てられ、この情報は、ページ・ディレクト
リに挿入される。すべての物理ページが既に他の仮想ペ
ージと関連付けられている場合は、ページ・フォルト・
ハンドラが、物理ページからディスクにスワップアウト
するべき古い仮想ページを選択する必要があり、それに
よりそられの物理ページが新しい仮想ページを自由に受
け取ることができる。スワップアウトすべき古い仮想ペ
ージを決定するには、先入れ先出し方式や最低使用頻度
アルゴリズムなどの多くのアルゴリズムがある。当技術
分野において周知のように、ページ・フォルト・ハンド
ラは、一般にソフトウェアで実現されるが、TLB更新
プロセスは、ハードウェアとソフトウェアのいずれでも
操作することができる。When accessing information that is not in main memory, the TLB must first be converted for translation that is not in that memory.
Is referred to. Next, the page table is referenced to obtain conversion information for updating the TLB. However,
The page table only has a translation of the information in main memory, and thus does not have the necessary translation information. This condition is called a page fault. In response to a page fault, a physical page is assigned to the referencing virtual page, and this information is inserted into the page directory. If all physical pages are already associated with other virtual pages, a page fault
The handler needs to select the old virtual page to swap out from the physical page to disk, so that the physical page is free to receive the new virtual page. There are many algorithms for determining old virtual pages to swap out, such as a first-in first-out or least recently used algorithm. As is well known in the art, page fault handlers are generally implemented in software, but the TLB update process can operate on either hardware or software.
【0009】図1は、以上のプロセスを示す。ステップ
112で、仮想アドレスがTLBに提示される。その仮
想アドレス用の変換がTLB内にある場合(TLBヒッ
ト)は、関連した物理アドレスがTLBから得られ、物
理メモリにアクセスするために利用される(ステップ1
14)。その仮想アドレス用の変換がTLB内にない場
合(TLBミス)は、ページ・ディレクトリ/テーブル
においてその仮想アドレス用の変換が参照される(ステ
ップ116)。変換がページ・ディレクトリ内にある場
合は、この情報はTLB(ステップ118)に挿入さ
れ、仮想アドレスが再び提示される(ステップ11
2)。このとき、TLBヒットとなり、それにより得ら
れた物理アドレスを使用して物理メモリがアクセスされ
る。FIG. 1 illustrates the above process. At step 112, the virtual address is presented to the TLB. If the translation for that virtual address is in the TLB (TLB hit), the associated physical address is obtained from the TLB and used to access physical memory (step 1).
14). If the translation for the virtual address is not in the TLB (TLB miss), the translation for the virtual address is referenced in the page directory / table (step 116). If the translation is in the page directory, this information is inserted into the TLB (step 118) and the virtual address is presented again (step 11).
2). At this time, a TLB hit occurs, and the physical memory is accessed using the obtained physical address.
【0010】仮想アドレスが、物理アドレスのページが
関連付けらていない仮想アドレスのページにある場合
は、ページ・ディレクトリにこのページのエントリはな
く、ページ・フォルトが起こる。この状況において、ソ
フトウェア・ページ・フォルト・ハンドラ(ステップ1
20)は、物理ページを仮想ページに割り当て、ディス
クから物理ページにページをコピーし、ページ・テーブ
ルを更新する。次に、仮想アドレスは、再びTLBに提
示される。しかしながら、TLBにまだ変換がないた
め、TLBミスになり、TLBはページ・ディレクトリ
から更新される。仮想アドレスがTLBに再び提示され
るとき、TLBヒットが行われ、得られた物理アドレス
を使用して物理メモリにアクセスする。If the virtual address is on a page at a virtual address that is not associated with a page at the physical address, there is no entry for this page in the page directory and a page fault occurs. In this situation, the software page fault handler (step 1
20) assigns physical pages to virtual pages, copies pages from disk to physical pages, and updates the page table. Next, the virtual address is presented again to the TLB. However, because there is no translation in the TLB yet, a TLB miss occurs and the TLB is updated from the page directory. When the virtual address is presented again to the TLB, a TLB hit is made and the physical memory obtained is used to access the physical memory.
【0011】図2は、仮想アドレスの呈示に応じて変換
参照バッファ(TLB)内のエントリにアクセスする簡
略化した方法を示す。例示のため、図のTLBは、1つ
のエントリだけを有するが、通常TLBはさらに多くの
エントリを有する。仮想アドレスは、レジスタ201に
ロードされる。この仮想アドレスは、仮想ページ番号2
03と物理オフセット205の2つの部分からなる。物
理オフセットは、ページ・サイズに対応する。4キロ・
バイトのページ・サイズを有するコンピュータ・システ
ムの場合、物理オフセット205は、アドレスの下位1
2ビット(ビット11〜0)であり、ページ内の特定の
バイトを指定する。レジスタ内の残りのビットは、仮想
ページ番号を示す。「ページ・オフセット」という用語
は、当業界でしばしば使用される用語であり、「物理オ
フセット」という用語と同義である。FIG. 2 shows a simplified method of accessing an entry in a translation reference buffer (TLB) in response to the presentation of a virtual address. For purposes of illustration, the illustrated TLB has only one entry, but typically the TLB has many more entries. The virtual address is loaded into register 201. This virtual address is virtual page number 2
03 and a physical offset 205. The physical offset corresponds to the page size. 4 km
For a computer system having a page size of bytes, the physical offset 205 is the lower one of the address.
Two bits (bits 11 to 0) specify a specific byte in the page. The remaining bits in the register indicate the virtual page number. The term “page offset” is a term often used in the art and is synonymous with the term “physical offset”.
【0012】他のビットは、物理ページ番号への変換を
一意に指定する際に使用されることがある。たとえば、
「アドレス空間識別子」ビットまたは「領域識別子」ビ
ットを使用して、物理ページを識別することができる。
しかしながら、本発明の目的のため、そのようなビット
はすべて、仮想ページ番号の一部と見なされる。Other bits may be used to uniquely specify the conversion to a physical page number. For example,
The “address space identifier” bit or the “region identifier” bit can be used to identify a physical page.
However, for the purposes of the present invention, all such bits are considered part of the virtual page number.
【0013】図の例では、仮想ページ番号が仮想タグに
なり、TLB比較器207の1つの入力として提供され
る。TLB209は、TLBタグ211およびそれと関
連した物理ページ番号213の2つの連結部分を有す
る。TLBタグ211は、TLB比較器207に第2の
入力を提供し、比較器は、TLBタグを仮想タグと比較
する。タグが一致する場合、比較器はTLBヒットを示
し、物理ページ番号213を物理オフセット205と組
み合わせて、物理(実)メモリ・アドレスが提供され
る。タグが一致しない場合は、TLBミスがあり、図1
と関連して説明したTLBミス・プロセスを使用してT
LBを更新する。In the example shown, the virtual page number becomes a virtual tag and is provided as one input to the TLB comparator 207. The TLB 209 has two connected portions of a TLB tag 211 and a physical page number 213 associated therewith. TLB tag 211 provides a second input to TLB comparator 207, which compares the TLB tag with the virtual tag. If the tags match, the comparator indicates a TLB hit and the physical page number 213 is combined with the physical offset 205 to provide the physical (real) memory address. If the tags do not match, there is a TLB miss and
TLB using the TLB miss process described in connection with
Update LB.
【0014】図3は、TLBミスの後にTLBを更新す
るために必要になる仮想ページ番号を提供する物理ペー
ジ情報を取り出すプロセスを示す。前述のように、仮想
−物理マッピングは、ページ・テーブル内に維持され
る。所与の仮想アドレスを物理アドレスに変換する1つ
の手法は、仮想アドレスについて多対単関数(ハッシュ
(hash))を実行してページ・テーブルへのインデックス
を形成することである。これは、エントリの連結リスト
へのポインタを提供する。次に、それらのエントリの一
致が探索される。一致を決定するために、仮想ページ番
号が、ページ・テーブル(仮想タグ)内のエントリと比
較される。2つが等しい場合、そのページ・テーブル・
エントリは、物理アドレス変換を提供する。FIG. 3 illustrates the process of retrieving physical page information that provides the virtual page number needed to update the TLB after a TLB miss. As mentioned above, the virtual-physical mapping is maintained in a page table. One approach to converting a given virtual address to a physical address is to use a many-to-one function (hash
(hash)) to form an index into the page table. This provides a pointer to a linked list of entries. Next, the entries are searched for a match. The virtual page number is compared to an entry in the page table (virtual tag) to determine a match. If the two are equal, the page / table /
Entries provide physical address translation.
【0015】示した例において、ハッシュ関数301が
仮想ページ番号203で実行され、インデックスが形成
される。このインデックスは、ページ・テーブル303
内へのオフセットである。図示したように、インデック
スは0であり、すなわちインデックスは、ページ・テー
ブル内の第1のエントリ305を指す。ページ・テーブ
ル内の各エントリは、複数部分からなるが、一般に、少
なくとも仮想タグ307、物理ページ309およびポイ
ンタ311を含む。仮想ページ番号203が仮想のタグ
307と等しい場合、物理ページ309は、所望の物理
(実)メモリ・ページ・アドレスを提供する。仮想タグ
が一致しない場合は、ポインタ311は、事実上物理変
換情報に含まれるメモリ内のエントリのチェーンを指
す。このチェーンに含まれる追加の情報は、複数の仮想
ページ番号が同じページ・テーブル・エントリにハッシ
ュすることができるときに必要とされる。In the example shown, hash function 301 is performed on virtual page number 203 to form an index. This index is stored in the page table 303
Offset into As shown, the index is 0, ie, the index points to the first entry 305 in the page table. Each entry in the page table has multiple parts, but generally includes at least a virtual tag 307, a physical page 309, and a pointer 311. If virtual page number 203 is equal to virtual tag 307, physical page 309 provides the desired physical (real) memory page address. If the virtual tags do not match, the pointer 311 effectively points to a chain of entries in memory included in the physical translation information. The additional information contained in this chain is needed when multiple virtual page numbers can hash to the same page table entry.
【0016】図示したように、ポインタ311は、チェ
ーン・セグメント313を指す。このチェーン・セグメ
ントは、ページ・テーブルと同じタイプの情報を含む。
前と同じように、仮想ページ番号203は、一致が起こ
るかどうか確認するために次の仮想のタグ315と比較
される。一致が起こる場合、関連した物理ページ317
が、所望の物理メモリ・ページのアドレスを提供する。
一致が起きない場合、必要に応じて、次のチェーン・セ
グメントを見つけるためにポインタ319が調べられ
る。図示したように、ポインタ319が別のチェーン・
セグメントを指さない場合は、ページ・フォルトが起き
ている。その場合、図1と関連して説明したように、ペ
ージ・フォルト・ソフトウェア・プログラムは使用さ
れ、ページ・テーブルが更新される。As shown, pointer 311 points to chain segment 313. This chain segment contains the same type of information as the page table.
As before, the virtual page number 203 is compared to the next virtual tag 315 to see if a match occurs. If a match occurs, the associated physical page 317
Provide the address of the desired physical memory page.
If no match occurs, pointer 319 is examined to find the next chain segment, if necessary. As shown, the pointer 319 is in another chain
If it does not point to a segment, a page fault has occurred. In that case, the page fault software program is used and the page table is updated, as described in connection with FIG.
【0017】以上の方法は、仮想タグがコンピュータの
基本データ・パス・サイズよりも小さいシステムでうま
く機能する。しかしながら、仮想タグがデータ・パス・
サイズよりも大きい場合は、仮想タグと仮想ページ番号
が同じであるかどうかを調べるために2つの比較が必要
である。The above method works well in systems where the virtual tags are smaller than the computer's base data path size. However, if the virtual tag is
If so, two comparisons are needed to see if the virtual tag and virtual page number are the same.
【0018】デール・モーリス(Dale Morris)らに譲
渡され、「Computer Memory AddressControl Apparatus
Utilizing Hashed Address Tags in Page Tables Whic
h Are Compared to a Combined Address Tag and Index
Which Are Longer than theBasic Data Width of the
Associated Computer」と題し、参照により本明細書に
組み込まれた米国特許第5,724,538号は、仮想
タグのサイズを小さくし、それにより仮想タグと仮想ペ
ージ番号が同じかどうかを調べるために必要な比較の数
を少なくする方式を開示している。基本的に、デール・
モーリスらは、仮想アドレスの一部分が既にハッシュ・
インデックスによって表されており、したがって、アド
レスの一部分が仮想タグによって表す必要がないことを
認識していた。Transferred to Dale Morris et al., "Computer Memory Address Control Apparatus
Utilizing Hashed Address Tags in Page Tables Whic
h Are Compared to a Combined Address Tag and Index
Which Are Longer than the Basic Data Width of the
U.S. Pat. No. 5,724,538, entitled "Associated Computer," incorporated herein by reference, discloses a method for reducing the size of a virtual tag and thereby determining whether the virtual tag and the virtual page number are the same. A scheme is disclosed that reduces the number of required comparisons. Basically, Dale
Maurice and colleagues believe that a portion of the virtual
It was represented by an index, and thus knew that a portion of the address did not need to be represented by a virtual tag.
【0019】図4は、デール・モーリスらによって開示
された実施形態の簡略化したブロック図を示す。図4に
おいて、ページ・テーブル413は、「ハッシュ・タ
グ」421および423を含む。ハッシュ・インデック
ス409は、仮想ページ番号ビット401をとり、ビッ
トについてインデックス・ハッシュ関数405を実行す
ることによって形成され、その結果、コンピュータの基
本データ幅よりも長くならない。同様に、ハッシュ・タ
グは、仮想ページ番号ビット401を取り、タグ・ハッ
シュ関数427を実行することにより形成され、得られ
たハッシュ・タグは、コンピュータの基本データ幅より
も長くならない。図4は、タグ・ハッシュ関数427と
ハッシュ・タグ421および423の間の明示的接続を
示していないが、タグ・ハッシュ関数427により表さ
れたアルゴリズムは、ハッシュ・タグ421および42
3が生成されページ・テーブル413に挿入されたとき
に使用されることに注意されたい。FIG. 4 shows a simplified block diagram of the embodiment disclosed by Dale Morris et al. In FIG. 4, the page table 413 includes “hash tags” 421 and 423. The hash index 409 is formed by taking the virtual page number bits 401 and performing the index hash function 405 on the bits so that they are no longer than the basic data width of the computer. Similarly, a hash tag is formed by taking the virtual page number bits 401 and performing a tag hash function 427, the resulting hash tag being no longer than the basic data width of the computer. Although FIG. 4 does not show an explicit connection between the tag hash function 427 and the hash tags 421 and 423, the algorithm represented by the tag hash function 427 uses the hash tags 421 and 42.
Note that 3 is used when generated and inserted into page table 413.
【0020】インデックス・ハッシュ関数405とタグ
・ハッシュ関数427は、任意の所与の仮想ページ番号
について、結果として得られるハッシュ・インデックス
と結果として得られるハッシュ・タグの組合せが独特で
なるという限度で相補的である。したがって、仮想ペー
ジがアクセスされるとき、仮想ページ番号401がイン
デックス・ハッシュ関数405に適用され、ページ・テ
ーブル413内のハッシュ・タグ(ハッシュ・タグ42
1、423など)を指すハッシュ・インデックスが生成
される。テーブル413から提供されるハッシュ・タグ
は、比較機能429に送られ。同時に、仮想ページ番号
401またタグ・ハッシュ関数427に提供されハッシ
ュ・タグ425が生成される。ハッシュ・タグ425と
ページ・テーブル413からのハッシュ・タグが一致す
る場合は、物理ページ(417のエントリ317に記憶
された物理ページなど)を使用してメモリ・アクセス操
作が完了する。タグが一致しない場合、チェーン・セグ
メントが存在するかどうか確認するために、ページ・テ
ーブル・エントリのポインタ(ポインタ319、419
など)がアクセスされる。チェーン・セグメントがない
か、または一致を見つけることなくすべてのチェーン・
セグメントが探索された場合は、前述のように、オペレ
ーティング・システムのページ・フォルト・ハンドラが
呼び出される。[0020] The index hash function 405 and the tag hash function 427 are used to the extent that, for any given virtual page number, the combination of the resulting hash index and the resulting hash tag is unique. Complementary. Therefore, when a virtual page is accessed, the virtual page number 401 is applied to the index hash function 405 and the hash tag (hash tag 42) in the page table 413 is used.
1, 423, etc.). The hash tag provided from table 413 is sent to comparison function 429. At the same time, the virtual page number 401 and the hash tag 425 provided to the tag hash function 427 are generated. If the hash tag 425 matches the hash tag from the page table 413, the memory access operation is completed using a physical page (such as the physical page stored in the entry 317 of 417). If the tags do not match, a pointer to the page table entry (pointers 319, 419) is used to determine if a chain segment exists.
Etc.) are accessed. No chain segments or all chain segments without finding a match
If a segment is found, the operating system page fault handler is invoked, as described above.
【0021】インデックス・ハッシュ関数405とタグ
・ハッシュ関数427は、ハードウェアとソフトウェア
の両方によってアクセスされることに注意されたい。ハ
ードウェアは、仮想ページ番号を物理ページ番号に変換
するときにハッシュ関数にアクセスし、ソフトウェア
は、ページ・テーブルを初期化するとき、またページ・
テーブルにアクセスしそれを修正するときに、ページ・
フォルトを修正するときに必要なようにハッシュ関数に
アクセスしなければならない。従来技術において、ハッ
シュ・アルゴリズムは、本質的に、2つの形態で提供さ
れた。コンピュータ・ハードウェアは、仮想対物理変換
を迅速に進めることができるハッシュ・アルゴリズムの
ハードウェア・ベースのバージョンを含み、オペレーテ
ィング・システムは、ページ・テーブルを初期化、アク
セスまたは修正するときに仮想対物理変換を生成するた
めにハッシュ・アルゴリズムのソフトウェア・ベースの
バージョンを含んでいた。Note that index hash function 405 and tag hash function 427 are accessed by both hardware and software. The hardware accesses the hash function when converting virtual page numbers to physical page numbers, and the software accesses the hash table when initializing the page table and
When accessing and modifying a table, the page
You must access the hash function as needed to correct the fault. In the prior art, hash algorithms have been provided in essentially two forms. Computer hardware includes a hardware-based version of a hashing algorithm that can expedite the virtual-to-physical conversion, and the operating system allows the virtual-to-physical conversion when initializing, accessing, or modifying the page tables. Included a software-based version of the hash algorithm to generate the physical transformation.
【0022】[0022]
【発明が解決しようとする課題】したがって、ハッシュ
・アルゴリズムの変更は、設計サイクルの長さに悪影響
を及ぼし、ハードウェア設計者とオペレーティング・シ
ステム設計者との間で綿密な調整を必要とする、ハード
ウェアとソフトウェア両方の変更を必要とした。さら
に、マイクロソフト社から提供されるWindows
(商標)NTなどの市販のオペレーティング・システム
が様々な変化するハッシュ・アルゴリズムをサポートす
るのは、実際的でない。当技術分野において必要とされ
ているのは、オペレーティング・システムが、ハードウ
ェアによって使用されるハッシュ・アルゴリズムにアク
セスすることができるようにすることであり、それによ
り実際のハッシュ・アルゴリズムをオペレーティング・
システムの中にコード化する必要がないようにすること
である。Therefore, changes in the hash algorithm negatively impact the length of the design cycle and require close coordination between hardware and operating system designers. Required both hardware and software changes. In addition, Windows provided by Microsoft
It is impractical for commercial operating systems, such as NT, to support a variety of changing hash algorithms. What is needed in the art is to allow an operating system to access the hash algorithm used by the hardware, thereby replacing the actual hash algorithm with the operating system.
It is not necessary to code it in the system.
【0023】[0023]
【課題を解決するための手段】本発明は、ハードウェア
・ベースの仮想メモリをソフトウェアに適用する方法お
よび装置である。計算技術の分野において、仮想メモリ
方式は、論理仮想アドレスを、コンピュータ・ハードウ
ェアによって使用される物理アドレスに変換するために
使用され、ページ・テーブルは、一般に、仮想−物理変
換を記憶するために使用される。SUMMARY OF THE INVENTION The present invention is a method and apparatus for applying hardware-based virtual memory to software. In the field of computing technology, virtual memory schemes are used to translate logical virtual addresses to physical addresses used by computer hardware, and page tables are generally used to store virtual-to-physical translations. used.
【0024】従来技術のコンピュータ・システムにおい
て、ハッシュ・アルゴリズムは、仮想アドレスからハッ
シュ・インデックスとハッシュ・タグを生成するために
使用される。ハッシュ・インデックスは、ページ・テー
ブルのエントリを参照するために使用され、ハッシュ・
タグは、物理ページ番号と共にエントリに記憶されてい
た。そのようなコンピュータ・システムでは、コンピュ
ータ・ハードウェアは、変換参照バッファ(TLB)ミ
スを処理するときにハッシュ・インデックスとハッシュ
・タグを生成しなければならなかった。さらに、コンピ
ュータ・オペレーティング・システム(またはその他の
システム・ハードウェア)は、ページ・フォルトを処理
するときなど、ページ・テーブルを初期化、修正、また
はアクセスするときにハッシュ・インデックスとハッシ
ュ・タグを生成しなければならなかった。したがって、
そのようなコンピュータ・システムは、コンピュータ・
ハードウェアによって使用される第1のバージョンと、
コンピュータ・オペレーティング・システム(またはそ
の他のシステム・ソフトウェア)にコード化された第2
のバージョンの2つのバージョンのハッシュ・アルゴリ
ズムを含んでいた。In prior art computer systems, a hash algorithm is used to generate a hash index and a hash tag from a virtual address. The hash index is used to refer to the entry in the page table, and the hash index
The tag was stored in the entry along with the physical page number. In such computer systems, computer hardware had to generate hash indexes and hash tags when handling translation reference buffer (TLB) misses. In addition, the computer operating system (or other system hardware) generates hash indexes and hash tags when initializing, modifying, or accessing page tables, such as when handling page faults I had to. Therefore,
Such computer systems are computer
A first version used by the hardware;
A second coded in the computer operating system (or other system software)
This version included two versions of the hash algorithm.
【0025】本発明によれば、ハードウェアのハッシュ
・アルゴリズムをソフトウェアにさらす2つの命令が提
供される。第1の命令は、変換ハッシュ・エントリ・ア
ドレス(THASH:Translation Hashed Entry Addre
ss)命令であり、仮想アドレスからページ・テーブル内
のエントリを示すハッシュ・インデックスを生成する。
第2の命令は、変換ハッシュ・エントリ・タグ(TTA
G:translation Hashed Entry Tag)命令であり、仮想
アドレスから、ハッシュ・インデックスによって参照さ
れるページ・テーブルのエントリに記憶されるハッシュ
・タグを生成する。これらの2つの命令を提供すること
により、コンピュータのオペレーティング・システム
(またはその他のシステム・ソフトウェア)に、コンピ
ュータ・ハードウェアが使用するハッシュ・アルゴリズ
ムをコード化する必要がない。むしろ、THASH命令
とTTAG命令は、ハードウェアによって使用されるハ
ッシュ・アルゴリズムに、ソフトウェアがアクセスする
ことを可能にするインタフェースを提供する。In accordance with the present invention, two instructions are provided that expose a hardware hash algorithm to software. The first instruction is a translation hash entry address (THASH).
ss) The instruction generates a hash index indicating an entry in the page table from the virtual address.
The second instruction is a translation hash entry tag (TTA
G: translation Hashed Entry Tag) instruction, which generates a hash tag stored in the entry of the page table referred to by the hash index from the virtual address. By providing these two instructions, the computer operating system (or other system software) does not need to code the hash algorithm used by the computer hardware. Rather, the THASH and TTAG instructions provide an interface that allows software to access the hash algorithm used by the hardware.
【0026】本発明の第1の実施形態において、THA
SH命令またはTTAG命令が実行されるとき、適切な
ハッシュ関数を実施するルーチンを実行するトラップが
生成される。本発明の第2の実施形態において、THA
SH命令とTTAG命令が、CPUによってハードウェ
ア内で実行される。In the first embodiment of the present invention, THA
When a SH or TTAG instruction is executed, a trap is generated that executes a routine that implements the appropriate hash function. In a second embodiment of the present invention, the THA
The SH and TTAG instructions are executed in hardware by the CPU.
【0027】[0027]
【発明の実施の形態】本発明は、ハッシュ関数をソフト
ウェアで実現することを必要とせずに、オペレーティン
グ・システム(または他のソフトウェア)が、そのソフ
トウェアが稼働中のコンピュータ・システムのハードウ
ェアによって使用されるインデックス・ハッシュ関数お
よびタグ・ハッシュ関数にアクセスすることができる方
法および装置である。本発明は、基本的に、2つのコン
ピュータ命令によって実現される。第1の命令は、変換
ハッシュ・エントリ・アドレス命令(Translation Hash
ed Entry Address instruction)であり、本明細書では
THASH命令と呼ばれる。第2の命令は、変換ハッシ
ュ・エントリ・タグ(Translation Hashed EntryTag in
struction)命令であり、本明細書ではTTAG命令と
呼ばれる。DETAILED DESCRIPTION OF THE INVENTION The present invention does not require the hash function to be implemented in software, but rather allows the operating system (or other software) to use the hardware by the hardware of the computer system on which the software is running. Methods and apparatus that can access index and tag hash functions that are performed. The invention is basically realized by two computer instructions. The first instruction is a translation hash entry address instruction (Translation Hash
ed Entry Address instruction), which is referred to herein as a THASH instruction. The second instruction is Translation Hashed EntryTag in
struction) instruction, and is referred to herein as a TTAG instruction.
【0028】THASH命令は、次の形式を有する。The THASH instruction has the following format.
【0029】THASH Rx=RyTHASH Rx = Ry
【0030】仮想アドレスは、レジスタRyで指定さ
れ、生成されたハッシュ・インデックスは、レジスタR
xに入れられる。したがって、図4において、THAS
H命令は、インデックス・ハッシュ関数405をソフト
ウェアに適用する。The virtual address is specified by the register Ry, and the generated hash index is stored in the register Ry.
Put in x. Therefore, in FIG.
The H instruction applies the index hash function 405 to software.
【0031】同様に、TTAG命令は、次の形式を有す
る。Similarly, the TTAG instruction has the following format.
【0032】TTAG Rx=RyTTAG Rx = Ry
【0033】仮想アドレスは、レジスタRyで指定さ
れ、生成されたハッシュ・タグは、レジスタRxに入れ
られる。したがって、TTAG命令は、図4のインデッ
クス・ハッシュ関数427をソフトウェアにさらす。The virtual address is specified by the register Ry, and the generated hash tag is stored in the register Rx. Thus, the TTAG instruction exposes the index hash function 427 of FIG. 4 to software.
【0034】本発明は、単一のCPUを有する低性能デ
ィスクトップ・コンピュータから32以上のCPUを有
する比較的複雑な高性能のサーバ・コンピュータまでの
コンピュータ・システムにおいて実施される。低性能コ
ンピュータにおいて、ハッシュ関数は、コンピュータの
基本入出力システム(BIOS)コードで記憶された一
連のソフトウェア命令によって実施することができる。
そのようなコンピュータにおいて、最も頻繁に使用され
る変換は、変換参照バッファ(TLB)に適合する。T
LBミスに遭遇したとき、プロセッサは、BIOSに記
憶されたハッシュ関数にジャンプして、ハッシュ・イン
デックスとハッシュ・タグを計算する。そのようなコン
ピュータにおいて、ページ・テーブルはあまり頻繁にア
クセスされないため、この方式は、満足できるパフォー
マンスを提供する。The invention is implemented in computer systems from low performance desktop computers having a single CPU to relatively complex high performance server computers having more than 32 CPUs. In low performance computers, the hash function can be implemented by a series of software instructions stored in the computer's basic input / output system (BIOS) code.
In such computers, the most frequently used transform fits into a translation reference buffer (TLB). T
When encountering an LB miss, the processor jumps to a hash function stored in the BIOS to calculate the hash index and hash tag. In such computers, this scheme provides satisfactory performance because the page tables are not accessed very often.
【0035】多数のCPUを有するより高性能コンピュ
ータでは、ハッシュ関数をハードウェアで実施すること
ができる。そのようなコンピュータでは、多くのプログ
ラムが同時にアクティブになることができ、頻繁に使用
される変換がすべて、TLBに適合するわけではない。
したがって、TLBミスが起きると、ハードウェア・ベ
ースのハッシュ関数がアクセスされ、ハッシュ・インデ
ックスとハッシュ・タグが生成される。In higher performance computers with multiple CPUs, the hash function can be implemented in hardware. In such a computer, many programs can be active at the same time, and not all frequently used conversions are compatible with the TLB.
Thus, when a TLB miss occurs, a hardware-based hash function is accessed and a hash index and hash tag are generated.
【0036】図5は、低性能コンピュータ501で実施
される本発明の実施形態を示す簡略化したブロック図で
ある。コンピュータ501は、命令レジスタ502、命
令デコード実行論理機構503、割込みトラップ・ハン
ドラ・ポインタ504、プログラム・カウンタ506、
ソフトウェア・ベースのインデックス・ハッシュ関数5
08、ソフトウェア・ベースのタグ・ハッシュ関数51
0、およびN個のレジスタであるレジスタ・ファイル5
12を含む。FIG. 5 is a simplified block diagram illustrating an embodiment of the present invention implemented on a low performance computer 501. The computer 501 includes an instruction register 502, an instruction decode execution logic 503, an interrupt trap handler pointer 504, a program counter 506,
Software-based index hash function 5
08, software-based tag hash function 51
Register file 5 which is 0 and N registers
12 inclusive.
【0037】コンピュータ501が、THASHまたは
TTAG命令を実行するとき、命令は、命令レジスタ5
02にロードされる。命令デコード実行論理機構503
は、THASHまたはTTAG命令をデコードし、命令
トラップを生成する。命令がTHASH命令の場合、割
込みトラップ・ハンドラ・ポインタ504のTHASH
エントリに保持されたプログラム・ロケーションが、プ
ログラム・カウンタ506にロードされる。その後、ソ
フトウェア・ベースのインデックス・ハッシュ関数50
8の第1の命令が、命令レジスタ502にロードされ、
ソフトウェア・ベースのインデックス・ハッシュ関数5
08が実行される。関数508の実行中に、仮想アドレ
スを含むレジスタRyが、レジスタ・ファイル512か
ら取り出される。関数508は、仮想アドレスを処理し
てハッシュ・インデックスを生成し、そのハッシュ・イ
ンデックスをレジスタRxに記憶する。次に、関数50
8が終了し、THASH命令の直後に命令により実行が
継続する。When the computer 501 executes a THASH or TTAG instruction, the instruction is stored in the instruction register 5
02 is loaded. Instruction decode execution logic 503
Decodes a THASH or TTAG instruction and generates an instruction trap. If the instruction is a THASH instruction, the THASH of the interrupt trap handler pointer 504
The program location held in the entry is loaded into the program counter 506. Then, the software-based index hash function 50
8 are loaded into the instruction register 502;
Software-based index hash function 5
08 is executed. During execution of function 508, register Ry containing the virtual address is retrieved from register file 512. Function 508 processes the virtual address to generate a hash index and stores the hash index in register Rx. Next, the function 50
8 ends and execution continues with the instruction immediately after the THASH instruction.
【0038】同様に、命令がTTAG命令の場合、割込
みトラップ・ハンドラ・ポインタ504のTTAGエン
トリに保持されたプログラム・ロケーションは、プログ
ラム・カウンタ506にロードされる。その後、ソフト
ウェア・ベースのタグ・ハッシュ関数510の第1の命
令が、命令レジスタ502にロードされ、ソフトウェア
・ベースのタグ・ハッシュ関数510が実行される。関
数510の実行中に、仮想アドレスを含むレジスタRy
が、レジスタ・ファイル512から取り出される。関数
510は、仮想アドレスを処理してハッシュ・タグを生
成し、レジスタRyにハッシュタグを記憶する。次に、
関数510が終了し、TTAG命令の直後に命令により
実行が継続する。Similarly, if the instruction is a TTAG instruction, the program location held in the TTAG entry of interrupt trap handler pointer 504 is loaded into program counter 506. Thereafter, the first instruction of the software-based tag hash function 510 is loaded into the instruction register 502 and the software-based tag hash function 510 is executed. During execution of function 510, register Ry containing the virtual address
Is retrieved from the register file 512. Function 510 processes the virtual address to generate a hash tag and stores the hash tag in register Ry. next,
Function 510 terminates and execution continues with the instruction immediately after the TTAG instruction.
【0039】ソフトウェア・ベースのインデックス・ハ
ッシュ関数508とソフトウェア・ベースのタグ・ハッ
シュ関数510を様々な方法で提供することができるこ
とに注意されたい。これらの関数は、コンピュータ・シ
ステムのBIOSコードに含まれ、読取り専用メモリに
記憶することができる。また、これらの関数は、そのよ
うな命令がCPUによってハードウェアで明示的に支援
されないときに、ソフトウェアにおいてある組み込まれ
た(architected)コンピュータ命令を実施する「抽象化
層」の一部として提供されることもある。または、機能
508および510は、コンピュータ501に固有の低
レベル・ドライバの一部として提供されることもある。
しかしながら、ページ・テーブルを維持しアクセスする
オペレーティング・システムの部分は、関数508およ
び510によって実施される実際のアルゴリズムを「知
らなくて」もよい。オペレーティング・システムは、T
ASH命令およびTTAG命令によって、これらのアル
ゴリズムにアクセスすることができるからである。Note that the software-based index hash function 508 and the software-based tag hash function 510 can be provided in various ways. These functions are contained in the BIOS code of the computer system and can be stored in read-only memory. Also, these functions are provided as part of an "abstraction layer" that implements certain architected computer instructions in software when such instructions are not explicitly supported in hardware by the CPU. Sometimes. Alternatively, functions 508 and 510 may be provided as part of a low-level driver specific to computer 501.
However, the part of the operating system that maintains and accesses the page tables may "don't know" the actual algorithm implemented by functions 508 and 510. The operating system is T
This is because these algorithms can be accessed by the ASH instruction and the TTAG instruction.
【0040】図6は、高性能コンピュータ601で実施
される本発明の実施形態を示す簡略化したブロック図で
ある。コンピュータ601は、命令レジスタ602、命
令デコード実行論理機構603、ハードウェア・ベース
のインデックス・ハッシュ関数604、ハードウェア・
ベースのタグ・ハッシュ関数605、およびN個のレジ
スタを有するレジスタ・ファイル606を含む。FIG. 6 is a simplified block diagram illustrating an embodiment of the present invention implemented on a high performance computer 601. The computer 601 includes an instruction register 602, an instruction decode execution logic 603, a hardware-based index hash function 604, a hardware
It includes a base tag hash function 605 and a register file 606 having N registers.
【0041】コンピュータ601がTHASHまたはT
TAG命令を実行するとき、その命令は、命令レジスタ
602にロードされる。命令デコード実行論理機構60
3は、THASHまたはTTAG命令をデコードする。
命令がTHASH命令の場合、命令デコード実行論理機
構603は、レジスタ・ファイル606のレジスタRy
から仮想アドレスをフェッチし、その仮想アドレスをハ
ードウェア・ベースのインデックス・ハッシュ関数60
4に適用する。関数604は、ハッシュ・インデックス
を生成し、ハッシュ・インデックスを命令デコード実行
論理機構603に提供し、レジスタ・ファイル606の
レジスタRxにハッシュ・インデックスを記憶する。次
に、THASH命令の直後に命令により実行が継続す
る。When the computer 601 is THASH or T
When executing a TAG instruction, the instruction is loaded into instruction register 602. Instruction decode execution logic 60
3 decodes a THASH or TTAG instruction.
If the instruction is a THASH instruction, the instruction decode execution logic 603 uses the register Ry in the register file 606
Fetches the virtual address from the hardware-based index hash function 60
Applies to 4. The function 604 generates a hash index, provides the hash index to the instruction decode execution logic 603, and stores the hash index in the register Rx of the register file 606. Next, the execution is continued by the instruction immediately after the THASH instruction.
【0042】同様に、命令がTTAG命令の場合、命令
デコード実行論理機構603が、レジスタ・ファイル6
06のレジスタRyから仮想アドレスをフェッチし、そ
の仮想アドレスをハードウェア・ベースのタグ・ハッシ
ュ関数605に適用する。関数605は、ハッシュ・タ
グを生成し、ハッシュ・タグを命令デコード実行論理機
構603に提供し、次にハッシュ・タグをレジスタ・フ
ァイル606のレジスタRxに記憶する。次に、TTA
G命令の直後の命令により実行が継続する。ハードウェ
ア・ベースのハッシュ関数は、CPUと同じ集積回路
上、CPUと別の集積回路上、または当技術分野におい
て周知の任意の他の方法で実施できることに注意された
い。Similarly, if the instruction is a TTAG instruction, instruction decode execution logic 603 causes register file 6
Fetch a virtual address from register Ry at 06 and apply the virtual address to hardware-based tag hash function 605. Function 605 generates a hash tag, provides the hash tag to instruction decode execution logic 603, and then stores the hash tag in register Rx of register file 606. Next, TTA
Execution continues with the instruction immediately following the G instruction. Note that the hardware-based hash function can be implemented on the same integrated circuit as the CPU, on a separate integrated circuit from the CPU, or in any other manner known in the art.
【0043】本発明は、ソフトウェアが、コンピュータ
・システムによって使用される実際のハッシュ・アルゴ
リズムを「知らない」場合でも、オペレーティング・シ
ステム・ソフトウェア(またはその他のシステム・ソフ
トウェア)がページ・テーブルにアクセスすることを可
能にする。たとえば、オペレーティング・システムがペ
ージ・テーブルを初期化しているとき、オペレーティン
グ・システムは、次のステップを実行する。The present invention allows the operating system software (or other system software) to access the page tables even if the software does not "know" the actual hash algorithm used by the computer system. Make it possible. For example, when the operating system is initializing the page table, the operating system performs the following steps.
【0044】1.ページ・テーブルに記憶される最初の
仮想対物理ページ・マッピングを生成する。1. Create the first virtual-to-physical page mapping stored in the page table.
【0045】2.ページ・テーブルに記憶されるそれぞ
れの仮想対物理ページ・マッピングに関して、THAS
H命令を実行してページ・テーブル内のエントリを指す
ハッシュ・インデックスを生成し、TTAG命令を実行
してページ・テーブルに記憶されるハッシュ・タグを生
成し、ハッシュ・インデックスによって参照されるペー
ジ・テーブル・エントリにハッシュ・タグと物理ページ
番号を記憶する。2. For each virtual-to-physical page mapping stored in the page table, the THAS
Execute the H instruction to generate a hash index pointing to an entry in the page table, execute the TTAG instruction to generate a hash tag stored in the page table, and execute the page index referenced by the hash index. Store the hash tag and physical page number in the table entry.
【0046】同様に、必要な仮想ページをディスクに記
憶しオペレーティング・システムがページ・フォルトを
処理するとき、オペレーティング・システムは、次のス
テップを実行する。Similarly, when the required virtual pages are stored on disk and the operating system handles page faults, the operating system performs the following steps.
【0047】1.ディスクから仮想ページを取り出す。 2.仮想ページを記憶する物理ページを見つける。 3.THASH命令を実行して、ページ・テーブル内の
エントリを指示するハッシュ・インデックスを生成す
る。 4.TTAG命令を実行して、ページ・テーブルに記憶
されるハッシュ・タグを生成する。 5.ハッシュ・インデックスに参照されるページ・テー
ブル・エントリにハッシュ・タグと物理ページ番号を記
憶する。 6.ディスクから取り出した仮想ページを物理ページに
記憶する。1. Retrieve a virtual page from disk. 2. Find the physical page that stores the virtual page. 3. Execute a THASH instruction to generate a hash index pointing to an entry in the page table. 4. Execute the TTAG instruction to generate a hash tag that is stored in the page table. 5. The hash tag and the physical page number are stored in the page table entry referenced by the hash index. 6. The virtual page extracted from the disk is stored in the physical page.
【0048】上記ステップは簡略化されており、オペレ
ーティング・システムはきわめて複雑であることは明ら
かである。しかしながら、本発明にとって重要な概念
は、従来技術において、オペレーティング・システム
(またはその他のシステム・ソフトウェア)のソフトウ
ェア・ルーチンが、ページ・テーブルにアクセスするた
めにハッシュ・アルゴリズムを含んでいたが、本発明で
は、ハードウェアにより使用されるハッシュ・アルゴリ
ズムは、TTAG命令とTHASH命令を使用するソフ
トウェアに「適用され」、それによりオペレーティング
・システムが実際にハッシュ・アルゴリズムを含む必要
がないことである。It is clear that the above steps have been simplified and that the operating system is quite complex. However, an important concept for the present invention is that in the prior art, software routines of the operating system (or other system software) included a hash algorithm to access the page table. In, the hash algorithm used by the hardware is "applied" to software that uses the TTAG and THASH instructions, so that the operating system does not actually need to include the hash algorithm.
【0049】前述の参照により組み込まれた米国特許第
5,724,538号において、主な目的は、仮想アド
レス・サイズがコンピュータ・システムの基本データ・
パス・サイズを超える場合でも、ハッシュ・タグのハッ
シュ・インデックスを、コンピュータ・システムの基本
データ・パス・サイズに適合させることができる機構を
提供することである。たとえば、32ビットのデータ・
パス・サイズを有するコンピュータは、一般に、4ギガ
バイトの物理アドレス空間を有し、より大きな仮想アド
レス空間を有することが望ましいことがある。In US Pat. No. 5,724,538, incorporated by reference above, the primary purpose is to reduce the virtual address size to the basic data size of the computer system.
The object is to provide a mechanism by which the hash index of a hash tag can be adapted to the basic data path size of a computer system even if the path size is exceeded. For example, 32-bit data
Computers with a path size typically have 4 gigabytes of physical address space, and it may be desirable to have a larger virtual address space.
【0050】64ビットのデータ・パス・サイズを有す
るコンピュータ・システムでは、これは、あまり重要で
はない。しかしながら、ハッシュ関数を使用してインデ
ックスとタグを形成し、THASH命令とTTAG命令
(本発明による)によってオペレーティング・システム
(またはその他のシステム・ソフトウェア)へのアクセ
スを提供することによって、コンピュータ設計者は、ペ
ージ・テーブルのサイズをページ・テーブルを探索する
のに必要な時間とバランスさせることができる高性能の
ツールを有することになる。For computer systems having a data path size of 64 bits, this is less important. However, by using a hash function to form indexes and tags and providing access to the operating system (or other system software) by THASH and TTAG instructions (according to the invention), the computer designer can Will have a sophisticated tool that can balance the size of the page table with the time required to search the page table.
【0051】ページ・テーブルのサイズが比較的大きい
場合、テーブルは、比較的平坦であり、テーブルがより
多くのエントリと少ないチェーン・セグメントを有する
ため、ページ・テーブルを探索するのに必要な時間が短
縮される。しかしながら、ページ・テーブルは、より多
くのメモリを必要とし、比較的まばらである。If the size of the page table is relatively large, the time required to search the page table is relatively flat, since the table has more entries and fewer chain segments. Be shortened. However, page tables require more memory and are relatively sparse.
【0052】これと対照的に、ページ・テーブルが小さ
い場合は、テーブルのエントリが少なくなりチェーン・
セグメントが多くなるため、テーブルが奥深くなり、ペ
ージ・テーブルの探索に必要な時間が長くなる。しかし
ながら、ページ・テーブルは、必要なメモリが少なくな
り、多くのエントリが仮想対物理変換を含むことにな
る。In contrast, if the page table is small, the table has fewer entries and the chain
The more segments, the deeper the table and the longer the time required to search the page table. However, the page table requires less memory and many entries will include a virtual-to-physical translation.
【0053】インデックス・ハッシュ関数は、ページ・
テーブルのサイズと関連付けられ、仮想アドレスはすべ
て、固有のハッシュ・インデックスとハッシュ・タグの
組合せを生成する。したがって、コンピュータ設計者
は、速度とページ・テーブル・サイズの間の所望のトレ
ードオフに基づいてページ・テーブル・サイズとハッシ
ュ・アルゴリズムを変更することができる。実際に、ペ
ージ・テーブル・サイズを変化させて、プログラムの特
定の混合物を実行する特定のコンピュータ・システムの
性能を調整することができる。図5のコンピュータ・シ
ステム501において、様々な機能を置き換えだけで、
ソフトウェア・ベースのインデックス・ハッシュ関数5
08とソフトウェア・ベースのタグ・ハッシュ関数51
0を変更することができる。図6のコンピュータ・シス
テム601において、構成レジスタにより変更するかC
PUのマイクロコードを変更することにより、ハードウ
ェア・ベースのインデックス・ハッシュ関数604とハ
ードウェア・ベースのタグ・ハッシュ関数605を変更
することができる。オペレーティング・システム(また
はその他のシステム・ソフトウェア)が、THASH命
令とTTAG命令によりこれらの機能を利用するため、
ハッシュ関数が変更されるときにオペレーティング・シ
ステム(またはその他のシステム・ソフトウェア)を変
更する必要がない。The index hash function calculates the page hash
Associated with the size of the table, all virtual addresses generate a unique hash index and hash tag combination. Thus, the computer designer can change the page table size and hash algorithm based on the desired trade-off between speed and page table size. In fact, the page table size can be varied to tune the performance of a particular computer system executing a particular mixture of programs. In the computer system 501 of FIG. 5, only by replacing various functions,
Software-based index hash function 5
08 and software based tag hash function 51
0 can be changed. In the computer system 601 shown in FIG.
By changing the microcode of the PU, the hardware-based index hash function 604 and the hardware-based tag hash function 605 can be changed. Because the operating system (or other system software) utilizes these features through THASH and TTAG instructions,
There is no need to change the operating system (or other system software) when the hash function changes.
【0054】コンピュータ業界では、高性能ハードウェ
アに向かう継続的な実際的傾向がある。しかしながら、
種々様々のハードウェア・アーキテクチャ上で実行する
ことができる安価な市販の「シリンクラップ(shirinki
wrapped)」オペレーティング・システムに向かう多少矛
盾した実際的傾向もある。本発明は、マイクロソフト社
から提供されるWindowsNT(商標)オペレーテ
ィング・システムなどの市販の「シリンクラップ」のオ
ペレーティング・システムが、テーブルにアクセスする
ために使用される実際のハッシュ・アルゴリズムを含む
ことなしに、種々様々なタイプのコンピュータ・システ
ムの仮想メモリ・ページ・テーブルにアクセスすること
を可能にする。したがって、本発明は、これらの両方の
実際的傾向が継続できる機構を提供する。There is a continuing practical trend in the computer industry toward high performance hardware. However,
An inexpensive commercial "shirinki wrap (shirinki wrap) that can run on a variety of hardware architectures
There is also a somewhat contradictory practical trend towards "wrapped" operating systems. The present invention does not require that a commercially available "Silink Wrap" operating system, such as the Windows NT (TM) operating system provided by Microsoft, include the actual hash algorithm used to access the table. In addition, it allows access to virtual memory page tables of a variety of different types of computer systems. Thus, the present invention provides a mechanism by which both these practical trends can continue.
【0055】本発明を好ましい実施形態に関して説明し
たが、当業者は、本発明の精神および範囲から逸脱せず
に形態と詳細に変更を行うことができることを理解され
よう。Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention.
【発明の効果】この発明によると、オペレーティング・
システムが、ハードウェアによって使用されるハッシュ
・アルゴリズムにアクセスすることができるので、ハッ
シュ・アルゴリズムをオペレーティング・システムの中
にコード化する必要がない。According to the present invention, the operating system
Since the system has access to the hash algorithm used by the hardware, there is no need to code the hash algorithm into the operating system.
【図1】プログラムの実行中に提示される仮想アドレス
に応答する従来技術の手順を示す図である。FIG. 1 illustrates a prior art procedure for responding to a virtual address presented during execution of a program.
【図2】変換参照バッファ(TLB)内のエントリにア
クセスする従来技術の方法を示す図である。FIG. 2 illustrates a prior art method of accessing an entry in a translation reference buffer (TLB).
【図3】TLBミスの後に物理ページ情報を取り出して
TLBを更新する従来技術の方法を示す図である。FIG. 3 illustrates a prior art method for retrieving physical page information after a TLB miss and updating the TLB.
【図4】ハッシュ・タグがページ・テーブルに記憶され
る従来技術のページ・テーブル方式の図である。FIG. 4 is a diagram of a prior art page table scheme in which hash tags are stored in a page table.
【図5】低性能コンピュータで実施されるような本発明
の実施形態を示す簡略化したブロック図である。FIG. 5 is a simplified block diagram illustrating an embodiment of the present invention as implemented on a low performance computer.
【図6】高性能コンピュータで実施されるような本発明
の実施形態を示す簡略化したブロック図である。FIG. 6 is a simplified block diagram illustrating an embodiment of the present invention as implemented on a high performance computer.
413 ページ・テーブル 413 page table
───────────────────────────────────────────────────── フロントページの続き (72)発明者 スティーブン・ジー・バーガー アメリカ合衆国95050カリフォルニア州サ ンタ・クララ、フォーブズ・アベニュー 2257 (72)発明者 ガリー・エヌ・ハモンド アメリカ合衆国95008カリフォルニア州キ ャンベル、サニーブルック・ドライブ 519 (72)発明者 ジェームズ・オー・ヘイズ アメリカ合衆国95125カリフォルニア州サ ン・ノゼ、キャンベル・アベニュー 1722 (72)発明者 ジョナサン・ケー・ロス アメリカ合衆国94087カリフォルニア州サ ニーベイル、ローン・ウェイ 974 (72)発明者 コーイチ・ヤマダ アメリカ合衆国95134カリフォルニア州サ ン・ノゼ、エラン・ヴィレッジ・レーン 371、ナンバー 116 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Stephen G. Burger United States 95050 Santa Clara, California, Forbes Avenue 2257 (72) Inventor Gary N. Hammond United States 95008 Campbell, California, Sunnybrook Drive 519 (72) Inventor James O. Hayes USA 95125 Campbell Avenue, San Jose, California 1722 (72) Inventor Jonathan Keros Inventor 94087 Sunnyvale, California USA Lawn Way 974 (72) Inventor Koichi Yamada United States 95134 San Jose, California, Elan Village Lane 371, Number 116
Claims (1)
ェア・ベースの方法であって、 仮想メモリ・ページ・アドレス対物理メモリ・ページ・
アドレス変換を生成するステップと、 仮想メモリ・ページ・アドレスをページ・テーブルのエ
ントリを参照するインデックスに変換する第1のハード
ウェア構成の命令を実行するステップと、 仮想メモリ・ページ・アドレスをタグに変換する第2の
ハードウェア構成の命令を実行するステップと、 仮想メモリ・ページ・アドレス対物理メモリ・ページ・
アドレス変換とタグを、インデックスによって参照され
るページ・テーブルのエントリに記憶するステップと、 を含む方法。1. A software-based method of accessing a page table, comprising: a virtual memory page address versus a physical memory page page.
Generating an address translation; executing a first hardware configuration instruction to translate the virtual memory page address into an index that references an entry in the page table; Executing instructions of the second hardware configuration to be translated; and virtual memory page address versus physical memory page page.
Storing the address translation and the tag in an entry of the page table referenced by the index.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US17014398A | 1998-10-12 | 1998-10-12 | |
| US170143 | 1998-10-12 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2000122928A true JP2000122928A (en) | 2000-04-28 |
Family
ID=22618723
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP11286661A Pending JP2000122928A (en) | 1998-10-12 | 1999-10-07 | Access method for page table |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2000122928A (en) |
-
1999
- 1999-10-07 JP JP11286661A patent/JP2000122928A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP1653365B1 (en) | Invalidating storage, clearing buffer entries | |
| JP4268332B2 (en) | Method and apparatus for calculating page table index from virtual address | |
| JP2618175B2 (en) | History table of virtual address translation prediction for cache access | |
| JP3640978B2 (en) | Memory address control device using hash address tag in page table | |
| US8296547B2 (en) | Loading entries into a TLB in hardware via indirect TLB entries | |
| US5652872A (en) | Translator having segment bounds encoding for storage in a TLB | |
| CN1993683B (en) | Maintain Processor Resources During Architectural Events | |
| US9804970B2 (en) | Invalidating a range of two or more translation table entries and instruction therefor | |
| US5918251A (en) | Method and apparatus for preloading different default address translation attributes | |
| US8041876B1 (en) | Method and system for providing hardware support for memory protection and virtual memory address translation for a virtual machine | |
| US7472253B1 (en) | System and method for managing table lookaside buffer performance | |
| WO2014058817A1 (en) | Asymmetric co-existent address translation structure formats | |
| JPH11265286A (en) | Emulation device for legacy command and method therefor | |
| US7549035B1 (en) | System and method for reference and modification tracking | |
| JP2000122928A (en) | Access method for page table | |
| US7546439B1 (en) | System and method for managing copy-on-write faults and change-protection |