JP2004252525A - Emulator and program - Google Patents

Emulator and program Download PDF

Info

Publication number
JP2004252525A
JP2004252525A JP2003039176A JP2003039176A JP2004252525A JP 2004252525 A JP2004252525 A JP 2004252525A JP 2003039176 A JP2003039176 A JP 2003039176A JP 2003039176 A JP2003039176 A JP 2003039176A JP 2004252525 A JP2004252525 A JP 2004252525A
Authority
JP
Japan
Prior art keywords
target machine
machine
main memory
data
target
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.)
Granted
Application number
JP2003039176A
Other languages
Japanese (ja)
Other versions
JP4155052B2 (en
Inventor
Takahiro Tanioka
隆浩 谷岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2003039176A priority Critical patent/JP4155052B2/en
Publication of JP2004252525A publication Critical patent/JP2004252525A/en
Application granted granted Critical
Publication of JP4155052B2 publication Critical patent/JP4155052B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To continue execution of emulation processing without leading to a system down or reboot, in the event of a failure involving an unrestorable data breakage on a platform machine during execution of an emulation, by performing restoration of data on an emulate side. <P>SOLUTION: A target address space 62 used for the main storage of a target machine and a target address space (copy) 62 that is a copy thereof are mapped on the main storage 50 of the platform machine. When a store command of the target machine is emulated, the same data are stored in both the address spaces 62 and 63. In the occurrence of a correction-impossible failure in the target address space 62, the data are written back from the address space 63 that is the copy area to the address space 62 to restore the data, and the execution of emulation processing is continued. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明はエミュレータに関し、特にターゲットマシンと異なるアーキテクチャのプラットフォームマシン上で動作し、ターゲットマシンのプログラムをエミュレートするエミュレータに関する。
【0002】
【従来の技術】
ターゲットマシンのプログラムをエミュレートするエミュレータには、特許文献1に記載されるようにハードウェアで実現するものと、ソフトウェアで実現するものとが存在するが、本発明は後者のソフトウェアで実現されるエミュレータに関する。この種のエミュレータの実装環境を図5に示す。エミュレータ14は、プラットフォームマシンのプロセッサで実行されるソフトウェアであり、このエミュレータ14によりターゲットマシンのオペレーティングシステム(ターゲットOS)13が実行され、このターゲットOS13上でさらにターゲットマシンのミドルウェア12やアプリケーションプログラム11が稼働する。ここで、ターゲットOS13、ミドルウェア12およびアプリケーションプログラム11は、プラットフォームマシンの主記憶上の一部に確保したターゲットマシンの主記憶領域に置かれる。
【0003】
プラットフォームマシンのプロセッサは、プラットフォーム(ハードウェア)18およびプロセッサ(ハードウェア)17から構成されるハードウェアと、プロセッサファームウェア16およびプラットフォームファームウェア15から構成されるファームウェアとを含む。プラットフォーム(ハードウェア)18は、メモリ、メモリコントローラ等のチップセット、PCIバスなどを含んで構成され、プロセッサ(ハードウェア)17は、プラットフォーム(ハードウェア)18に接続されるプロセッサLSIに相当する。プロセッサファームウェア16は、プロセッサLSIに内蔵されるプロセッサ(ハードウェア)17固有のファームウェア、プラットフォームファームウェア15は、メモリの初期化などプラットフォーム(ハードウェア)18全体の制御を行うファームウェアである。なお、プロセッサ(ハードウェア)17としては任意のプロセッサLSIを使用することができるが、例えば一例を挙げれば、インテル社のIPF(Itanium(登録商標)Processor Family)を使用することができる。
【0004】
図6は、エミュレータ14がターゲットマシンの命令語をエミュレートする際の動作説明図である。図の上部から下に向かって順に参照して、まずターゲットマシンの命令語の取り出しを、命令カウンタ21に格納されたアドレスから開始する。命令カウンタ21は、プラットフォームのプロセッサのレジスタにマッピングされる。
【0005】
ターゲットマシンのメモリ空間(論理アドレス)は、プラットフォームマシン上で独立したアドレス空間にマッピングされており、メモリ空間(絶対アドレス)は、プラットフォームマシンのメモリ空間(絶対アドレス)の一部分にマッピングされている。命令カウンタ21で示されるターゲットマシンの命令語アドレス(論理アドレス)は、TLB22でプラットフォーム上の絶対アドレスへ変換された後、オペランドキャッシュ(O−Cache)23から命令語の取り出しに使われるが、ターゲットマシンの絶対アドレスは、プラットフォーム上にマッピングされたメモリ空間の先頭アドレスからのオフセットとなる。
【0006】
このようにして取り出された命令語24は、一例としてストア命令を挙げると図示したように先頭から命令コード(OP)、汎用レジスタ番号(GR)、ベースレジスタ番号(BR)、インデックスレジスタ番号(XR)、オフセットアドレス(D)が格納されている。取り出されたベースレジスタ番号(BR)とインデックスレジスタ番号(XR)から、レジスタの値を格納したテーブル25、26をそれぞれ参照し、演算器27においてテーブル25、26から取り出された値とオフセットアドレス(D)との加算を行って、実効論理アドレスを得る。
【0007】
続いて、得られた実効論理アドレスからTLB22を参照してプラットフォーム上にマッピングされた絶対アドレスを求め、汎用レジスタ番号(GR)からレジスタの値を格納したテーブル28を参照して得られたストアデータを、オペランドキャッシュ23へ書き込む。
【0008】
なお、ここで説明したTLB22とオペランドキャッシュ23は、命令実行中に命令取り出し時とストア時の2回使用されるため、図中には処理の流れに従って各々2個記載している。
【0009】
図7は上記で一例として説明したストア命令のエミュレート時の処理フローの例である。ここでは、エミュレータのコードをターゲットマシンの命令語毎のモジュールに分割して実装する場合を想定している。つまり、ターゲットマシンの例えばストア命令に対応して、ストア命令をエミュレートするために必要なエミュレータの一連のコードが一つのモジュールとして予め用意されており、図7はそのモジュールによる処理例を示している。また、命令語の取り出しは前半の命令コード(つまりOPコード)の取り出し(ステップ39)と後半の残り部分の取り出し(ステップ31)に分けて実行するが、処理速度を上げるために、モジュールの最後で次の命令の前半の命令コードを取り出すようにしている。従って、図7の処理フローでは、命令語の後半部分の取り出しから処理が始まっている。
【0010】
図7を参照すると、まず、命令語の後半を取り出し(ステップ31)、その命令語からベースレジスタ番号(BR)、インデックスレジスタ番号(XR)を取り出し、それぞれBR・XRの値が格納されたテーブル25、26を参照して値を取り出し(ステップ32)、オフセット値(D)を加算して論理アドレスを求める(ステップ33)。
【0011】
この後、論理アドレス生成時の例外チェックを行う(ステップ34)。ここで検出される例外は、ターゲットマシンのアーキテクチャによって相違するが、例えばアドレス加算時の回り込みなどである。例外が検出された場合は、例外処理を行う例外ハンドラへ移入して例外動作に入る(ステップ40)。
【0012】
一方で例外が検出されなければ、続いて論理アドレスから絶対アドレスへの変換を行う(ステップ35)。プロセッサハードウェアでは、この処理はTLBを用いて行われる部分だが、エミュレーションでは通常この変換もソフトウェアで行うことになる。
【0013】
続くステップでは、アドレス変換時の例外チェックを行う(ステップ36)。ハードウェアのTLBではアドレス変換と同時にリングによるメモリ保護のチェックや、ページの読み出し、書き込み保護のチェックを行うが、これに相当するチェックである。例外が検出された場合は、例外ハンドラへ処理が移り(ステップ40)、例外が検出されなければ続くステップ37へ進む。
【0014】
次のステップ37では、汎用レジスタ番号(GR)によるテーブル28の参照によりGRの値を取得し、この値をストアデータとして先に変換した絶対アドレスの番地へストアする。
【0015】
ストアが終わると、次の命令の実行に移るため、命令カウンタを更新し(ステップ38)、次命令の命令コード部分の取り出しを行う(ステップ39)。次命令を実行するためのエミュレーションコード(モジュール)への分岐は、ここで取り出した命令コードの値によって分岐先が決定される。
【0016】
【特許文献1】
特開2001−34498号公報
【0017】
【発明が解決しようとする課題】
次にプラットフォームのハードウェアに障害が発生した際の従来における動作を図5を参照して説明する。
【0018】
プラットフォームハードウェア18で例えば、主記憶上や主記憶とプロセッサとをつなぐバス上でECC等のハードウェアによる自動訂正が不可能な障害を検出した場合、プラットフォームハードウェア18は、プロセッサハードウェア17に割り込み等の手段を用いて障害の通知を行う。通知を受けたプロセッサは、実行中のプログラムを一時中断し、プロセッサファームウェア16の実行を開始する。また、プロセッサハードウェア17の内部で障害を検出した場合でも同様に当該プロセッサはプロセッサファームウェア16に割り込む。
【0019】
プロセッサファームウェア16は、検出された障害がプロセッサ内で訂正可能であれば訂正を試みる。訂正が可能なケースとしては、例えばプロセッサに内蔵されたストアスルーキャッシュの障害などが該当し、このケースでは障害を検出したデータブロックをキャッシュ上から破棄し、主記憶からデータを再取得する。訂正が成功すればプロセッサファームウェア16の処理は終了し、中断していたプログラムの実行が再開される。
【0020】
プロセッサファームウェア16で訂正ができなかった場合または障害がプロセッサの外のプラットフォームハードウェア18で検出されたものであれば、さらにプラットフォームファームウェア15へ処理が渡される。プラットフォームファームウェア15では、検出された障害が訂正可能であれば訂正を試みる。ファームウェアによる訂正が成功すればプラットフォームファームウェア15の処理は終了し、一旦プロセッサファームウェア16へ制御を経由した後、中断していたプログラムの実行が再開される。
【0021】
ここで、プラットフォームファームウェア15で訂正が出来ない障害の場合はさらにプラットフォームファームウェア15からエミュレータ14(一般にはオペレーティングシステム)へ制御を移し、障害からの復旧を試みる。しかしながら、このようなケースは例えば主記憶の読み出し時に主記憶上でECC(エラー訂正コード)での自動訂正が不可能な障害が発生してデータが破壊された場合や、バスを通じてプロセッサから主記憶へデータを書き込んだり、読み出したりした際にバス上でECCでの自動訂正が不可能な障害が発生してデータが破壊された場合などが該当するため、このようなケースを救済するには当該のメモリ領域を使用しているプロセスを特定した上で破壊されたデータ領域を破棄できるかどうかを判断する、あるいはプロセスの再実行によりデータが復旧できるかを判断する等の複雑な処理が必要となる。このようなリカバリを行うことは、エミュレータには一般に非常に困難であり、特にエミュレータの場合はその上で稼働するオペレーティングシステムのプロセスの状態を把握することが出来ないため、バスやメモリの訂正不能障害が発生した場合は復旧が不可能である。このため、必ずシステムダウンに至ってしまい、可用性の点で問題があった。
【0022】
また、高いデータインテグリティを要求されるミッションクリティカル領域のコンピュータシステムにおいては、メモリやI/Oデバイスからプロセッサまでのデータ転送路の中で障害が検出されない箇所が存在してはならないが、エミュレータがサポートするプラットフォームの各々の機種についてこれを検証することは現実的に不可能であるという問題もある。
【0023】
本発明の第1の目的は、ターゲットマシンと異なるアーキテクチャのプラットフォームマシン上でターゲットマシンのプログラムをエミュレートするエミュレータにおいて、エミュレーション実行中にプラットフォームマシン上で復旧不能なデータ破壊を伴う障害が発生した場合に、エミュレート側でデータの復旧を行い、システムダウンやリブートに至らずにエミュレーション処理の実行を継続することができるようにすることにある。
【0024】
本発明の第2の目的は、ターゲットマシンと異なるアーキテクチャのプラットフォームマシン上でターゲットマシンのプログラムをエミュレートするエミュレータにおいて、プラットフォームハードウェアの障害検出回路で検出できない障害をエミュレート側で検出して不正なエミュレーション処理が継続されることを防止することにある。
【0025】
【課題を解決するための手段】
本発明のエミュレータは、ターゲットマシンと異なるアーキテクチャのプラットフォームマシン上で動作し、前記プラットフォームマシンの主記憶の一部に確保された前記ターゲットマシンの主記憶に記憶された前記ターゲットマシンのプログラムをエミュレートするエミュレータであり、前記プラットフォームマシンの主記憶の他の部分に前記ターゲットマシンの主記憶のコピーである主記憶コピー領域を備え、前記ターゲットマシンのストア命令をエミュレートする際に前記ターゲットマシンの主記憶と前記主記憶コピー領域の両方に対して同じデータをストアすることを基本とする。
【0026】
そして、第1の発明にかかるエミュレータにあっては、前記ターゲットマシンのロード命令をエミュレートする際には前記ターゲットマシンの主記憶と前記主記憶コピー領域のうち前記ターゲットマシンの主記憶からのみデータをロードし、前記ターゲットマシンのプログラムをエミュレートしている際、前記ターゲットマシンの主記憶のリード及びライト時に前記プラットフォームマシンでデータの訂正不能障害が検出された場合、前記主記憶コピー領域の対応するデータを、前記ターゲットマシンの主記憶における前記訂正不能障害が検出されたデータにかかるメモリアドレスに書き戻した後、前記訂正不能障害が検出された時点の命令から実行を再開することを特徴とする。
【0027】
また、第2の発明にかかるエミュレータにあっては、前記ターゲットマシンのロード命令をエミュレートする際には前記ターゲットマシンの主記憶と前記主記憶コピー領域の両方からデータをロードして両者を比較し、不一致を検出した場合にソフトウェアの処理を中断することを特徴とする。
【0028】
【作用】
プラットフォームマシンの主記憶にターゲットマシンの主記憶とそのコピーである主記憶コピー領域を設け、ターゲットマシンのストア命令をエミュレートする際にターゲットマシンの主記憶と主記憶コピー領域の両方に対して同じデータをストアすることにより、訂正不能障害が発生した際にコピー領域からデータを書き戻すことができる。このため、エミュレート側でデータの復旧を行い、エミュレーション処理の実行を継続することができる。
【0029】
また、ターゲットマシンのロード命令をエミュレートする際にターゲットマシンの主記憶と主記憶コピー領域の両方からデータをロードして両者を比較することにより、プラットフォームハードウェアの障害検出回路で検出できないような障害によるリードデータの破壊を検出することができる。このため、プラットフォームハードウェアの障害検出回路で検出できない障害を看過して、不正なエミュレーション処理が継続されるのが防止される。
【0030】
【発明の第1の実施の形態】
次に本発明の第1の実施の形態にかかるエミュレータについて図面を参照して詳細に説明する。
【0031】
本実施の形態にかかるエミュレータは、図5に示したエミュレータ14と同じく、プラットフォームマシンのプロセッサで実行されるソフトウェアであり、プラットフォームマシンの主記憶上の一部に確保したターゲットマシンの主記憶領域に記憶されたターゲットマシンのオペレーティングシステムおよびミドルウェアやアプリケーションプログラムをエミュレートする。但し、従来のエミュレータと異なり、プラットフォームマシンの主記憶上にターゲットマシンの主記憶領域とは別にそのターゲットマシンの主記憶のコピーを記録する記憶領域を置き、ターゲットマシンのストア命令をエミュレートする際に主記憶領域と主記憶のコピー領域の両方に対し同じデータをストアし、ロード命令をエミュレートする際には主記憶領域のみからデータをロードする。
【0032】
図1にプラットフォームマシンの主記憶上にターゲットマシン用の2つの領域を設定する例と本実施の形態にかかるエミュレータのストア命令のエミュレート時の処理フローを示す。
【0033】
ターゲットマシンの絶対アドレス空間は、プラットフォームマシンの主記憶50上の一部分にターゲットアドレス空間62としてマッピングされ、この領域62にターゲットマシンのオペレーティングシステムやアプリケーションプログラムを構成する命令コードやデータが格納される。また、この領域62とは別に、この領域62のコピーを格納する領域がターゲットアドレス空間(コピー)63としてマッピングされている。ここで、ターゲットアドレス空間(コピー)63の先頭アドレスは、ターゲットアドレス空間62の先頭アドレス+オフセットdの位置に設定されている。
【0034】
続いて本実施の形態の動作について説明する。以下では、基本的な命令としてストア命令とロード命令のみ説明するが、他の複雑な命令、例えばメモリアクセスを伴う演算命令やメモリ間のコピー命令なども同様に実現可能である。
【0035】
まず図1を参照して、ターゲットマシンのストア命令をエミュレートする際の動作を説明する。
【0036】
ストア命令の実行が開始されると、先に図7で説明した従来の技術と同様に、命令語の取り出しからオペランド書き込みまでが実行される(ステップ51〜57)。この間で例外が検出された場合に例外ハンドラへ移入して例外処理が行われる点も同様である(ステップ61)。
【0037】
ここで続くステップ58において、ステップ57でストアを実行したアドレスに対してオフセット値dを加算し、ターゲットアドレス空間(コピー)63内のストアアドレスを求め、ステップ57でストアしたものと同じデータをターゲットアドレス空間(コピー)に対してストアすることにより、ターゲットアドレス空間62と同じ状態をターゲットアドレス空間(コピー)63側にも生成する。
【0038】
この後、続く命令カウンタの更新、次命令語の取り出し(ステップ59〜60)に関しては従来技術と同様である。
【0039】
ここで、プラットフォームマシンのプロセッサとして、例えば前述したインテル社のIPFのように複数の命令を同時に実行可能なプロセッサを使用する場合、図1におけるターゲットアドレス空間62へのデータの書き込み(ステップ57)と、ターゲットアドレス空間63へのデータの書き込み(ステップ58)とを同時に実行することにより、2度の書き込みよる処理速度の低下を防止することができる。
【0040】
次に図2を参照して、ターゲットマシンのロード命令をエミュレートする際の動作について説明する。本実施の形態においては、ロード命令のエミュレート動作は従来技術によるロード命令のエミュレートと変わりがなく、以下のように進められる。
【0041】
ロード命令の実行が開始されると、やはりストア命令の場合と同様に命令語の取り出しからメモリアクセス時の例外チェックまでのステップが実行される(ステップ71〜76)。この間で例外が検出された場合に例外ハンドラへ移入して例外処理が行われる点も同様である(ステップ61)。
【0042】
ここで続くステップ77では、ステップ75で得たターゲットアドレス空間62中の絶対アドレスからデータをロードし、汎用レジスタGRへ格納する。
【0043】
続く命令カウンタの更新、次命令の取り出し操作(ステップ78、79)はストア命令の場合と同様である。
【0044】
続いて、エミュレーション実行中にプラットフォームハードウェアで障害が発生した場合の動作について、図3を参照しながら説明する。
【0045】
まず、プラットフォームのハードウェアで障害が検出された場合(ステップ81)を考えると、障害はECCなどのハードウェアによる自動訂正が可能な場合と、訂正不可能な場合に分類される(ステップ82)。ハードウェアによる訂正が可能な障害であれば、障害が発生したデータは自動訂正されてソフトウェアの処理はそのまま継続される(ステップ83)。
【0046】
一方で自動訂正が不可能な障害であった場合、ハードウェアは割り込み等の手段を用いてプロセッサへ障害を通知し、プロセッサは実行中のソフトウェアからプロセッサファームウェアを起動する。プロセッサファームウェアはプロセッサ内に閉じた操作で障害が復旧可能であるかどうかを判定し、復旧可能であれば復旧処理を行い(ステップ86)、その後ハードウェアに対してソフトウェア処理への復帰指示を与えて(ステップ89)、障害が発生した命令からの実行を再開する(ステップ85)。
【0047】
ステップ86にてプロセッサ内に閉じた復旧ができない障害だった場合は、障害処理はプラットフォームファームウェアに渡され、プラットフォームによる障害復旧が可能か否かを判断した後、復旧が可能であれば復旧処理を行い(ステップ87)、その後同様にハードウェアに対してソフトウェア処理への復帰指示を与えて(ステップ89)、障害が発生した命令からの実行を再開する(ステップ85)。
【0048】
ステップ87にてプラットフォームでの障害の復旧ができない障害だった場合は、ファームウェアからエミュレータへ制御が移り、障害処理がエミュレータに委ねられる。このような障害のケースとしては、例えばメモリ読み出し時の多ビットエラーによる訂正不能障害や、バスエラーによる訂正不能障害などが挙げられる。
【0049】
ステップ90にて、障害からの復旧を委ねられたエミュレータは、まず障害が復旧可能な種類の障害かどうかを判定する。もしエミュレータでも復旧ができない種類の致命的な障害だった場合は、エミュレータはファームウェアに制御を戻し、ファームウェア制御によりシステムリブートに移行する(ステップ88、84)。
【0050】
エミュレータで復旧可能な障害だった場合は、続くステップ91へ進み、エミュレータは、ターゲットアドレス空間(コピー)63から障害アドレスのデータのコピーを取り出して、ターゲットアドレス空間62における障害アドレスへデータを書き戻す。そして、ファームウェアへ障害処理からの復旧指示を出してエミュレータは障害処理を終了する(ステップ92)。続くステップは上記のファームウェアによる訂正が成功した場合と同様に、ハードウェアに対してソフトウェア処理への復帰指示を与えて障害が発生した命令からの実行を再開する(ステップ89、85)。
【0051】
発生した訂正不能障害が、ターゲットアドレス空間62のリード時に主記憶50上で検出されたものである場合、障害の原因が間欠故障によるものであれば、ターゲットアドレス空間(コピー)63の正常なデータをターゲットアドレス空間62における障害発生メモリアドレス部分に書き戻すことで復旧でき、障害が発生した命令からソフトウェア処理を再開することで、エミュレート処理を正常に継続することができる。また、発生した訂正不能障害が、ターゲットアドレス空間62のリード時に主記憶50とプロセッサとをつなぐバス上で検出されたものである場合、ターゲットアドレス空間62上のデータは正常である可能性はあるが、リードした誤ったデータがプロセッサのキャッシュに蓄積されてしまっている可能性があるため、ターゲットアドレス空間(コピー)63の正常なデータをターゲットアドレス空間62における障害発生メモリアドレス部分に書き戻し、障害が発生した命令からソフトウェア処理を再開することで、再度リード動作を行わせることができ、間欠障害であれば、エミュレート処理を正常に継続することができる。さらに、発生した訂正不能障害が、ターゲットアドレス空間62のライト時に主記憶50とプロセッサとをつなぐバス上で検出されたものである場合、ターゲットアドレス空間62のデータが破壊されている可能性があるため、ターゲットアドレス空間(コピー)63の正常なデータをターゲットアドレス空間62における障害発生メモリアドレス部分に書き戻すことで復旧でき、障害が発生した命令からソフトウェア処理を再開することで、間欠障害であればエミュレート処理を正常に継続することができる。
【0052】
以上説明したように、本実施の形態によれば、メモリ読み出し時の多ビットエラーによる訂正不能障害や、バスエラーによる訂正不能障害のような復旧不能なデータ破壊を伴う障害が発生した場合に、データの復旧を行い、システムダウンやリブートに至らずソフトウェアの実行、つまりターゲットマシンのプログラムのエミュレーションを継続することができる。
【0053】
【発明の第2の実施の形態】
次に本発明の第2の実施の形態にかかるエミュレータについて図面を参照して詳細に説明する。
【0054】
本実施の形態にかかるエミュレータは、図5に示したエミュレータ14と同じく、プラットフォームマシンのプロセッサで実行されるソフトウェアであり、プラットフォームマシンの主記憶上の一部に確保したターゲットマシンの主記憶領域に記憶されたターゲットマシンのオペレーティングシステムおよびミドルウェアやアプリケーションプログラムをエミュレートする。但し、従来のエミュレータと異なり、プラットフォームマシンの主記憶上にターゲットマシンの主記憶領域とは別にそのターゲットマシンの主記憶のコピーを記録する記憶領域を置き、ターゲットマシンのストア命令をエミュレートする際に主記憶領域と主記憶のコピー領域の両方に対し同じデータをストアし、ロード命令をエミュレートする際には主記憶領域とコピー領域の両方からデータをロードした後、双方のデータを比較することによって、プラットフォームマシンのハードウェアの障害検出回路で検出されなかったデータ破壊を検出する。
【0055】
図4にプラットフォームマシンの主記憶上にターゲットマシン用の2つの領域を設定する例と本実施の形態にかかるエミュレータのロード命令のエミュレート時の処理フローを示す。
【0056】
ターゲットマシンの絶対アドレス空間は、プラットフォームマシンの主記憶50上の一部分にターゲットアドレス空間62としてマッピングされ、この領域62にターゲットマシンのオペレーティングシステムやアプリケーションプログラムを構成する命令コードやデータが格納される。また、この領域62とは別に、この領域62のコピーを格納する領域がターゲットアドレス空間(コピー)63としてマッピングされている。ここで、ターゲットアドレス空間(コピー)63の先頭アドレスは、ターゲットアドレス空間62の先頭アドレス+オフセットdの位置に設定されている。
【0057】
続いて本実施の形態の動作について説明する。以下では、基本的な命令としてストア命令とロード命令のみ説明するが、他の複雑な命令、例えばメモリアクセスを伴う演算命令やメモリ間のコピー命令なども同様に実現可能である。
【0058】
本実施の形態において、ターゲットマシンのストア命令をエミュレートする動作は、第1の実施の形態と同様に図1に示した処理フローに沿って行われる。すなわち、ターゲットアドレス空間62とターゲットアドレス空間(コピー)63の両方に対して同じデータがストアされる。
【0059】
次に図4を参照して本実施の形態にかかるエミュレータがターゲットマシンのロード命令をエミュレートする手順について説明する。
【0060】
ロード命令の実行が開始されると、図2で説明した第1の実施の形態におけるロード命令の実行手順と同様に命令語の取り出しからオペランド読み出しまでのステップが実行される(ステップ101〜107)。この間で例外が検出された場合に例外ハンドラへ移入して例外処理が行われる点も同様である(ステップ120)。
【0061】
続くステップ108において、エミュレータはステップ107で読み出したオペランドのアドレスに対してオフセット値dを加算し、ターゲットアドレス空間(コピー)63内のロードアドレスを求め、ステップ107でロードしたものと同じデータであるはずのデータをロードし、ワークレジスタに格納する(ステップ108)。
【0062】
さらにステップ107でロードしたデータとステップ108でロードしたデータの比較を行い(ステップ109)、もし不一致が検出された場合は、以降のエミュレーションにかかるソフトウェアの実行を中断する。不一致を検出したケースでは、いずれかのリードデータが破壊されていることが想定されるが、二値の比較チェックではどちらが不正であるか判定できないため、ここではログ採取を行った後、リブート処理を開始する(ステップ121)。ログ採取では、ソフトウェア的に採取可能な情報、例えばレジスタの内容や命令カウンタの内容などが採取される。
【0063】
比較チェックの結果、不一致が検出されなかった場合は続くステップに進むが、ここからの手順は図2等で説明したものと同様である(ステップ110、111)。
【0064】
このように本実施の形態によれば、プラットフォームハードウェアの障害検出回路で検出できない障害があった場合に、リードデータが破壊されたことを検出し、不正なエミュレーション処理が継続されることを止めることができ、データインテグリティを保証したエミュレートが可能となる。
【0065】
【発明の効果】
以上説明したように、本発明によれば、以下のような効果が得られる。
【0066】
第1の発明によれば、メモリ読み出し時の多ビットエラーによる訂正不能障害や、バスエラーによる訂正不能障害のような復旧不能なデータ破壊を伴う障害がプラットフォームハードウェアで発生した場合に、エミュレータ側でデータの復旧を行い、システムダウンやリブートに至らずにターゲットマシンのエミュレーションの実行を継続することができる。その理由は、エミュレータによりターゲットマシンのメモリ空間のコピーを生成することにより、訂正不能障害が発生した際にコピー領域からデータを書き戻すことができるからである。
【0067】
第2の発明によれば、プラットフォームハードウェアの障害検出回路で検出できないような障害によってリードデータが破壊された場合、そのことを検出し、不正なエミュレーション処理が継続されるのを防止することができる。その理由は、エミュレータによりターゲットマシンのメモリ空間のコピー(コピー空間)を生成し、ターゲットマシンのメモリリードをエミュレートする際にターゲットマシンのメモリ空間とコピー空間の両方からデータをリードして値の比較チェックを行い、万一不一致を検出した場合にソフトウェアの実行を中断するからである。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態におけるプラットフォームマシンの主記憶上にターゲットマシン用の2つの領域を設定する例とエミュレータのストア命令のエミュレート時の処理フローを示す図である。
【図2】本発明の第1の実施の形態におけるエミュレータのロード命令のエミュレート時の処理フローを示す図である。
【図3】本発明の第1の実施の形態におけるエミュレーション実行中にプラットフォームハードウェアで障害が発生した場合の動作説明図である。
【図4】本発明の第2の実施の形態におけるプラットフォームマシンの主記憶上にターゲットマシン用の2つの領域を設定する例とエミュレータのロード命令のエミュレート時の処理フローを示す図である。
【図5】エミュレータの実装環境を示すブロック図である。
【図6】エミュレータがターゲットマシンの命令語をエミュレートする際の動作説明図である。
【図7】従来のエミュレータにおけるストア命令のエミュレート時の処理フローを示す図である。
【符号の説明】
11…アプリケーションプログラム
12…ミドルウェア
13…ターゲットOS
14…エミュレータ
15…プラットフォームファームウェア
16…プロセッサファームウェア
17…プロセッサ(ハードウェア)
18…プラットフォーム(ハードウェア)
50…プラットフォームマシンの主記憶
62…ターゲットマシンの主記憶としての割り当てられたターゲットアドレス空間
63…ターゲットアドレス空間62のコピー領域となるターゲットアドレス空間(コピー)
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an emulator, and more particularly, to an emulator that operates on a platform machine having a different architecture from a target machine and emulates a program of the target machine.
[0002]
[Prior art]
As described in Patent Document 1, there are emulators for emulating a program of a target machine, one emulated by hardware, and the other emulated by software. The present invention is realized by the latter software. About emulators. FIG. 5 shows a mounting environment of this type of emulator. The emulator 14 is software executed by a processor of the platform machine. The emulator 14 executes an operating system (target OS) 13 of the target machine. On the target OS 13, the middleware 12 and the application program 11 of the target machine are further executed. Work. Here, the target OS 13, the middleware 12, and the application program 11 are placed in the main storage area of the target machine secured in a part of the main storage of the platform machine.
[0003]
The processor of the platform machine includes hardware including a platform (hardware) 18 and a processor (hardware) 17, and firmware including a processor firmware 16 and a platform firmware 15. The platform (hardware) 18 includes a memory, a chip set such as a memory controller, a PCI bus, and the like. The processor (hardware) 17 corresponds to a processor LSI connected to the platform (hardware) 18. The processor firmware 16 is firmware specific to the processor (hardware) 17 built in the processor LSI, and the platform firmware 15 is firmware for controlling the entire platform (hardware) 18 such as memory initialization. Note that any processor LSI can be used as the processor (hardware) 17. For example, an IPF (Itanium (registered trademark) Processor Family) of Intel Corporation can be used, for example.
[0004]
FIG. 6 is an operation explanatory diagram when the emulator 14 emulates a command word of the target machine. Referring to the order from the top to the bottom of the figure, first, the extraction of the instruction word of the target machine is started from the address stored in the instruction counter 21. The instruction counter 21 is mapped to a register of the processor of the platform.
[0005]
The memory space (logical address) of the target machine is mapped to an independent address space on the platform machine, and the memory space (absolute address) is mapped to a part of the memory space (absolute address) of the platform machine. The instruction word address (logical address) of the target machine indicated by the instruction counter 21 is converted into an absolute address on the platform by the TLB 22, and then used to fetch the instruction word from the operand cache (O-Cache) 23. The absolute address of the machine is an offset from the start address of the memory space mapped on the platform.
[0006]
The instruction word 24 fetched in this manner is, as an example, an instruction code (OP), a general-purpose register number (GR), a base register number (BR), and an index register number (XR) as shown in the drawing, as an example. ) And an offset address (D). Based on the extracted base register number (BR) and index register number (XR), the tables 25 and 26 storing the register values are respectively referred to, and the value extracted from the tables 25 and 26 and the offset address ( D) to obtain an effective logical address.
[0007]
Subsequently, the absolute address mapped on the platform is obtained by referring to the TLB 22 from the obtained effective logical address, and the store data obtained by referring to the table 28 storing the register value from the general-purpose register number (GR) Is written to the operand cache 23.
[0008]
Note that the TLB 22 and the operand cache 23 described here are used twice during the execution of the instruction, that is, when the instruction is fetched and when the store is performed. Therefore, two TLBs and two operand caches are shown in the figure according to the processing flow.
[0009]
FIG. 7 is an example of a processing flow at the time of emulating the store instruction described above as an example. Here, it is assumed that the code of the emulator is divided into modules for each instruction word of the target machine and implemented. That is, a series of emulator codes required to emulate a store instruction are prepared in advance as one module corresponding to, for example, a store instruction of the target machine. FIG. 7 shows an example of processing by the module. I have. The instruction word is fetched separately from the first half of the instruction code (that is, the OP code) (step 39) and the second half of the remaining part (step 31). Fetches the instruction code of the first half of the next instruction. Therefore, in the processing flow of FIG. 7, the processing is started from the extraction of the latter half of the instruction word.
[0010]
Referring to FIG. 7, first, the latter half of the instruction word is extracted (step 31), the base register number (BR) and the index register number (XR) are extracted from the instruction word, and a table in which the values of BR and XR are stored respectively. A value is extracted with reference to 25 and 26 (step 32), and an offset value (D) is added to obtain a logical address (step 33).
[0011]
Thereafter, an exception check is performed at the time of generating a logical address (step 34). The exception detected here differs depending on the architecture of the target machine, but is, for example, a wraparound at the time of address addition. If an exception is detected, the exception is transferred to an exception handler that performs exception processing and an exception operation starts (step 40).
[0012]
On the other hand, if no exception is detected, the conversion from the logical address to the absolute address is subsequently performed (step 35). In processor hardware, this processing is performed using TLB, but in emulation, this conversion is usually performed by software.
[0013]
In the subsequent step, an exception check at the time of address conversion is performed (step 36). In the TLB of the hardware, a memory protection check by a ring and a page read / write protection check are performed at the same time as the address conversion. This is a check corresponding to this. If an exception is detected, the process proceeds to an exception handler (step 40). If no exception is detected, the process proceeds to the subsequent step 37.
[0014]
In the next step 37, the value of GR is acquired by referring to the table 28 using the general-purpose register number (GR), and this value is stored as store data at the address of the previously converted absolute address.
[0015]
When the store is completed, the instruction counter is updated to execute the next instruction (step 38), and the instruction code portion of the next instruction is extracted (step 39). The branch destination to the emulation code (module) for executing the next instruction is determined by the value of the instruction code extracted here.
[0016]
[Patent Document 1]
JP 2001-34498 A
[0017]
[Problems to be solved by the invention]
Next, a conventional operation when a failure occurs in the hardware of the platform will be described with reference to FIG.
[0018]
For example, when the platform hardware 18 detects a failure that cannot be automatically corrected by hardware such as ECC on a main memory or a bus connecting the main memory and the processor, the platform hardware 18 The failure is notified using a means such as an interrupt. The processor that has received the notification temporarily suspends the program being executed, and starts executing the processor firmware 16. Further, even when a failure is detected inside the processor hardware 17, the processor similarly interrupts the processor firmware 16.
[0019]
The processor firmware 16 attempts to correct the detected fault if it can be corrected in the processor. A case in which correction is possible corresponds to, for example, a failure in a store-through cache built in the processor. In this case, the data block in which the failure is detected is discarded from the cache, and data is reacquired from the main memory. If the correction is successful, the processing of the processor firmware 16 ends, and the execution of the interrupted program is resumed.
[0020]
If the correction cannot be performed by the processor firmware 16 or if the failure is detected by the platform hardware 18 outside the processor, the processing is further passed to the platform firmware 15. The platform firmware 15 attempts to correct the detected fault if it can be corrected. If the correction by the firmware is successful, the processing of the platform firmware 15 ends, and once the control is passed to the processor firmware 16, the execution of the interrupted program is resumed.
[0021]
Here, in the case of a failure that cannot be corrected by the platform firmware 15, the control is further transferred from the platform firmware 15 to the emulator 14 (generally, an operating system) to try to recover from the failure. However, in such a case, for example, when data is destroyed due to a failure that cannot be automatically corrected by an ECC (error correction code) on the main memory when the main memory is read, or when the main memory is read from the processor via a bus. When data is written to or read from a bus, a failure that cannot be automatically corrected by the ECC occurs on the bus and the data is destroyed. It is necessary to determine the process that uses the memory area of the specified area and determine whether the destroyed data area can be destroyed, or to determine whether the data can be recovered by re-executing the process. Become. It is generally very difficult for an emulator to perform such a recovery, especially in the case of an emulator because the status of the operating system processes running on the emulator cannot be grasped. If a failure occurs, recovery is not possible. For this reason, the system always goes down, and there is a problem in terms of availability.
[0022]
In a computer system in a mission-critical area where high data integrity is required, there must be no part in the data transfer path from the memory or I / O device to the processor where no failure is detected, but the emulator supports it. There is also the problem that it is not practically possible to verify this for each model of the platform that does.
[0023]
A first object of the present invention is to provide an emulator that emulates a program of a target machine on a platform machine having a different architecture from that of the target machine when a failure accompanied by unrecoverable data corruption occurs on the platform machine during execution of the emulation. Another object of the present invention is to restore data on the emulation side so that execution of emulation processing can be continued without causing a system down or reboot.
[0024]
A second object of the present invention is to provide an emulator that emulates a program of a target machine on a platform machine having a different architecture from that of the target machine, and detects a fault that cannot be detected by a fault detection circuit of the platform hardware on the emulation side to detect an error. It is to prevent continuous emulation processing from being continued.
[0025]
[Means for Solving the Problems]
The emulator of the present invention operates on a platform machine having a different architecture from the target machine, and emulates a program of the target machine stored in a main memory of the target machine secured in a part of a main memory of the platform machine. An emulator that includes a main memory copy area that is a copy of the main memory of the target machine in another part of the main memory of the platform machine, and emulates a store instruction of the target machine when emulating a store instruction of the target machine. Basically, the same data is stored in both the storage and the main storage copy area.
[0026]
In the emulator according to the first aspect of the present invention, when emulating a load instruction of the target machine, data is read only from the main memory of the target machine in the main memory of the target machine and the main memory of the main memory copy area. When emulating the program of the target machine, if an uncorrectable data error is detected in the platform machine at the time of reading and writing the main memory of the target machine, the Writing back the data to be executed to the memory address of the main memory of the target machine corresponding to the data where the uncorrectable failure is detected, and then restarts execution from the instruction at the time when the uncorrectable failure is detected. I do.
[0027]
Further, in the emulator according to the second invention, when emulating a load instruction of the target machine, data is loaded from both the main storage of the target machine and the main storage copy area and the two are compared. Then, when a mismatch is detected, processing of software is interrupted.
[0028]
[Action]
The main memory of the target machine is provided in the main memory of the platform machine and the main memory copy area that is a copy of the target machine. By storing data, data can be written back from the copy area when an uncorrectable failure occurs. Therefore, the data can be restored on the emulation side, and the execution of the emulation processing can be continued.
[0029]
Also, when emulating a load instruction of the target machine, by loading data from both the main storage and the main storage copy area of the target machine and comparing the two, the failure detection circuit of the platform hardware cannot detect the failure. Destruction of read data due to a failure can be detected. For this reason, it is possible to prevent a failure that cannot be detected by the failure detection circuit of the platform hardware from being overlooked and prevent the illegal emulation processing from continuing.
[0030]
First Embodiment of the Invention
Next, an emulator according to a first embodiment of the present invention will be described in detail with reference to the drawings.
[0031]
The emulator according to the present embodiment is, like the emulator 14 shown in FIG. 5, software executed by the processor of the platform machine, and is stored in a main storage area of the target machine secured in a part of the main memory of the platform machine. Emulates the stored target machine operating system and middleware and application programs. However, unlike a conventional emulator, a storage area for recording a copy of the main memory of the target machine is placed on the main memory of the platform machine separately from the main memory area of the target machine, and when emulating a store instruction of the target machine. The same data is stored in both the main storage area and the main storage copy area, and when emulating a load instruction, data is loaded only from the main storage area.
[0032]
FIG. 1 shows an example of setting two areas for a target machine on a main memory of a platform machine and a processing flow at the time of emulating a store instruction of an emulator according to the present embodiment.
[0033]
The absolute address space of the target machine is mapped as a target address space 62 on a portion of the main memory 50 of the platform machine as a target address space 62. In this area 62, instruction codes and data constituting an operating system and application programs of the target machine are stored. In addition to the area 62, an area for storing a copy of the area 62 is mapped as a target address space (copy) 63. Here, the start address of the target address space (copy) 63 is set to the position of the start address of the target address space 62 + the offset d.
[0034]
Next, the operation of the present embodiment will be described. Hereinafter, only a store instruction and a load instruction will be described as basic instructions. However, other complicated instructions, such as an operation instruction involving memory access and a copy instruction between memories, can be similarly realized.
[0035]
First, an operation of emulating a store instruction of a target machine will be described with reference to FIG.
[0036]
When the execution of the store instruction is started, the steps from fetching the instruction word to writing the operand are executed in the same manner as in the conventional technique described above with reference to FIG. 7 (steps 51 to 57). In the same manner, when an exception is detected during this time, the exception is transferred to an exception handler and exception processing is performed (step 61).
[0037]
In the following step 58, the offset value d is added to the address executed in step 57 to obtain a store address in the target address space (copy) 63, and the same data as stored in step 57 is targeted. By storing in the address space (copy), the same state as in the target address space 62 is also generated in the target address space (copy) 63 side.
[0038]
Thereafter, the subsequent updating of the instruction counter and the extraction of the next instruction word (steps 59 to 60) are the same as in the prior art.
[0039]
Here, when a processor capable of simultaneously executing a plurality of instructions, such as the above-mentioned Intel IPF, is used as the processor of the platform machine, data is written to the target address space 62 in FIG. 1 (step 57). And writing data to the target address space 63 (step 58) at the same time, it is possible to prevent a reduction in processing speed due to two writings.
[0040]
Next, an operation when emulating a load instruction of the target machine will be described with reference to FIG. In this embodiment, the emulation operation of the load instruction is the same as the emulation of the load instruction according to the prior art, and proceeds as follows.
[0041]
When the execution of the load instruction is started, the steps from the fetching of the instruction word to the exception check at the time of memory access are executed as in the case of the store instruction (steps 71 to 76). In the same manner, when an exception is detected during this time, the exception is transferred to an exception handler and exception processing is performed (step 61).
[0042]
In the following step 77, data is loaded from the absolute address in the target address space 62 obtained in step 75 and stored in the general-purpose register GR.
[0043]
Subsequent updating of the instruction counter and fetching of the next instruction (steps 78 and 79) are the same as in the case of the store instruction.
[0044]
Next, an operation when a failure occurs in the platform hardware during execution of the emulation will be described with reference to FIG.
[0045]
First, when a failure is detected in the hardware of the platform (step 81), the failure is classified into a case where automatic correction by hardware such as ECC is possible and a case where it is impossible to correct (step 82). . If the failure can be corrected by hardware, the data in which the failure has occurred is automatically corrected, and the processing of the software is continued (step 83).
[0046]
On the other hand, if the failure cannot be automatically corrected, the hardware notifies the processor of the failure using a means such as an interrupt, and the processor activates the processor firmware from the software being executed. The processor firmware determines whether the failure can be recovered by an operation closed in the processor, and if recovery is possible, performs recovery processing (step 86), and then gives an instruction to the hardware to return to software processing. (Step 89), execution is resumed from the failed instruction (step 85).
[0047]
If it is a failure that cannot be recovered closed in the processor in step 86, the failure processing is passed to the platform firmware, and it is determined whether the failure recovery by the platform is possible. If the recovery is possible, the recovery processing is performed. Then, similarly, an instruction to return to the software processing is given to the hardware (step 89), and the execution from the failed instruction is resumed (step 85).
[0048]
If the failure cannot be recovered from the failure in the platform in step 87, the control is transferred from the firmware to the emulator, and the failure processing is delegated to the emulator. Examples of such a failure include an uncorrectable failure due to a multi-bit error during memory reading and an uncorrectable failure due to a bus error.
[0049]
In step 90, the emulator that has been entrusted with recovery from the failure first determines whether the failure is of a recoverable type. If it is a catastrophic failure of a type that cannot be recovered by the emulator, the emulator returns control to the firmware and shifts to system reboot by firmware control (steps 88 and 84).
[0050]
If the failure can be recovered by the emulator, the process proceeds to step 91, where the emulator extracts a copy of the data of the failed address from the target address space (copy) 63 and writes the data back to the failed address in the target address space 62. . Then, the emulator issues an instruction to recover from the failure processing to the firmware, and the emulator ends the failure processing (step 92). In the subsequent steps, as in the case where the correction by the firmware is successful, an instruction to return to the software processing is given to the hardware, and execution from the failed instruction is resumed (steps 89 and 85).
[0051]
If the uncorrectable fault that has occurred is detected in the main memory 50 when the target address space 62 is read, if the fault is caused by an intermittent fault, the normal data in the target address space (copy) 63 Can be recovered by writing back to the faulty memory address portion in the target address space 62, and the emulation process can be normally continued by restarting the software processing from the faulty instruction. If the uncorrectable fault that has occurred is detected on the bus connecting the main memory 50 and the processor when reading the target address space 62, the data on the target address space 62 may be normal. However, since the erroneous data that has been read may have been accumulated in the cache of the processor, the normal data in the target address space (copy) 63 is written back to the failed memory address portion in the target address space 62, By restarting the software processing from the instruction in which the failure has occurred, the read operation can be performed again. In the case of an intermittent failure, the emulation processing can be normally continued. Further, when the uncorrectable error that has occurred is detected on the bus connecting the main memory 50 and the processor when the target address space 62 is written, the data in the target address space 62 may be destroyed. Therefore, normal data in the target address space (copy) 63 can be recovered by writing back to the faulty memory address portion in the target address space 62, and software processing can be restarted from the faulty instruction, so that any intermittent fault can be recovered. If this is the case, the emulation processing can be continued normally.
[0052]
As described above, according to the present embodiment, when an uncorrectable failure due to a multi-bit error at the time of memory reading or an unrecoverable failure such as an uncorrectable failure due to a bus error occurs, By recovering data, software execution, that is, emulation of the program of the target machine, can be continued without causing a system down or reboot.
[0053]
Second Embodiment of the Invention
Next, an emulator according to a second embodiment of the present invention will be described in detail with reference to the drawings.
[0054]
The emulator according to the present embodiment is, like the emulator 14 shown in FIG. 5, software executed by the processor of the platform machine, and is stored in a main storage area of the target machine secured in a part of the main memory of the platform machine. Emulates the stored target machine operating system and middleware and application programs. However, unlike a conventional emulator, a storage area for recording a copy of the main memory of the target machine is placed on the main memory of the platform machine separately from the main memory area of the target machine, and when emulating a store instruction of the target machine. The same data is stored in both the main storage area and the copy area of the main storage, and when emulating a load instruction, the data is loaded from both the main storage area and the copy area, and then both data are compared. Thus, data destruction not detected by the hardware failure detection circuit of the platform machine is detected.
[0055]
FIG. 4 shows an example in which two areas for the target machine are set on the main memory of the platform machine and a processing flow when emulating a load instruction of the emulator according to the present embodiment.
[0056]
The absolute address space of the target machine is mapped as a target address space 62 on a portion of the main memory 50 of the platform machine as a target address space 62. In this area 62, instruction codes and data constituting an operating system and application programs of the target machine are stored. In addition to the area 62, an area for storing a copy of the area 62 is mapped as a target address space (copy) 63. Here, the start address of the target address space (copy) 63 is set to the position of the start address of the target address space 62 + the offset d.
[0057]
Next, the operation of the present embodiment will be described. Hereinafter, only a store instruction and a load instruction will be described as basic instructions. However, other complicated instructions, such as an operation instruction involving memory access and a copy instruction between memories, can be similarly realized.
[0058]
In the present embodiment, the operation of emulating the store instruction of the target machine is performed according to the processing flow shown in FIG. 1, as in the first embodiment. That is, the same data is stored in both the target address space 62 and the target address space (copy) 63.
[0059]
Next, a procedure in which the emulator according to the present embodiment emulates a load instruction of the target machine will be described with reference to FIG.
[0060]
When the execution of the load instruction is started, the steps from the fetching of the instruction word to the reading of the operand are performed in the same manner as in the execution procedure of the load instruction in the first embodiment described with reference to FIG. 2 (steps 101 to 107). . In the same manner, when an exception is detected during this time, the exception is transferred to an exception handler and exception processing is performed (step 120).
[0061]
In the next step 108, the emulator adds the offset value d to the address of the operand read in step 107, obtains the load address in the target address space (copy) 63, and has the same data as that loaded in step 107. The expected data is loaded and stored in the work register (step 108).
[0062]
Further, the data loaded in step 107 is compared with the data loaded in step 108 (step 109). If a mismatch is detected, the execution of the software for the subsequent emulation is interrupted. In the case where a mismatch is detected, it is assumed that one of the read data has been corrupted. Is started (step 121). In the log collection, information that can be collected by software, for example, the contents of a register and the contents of an instruction counter are collected.
[0063]
If no inconsistency is detected as a result of the comparison check, the process proceeds to the next step, but the procedure from here is the same as that described in FIG. 2 and the like (steps 110 and 111).
[0064]
As described above, according to the present embodiment, when there is a failure that cannot be detected by the failure detection circuit of the platform hardware, it is detected that the read data has been destroyed, and the illegal emulation process is prevented from continuing. Emulation that guarantees data integrity.
[0065]
【The invention's effect】
As described above, according to the present invention, the following effects can be obtained.
[0066]
According to the first aspect, when an uncorrectable failure due to a multi-bit error at the time of memory reading or a failure involving irrecoverable data corruption such as an uncorrectable failure due to a bus error occurs in the platform hardware, To recover data and continue emulation of the target machine without causing a system down or reboot. The reason is that by generating a copy of the memory space of the target machine by the emulator, data can be written back from the copy area when an uncorrectable failure occurs.
[0067]
According to the second invention, when the read data is destroyed by a failure that cannot be detected by the failure detection circuit of the platform hardware, it is possible to detect that the read data has been destroyed and prevent the illegal emulation processing from continuing. it can. The reason is that a copy (copy space) of the memory space of the target machine is generated by the emulator, and when emulating the memory read of the target machine, data is read from both the memory space and the copy space of the target machine to read the value. This is because a comparison check is performed, and if a mismatch is detected, execution of the software is interrupted.
[Brief description of the drawings]
FIG. 1 is a diagram showing an example of setting two areas for a target machine on a main memory of a platform machine and a processing flow at the time of emulating a store instruction of an emulator according to the first embodiment of the present invention.
FIG. 2 is a diagram showing a processing flow when emulating a load instruction of an emulator according to the first embodiment of the present invention.
FIG. 3 is an operation explanatory diagram when a failure occurs in platform hardware during execution of emulation according to the first embodiment of the present invention.
FIG. 4 is a diagram illustrating an example of setting two areas for a target machine on a main memory of a platform machine and a processing flow when emulating a load instruction of an emulator according to a second embodiment of the present invention.
FIG. 5 is a block diagram showing a mounting environment of the emulator.
FIG. 6 is an operation explanatory diagram when the emulator emulates a command word of a target machine.
FIG. 7 is a diagram showing a processing flow at the time of emulating a store instruction in a conventional emulator.
[Explanation of symbols]
11 ... Application program
12. Middleware
13. Target OS
14 ... Emulator
15 ... Platform firmware
16 ... Processor firmware
17 Processor (hardware)
18 ... Platform (hardware)
50: Main memory of the platform machine
62: Assigned target address space as main memory of the target machine
63: target address space (copy) serving as a copy area of target address space 62

Claims (6)

ターゲットマシンと異なるアーキテクチャのプラットフォームマシン上で動作し、前記プラットフォームマシンの主記憶の一部に確保された前記ターゲットマシンの主記憶に記憶された前記ターゲットマシンのプログラムをエミュレートするエミュレータにおいて、前記プラットフォームマシンの主記憶の他の部分に前記ターゲットマシンの主記憶のコピーである主記憶コピー領域を備え、前記ターゲットマシンのストア命令をエミュレートする際に前記ターゲットマシンの主記憶と前記主記憶コピー領域の両方に対して同じデータをストアすることを特徴とするエミュレータ。An emulator that operates on a platform machine having a different architecture from the target machine and emulates a program of the target machine stored in a main memory of the target machine secured in a part of a main memory of the platform machine. A main storage copy area that is a copy of the main storage of the target machine in another part of the main storage of the machine, and a main storage of the target machine and the main storage copy area when emulating a store instruction of the target machine. An emulator characterized by storing the same data for both. 前記ターゲットマシンのロード命令をエミュレートする際には前記ターゲットマシンの主記憶と前記主記憶コピー領域のうち前記ターゲットマシンの主記憶からのみデータをロードすることを特徴とする請求項1記載のエミュレータ。2. The emulator according to claim 1, wherein when emulating the load instruction of the target machine, data is loaded only from the main memory of the target machine in the main memory of the target machine and the main memory copy area. . 前記ターゲットマシンのプログラムをエミュレートしている際、前記ターゲットマシンの主記憶のリード及びライト時に前記プラットフォームマシンでデータの訂正不能障害が検出された場合、前記主記憶コピー領域の対応するデータを、前記ターゲットマシンの主記憶における前記訂正不能障害が検出されたデータにかかるメモリアドレスに書き戻した後、前記訂正不能障害が検出された時点の命令から実行を再開することを特徴とする請求項2記載のエミュレータ。While emulating the program of the target machine, if an uncorrectable failure of data is detected in the platform machine at the time of reading and writing the main memory of the target machine, the corresponding data in the main memory copy area is 3. The method according to claim 2, wherein, after writing back to a memory address in the main memory of the target machine corresponding to the data where the uncorrectable failure is detected, execution is resumed from an instruction at the time when the uncorrectable failure is detected. The emulator described. 前記ターゲットマシンのロード命令をエミュレートする際には前記ターゲットマシンの主記憶と前記主記憶コピー領域の両方からデータをロードして両者を比較し、不一致を検出した場合にソフトウェアの処理を中断することを特徴とする請求項1記載のエミュレータ。When emulating a load instruction of the target machine, data is loaded from both the main storage of the target machine and the main storage copy area, the two are compared, and if a mismatch is detected, software processing is interrupted. The emulator according to claim 1, wherein: ターゲットマシンと異なるアーキテクチャのプラットフォームマシンを構成するコンピュータを、前記プラットフォームマシンの主記憶の一部に確保された前記ターゲットマシンの主記憶に記憶された前記ターゲットマシンのプログラムをエミュレートするエミュレータとして機能させるプログラムであって、前記コンピュータを、前記ターゲットマシンのストア命令をエミュレートする際に、前記ターゲットマシンの主記憶と、前記プラットフォームマシンの主記憶の他の部分に設けられた前記ターゲットマシンの主記憶のコピー領域である主記憶コピー領域の両方に対して同じデータをストアする手段、前記ターゲットマシンのロード命令をエミュレートする際に、前記ターゲットマシンの主記憶と前記主記憶コピー領域のうち前記ターゲットマシンの主記憶からのみデータをロードする手段、前記ターゲットマシンのプログラムをエミュレートしている際、前記ターゲットマシンの主記憶のリード及びライト時に前記プラットフォームマシンでデータの訂正不能障害が検出された場合、前記主記憶コピー領域の対応するデータを、前記ターゲットマシンの主記憶における前記訂正不能障害が検出されたデータにかかるメモリアドレスに書き戻した後、前記訂正不能障害が検出された時点の命令から実行を再開させる手段、として機能させるプログラム。A computer constituting a platform machine having a different architecture from that of the target machine functions as an emulator for emulating a program of the target machine stored in a main memory of the target machine secured in a part of a main memory of the platform machine. A program, when the computer emulates a store instruction of the target machine, a main memory of the target machine, and a main memory of the target machine provided in another part of the main memory of the platform machine. Means for storing the same data in both the main storage copy area, which is a copy area of the target machine, and emulating a load instruction of the target machine. Means for loading data only from the main memory of the target machine, and when emulating a program of the target machine, when an uncorrectable failure of data is detected in the platform machine during reading and writing of the main memory of the target machine. After writing back the corresponding data in the main storage copy area to a memory address of the main memory of the target machine corresponding to the data in which the uncorrectable failure is detected, from the instruction at the time when the uncorrectable failure is detected, A program that functions as a means to resume execution. ターゲットマシンと異なるアーキテクチャのプラットフォームマシンを構成するコンピュータを、前記プラットフォームマシンの主記憶の一部に確保された前記ターゲットマシンの主記憶に記憶された前記ターゲットマシンのプログラムをエミュレートするエミュレータとして機能させるプログラムであって、前記コンピュータを、前記ターゲットマシンのストア命令をエミュレートする際に、前記ターゲットマシンの主記憶と、前記プラットフォームマシンの主記憶の他の部分に設けられた前記ターゲットマシンの主記憶のコピー領域である主記憶コピー領域の両方に対して同じデータをストアする手段、前記ターゲットマシンのロード命令をエミュレートする際に、前記ターゲットマシンの主記憶と前記主記憶コピー領域の両方からデータをロードして両者を比較し、不一致を検出した場合にソフトウェアの処理を中断する手段、として機能させるプログラム。A computer constituting a platform machine having a different architecture from that of the target machine functions as an emulator for emulating a program of the target machine stored in a main memory of the target machine secured in a part of a main memory of the platform machine. A program, when the computer emulates a store instruction of the target machine, a main memory of the target machine, and a main memory of the target machine provided in another part of the main memory of the platform machine. Means for storing the same data in both the main storage copy area, which is a copy area of the target machine, and emulating a load instruction of the target machine. The load compare both a program that causes a processing software interrupt means as, when detecting disagreement.
JP2003039176A 2003-02-18 2003-02-18 Emulator, emulation method and program Expired - Fee Related JP4155052B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003039176A JP4155052B2 (en) 2003-02-18 2003-02-18 Emulator, emulation method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003039176A JP4155052B2 (en) 2003-02-18 2003-02-18 Emulator, emulation method and program

Publications (2)

Publication Number Publication Date
JP2004252525A true JP2004252525A (en) 2004-09-09
JP4155052B2 JP4155052B2 (en) 2008-09-24

Family

ID=33023418

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003039176A Expired - Fee Related JP4155052B2 (en) 2003-02-18 2003-02-18 Emulator, emulation method and program

Country Status (1)

Country Link
JP (1) JP4155052B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040540A (en) * 2006-08-01 2008-02-21 Nec Corp Emulation device and emulation method
JP2009282774A (en) * 2008-05-22 2009-12-03 Fujitsu Ltd Emulation program, emulation device, and emulation method
JP2010518470A (en) * 2007-02-01 2010-05-27 インターナショナル・ビジネス・マシーンズ・コーポレーション Using buffers to facilitate instruction execution
CN101729727A (en) * 2008-10-31 2010-06-09 佳能株式会社 Image processing apparatus and control method thereof, information processing apparatus and control method thereof
JP2011192282A (en) * 2010-03-16 2011-09-29 Fujitsu Technology Solutions Intellectual Property Gmbh Method for conversion of instruction with base register-relative addressing in emulation
CN108694131A (en) * 2017-04-06 2018-10-23 罗伯特·博世有限公司 Method and apparatus for Running storage device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6275427B2 (en) 2013-09-06 2018-02-07 株式会社東芝 Memory control circuit and cache memory

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040540A (en) * 2006-08-01 2008-02-21 Nec Corp Emulation device and emulation method
JP2010518470A (en) * 2007-02-01 2010-05-27 インターナショナル・ビジネス・マシーンズ・コーポレーション Using buffers to facilitate instruction execution
JP2009282774A (en) * 2008-05-22 2009-12-03 Fujitsu Ltd Emulation program, emulation device, and emulation method
CN101729727A (en) * 2008-10-31 2010-06-09 佳能株式会社 Image processing apparatus and control method thereof, information processing apparatus and control method thereof
JP2011192282A (en) * 2010-03-16 2011-09-29 Fujitsu Technology Solutions Intellectual Property Gmbh Method for conversion of instruction with base register-relative addressing in emulation
CN108694131A (en) * 2017-04-06 2018-10-23 罗伯特·博世有限公司 Method and apparatus for Running storage device
CN108694131B (en) * 2017-04-06 2024-03-29 罗伯特·博世有限公司 Method and device for operating a storage device

Also Published As

Publication number Publication date
JP4155052B2 (en) 2008-09-24

Similar Documents

Publication Publication Date Title
CN100489801C (en) Firmware mechanism for correcting soft errors
US7831857B2 (en) Method and system for recovering from operating system crash or failure
US6851074B2 (en) System and method for recovering from memory failures in computer systems
US10909006B2 (en) Main processor error detection using checker processors
US8166338B2 (en) Reliable exception handling in a computer system
JP4603185B2 (en) Computer and its error recovery method
US20060190702A1 (en) Device and method for correcting errors in a processor having two execution units
US7752494B2 (en) Method and system of aligning execution point of duplicate copies of a user program by exchanging information about instructions executed
US8650437B2 (en) Computer system and method of protection for the system&#39;s marking store
EP3198448B1 (en) Hardware assisted object memory migration
US10817369B2 (en) Apparatus and method for increasing resilience to faults
US20100205477A1 (en) Memory Handling Techniques To Facilitate Debugging
Milojicic et al. Increasing relevance of memory hardware errors: a case for recoverable programming models
JP4155052B2 (en) Emulator, emulation method and program
Smith et al. Surviving peripheral failures in embedded systems
Tamir et al. The UCLA mirror processor: A building block for self-checking self-repairing computing nodes
Nagarajan et al. Self-recovery in server programs
Wamhoff et al. Transactional encoding for tolerating transient hardware errors
JP2513060B2 (en) Failure recovery type computer
Qin System Support for Improving Software Dependability During Production Runs
WO2010109631A1 (en) Information processing device, information processing method and information processing program
JPS60142747A (en) Instruction execution control system
JPH07152594A (en) Retry control system for control processor
JPH05165730A (en) Data processor
Garg Soft error fault tolerant systems: cs456 survey

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070703

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070822

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080422

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080509

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080617

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080630

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110718

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110718

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120718

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120718

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130718

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees