JP2015215641A - Information processor, emulation program and emulation method - Google Patents
Information processor, emulation program and emulation method Download PDFInfo
- Publication number
- JP2015215641A JP2015215641A JP2014096206A JP2014096206A JP2015215641A JP 2015215641 A JP2015215641 A JP 2015215641A JP 2014096206 A JP2014096206 A JP 2014096206A JP 2014096206 A JP2014096206 A JP 2014096206A JP 2015215641 A JP2015215641 A JP 2015215641A
- Authority
- JP
- Japan
- Prior art keywords
- read
- virtual
- storage unit
- queue
- write
- 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
Images
Abstract
Description
本発明は、情報処理装置,エミュレーションプログラム,及びエミュレーション方法に関する。 The present invention relates to an information processing apparatus, an emulation program, and an emulation method.
近年、DVD(Digital Versatile Disc)/HDD(Hard Disk Drive)レコーダやNAS(Network Area Storage)装置をはじめとする各種装置のライフサイクルが短くなり、ベンダが自社のみで装置の全ての部品を製造することが減少している。代わりに、ベンダが部品を各社から調達して組み立て、ソフトウェア(Firmware;FW等)を組み込むことで、1つの装置を製造することが多くなっている。 In recent years, the life cycle of various devices including DVD (Digital Versatile Disc) / HDD (Hard Disk Drive) recorders and NAS (Network Area Storage) devices has been shortened, and vendors manufacture all parts of the devices by themselves. That is decreasing. Instead, vendors often procure parts from various companies, assemble them, and incorporate software (Firmware, FW, etc.) to manufacture a single device.
大規模な装置は多くの細かなソフトウェア(モジュール等)を組み込まれることが多い。これらのソフトウェアの多くは、装置が完成してからデバッグが行なわれるため、ソフトウェアの数が多くなるのに伴ってデバッグに時間がかかる。 Large-scale devices often incorporate many small pieces of software (modules, etc.). Since most of these softwares are debugged after the apparatus is completed, debugging takes time as the number of softwares increases.
このため、試作としての装置(試作装置)を多く作成して同時に(並行して)デバッグを行ない、デバッグ期間を短縮する手法等が考えられる。しかし、この手法では、試作装置を多く作成するため、コストがかかる。また、装置の修正(改版)等があった場合、再度複数の試作装置を作成することになるため、工数が増加し、ライフサイクルに合わなくなったり、装置のコストアップに繋がる場合もある。 For this reason, a method of shortening the debugging period by creating a large number of prototype devices (prototype devices) and performing debugging simultaneously (in parallel) can be considered. However, this method is costly because many prototype devices are created. In addition, when the device is corrected (revised) or the like, a plurality of prototype devices are created again, which may increase the number of man-hours and may not be able to meet the life cycle or increase the cost of the device.
上記の不都合を回避する手法として、装置の全体若しくは一部をソフトウェア的にサーバやPC(Personal Computer)等のコンピュータ(情報処理装置)上でエミュレート(再現)することが考えられる。 As a technique for avoiding the above inconvenience, it is conceivable to emulate (reproduce) the whole or a part of the apparatus on a computer (information processing apparatus) such as a server or a PC (Personal Computer).
上述したエミュレーションでは、装置を実際に製造せずに、コンピュータ上で、装置(ハードウェア)をエミュレートするソフトウェア(エミュレータ)により仮想的に装置を構成し、仮想的な装置(仮想装置)上で実際のソフトウェアを実行させる。これにより、装置を実際に製造した際の問題点を洗い出すことができる。 In the above-described emulation, the device is virtually configured by software (emulator) that emulates the device (hardware) on the computer without actually manufacturing the device, and on the virtual device (virtual device). Run the actual software. Thereby, the problem at the time of actually manufacturing an apparatus can be identified.
しかし、エミュレータでは、再現対象の対象装置(ハードウェア)とは異なり、情報処理装置のプロセッサ(CPU等)が、ソフトウェアで再現した仮想CPU(Central Processing Unit)及び仮想デバイスから仮想メモリへのアクセスを行なう。このため、仮想装置では、対象装置とは異なり、エミュレータ特有で起こる性能(動作速度)の低下が生じ得る。 However, in the emulator, unlike the target device (hardware) to be reproduced, the processor (CPU, etc.) of the information processing device accesses the virtual memory from the virtual CPU (Central Processing Unit) and virtual device reproduced by software. Do. For this reason, unlike the target device, the virtual device may have a decrease in performance (operation speed) that is unique to the emulator.
1つの側面では、本発明は、対象装置を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することを目的とする。 In one aspect, an object of the present invention is to suppress degradation in performance of a virtual model in an information processing apparatus that reproduces a target device using a virtual model.
なお、前記目的に限らず、後述する発明を実施するための形態に示す各構成により導かれる作用効果であって、従来の技術によっては得られない作用効果を奏することも本発明の他の目的の1つとして位置付けることができる。 In addition, the present invention is not limited to the above-described object, and other effects of the present invention can be achieved by the functions and effects derived from the respective configurations shown in the embodiments for carrying out the invention which will be described later. It can be positioned as one of
本件の情報処理装置は、対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置であり、格納部と読出制御部とをそなえる。前記格納部は、前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納する。前記読出制御部は、前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定する。重ならない場合、前記読出制御部は、前記読み出し要求に係る読み出し処理を実行する。 The information processing apparatus according to the present embodiment is an information processing apparatus that reproduces a target device including a target storage unit and a plurality of target processing units that share the storage area of the target storage unit, and includes a storage unit and a read control unit. The storage unit stores a write request to the virtual storage unit corresponding to the target storage unit issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units in the order of processing. For the read request to the virtual storage unit issued from the virtual processing unit, whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit Determine whether or not. If they do not overlap, the read control unit executes a read process related to the read request.
一実施形態によれば、対象装置を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することができる。 According to one embodiment, it is possible to suppress the performance degradation of the virtual model in the information processing apparatus that reproduces the target device using the virtual model.
以下、図面を参照して本発明の実施の形態を説明する。ただし、以下に説明する実施形態は、あくまでも例示であり、以下に明示しない種々の変形や技術の適用を排除する意図はない。すなわち、本実施形態を、その趣旨を逸脱しない範囲で種々変形して実施することができる。なお、以下の実施形態で用いる図面において、同一符号を付した部分は、特に断らない限り、同一若しくは同様の部分を表す。 Embodiments of the present invention will be described below with reference to the drawings. However, the embodiment described below is merely an example, and there is no intention to exclude various modifications and technical applications that are not explicitly described below. That is, the present embodiment can be implemented with various modifications without departing from the spirit of the present embodiment. Note that, in the drawings used in the following embodiments, portions denoted by the same reference numerals represent the same or similar portions unless otherwise specified.
〔1〕一実施形態
〔1−1〕対比例
はじめに、図1及び図2に示す対比例を説明する。図1及び図2は、それぞれ、再現対象の装置(対象装置)1000(図22参照)をエミュレータにより再現した仮想装置100及び200の構成例を示す図である。なお、対象装置1000の構成例を図22に示す。対象装置1000は、図22に示すように、CPU1100及び複数のデバイス1200−1〜1200−3が、内部バス1400を介してメモリ1300にアクセスすることができる。
[1] One Embodiment [1-1] Comparison The comparison shown in FIGS. 1 and 2 will be described first. FIG. 1 and FIG. 2 are diagrams showing configuration examples of
エミュレータは、装置(対象装置)1000のエミュレートを行なうソフトウェアであり、図示しないCPU及びRAM(Random Access Memory)等のメモリをそなえるサーバやPC等のコンピュータ(情報処理装置)上で実行される。エミュレータは、コンピュータにおいてCPUによりメモリ上に展開されたエミュレーションプログラムが実行されることで実現される。エミュレータは、図1に示すようにソフトウェア的に仮想装置100を構成することができる。
The emulator is software for emulating the device (target device) 1000, and is executed on a computer (information processing device) such as a server or a PC having a memory such as a CPU and a RAM (Random Access Memory) (not shown). The emulator is realized by executing an emulation program developed on a memory by a CPU in a computer. The emulator can configure the
仮想装置100は、エミュレーションの対象装置1000を再現したものであり、図1に示すように仮想(疑似)CPU(Pseudo CPU)110,複数(例えば3つ)の仮想(疑似)デバイス(Pseudo Device)120−1〜120−3,及び仮想メモリ130をそなえる。
The
仮想CPU110は、実際のプログラム(FW)を実行する仮想的なCPUである。仮想デバイス120−1〜120−3(以下の説明において仮想デバイス120−1〜120−3を区別しない場合には単に仮想デバイス120という)は、対象装置1000(仮想装置100)内部の各デバイスの動作を疑似的に再現する仮想的なデバイスである。以下、仮想CPU110及び複数の仮想デバイス120をまとめて仮想処理部という場合がある。
The
仮想メモリ130は、コンピュータのメモリのリソースを用いて実現される仮想的なメモリである。仮想CPU110及び仮想デバイス120は、仮想メモリ130に対してアクセス、つまりデータの読み出しや書き込みを行なうことができる。
The
ところで、図1に示すエミュレータでは、各仮想処理部は互いに独立して仮想装置100内の仮想メモリ130に対しアクセスを発生させる。すなわち、図1に示すエミュレータは、仮想処理部間にて排他処理を行なう機能をそなえていない。
By the way, in the emulator shown in FIG. 1, each virtual processing unit generates access to the
仮想装置100では、仮想CPU110が仮想デバイス120から仮想メモリ130への書き込みの値を監視し、状態が変化したときに次の処理に移行するようなプログラムが実行されることがある。このとき、仮想CPU110は、仮想デバイス120から仮想メモリ130への書き込みが中途半端な状態でも次の動作に移行してしまう場合がある。
In the
一例として、仮想CPU110と仮想デバイス120とが仮想メモリ130の同一の空間(記憶領域)をアクセスするような処理を考える。このような処理としては、割り込み等を使用して仮想デバイス120が複数のデータを仮想メモリ130に書き込み、そのデータを仮想CPU110が読み出すような処理が挙げられる。この場合、仮想デバイス120が仮想メモリ130へのデータの書き込みを完了しないうちに、仮想CPU110が同一の記憶領域からの読み出しを実行し、仮想デバイス120からのデータが途中までしか書き込まれない事態が生じ得る。
As an example, consider a process in which the
また、Linux(登録商標)を実行するコンピュータ上で動作するエミュレータにおいて、仮想CPU110が仮想メモリ130にアクセスすると、ページ概念により4Kバイト単位でスレッドが切り替わる可能性がある。このため、データが途中までしか書き込まれない状態と同様に、転送途中で次の処理が実行され処理の追い越しが発生する可能性があり、予期しない誤動作を生じる場合もある。
Further, in an emulator operating on a computer that executes Linux (registered trademark), when the
このように、仮想装置100が対象装置1000の仕様とは異なる動作をする場合、エミュレータの使用者等は、このような不都合が発生する都度、対処方法を検討し修正することになる。
As described above, when the
上述した不都合を解消する手法として、図2に示すエミュレータを用いることも考えられる。このエミュレータは、図2に示すようにソフトウェア的に仮想装置200を構成(再現)することができる。
As a technique for solving the above-described inconvenience, an emulator shown in FIG. 2 may be used. The emulator can configure (reproduce) the
仮想装置200は、基本的に図1に示す仮想装置100と同様の構成をそなえるが、図2に示すように、仮想装置100の構成に加えて、アービタ140及びセレクタ150をそなえる点が異なる。
The
アービタ140は、ハードウェアの装置で用いられるアービタと同様に、仮想処理部間で仮想メモリ130へのメモリアクセスに対し調停(排他処理)を行ない、メモリアクセスを調整する。例えば、アービタ140は、入力される複数のリクエスト信号の送信元の仮想処理部について調停を行ない、選択した仮想処理部から完了信号を入力されるまで当該仮想処理部にメモリアクセスを行なわせる。
Similar to the arbiter used in the hardware device, the
セレクタ150は、アービタ140から入力される選択信号に応じた仮想処理部を選択し、仮想メモリ130へのアクセスを許可すべく入力側の切り替えを行なう。このとき、セレクタ150は、選択信号に応じた仮想処理部へ、選択されていることを示す信号(被セレクト信号)を出力することで、仮想処理部は自身が選択されていることを検出する。
The
このように、仮想装置200では、全仮想処理部(仮想CPU110及び仮想デバイス120)による仮想メモリ130への全てのリード及びライトに対し、調停(排他処理)を行なうことになる。
As described above, in the
しかし、図2に示す仮想装置200において、アービタ140及びセレクタ150を含む調停処理部分は、仮想デバイス120が増加するにつれ複雑化し、規模が大きくなるため、仮想装置200の処理速度の低下が発生し得る。例えば、CPUから見たプログラム領域は読出専用(Read Only)であり、実際には調停は不要であるが、仮想装置200では当該領域まで調停することになるため、不要な調停が発生して処理速度の低下を招くことになる。
However, in the
以上のように、エミュレータにより対象装置1000を再現し調停処理部分を含む仮想装置200を構成すると、エミュレータ特有で起こる、仮想装置200(エミュレータひいてはコンピュータ)の動作速度の低下が生じ得る。
As described above, when the
〔1−2〕エミュレーションサーバについて
上述した点に鑑み、本実施形態に係るエミュレーションサーバ1(図3参照)によれば、以下に詳述するように、仮想装置3(図5参照)がキュー処理部40をそなえる。このキュー処理部40は、複数の仮想処理部の各々から発行される仮想記憶部への書き込み要求を、処理される処理順に格納する。また、キュー処理部40は、仮想処理部から発行される仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が、格納する1以上の書き込み要求に係るアクセス範囲と重なるか否かを判定する。そして、キュー処理部40は、重ならない場合、読み出し要求に係るリード処理を実行する。
[1-2] Emulation Server In view of the above points, according to the emulation server 1 (see FIG. 3) according to the present embodiment, the virtual device 3 (see FIG. 5) performs queue processing as will be described in detail below. A
上述のように、図2に示す仮想装置200では、書き込み要求及び読み出し要求のアクセス範囲が重ならない場合にもアービタ140による調停が画一的に行なわれ、処理速度の低下が生じ得る。
As described above, in the
これに対し、エミュレーションサーバ1によれば、各仮想処理部のメモリ調停(排他処理)を最小限に留め、単純化することができるため、速度低下を抑制でき、高速にエミュレートを行なうことができる。従って、対象装置1000を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することができる。
On the other hand, according to the
〔1−3〕エミュレーションサーバの構成
以下、図3及び図4を参照しながら、本実施形態に係るエミュレーションサーバ1の構成について説明する。図3は、一実施形態に係るエミュレーションサーバ1の構成例を示す図であり、図4は、図3に示すエミュレーションサーバ1のハードウェア構成例を示す図である。
[1-3] Configuration of Emulation Server The configuration of the
エミュレーションサーバ1は、メモリ(対象記憶部)と当該メモリの記憶領域を共用する複数のデバイス及び1以上のCPU(複数の対象処理部)とをそなえるエミュレーション対象の対象装置1000を、仮想装置(仮想モデル)を用いてエミュレート(再現)する。エミュレーションサーバ1としては、例えばサーバやPC等の情報処理装置が挙げられる。
The
図3及び図4に示すように、エミュレーションサーバ1は、CPU1a,メモリ1b,記憶部1c,インタフェース部1d,入出力部1e,記録媒体1f,及び読取部1gをそなえることができる。
As shown in FIGS. 3 and 4, the
CPU1aは、種々の制御や演算を行なう演算処理装置(プロセッサ)の一例である。CPU1aは、対応する各ブロック1b〜1gと接続され、メモリ1b,記憶部1c,記録媒体1fや1h,又は図示しないROM(Read Only Memory)等に格納されたプログラムを実行することにより、種々の機能を実現することができる。例えばCPU1aは、メモリ1bに格納されたエミュレーションプログラム5(図3参照)を実行することにより、仮想装置3をエミュレートするエミュレータ2としての機能を実現することができる。
The
メモリ1bは、種々のデータやプログラムを格納する記憶装置である。CPU1aは、プログラムを実行する際に、メモリ1bにデータやプログラムを格納し展開する。メモリ1bは、上記エミュレーションプログラム5を保存するほか、エミュレータ2によるエミュレーションで用いられるエミュレーション領域4を確保する。なお、メモリ1bとしては、例えばRAM等の揮発性メモリが挙げられる。記憶部1cは、種々のデータやプログラム等を格納するハードウェアである。記憶部1cとしては、例えばHDD等の磁気ディスク装置,SSD(Solid State Drive)等の半導体ドライブ装置,フラッシュメモリ等の不揮発性メモリ等の各種装置が挙げられる。
The
インタフェース部1dは、有線又は無線による、ネットワーク(図示省略)や他の情報処理装置との間の接続及び通信の制御等を行なうものである。インタフェース部1dとしては、例えば、LAN(Local Area Network),ファイバチャネル(Fibre Channel;FC),インフィニバンド(InfiniBand)等に準拠したアダプタが挙げられる。入出力部1eは、マウスやキーボード等の入力装置及びディスプレイやプリンタ等の出力装置の少なくとも一方を含むことができる。例えば、入力装置は使用者等によるエミュレーションサーバ1(仮想装置3)の条件やデータの入力等の作業に用いられ、出力装置はエミュレーションサーバ1(仮想装置3)による動作状態や処理結果等の出力に用いられる。
The
記録媒体1fは、例えばフラッシュメモリやROM等の記憶装置であり、種々のデータやプログラムを記録することができる。読取部1gは、コンピュータ読取可能な記録媒体1hに記録されたデータやプログラムを読み出す装置である。記録媒体1f及び1hの少なくとも一方には、本実施形態に係るエミュレーションサーバ1の各種機能の全部もしくは一部を実現するエミュレーションプログラム5が格納されてもよい。例えば、CPU1aは、記録媒体1fから読み出したプログラム、又は、読取部1gを介して記録媒体1hから読み出したプログラムを、メモリ1b等の記憶装置に展開して実行してもよい。
The
なお、記録媒体1hとしては、例えばフレキシブルディスク、CD(Compact Disc)、DVD(Digital Versatile Disc)、ブルーレイディスク等の光ディスクや、USB(Universal Serial Bus)メモリやSDカード等のフラッシュメモリが挙げられる。なお、CDとしては、CD−ROM、CD−R(CD-Recordable)、CD−RW(CD-Rewritable)等が挙げられる。また、DVDとしては、DVD−ROM、DVD−RAM、DVD−R、DVD−RW、DVD+R、DVD+RW等が挙げられる。
Examples of the
上述した各ブロック1a〜1g間はバスで相互に通信可能に接続される。また、エミュレーションサーバ1の上述したハードウェア構成は例示である。従って、エミュレーションサーバ1内でのハードウェアの増減(例えば任意のブロックの追加や省略),分割,任意の組み合わせでの統合,バスの追加又は省略等は適宜行なわれてもよい。
The
〔1−4〕エミュレータの構成
次に、図5〜図19を参照しながら、本実施形態に係るエミュレーションサーバ1の構成について説明する。図5は、一実施形態に係るエミュレータ2により再現される仮想装置3の構成例を示す図であり、図6は、図5に示すキュー処理部40の動作例を説明する図である。
[1-4] Configuration of Emulator Next, the configuration of the
仮想装置3は、エミュレーションの対象装置1000を再現したものである。仮想装置3は、図5に示すように、1以上(例えば1つ)の仮想(疑似)CPU10,複数(例えば3つ)の仮想(疑似)デバイス20−1〜20−3,仮想メモリ30,及びキュー処理部40をそなえる。
The
仮想CPU10は、実際のプログラム(FW)を実行する仮想的なCPUである。仮想デバイス20−1〜20−3(以下の説明において仮想デバイス20−1〜20−3を区別しない場合には単に仮想デバイス20という)は、対象装置1000(仮想装置3)内部の各デバイスの動作を疑似的に再現する仮想的なデバイスである。仮想CPU10及び仮想デバイス20は、対象装置1000に実装されるCPU及びデバイスと同様の機能や性能を持つように設定され、エミュレーションサーバ1のCPU1aのリソースを用いて実現される。
The
仮想メモリ30は、エミュレーションサーバ1のメモリ1bのリソース(例えばエミュレーション領域4(図3参照))を用いて実現される仮想的なメモリである。仮想CPU10及び仮想デバイス20は、仮想メモリ30に対してアクセス、つまりデータの読み出しや書き込みを行なうことができる。このように、仮想CPU10及び仮想デバイス20は、仮想メモリ30の記憶領域を共用する複数の仮想処理部の一例である。なお、これら複数の仮想処理部は対象装置1000がそなえる複数の対象処理部に対応するものである。
The
キュー処理部40は、各仮想CPU10及び仮想デバイス20から仮想メモリ30へのリード/ライトアクセスを制御するものであり、リード/ライトアクセスはキュー処理部40を経由して処理が行なわれる。
The
キュー処理部40は、例示的に、キュー格納部41,キュー制御部42,読出判定部43,及びアクセス制御部44をそなえる。
The
キュー格納部41は、仮想CPU10及び複数の仮想デバイス20の各々から発行された書き込み要求及び読み出し要求を、処理される処理順(例えば発行順)に格納(キューイング)する。キュー格納部41は、例えばCPU1aの図示しないキャッシュメモリの一部やメモリ1bの一部(例えばエミュレーション領域4)等の記憶領域により実現される。
The
キュー格納部41は、例えば図6に示すように、キュー41a及びメッセージキュー41bを複数格納することができる。キュー41aは仮想メモリ30にアクセスするアドレス(先頭アドレス)(addr),データサイズ(size),及びリード/ライトのいずれかを示すR/Wフラグ(R_FLG)を含む管理用(制御用)の情報を保持する。また、このキュー41aは、図7に示すように前後のキュー41aの書き込みポインタ(write pointer)を示すBefore_wp及びNext_wpをさらに含む。メッセージキュー41bは書き込み要求のライトデータ(W_data)を保持する。
The
キュー制御部42は、キュー格納部41(キュー41a及びメッセージキュー41b)へのアクセス要求の登録,削除,更新等の管理(キューイング)を行なうものであり、アクセス要求をキュー格納部41に登録するQueue登録関数の一例である。
The
ここで、仮想CPU10及び複数の仮想デバイス20は、共通するフォーマットを用いて書き込み要求及び読み出し要求を発行することができる。一例として、書き込み要求はキュー処理部40のWrite関数を呼び出す(call)ための以下のフォーマット(メッセージ)とし、読み出し要求はキュー処理部40のRead関数を呼び出すための以下のフォーマット(メッセージ)とすることができる。
・ライト:アドレス(W_addr),データサイズ(W_size),ライトデータ(W_data)
・リード:アドレス(R_addr),データサイズ(R_size),データ格納用ポインタ
Here, the
Write: address (W_addr), data size (W_size), write data (W_data)
Read: Address (R_addr), data size (R_size), data storage pointer
例えば、キュー制御部42は、仮想CPU10及び複数の仮想デバイス20の各々から書き込み要求を入力されると、ライトアドレス(W_addr),ライトのデータサイズ(Byte)(W_size)を管理用のキュー41aに登録する。このとき、キュー制御部42はキュー41aにライトフラグ(例えばR_FLG(リードフラグ) = 0)を設定する。また、キュー制御部42は、ライトデータ(W_data)をライトデータ用のメッセージキュー41bに格納する。
For example, when a write request is input from each of the
ここで、キュー制御部42によるキューイング(追加及び削除)の動作例を、図7及び図8を参照して説明する。
Here, an operation example of queuing (addition and deletion) by the
はじめに、図7において、キュー格納部41に先頭のリクエスト(Que_REQ0)のみが登録されている(Que_WP(キュー41aからの読み出しポインタ) = Que_REQ0)場合のキューイング(追加)例を説明する。この場合、次のアクセス要求が入力されると、キュー制御部42は、Que_REQ0のNext_wpに次のアクセスによって獲得されたポインタ(キュー41aのアドレス(addr))であるQue_REQ1のポインタを登録する。また、キュー制御部42は、Que_REQ1のBefore_wpに直前のアクセスのポインタであるQue_REQ0のポインタを登録する。そして、さらに次のアクセス要求が入力されると、キュー制御部42は、Que_REQ1のNext_wpに次のアクセスによって獲得されたポインタであるQue_REQ2のポインタを登録し、Que_REQ2のBefore_wpに直前のアクセスのポインタであるQue_REQ1のポインタを登録する。
First, referring to FIG. 7, an example of queuing (addition) when only the first request (Que_REQ0) is registered in the queue storage unit 41 (Que_WP (read pointer from the
次に、図8において、キュー格納部41にQue_REQ0〜Que_REQ2が登録されており、読み出しポインタがQue_REQ1である場合のキューイング(Que_REQ0の削除)例を説明する。この場合、キュー制御部42は、Que_REQ0に係るアクセス要求(情報)を削除し(freeとし)、Before_wpにQue_REQ0のポインタを設定されたQue_REQ1について、直前の情報が削除されたためBefore_wpに“0”を設定する(Que_WP -> Before_wp = 0)。なお、読み出しポインタが示すアクセス要求に次のエントリ(Next_wp)が無い場合、Que_WP -> Before_wp= 0且つQue_WP -> Next_wp = 0の状態であるアクセス要求が先頭になる。
Next, an example of queuing (deleting Que_REQ0) when Que_REQ0 to Que_REQ2 are registered in the
なお、キュー制御部42による読み出し要求のキュー格納部41への登録処理については、キュー格納部41への格納判断を読出判定部43が行なうため、後述する。
Note that the registration process of the read request to the
読出判定部43は、仮想CPU10及び複数の仮想デバイス20の各々から読み出し要求を入力されると、当該読み出し要求をキュー格納部41に格納するか否かを判定し、判定結果に応じたリード処理を行なう。読出判定部43は、リード処理を行なうRead関数の一例である。
When a read request is input from each of the
例えば、読出判定部43は、入力された読み出し要求で指示された仮想メモリ30のアドレス(R_addr)及びリードデータサイズ(R_size)から得られるエリアと、管理用のキュー41aに格納されているライトデータのエリアとが重なっているか否かを判定する。一例として、読出判定部43は、以下の判定を行ない、いずれかの条件を満たす場合に、読み出し要求のアクセス範囲がキュー格納部41内のライトデータのアクセス範囲と重なっている(Hitする)と判定する。
・(W_addr>= R_addr) && (W_addr<= R_addr + R_size)
(読み出し要求のアクセス範囲内に書き込み要求の先頭アドレスが含まれるか否か)
・(R_addr>= W_addr) && (R_addr<= W_addr + W_size)
(書き込み要求のアクセス範囲内に読み出し要求の先頭アドレスが含まれるか否か)
For example, the
・ (W_addr> = R_addr) && (W_addr <= R_addr + R_size)
(Whether or not the start address of the write request is included within the access range of the read request)
・ (R_addr> = W_addr) && (R_addr <= W_addr + W_size)
(Whether or not the read request start address is included in the access range of the write request)
このとき、読出判定部43は、キュー格納部41内のキュー41aから、書き込み要求のエントリつまりR_FLGが“0”であるエントリ(リクエスト)のアドレス(addr)及びサイズ(size)を、それぞれW_addr及びW_sizeとして取得する。
At this time, the read
なお、読出判定部43は、キュー格納部41の格納する一以上のアクセス要求(書き込み要求)について、格納順序(処理順序)とは逆の順序、つまり最後尾のアクセス要求からBefore_wpを辿る順序で、読み出し要求のアクセス範囲と重なるか否かを判定することが好ましい。これにより、読み出し要求のアクセス範囲と重なる書き込み要求がキュー格納部41内に複数存在する場合でも、リード処理に影響を与える(最後にライト処理が行なわれる)書き込み要求を確実に特定することができる。従って、リード/ライトのアクセス競合が発生した場合でも、仮想メモリ30のデータの整合性を保つことができる。
Note that the read
次いで、読出判定部43は、判定の結果、重なっていない(Hitしていない)場合、読み出し要求で要求されたデータを、仮想メモリ30のアドレス(R_addr)からリードデータサイズ(R_size)分読み出し、Read関数の戻り値とする。この戻り値は、読み出し要求への応答として、要求元の仮想CPU10又は仮想デバイス20の読み出し要求で指定されたデータ格納用ポインタに格納(送信)される。なお、読出判定部43は、仮想メモリ30からのデータの読み出しを、例えばmemcpyコマンドを用いて、仮想メモリ30空間から要求元の仮想CPU10又は仮想デバイス20へのダイレクトコピーを実施することにより行なってもよい。
Next, if the result of the determination is that there is no overlap (no hit), the read
なお、アクセス範囲が重なっていない場合の仮想メモリ30からのリード処理は、アクセス競合が生じないため、後述するアクセス制御部44による仮想メモリ30へのライト処理と並行して行なうことができる。
Note that the read processing from the
一方、読出判定部43は、判定の結果、重なっている(Hitする)場合、読み出し要求をキュー格納部41内の管理用のキュー41aに登録する。例えば読出判定部43は、入力された読み出し要求に係るリードアドレス(R_addr)及びリードデータサイズ(Byte)(R_size)を管理用のキュー41aに登録すべく、キュー制御部42に渡す。
On the other hand, the read
このとき、読出判定部43は、読み出し要求の処理順が読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように、アクセス範囲が重なると判定した書き込み要求のポインタをキュー制御部42に通知することができる。
At this time, the read
次いで、読出判定部43は、キュー格納部41に登録した読み出し要求のエントリの登録ポインタ(アドレス,QueueBuffポインタ)を戻り値としてキュー制御部42から受け取り、読み出し要求に係るリード処理を待機する。読出判定部43は、キュー格納部41からアクセス制御部44によりデータ(addr,size)が読み出された際の、キュー41aのポインタをチェックする。そして、読出判定部43は、待機しているリード処理が、読み出されたキュー41aのポインタにヒットしたことを契機に、待機を解除してリード処理を実行する。なお、リード処理は、既述のように読出判定部43により仮想メモリ30からリードデータが読み出され、Read関数の戻り値として要求元に返される。
Next, the read
なお、アクセス範囲が重なっている場合、仮想メモリ30からのリード処理においてアクセス競合が生じる可能性があるため、リード処理中はアクセス制御部44による仮想メモリ30へのライト処理が抑止される。例えば読出判定部43は、キュー制御部42からの戻り値の登録ポインタについて、リード処理実行中を示すフラグ(R_EXEC)を有効にし、R_EXECが有効の間、アクセス制御部44によるライト処理を待機させることができる。
If the access ranges overlap, there may be an access conflict in the read process from the
読出判定部43による処理の詳細及び動作例については、図15,図16,図18,及び図19を参照しながら後述する。
Details of processing performed by the read
ここで、キュー制御部42の説明に戻る。キュー制御部42は、上述のように読出判定部43において読み出し要求のアクセス範囲がキュー格納部41内の書き込み要求のアクセス範囲と重なると判定されると、読み出し要求をキュー格納部41に格納する。これにより、仮想メモリ30の重複するエリアへのライト処理が完了してからリード処理が実行されるため、リードデータの整合性を保つことができる。
Here, the description returns to the
例えば、キュー制御部42は、読出判定部43から渡されるリードアドレス(R_addr)及びリードデータサイズ(Byte)(R_size)と、リードフラグ(例えばR_FLG(リードフラグ) = 1)とを管理用のキュー41aに登録する。このとき、キュー制御部42は、読出判定部43から読み出し要求に係るデータとともにキュー41aのポインタを通知されると、通知されたポインタのアクセス要求とその次のアクセス要求との間に、読み出し要求に係るエントリ(リクエスト)を挿入することができる。
For example, the
以下、キュー制御部42によるキュー格納部41(キュー41a)への読み出し要求の挿入動作例を、図9及び図10を参照して説明する。
Hereinafter, an example of an operation of inserting a read request into the queue storage unit 41 (
図9において、リードのリクエスト(Que_REQ3)のアクセス要求が、キュー格納部41内のキュー41aにおけるQue_REQ1のアクセス範囲にHitしている場合の、Que_REQ3のアクセス要求の挿入例を説明する。なお、キュー制御部42は、読出判定部43からQue_REQ1のポインタを通知されているものとする。この場合、例えばキュー制御部42は、図10に示すように、Que_REQ1とその次のQue_REQ2との間に読み出し要求に係るQue_REQ3を挿入する。
9, an example of inserting an access request for Que_REQ3 when the access request for the read request (Que_REQ3) is hit in the access range of Que_REQ1 in the
具体的には、キュー制御部42は、HitしたQue_REQ1のNext_wpに読み出し要求に係るQue_REQ3のポインタを登録する。また、キュー制御部42は、Que_REQ3のBefore_wpにHitしたQue_REQ1のポインタを登録し、Que_REQ3のNext_wpにQue_REQ1の直後(Que_REQ1のNext_wpに登録されていた)Que_REQ2のポインタを登録する。さらに、キュー制御部42は、Que_REQ2のBefore_wpに読み出し要求に係るQue_REQ3のポインタを登録する。
Specifically, the
このように、キュー制御部42は、アクセス範囲が重なると判定された書き込み要求の直後に読み出し要求を格納(挿入)することで、リード処理の待機時間を最小限に留めることができ、リード処理の高速化を図ることができる。
As described above, the
キュー制御部42による処理の詳細及び動作例については、図13及び図14を参照しながら後述する。
Details of processing performed by the
以上のように、キュー制御部42及び読出判定部43は、読み出し要求について、当該読み出し要求に係るアクセス範囲がキュー格納部41の格納する1以上の書き込み要求に係るアクセス範囲と重なるか否かを判定する読出制御部の一例であるといえる。具体的には、この読出制御部は、判定の結果、重ならない場合、読み出し要求に係る読み出し処理を実行するのである。
As described above, for the read request, the
このように、一実施形態に係るエミュレーションサーバ1によれば、キュー格納部41に読み出し要求のエリアにHitする書き込み要求が無い場合、読み出し要求をキュー格納部41に格納せずにリード処理を行なうことができる。従って、リード処理の高速化を図ることができ、仮想装置3の性能低下を抑制することができる。
As described above, according to the
なお、キュー格納部41への読み出し要求の挿入位置の判断は、読出判定部43が行なってもよいしキュー制御部42が行なってもよい。
Note that the determination of the insertion position of the read request to the
アクセス制御部44は、キュー格納部41に格納されたキューについて、処理順(例えばアクセス要求の発行順)にキュー41a及びメッセージキュー41b(W_addr,W_size,W_data)から情報を読み出しライト処理を実行する。例えば、アクセス制御部44は、キュー格納部41から先頭のエントリ(アクセス要求)を読み出し、ライトフラグが有効(例えばR_FLG(リードフラグ) = 0)である場合、先頭のメッセージキュー41bを読み出す。そして、アクセス制御部44は、メッセージキュー41b内のライトデータサイズ(W_size)分のライトデータを仮想メモリ30のアドレス(W_addr)に転送する。
The
このように、アクセス制御部44は、キュー格納部41の格納順に書き込み要求を読み出し、ライト処理を行なうことで、1つのライト処理が完了しない限り、他のスレッド(Thread)が仮想メモリ30にアクセスできないように排他制御することができる。なお、仮想CPU10や仮想デバイス20から書き込み要求の送信によって呼び出されるWrite関数は、キュー格納部41へ書き込むだけの突き放し型である。従って、読み出し完了(return)を待つRead関数とは異なり、書き込み要求がキュー格納部41にキューイングされても、仮想装置3の性能(動作速度)の低下には影響を与えない。
In this way, the
なお、キュー格納部41から読み出された情報については、例えばキュー格納部41又はアクセス制御部44によりキュー41a及びメッセージキュー41bから削除される。或いは、メッセージキュー41b内のライトアドレスについては、キュー格納部41から読み出されたデータがメッセージキュー41bから自動で削除されるようにしてもよい。
Information read from the
また、キュー格納部41のキュー41aにアクセス要求が格納されていない状態で、リード処理実行中の読み出し要求がある場合、リード処理のアクセス範囲と重なる書き込み要求が入力されると、キュー制御部42により、当該書き込み要求はキュー41aに格納される。この場合においても、この書き込み要求はアクセス制御部44により読み出されライト処理が実行される。しかし、ライト処理の実行の際に、書き込み要求に係るアクセス範囲がリード処理実行中のアクセス範囲にHitした場合は、アクセス制御部44は、リード処理の完了後にライト処理を実行する。
Further, when there is no access request stored in the
さらに、アクセス制御部44は、キュー41aから読み出した要求が読み出し要求である場合、当該読み出し要求に係るリード処理を実行させるため、キュー41aのポインタを読出判定部43に渡す。
Further, when the request read from the
以上のように、キュー制御部42及びアクセス制御部44は、キュー格納部41の格納する1以上の要求(書き込み要求/読み出し要求)を処理順に読み出し所定の処理を実行する実行部の一例であるといえる。具体的には、この実行部は、キュー格納部41から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なると判断した場合、当該読み出し処理が完了するまで当該書き込み要求に対する所定の処理の実行を待機するのである。
As described above, the
このように、キュー制御部42及びアクセス制御部44によれば、リード処理の完了後にキュー格納部41から読み出したライト処理が実行されるため、リード/ライトの排他処理を適切に行なうことができる。従って、仮想メモリ30におけるリード/ライトデータの整合性を保つことができる。
As described above, according to the
アクセス制御部44による処理の詳細及び動作例については、図17,図18を参照しながら後述する。
Details of processing performed by the
〔1−5〕エミュレーションサーバの動作例
次に、上述の如く構成されたエミュレーションサーバ1の動作例を、図11〜図19を参照して説明する。
[1-5] Operation Example of Emulation Server Next, an operation example of the
はじめに、図11及び図12に示すシーケンス図を参照して、エミュレーションサーバ1によるエミュレータ2(仮想装置3)の全体の動作例について説明する。なお、前提として、キュー格納部41にはアクセス要求が存在しない(実行待ちのアクセス要求が無い)場合を想定する。
First, an overall operation example of the emulator 2 (virtual device 3) by the
まず、図11に示すように、仮想デバイス20によるライトアクセスと同じ範囲に対して仮想CPU10がリードアクセスを行なった場合を説明する。
First, as shown in FIG. 11, a case where the
図11に示すように、仮想デバイス20によるWrite関数CALLにより、キュー制御部42が書き込み要求をキュー格納部41(キュー41a及びメッセージキュー41b)に積む(登録する)(処理T1)。次いで、アクセス制御部44(スレッド)は、キュー格納部41のキュー41aからアクセス要求(この場合書き込み要求)を読み出し(処理T2)、R_EXEC等のチェックを行なう。そして、アクセス制御部44は、読み出した書き込み要求と同じ範囲に対するリード処理が実行されていないか否かを判断する。R_EXEC等のチェックがOKであれば(競合するリード処理が無ければ)、アクセス制御部44は、仮想デバイス20のライト処理を実行する(処理T3)。また、キュー制御部42は、仮想デバイス20にキュー41aへの書き込み要求の登録が完了したことを通知する(処理T4)。
As shown in FIG. 11, the
一方、仮想CPU10によるRead関数CALLが発生すると、読出判定部43は、キュー格納部41を確認する(処理T5)。確認の結果、キュー41aにおけるライト処理中の書き込み要求のアクセス範囲がリードアクセスと重なる場合、読出判定部43は、キュー制御部42を介して、読み出し要求をキュー格納部41のライト処理に係るエントリの直後に挿入する(処理T6)。
On the other hand, when the Read function CALL is generated by the
アクセス制御部44では、ライト処理が完了すると(処理T7)、キュー制御部42を介して、キュー41a内のライト処理に係るエントリが削除されて更新され(処理T8)、次のエントリ(アクセス要求)が読み出される(処理T9)。アクセス制御部44は、次のアクセス要求が読み出し要求である(R_FLGが立っている)場合、読出判定部43に読み出したエントリが読み出し要求であることを通知する(処理T10)。なお、アクセス要求が読み出し要求である(R_FLGが立っている)ため、アクセス制御部44は、リード処理の完了を待たずに、キュー制御部42を介してキュー41a内のリード処理に係るエントリを削除して更新し(処理T11)、次のエントリを読み出す。
In the
読出判定部43は、アクセス制御部44から通知された読み出し要求について、EXECフラグをセットし(処理T12)、リード処理を実行する(処理T13)。リード処理が完了すると(処理T14)、読出判定部43は、EXECフラグをクリアし(処理T15)、処理が終了する。
The read
次に、図12に示すように、仮想デバイス20によるリードアクセスと同じ範囲に対して仮想CPU10がライトアクセスを行なった場合を説明する。
Next, as shown in FIG. 12, a case where the
図12に示すように、仮想デバイス20によるRead関数CALLが発生すると、読出判定部43は、キュー格納部41を確認する(処理T21)。確認の結果、キュー41a内にアクセス要求が存在しない(リードアクセスのアクセス範囲と重なるライトアクセスが無い)ため、読出判定部43は、EXECフラグをセットし(処理T22)、リード処理を実行する(処理T23)。
As shown in FIG. 12, when the Read function CALL is generated by the
一方、仮想CPU10によるWrite関数CALLにより、キュー制御部42が書き込み要求のキューをキュー格納部41に積む(登録する)(処理T24)。次いで、アクセス制御部44(スレッド)は、キュー格納部41からキューを読み出し(処理T25)、R_EXEC等のチェックを行ない、読み出したキューと同じ範囲に対するリード処理が実行されていないか否かを判断する。しかし、処理T22において、ライトアクセスと同じ範囲に対するリードアクセスについてR_EXECフラグがセットされているため、R_EXEC等のチェックはNGとなる(競合するリード処理がある)(処理T26)。なお、キュー制御部42は、仮想CPU10にキュー41aへの書き込み要求の登録が完了したことを通知する(処理T27)。
On the other hand, by the write function CALL by the
リード処理が完了すると(処理T28)、読出判定部43は、EXECフラグをクリアする(処理T29)。R_EXECフラグがクリアされたため、アクセス制御部44(スレッド)は、R_EXEC等のチェックを行ない、チェックがOKとなれば(競合するリード処理が無ければ)、仮想CPU10のライト処理を実行する(処理T30)。アクセス制御部44では、ライト処理が完了すると(処理T31)、キュー制御部42を介して、キュー格納部41内のライト処理に係るエントリが削除されて更新され(処理T32)、処理が終了する。
When the read process is completed (process T28), the read
〔1−5−1〕Write関数の動作例
次に、図13に示すフローチャートに従って、Write関数の動作例を説明する。
[1-5-1] Example of Write Function Operation Next, an example of the Write function operation will be described with reference to the flowchart shown in FIG.
仮想CPU10又は仮想デバイス20は、仮想メモリ30に書き込むデータとして、上述したWrite関数を呼び出すためのフォーマットの書き込み要求(メッセージ)を生成し、キュー処理部40へ送信する。キュー処理部40は、受信した書き込み要求に基づき以下に示すWrite関数を実行し(ステップS1)、キュー制御部42によるキュー格納部41へのライトアクセスのQueue登録関数を呼び出す。
The
Write_p = Que登録(W_addr, W_size, *W_data, 0, 0)
但し、Que登録の引数は、左から順にライトアドレス,ライトデータサイズ,ライトデータ,ポインタ,リードフラグ(R_FLG)である。
Write_p = Que registration (W_addr, W_size, * W_data, 0, 0)
However, Que registration arguments are a write address, a write data size, write data, a pointer, and a read flag (R_FLG) in order from the left.
〔1−5−2〕Queue登録関数の動作例
次に、図14に示すフローチャートに従って、Queue登録関数の動作例を説明する。
[1-5-2] Operation Example of Queue Registration Function Next, an operation example of the Queue registration function will be described with reference to the flowchart shown in FIG.
Queue登録関数は、Write関数又はRead関数の実行により、キュー格納部41への書き込み要求又は読み出し要求の追加や挿入の際に、キュー制御部42により実行される。Queue登録関数が起動されると、キュー制御部42は、呼出元から値を入力される(ステップS11)。例えばキュー制御部42は、キュー41a及びメッセージキュー41bに設定される、先頭アドレス,データサイズ,ライトデータ,読み出し要求を挿入するポインタ,及びR/Wフラグの値を取得する。
The queue registration function is executed by the
次いで、キュー制御部42は、登録するアクセス要求がリード/ライトのいずれかを判断するため、R_FLG == 0であるか否かを判断する(ステップS12)。R_FLG == 0である場合、つまり書き込み要求である場合(ステップS12のYesルート)、キュー制御部42は、Global変数であるwp(書き込みポインタ)が示す領域に、書き込み要求の情報を設定してキュー41aに登録する(ステップS13)。具体的には、キュー制御部42は、wpが示すエントリのaddr,size,R_FLGに、それぞれ書き込み要求に係るアドレス,サイズ,R/Wフラグを設定する。
Next, the
また、キュー制御部42は、メッセージキュー41bにライトデータサイズ分のライトデータ(W_data)を格納し(ステップS14)、Next_wpの領域を確保、つまりキュー41aの次の領域を確保する(ステップS15)。キュー制御部42は、Next_wp != 0でなくなるまでステップS15の処理を繰り返し(ステップS16及びステップS16のNoルート)、Next_wpの領域を確保できたら(ステップS16のYesルート)、ステップS17に移行する。
Further, the
ステップS17では、キュー制御部42は、wpが示すエントリのNext_wpに確保したNext_wpを設定し、当該Next_wpが示すエントリのBefore_wpに現在のwpを設定し、現在のwpの値をNext_wpの値に更新する(次のキュー41aに切り替える)。そして、キュー制御部42は、戻りとしてwpを返し、Queue登録関数の処理が終了する。
In step S17, the
一方、ステップS12において、R_FLG == 0ではない場合、つまり読み出し要求である場合(ステップS12のNoルート)、キュー制御部42は、Read_p(読み出しポインタ)の領域を確保、つまり読み出し要求に係る情報を格納(挿入)する領域を確保する(ステップS18)。キュー制御部42は、Read_p != 0でなくなるまでステップS18の処理を繰り返し(ステップS19及びステップS19のNoルート)、Read_pの領域を確保できたら(ステップS19のYesルート)、ステップS20に移行する。
On the other hand, if R_FLG == 0 in step S12, that is, if it is a read request (No route in step S12), the
ステップS20では、キュー制御部42は、Read_pが示す領域に読み出し要求の情報を設定してキュー41aに登録(挿入)するとともに、キュー41aに登録したことによる前後のアクセス要求のNext_wp及びBefore_wpを変更する。具体的には、キュー制御部42は、Read_pが示すエントリのaddr,size,R_FLGに、それぞれ読み出し要求に係るアドレス,サイズ,R/Wフラグを設定する。また、キュー制御部42は、Read_pが示すエントリのNext_wp,Before_wpと、挿入したアクセス要求の前後のエントリNext_wp,Before_wpを変更する(図9及び図10参照)。そして、キュー制御部42は、戻り値としてRead_pを返し、Queue登録関数の処理が終了する。
In step S20, the
〔1−5−3〕Read関数の動作例
次に、図15及び図16に示すフローチャート、並びに図18に示す図に従って、Read関数の動作例を説明する。
[1-5-3] Operation Example of Read Function Next, an operation example of the Read function will be described with reference to the flowcharts illustrated in FIGS. 15 and 16 and the diagram illustrated in FIG.
仮想CPU10又は仮想デバイス20は、仮想メモリ30からデータを読み出す際に、上述したRead関数を呼び出すためのフォーマットの読み出し要求(メッセージ)を生成し、キュー処理部40へ送信する。キュー処理部40は、主に読出判定部43により以下に示すRead関数の処理を実行する。
When the
はじめに、読出判定部43は、読み出し要求から読み出しの先頭アドレス及びデータサイズを取得する(ステップS21)。そして、読出判定部43は、リード処理を要求した仮想CPU10又は仮想デバイス20(Device(Read_Req_DEV))のリード処理を、対応するデバイスのReadExecに登録する(ステップS22,図18の符号43a及びA1の“1”参照)。
First, the read
次いで、読出判定部43は、Global変数であるwp(ライトポインタ)(この場合、キュー41aの最後尾のエントリを示すポインタ)の値をrp(読み出しポインタ)に設定し(ステップS23)、rp != 0であるか否かを判定する(ステップS24)。rp != 0である場合(ステップS24のYesルート)、読出判定部43は、rpが示すエントリについてR_FLG == 1であるか否かを判定する(ステップS25)。R_FLG == 1である場合(リード処理)(ステップS25のYesルート)、読出判定部43は、rpを直前のエントリのポインタに変更し(キュー41aを遡り)(ステップS27)、処理がステップS24に移行する。
Next, the read
一方、R_FLG == 1ではない場合(ライト処理)(ステップS25のNoルート)、読出判定部43は、リード処理のアクセス範囲がライト処理のアクセス範囲と重なるか否かを判定する(ステップS26,図18の符号A1の“2”参照)。アクセス範囲が重ならない場合(ステップS26のNoルート)、処理がステップS27に移行する。一方、アクセス範囲が重なる場合(ステップS26のYesルート)、読出判定部43は、当該リード処理について、キュー制御部42によるキュー格納部41へのリードアクセスのQueue登録関数を呼び出す(ステップS28,図18の符号A2参照)。
On the other hand, when R_FLG == 1 is not satisfied (write process) (No route in step S25), the read
次いで、読出判定部43は、実行するリード処理のポインタを、対応するデバイスのR_EXECに登録する(ステップS29,図18の符号43bの“rp”及びA1の“2.1”参照)。このように、実行するリード処理のポインタを登録することで、読出判定部43は、リード処理がキュー格納部41から読み出され処理が完了したことをアクセス制御部44を介して検出することができる。なお、ReadExec43a及びR_EXEC43bは、それぞれ仮想CPU10及び仮想デバイス20の各デバイスごとに存在する。読出判定部43は、ReadExec43a及びR_EXEC43bをCPU1aのキャッシュメモリや仮想メモリ30等の記憶領域の一部に記憶することができる。
Next, the read
そして、読出判定部43は、アクセス制御部44によるキュー41aからの読み出し待ちを行なう(ステップS30及びステップS30のYesルート)。リード処理のアクセス要求が読み出されると(ステップS30のNoルート)、処理が図16のステップS31に移行する。
Then, the read
図16のステップS31では、読出判定部43は、読み出し要求を発行したデバイスに対応するR_EXEC43bに対して、リード処理実行中であることを示すEXECフラグを設定する(図18の符号43bの“EXEC”,A1の“2.1”,及びA3参照)。そして、読出判定部43は、R_EXEC内のリード処理のポインタをクリア(例えば“0”を設定)し(ステップS32)、リード処理を実行する(ステップS33,図18の符号A4参照)。なお、リード処理は、例えばmemcpyコマンドにより実行し、戻り値としてリードデータをデバイスに返すことができる。
In step S31 of FIG. 16, the read
最後に、読出判定部43は、ReadExec43a及びR_EXEC43bをそれぞれリセット(例えば“0”を設定)し(ステップS34及びS35,図18の符号A1の“3”及びA5参照)、処理を終了する。なお、図15のステップS24において、rp != 0ではない場合、つまりキュー格納部41の先頭のエントリまで検索を行なった場合(ステップS24のNoルート)、読出判定部43は、リード処理とアクセス範囲が重なるライト処理は無いと判定する。そして、処理が図16のステップS31に移行する(図18の符号A1の“2.2”参照)。
Finally, the read
〔1−5−4〕アクセス処理(スレッド)の動作例
次に、図17に示すフローチャート及び図18に示す図に従って、アクセス処理(スレッド)の動作例を説明する。
[1-5-4] Operation Example of Access Process (Thread) Next, an operation example of the access process (thread) will be described with reference to the flowchart shown in FIG. 17 and the diagram shown in FIG.
アクセス制御部44は、キュー格納部41(キュー41a)から格納順にアクセス要求を読み出し、読み出したアクセス要求に対して所定の処理を実行する。
The
はじめに、アクセス制御部44は、Global変数であるquerp(キュー41aからの読み出しポインタ)が示すアクセス要求のアドレス,サイズ及びR/Wフラグを変数に登録する(ステップS41,図18の符号B1参照)。そして、アクセス制御部44は、アクセス要求の中身が空であるか否かを判定し(ステップS42)、空である場合(ステップS42のYesルート)、処理がステップS41に移行する。一方、空ではない場合(ステップS42のNoルート)、アクセス制御部44は、アクセス要求の中身がリード処理であるか否かをR_FLGを参照して判定する(ステップS43)。
First, the
一方、リード処理ではない(ライト処理である)場合(ステップS43のNoルート)、処理がステップS44に移行する。ステップS44〜48では、アクセス制御部44は、ライト処理を行なう前に、読出判定部43に対して、ライト処理のアクセス範囲と重なるリード処理が実行されているか否かを判定させる(図18の符号B2参照)。
On the other hand, when it is not a read process (a write process) (No route of step S43), the process proceeds to step S44. In steps S44 to S48, the
一例として、読出判定部43は、リード処理登録(ReadExec)しているリード処理が実行中(R_EXEC == 1)か否かを判定することができる。そして、読出判定部43は、実行中である登録情報(例えば対応するReadExec43a)と、アクセス制御部44から取得するライト処理に関する情報とを比較し、ライト処理を待機させるか否かを判定する。
As an example, the read
例えば、読出判定部43は、ステップS44において、R_EXEC43bを確認するデバイスを仮想CPU10として、仮想CPU10のEXECフラグが有効(例えば“1”)であるか否かを判定する(ステップS45)。
For example, in step S44, the read
EXECフラグが有効である場合(ステップS45のYesルート)、読出判定部43は、Read関数の処理と同様の手法で、ライト処理のアクセス範囲がリード処理のアクセス範囲と重なるか否かを判定する(ステップS46,図18の符号A1の“2”参照)。アクセス範囲が重ならない場合(ステップS46のNoルート)、又は、ステップS45でEXECフラグが無効である場合(ステップS45のNoルート)、読出判定部43は、仮想CPU10を他の仮想デバイス20に変更する(ステップ47)。そして、読出判定部43は、全てのデバイスについて判定を行なうまで処理を繰り返す(ステップS48及びステップS48のNoルート)。
When the EXEC flag is valid (Yes route in step S45), the read
なお、ステップS46においてアクセス範囲が重なる場合(ステップS46のYesルート)、EXECフラグが有効である間(リード処理中)の処理は、ステップS45のYesルート〜ステップS46のYesルートのループに入る。これにより、読出判定部43は、ライト処理を待機させることができる。
If the access ranges overlap in step S46 (Yes route in step S46), the processing while the EXEC flag is valid (during the read process) enters the loop from the Yes route in step S45 to the Yes route in step S46. Thereby, the read
全てのデバイスについて判定を行なうと(ステップS48のYesルート)、処理が読出判定部43からアクセス制御部44に戻され、アクセス制御部44は、ライト処理を実行する(ステップS49,図18の符号B3参照)。例えばアクセス制御部44は、memcpyコマンドを用いて、メッセージキュー41b(バッファ)からライトサイズ分のライトデータを読み出して、仮想メモリ30へコピーすることができる。
If all the devices have been determined (Yes route in step S48), the process is returned from the read
次いで、アクセス制御部44は、キュー制御部42に対して、ライト処理が完了したアクセス要求の削除を指示し、キュー制御部42は、当該アクセス要求をキュー格納部41から削除する(ステップS50,図8,図18の符号B4参照)。なお、ステップS43において、アクセス要求の中身がリード処理である場合(ステップS43のYesルート)、処理がステップS50に移行する。この場合、アクセス制御部44は、リード処理に係るキュー41aのポインタを読出判定部43に通知し、キュー制御部42に対して、リード処理に係るアクセス要求の削除を指示する。
Next, the
次に、アクセス制御部44は、ステップS50でQuerpがNext_wpに更新され、Que_WPも更新されたため、新たにアクセス要求を取得する。このとき、スレッドの切り替わりが遅い場合があり得るため、アクセス制御部44は、読み出したアクセス要求のデータがリードであるならば、リード実行中を示すEXECフラグをセットする(ステップS51,S51のYesルート及びS52)。そして、ステップS52の処理が完了した場合、又は、読み出したアクセス要求のデータがライトである場合(ステップS51のNoルート)、処理がステップS41に移行する。
Next, the
〔1−5−5〕EXECフラグ設定処理の動作例
次に、図19に示すフローチャートに従って、EXECフラグ設定処理の動作例を説明する。
[1-5-5] Example of EXEC Flag Setting Process Next, an example of the EXEC flag setting process will be described with reference to the flowchart shown in FIG.
図17のステップS52において、アクセス制御部44によりEXECフラグ設定処理が実行されると、読出判定部43が起動される。読出判定部43は、R_EXEC43bを確認するデバイスを仮想CPU10として(ステップS61)、仮想CPU10のrpがQue_WPと一致し、且つ“0”ではないか否かを判定する(ステップS62)。条件を満たさない場合(ステップS62のNoルート)、読出判定部43は、仮想CPU10を他の仮想デバイス20に変更し(ステップ63)、全てのデバイスについて判定を行なうまで処理を繰り返す(ステップS64及びステップS64のNoルート)。全てのデバイスについて判定を行なうと、処理が終了する。
In step S52 of FIG. 17, when the EXEC flag setting process is executed by the
一方、ステップS62において、条件を満たす場合(ステップS62のYesルート)、読出判定部43は、EXECフラグが有効か否かを判定し(ステップS65)、有効である場合(ステップS65のYesルート)、処理が終了する。また、EXECフラグが無効である場合には(ステップS65のNoルート)、読出判定部43は、当該EXECフラグを有効にし(ステップS66)、処理が終了する。
On the other hand, if the condition is satisfied in step S62 (Yes route in step S62), the read
なお、上述したEXECフラグの設定処理は、アクセス制御部44が行なってもよい。
The above-described EXEC flag setting process may be performed by the
〔1−6〕本実施形態の効果
本実施形態に係るエミュレーションサーバ1によれば、ハードウェアと同等の調停機能(アービタ)を設けた図2に示す仮想装置200よりも、仮想装置3の性能(処理速度)の悪化を抑えることができる。
[1-6] Effects of this Embodiment According to the
ここで、アービタはバス調停を行なう回路であるため、仮想CPUや仮想デバイスのいずれかのデバイスが仮想メモリへアクセスする間は、他のデバイスは仮想メモリにアクセスできず、処理が待たされる(応答速度が低下する)。ハードウェアでの調停は、1つのデバイス(CPUを含む)がバスを使用していた場合、他のデバイスはバスを使用できないように調停が行なわれる。 Here, since the arbiter is a circuit that performs bus arbitration, while either the virtual CPU or the virtual device accesses the virtual memory, the other device cannot access the virtual memory, and the process is waited for (response) Speed decreases). In the arbitration by hardware, when one device (including the CPU) uses the bus, arbitration is performed so that other devices cannot use the bus.
しかし、ソフトウェアでは、複数のプロセス(スレッド)が仮想メモリにアクセス可能である。このため、ハードウェアをソフトウェアで実現(再現)するエミュレータには、ハードウェアのような排他処理をさせることが、エミュレータによる対象装置1000の再現性の観点から好ましい。この場合、図2を用いて説明したように、仮想装置の速度低下が著しい。
However, in software, a plurality of processes (threads) can access the virtual memory. For this reason, it is preferable from the viewpoint of reproducibility of the
これに対し、本実施形態に係るエミュレーションサーバ1によれば、各仮想処理部のメモリ調停(排他処理)を最小限に留め、単純化することができるため、速度低下を抑制でき、高速にエミュレートを行なうことができる。従って、対象装置1000を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することができる。また、仮想メモリ30へのアクセスの排他性が保たれるため、仮想CPU10及び仮想デバイス20のマルチスレッド化を容易に行なうことができる。
On the other hand, according to the
さらに、エミュレーションサーバ1は、仮想装置3に書き込み要求を処理順に格納するキュー格納部41をそなえるため、仮想メモリ30へのアクセスの順序性が保証される。従って、仮想CPU10の部分についてもメモリバリアを実装することができる。
Furthermore, since the
さらに、仮想CPU10及び仮想デバイス20による仮想メモリ30へのアクセスの順序性が一定になるため、DMA(Direct Memory Access)等に起因する、メモリのデータ破壊等のバグの発見を容易にすることができる。
Furthermore, since the order of access to the
〔1−7〕適用例
上述のように、エミュレーションサーバ1は、1以上の仮想CPU10及び複数の仮想デバイス20が仮想メモリ30の同一のメモリ空間をアクセスする際の排他制御を実現することができる。このような排他制御は、例えば仮想デバイス20が仮想メモリ30を用いて仮想CPU10に割り込みを発生させる割り込み処理に用いて好適である。
[1-7] Application Example As described above, the
以下、図20に示す仮想装置300及び図21に示す仮想装置6を参照しながら、本実施形態に係るエミュレーションサーバ1の適用例について説明する。なお、仮想装置300は図1に示す仮想装置100と基本的に同様な構成であるものとし、仮想装置6は図5及び図6等に示す仮想装置3と基本的に同様な構成であるものとする。
Hereinafter, application examples of the
図20において、符号(1)〜(6)は以下の処理である。
(1) 仮想デバイス120−1から仮想メモリ130へのライト処理
(2) 仮想デバイス120−1が仮想メモリ130からのリード処理
(3) 仮想デバイス120−2から仮想メモリ130へのライト処理
(4) 仮想デバイス120−2が仮想メモリ130からのリード処理
(5) 仮想CPU110から仮想メモリ130へのライト処理
(6) 仮想CPU110が仮想メモリ130からのリード処理
In FIG. 20, reference numerals (1) to (6) are the following processes.
(1) Write process from virtual device 120-1 to virtual memory 130 (2) Virtual device 120-1 read process from virtual memory 130 (3) Write process from virtual device 120-2 to virtual memory 130 (4 ) The virtual device 120-2 reads from the virtual memory 130 (5) The
以下、仮想装置300が、(※1)〜(※4)の処理を行なうものとして説明する。
(※1) 仮想デバイス120−1が仮想メモリ130の“0x0F80”に“0x100 Byte”のデータを書き込むライト処理を行なう。
(※2) 仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のデータを読み出すリード処理を行なう。
(※3) 仮想デバイス120−1が仮想メモリ130の“0x1080”に“0x100 Byte”のデータを書き込むライト処理を行なう。
(※4) 仮想CPU110が仮想デバイス120−1によるデータ書き込みの完了を確認し処理する。
In the following description, it is assumed that the
(* 1) The virtual device 120-1 performs a write process of writing “0x100 Byte” data to “0x0F80” of the
(* 2) The virtual device 120-2 performs a read process of reading data “0x200 Byte” from “0x2000” of the
(* 3) The virtual device 120-1 performs a write process of writing “0x100 Byte” data to “0x1080” of the
(* 4) The
(※4)の処理のように、仮想CPU110が仮想デバイス120−1による書き込みの完了を待つ場合、仮想CPU110は、仮想デバイス120−1からの書き込み完了の割り込みを待つ。そして、仮想CPU110は、その割り込みにより割り込みハンドラに実行が移り、書き込みの完了を認識することが考えられる。
When the
しかし、仮想デバイス120−1は(※1)及び(※3)の処理を行なうため、例えば(※1)の処理に係る割り込みハンドラ処理中に、(※3)の処理が完了する場合がある。この場合、仮想CPU110の(※1)に係る割り込み処理完了直後に(※3)に係る割り込みが発生し、再度割り込みハンドラに処理が移るということも起こり得るため、効率が悪い。
However, since the virtual device 120-1 performs the processes (* 1) and (* 3), for example, the process (* 3) may be completed during the interrupt handler process related to the process (* 1). . In this case, since the interrupt according to (* 3) may occur immediately after the completion of the interrupt process according to (* 1) of the
近年のシステムでは、仮想デバイスが仮想CPUへの割り込みを発生させる前にメモリ空間に割り込み情報を書き込み、割り込み通知としてMSI(Message Signaled Interrupt)やMSI−X(MSI-eXtended)を用いるといった手法が知られている。なお、割り込み情報としては、エラーStatusやデータ転送アドレス(Scatgather等のテーブルを用いた転送等があり得るため)等が挙げられる。 In recent systems, a technique is known in which interrupt information is written into a memory space before a virtual device generates an interrupt to a virtual CPU, and MSI (Message Signaled Interrupt) or MSI-X (MSI-eXtended) is used as an interrupt notification. It has been. The interrupt information includes an error status, a data transfer address (because transfer using a table such as Scatchather is possible), and the like.
この手法では、メモリ空間に割り込み情報を書き込むため、仮想CPUは、一回の割り込みハンドラ処理の際に、或る領域にデータが書かれていたら処理が完了していると判断することで、極力、割り込み処理によるオーバヘッドを減らしている。実際のハードウェアでは、この割り込み情報のメモリ空間への書き込み中にCPUが当該データを読み出すことは、排他制御により抑止されるが、既述のように、ソフトウェアエミュレータでは可能となってしまう。 In this method, since the interrupt information is written in the memory space, the virtual CPU determines that the processing is completed if data is written in a certain area at the time of one interrupt handler process. The overhead due to interrupt processing is reduced. In actual hardware, while the interrupt information is being written into the memory space, the CPU does not allow the data to be read by the exclusive control, but as described above, it is possible in the software emulator.
例として、一回の割り込みごとに仮想デバイス120−1が割り込み情報として“8 Byte”のデータをメモリ空間Aに書き込むこととする(図20参照)。メモリ空間Aは仮想デバイス120−1に書き込み可能なメモリとして登録されており、割り込み発生ごとにメモリ空間Aにデータを書き込んだ後、Aは“8 Byte”ずつ増加するものとする。また、メモリ空間Aへのライトデータは、先頭の“2 Byte”が何の割り込みかを示す情報,次の“2 Byte”がエラー等のStatus情報,最後の“4 Byte”がデータの格納先アドレスであるとする。 As an example, assume that the virtual device 120-1 writes “8 Byte” data in the memory space A as interrupt information for each interrupt (see FIG. 20). The memory space A is registered as a writable memory in the virtual device 120-1, and A is increased by “8 Bytes” after data is written to the memory space A every time an interrupt occurs. The write data to the memory space A is the information indicating what interrupt the first “2 Byte” is, the next “2 Byte” is the status information such as an error, and the last “4 Byte” is the data storage destination Assume that it is an address.
通常の処理では、仮想装置300は例えば以下の手順で動作する。
In normal processing, the
・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x0F80”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。
In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x0F80” of the
・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。そして、仮想CPU110は、問題がないことを確認し処理を継続(return)する。
The
・(4)の経路にて、仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のリード処理を行なう。
In the path (4), the virtual device 120-2 performs a read process from “0x2000” to “0x200 Byte” of the
・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x1080”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。
In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x1080” of the
・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。そして、仮想CPU110は、問題がないことを確認し処理を継続(return)する。
The
上述した手順を、一回の割り込みで複数の割り込み処理を実行するような割り込みハンドラの動作で説明すると、以下のようになる。 The above-described procedure is described as the operation of an interrupt handler that executes a plurality of interrupt processes with a single interrupt as follows.
・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x0F80”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。
In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x0F80” of the
・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。
The
また、仮想CPU110は、更新前の空間(A+8)のデータを読み出し、データが書かれているか否かを確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+12)で示されるアドレスのデータを確認する。そして、仮想CPU110は、更新前の空間(A+16)のデータを読み、データが書かれているか確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+20)で示されるアドレスのデータを確認する。以降、仮想CPU110は、空間(A+x(xは4の倍数))にデータ書かれている場合、同様に処理を進める。
In addition, the
・(4)の経路にて、仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のリード処理を行なう。
In the path (4), the virtual device 120-2 performs a read process from “0x2000” to “0x200 Byte” of the
・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x1080”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。
In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x1080” of the
・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。
The
また、仮想CPU110は、更新前の空間(A+8)のデータを読み出し、データが書かれているか否かを確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+12)で示されるアドレスのデータを確認する。そして、仮想CPU110は、更新前の空間(A+16)のデータを読み、データが書かれているか確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+20)で示されるアドレスのデータを確認する。以降、仮想CPU110は、空間(A+x(xは4の倍数))にデータ書かれている場合、同様に処理を進める。
In addition, the
このように、(※1)の処理が完了後、割り込みハンドラに処理が移る前に(※2),(※3)の処理が実行されると、(※1)の処理の割り込みで(※3)の割り込み処理も行なわれてしまう。 In this way, if the processing of (* 2) and (* 3) is executed after the processing of (* 1) is completed and before the processing moves to the interrupt handler, The interrupt process 3) is also performed.
ソフトエミュレータでは、各仮想デバイス120が別スレッド(プロセス)で動作している。従って、(※1),(※2),(※3)と処理を進めていく際に、(※3)でA+0〜A+7まで書き込めずに、A+0,A+1辺りまで書き込んだところで仮想デバイス120−1が別のスレッド(例えば仮想デバイス120−2)に切り替わることが起こり得る。
In the software emulator, each
こうなった場合、仮想CPU110のスレッドの順番の際に、割り込みハンドラで処理する(※3)のアドレスが違うエリアのアドレスを示すことになり、誤動作が発生することになる。
In this case, in the order of the threads of the
これに対し、本実施形態の適用例に係る仮想装置6は、例えば以下の手順で動作する。
On the other hand, the
・(1)の経路にて、仮想デバイス20−1が仮想メモリ30の“0x0F80”に“0x100 Byte”のライト処理を行なうため、キュー処理部40にライトアドレス,サイズ,及びサイズ分のライトデータを書き込む(キュー格納部41に格納する)。
In the path (1), the virtual device 20-1 performs write processing of “0x100 Byte” on “0x0F80” of the
書き込みが完了すると、仮想デバイス20は、メモリ空間Aに対し、“8 Byte”のデータを書くため、キュー処理部40にメモリ空間Aのアドレス(A),サイズ(8 Byte),及びデータ(8 Byte分)を書きこむ(キュー格納部41に格納する)。そして、仮想デバイス20は、仮想CPU10に対して割り込みを発生させ、次のライトアドレスとして“A=A+8”を実施する。
When the writing is completed, the
・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出すため、キュー処理部40にリードアドレス(A+0),サイズ(1 Byte),及び仮想CPU10のリードデータを格納するポインタを指示し、アクセスする。
The
その際、キュー処理部40では、仮想メモリ30にアクセスするアドレス(リードアドレス)とキュー格納部41に積まれているアドレス(ライトアドレス)からアクセス範囲が重なっていないかを確認する。重なっている場合、キュー処理部40では、リード処理がキュー格納部41に積まれ、仮想CPU10はリードの応答を待たされ、次の処理に進めなくなる。この場合、メモリ空間Aの書き込みと読み出しとが重なっている。
At this time, the
キュー処理部40からリード処理が読み出されると、仮想CPU10は、仮想メモリ30のメモリ空間Aからリードを行なう。そして、仮想CPU10は、次の処理としての更新前の空間(A+4)で示されるアドレスのデータを確認するため、キュー処理部40にアドレス(A+4),サイズ(4 Byte),仮想CPU10のリードデータを格納するポインタを指示し、アクセスする。その際、仮想CPU10は、同様にキュー格納部41に積まれていないかを確認し処理を進める。このような処理手法により、仮想装置6では、仮想CPU10等により仮想メモリ30から中途半端なデータが読み出されることを抑止し、誤動作を防止することができる。
When the read process is read from the
・(4)の経路にて、仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のリード処理を行なため、キュー処理部40にアドレス(0x2000),サイズ(0x200),及び仮想デバイス20−2がデータを格納するポインタを指示しアクセスする。キュー処理部40では、仮想メモリ30に対しアクセスするアドレス(リードアドレス)及びキュー格納部41に積まれているアドレス(ライトアドレス)からアクセス範囲が重なっていないかを確認する。重なっている場合は、キュー格納部41に仮想デバイス20−2のリード処理が積まれリードの応答を待たされ、次の処理には進めなくなる。この場合、重なっていないため処理が進む。
In the path (4), the virtual device 120-2 performs read processing from “0x2000” to “0x200 Byte” of the
その際、キュー処理部40での処理が仮想CPU10の処理を追い越す場合があるが、重なっていないエリアの状況であるため、特に問題は生じない。むしろ、キュー処理部40では、このような追い越しが発生することで、仮想装置6の全体的な速度低下を防止することができるのである。なお、以降の処理は、同様に進むため割愛する。
At this time, the processing in the
以上のように、本実施形態の適用例においても、一実施形態と同様の効果を奏することができるほか、仮想CPU10及び仮想デバイス20の各々が別スレッドで動作するような場合において、仮想装置6全体の性能低下を抑止することができる。
As described above, in the application example of this embodiment, the same effect as that of the embodiment can be obtained, and in the case where each of the
〔2〕その他
以上、本発明の好ましい実施形態について詳述したが、本発明は、係る特定の実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲内において、種々の変形、変更して実施することができる。
[2] Others While the preferred embodiments of the present invention have been described in detail above, the present invention is not limited to such specific embodiments, and various modifications and changes can be made without departing from the spirit of the present invention. It can be changed and implemented.
例えば、仮想装置3及び6において、キュー制御部42,読出判定部43,及びアクセス制御部44の機能は、任意の組み合わせで併合してもよく、分割してもよい。
For example, in the
〔3〕付記
以上の実施形態に関し、更に以下の付記を開示する。
[3] Supplementary Notes Regarding the above embodiment, the following supplementary notes are further disclosed.
(付記1)
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置であって、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納する格納部と、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、重ならない場合、前記読み出し要求に係る読み出し処理を実行する読出制御部と、をそなえる
ことを特徴とする、情報処理装置。
(Appendix 1)
An information processing apparatus that reproduces a target device having a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
A storage unit for storing a write request to the virtual storage unit corresponding to the target storage unit issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units in the processing order;
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit, An information processing apparatus comprising: a read control unit that executes a read process related to the read request when they do not overlap.
(付記2)
前記読出制御部は、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記1記載の情報処理装置。
(Appendix 2)
The read control unit stores the read request in the storage unit when it is determined that an access range related to the read request overlaps an access range related to one or more write requests stored in the storage unit. The information processing apparatus according to
(付記3)
前記読出制御部は、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記2記載の情報処理装置。
(Appendix 3)
When the read control unit determines that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read requests overlaps the read request and the access range The information processing apparatus according to
(付記4)
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行する実行部をさらにそなえ、
前記実行部は、前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なると判断した場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
ことを特徴とする、付記1〜3のいずれか1項記載の情報処理装置。
(Appendix 4)
It further includes an execution unit that reads one or more requests stored in the storage unit in a processing order and executes a predetermined process,
If the execution unit determines that the access range related to the write request read from the storage unit overlaps the access range related to the read request during the read process, the execution unit reads from the storage unit until the read process is completed 4. The information processing apparatus according to any one of
(付記5)
前記読出制御部は、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、付記1〜4のいずれか1項記載の情報処理装置。
(Appendix 5)
The read control unit searches for one or more write requests stored in the storage unit in an order reverse to the processing order, and determines whether or not the access range of the read request overlaps. The information processing apparatus according to any one of
(付記6)
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現するコンピュータに、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
処理を実行させることを特徴とする、エミュレーションプログラム。
(Appendix 6)
A computer that reproduces a target device that includes a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation program characterized by causing a process of executing a read process related to the read request to be executed when there is no overlap as a result of the determination.
(付記7)
前記コンピュータに、
読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
処理を実行させることを特徴とする、付記6記載のエミュレーションプログラム。
(Appendix 7)
In the computer,
Note that when it is determined that an access range related to a read request overlaps an access range related to one or more write requests stored in the storage unit, a process of storing the read request in the storage unit is executed. 6. The emulation program according to 6.
(付記8)
前記読み出し要求を格納する処理において、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記7記載のエミュレーションプログラム。
(Appendix 8)
In the process of storing the read request, when it is determined that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read request is the read request and the access The emulation program according to
(付記9)
前記コンピュータに、
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行し、
前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なるか否かを判断し、
判断の結果、重なる場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
処理をさらに実行させることを特徴とする、付記6〜8のいずれか1項記載のエミュレーションプログラム。
(Appendix 9)
In the computer,
One or more requests stored in the storage unit are read in the order of processing, and predetermined processing is executed.
Determining whether the access range related to the write request read from the storage unit overlaps the access range related to the read request during the execution of the read process;
If the result of the determination is that there is an overlap, any one of
(付記10)
前記判定する処理において、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、付記6〜9のいずれか1項記載のエミュレーションプログラム。
(Appendix 10)
In the determination process, the one or more write requests stored in the storage unit are searched in an order reverse to the processing order, and it is determined whether or not the access range of the read request overlaps. The emulation program according to any one of
(付記11)
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置におけるエミュレーション方法であって、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
ことを特徴とする、エミュレーション方法。
(Appendix 11)
An emulation method in an information processing apparatus for reproducing a target device having a target storage unit and a plurality of target processing units sharing a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation method, wherein if the result of determination is that there is no overlap, a read process related to the read request is executed.
(付記12)
読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記11記載のエミュレーション方法。
(Appendix 12)
The emulation according to appendix 11, wherein the read request is stored in the storage unit when it is determined that the access range related to the read request overlaps with an access range related to one or more write requests stored in the storage unit Method.
(付記13)
前記読み出し要求を格納する処理において、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記12記載のエミュレーション方法。
(Appendix 13)
In the process of storing the read request, when it is determined that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read request is the read request and the
(付記14)
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行し、
前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なるか否かを判断し、
判断の結果、重なる場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
ことを特徴とする、付記11〜13のいずれか1項記載のエミュレーション方法。
(Appendix 14)
One or more requests stored in the storage unit are read in the order of processing, and predetermined processing is executed.
Determining whether the access range related to the write request read from the storage unit overlaps the access range related to the read request during the execution of the read process;
14. The emulation method according to any one of appendices 11 to 13, wherein when the determination results in overlapping, the execution of a predetermined process for the write request read from the storage unit is waited until the read process is completed. .
(付記15)
前記判定する処理において、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、付記11〜14のいずれか1項記載のエミュレーション方法。
(Appendix 15)
In the determination process, the one or more write requests stored in the storage unit are searched in an order reverse to the processing order, and it is determined whether or not the access range of the read request overlaps. The emulation method according to any one of appendices 11 to 14.
1 エミュレーションサーバ(情報処理装置)
1a,1100 CPU
1b,1300 メモリ
1c 記憶部
1d インタフェース部
1e 入出力部
1f,1h 記録媒体
1g 読取部
2 エミュレータ
3,6,100,200,300 仮想装置
4 エミュレーション領域
5 エミュレーションプログラム
10,110 仮想CPU
20,20−1〜20−3,120,120−1〜120−3 仮想デバイス
30,130 仮想メモリ
40 キュー処理部
41 キュー格納部(格納部)
41a キュー
41b メッセージキュー
42 キュー制御部
43 読出判定部
44 アクセス制御部
140 アービタ
150 セレクタ
1000 対象装置(装置)
1200−1〜1200−3 デバイス
1400 内部バス
1 Emulation server (information processing device)
1a, 1100 CPU
1b, 1300
20, 20-1 to 20-3, 120, 120-1 to 120-3
1200-1 to 1200-3 device 1400 internal bus
Claims (7)
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納する格納部と、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、重ならない場合、前記読み出し要求に係る読み出し処理を実行する読出制御部と、をそなえる
ことを特徴とする、情報処理装置。 An information processing apparatus that reproduces a target device having a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
A storage unit for storing a write request to the virtual storage unit corresponding to the target storage unit issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units in the processing order;
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit, An information processing apparatus comprising: a read control unit that executes a read process related to the read request when they do not overlap.
ことを特徴とする、請求項1記載の情報処理装置。 The read control unit stores the read request in the storage unit when it is determined that an access range related to the read request overlaps an access range related to one or more write requests stored in the storage unit. The information processing apparatus according to claim 1.
ことを特徴とする、請求項2記載の情報処理装置。 When the read control unit determines that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read requests overlaps the read request and the access range The information processing apparatus according to claim 2, wherein the read request is stored in the storage unit immediately after the write request.
前記実行部は、前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なると判断した場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
ことを特徴とする、請求項1〜3のいずれか1項記載の情報処理装置。 It further includes an execution unit that reads one or more requests stored in the storage unit in a processing order and executes a predetermined process,
If the execution unit determines that the access range related to the write request read from the storage unit overlaps the access range related to the read request during the read process, the execution unit reads from the storage unit until the read process is completed The information processing apparatus according to claim 1, wherein the information processing apparatus waits for execution of a predetermined process for a write request.
ことを特徴とする、請求項1〜4のいずれか1項記載の情報処理装置。 The read control unit searches for one or more write requests stored in the storage unit in an order reverse to the processing order, and determines whether or not the access range of the read request overlaps. The information processing apparatus according to any one of claims 1 to 4.
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
処理を実行させることを特徴とする、エミュレーションプログラム。 A computer that reproduces a target device that includes a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation program characterized by causing a process of executing a read process related to the read request to be executed when there is no overlap as a result of the determination.
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
ことを特徴とする、エミュレーション方法。 An emulation method in an information processing apparatus for reproducing a target device having a target storage unit and a plurality of target processing units sharing a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation method, wherein if the result of determination is that there is no overlap, a read process related to the read request is executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014096206A JP2015215641A (en) | 2014-05-07 | 2014-05-07 | Information processor, emulation program and emulation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014096206A JP2015215641A (en) | 2014-05-07 | 2014-05-07 | Information processor, emulation program and emulation method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015215641A true JP2015215641A (en) | 2015-12-03 |
Family
ID=54752511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014096206A Pending JP2015215641A (en) | 2014-05-07 | 2014-05-07 | Information processor, emulation program and emulation method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015215641A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110851243A (en) * | 2019-11-05 | 2020-02-28 | 东软集团股份有限公司 | Flow access control method and device, storage medium and electronic equipment |
-
2014
- 2014-05-07 JP JP2014096206A patent/JP2015215641A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110851243A (en) * | 2019-11-05 | 2020-02-28 | 东软集团股份有限公司 | Flow access control method and device, storage medium and electronic equipment |
CN110851243B (en) * | 2019-11-05 | 2022-04-12 | 东软集团股份有限公司 | Flow access control method and device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10909012B2 (en) | System having persistent memory | |
JP4928100B2 (en) | Controller apparatus and method for improved data transfer | |
US10282192B1 (en) | Updating device code through a bus | |
CN100592271C (en) | Apparatus and method for high performance volatile disk drive memory access using an integrated DMA engine | |
JP5658197B2 (en) | Computer system, virtualization mechanism, and computer system control method | |
WO2013170731A1 (en) | Method for writing data into storage device and storage device | |
KR101183779B1 (en) | Chipset support for binding and migrating hardware devices among heterogeneous processing units | |
CN109977037B (en) | DMA data transmission method and system | |
US10459662B1 (en) | Write failure handling for a memory controller to non-volatile memory | |
TW202225976A (en) | Apparatus for virtualized registers and method and computer program product for accessing to the apparatus | |
Markussen et al. | Smartio: Zero-overhead device sharing through pcie networking | |
TWI603199B (en) | Capability based device driver framework | |
WO2022042127A1 (en) | Coroutine switching method and apparatus, and device | |
US10831684B1 (en) | Kernal driver extension system and method | |
JP2006268753A (en) | Dma circuit and computer system | |
WO2019223445A1 (en) | Hard disk read-write control method and apparatus, electronic device and storage medium | |
JP2015215641A (en) | Information processor, emulation program and emulation method | |
US10909044B2 (en) | Access control device, access control method, and recording medium containing access control program | |
JP2005258509A (en) | Storage device | |
US20100312543A1 (en) | Computer system for executing emulator emulating random access storage medium on virtual sequential access storage medium | |
JP2018520398A (en) | Improved transmission of multimedia streams | |
JP6206524B2 (en) | Data transfer device, data transfer method, and program | |
US20110191638A1 (en) | Parallel computer system and method for controlling parallel computer system | |
JP2009181373A (en) | Method of storing/reproducing network reception history, and information processor | |
JP2008097358A (en) | Distributed processing system |