JP2009157731A - Virtual computer system and control method of virtual computer system - Google Patents
Virtual computer system and control method of virtual computer system Download PDFInfo
- Publication number
- JP2009157731A JP2009157731A JP2007336441A JP2007336441A JP2009157731A JP 2009157731 A JP2009157731 A JP 2009157731A JP 2007336441 A JP2007336441 A JP 2007336441A JP 2007336441 A JP2007336441 A JP 2007336441A JP 2009157731 A JP2009157731 A JP 2009157731A
- Authority
- JP
- Japan
- Prior art keywords
- network device
- virtual
- network
- register
- start pointer
- 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.)
- Withdrawn
Links
Images
Landscapes
- Multi Processors (AREA)
Abstract
Description
本発明は、複数のオペレーティングシステムから同一の周辺機器を制御可能とする仮想計算機システムおよび仮想計算機システムの制御方法に関する。 The present invention relates to a virtual computer system and a control method for the virtual computer system that can control the same peripheral device from a plurality of operating systems.
一般に、複数のオペレーティングシステム(以下、単に「OS」と呼称する。)が動作する仮想計算機システムでは、同一の周辺機器に対して複数のOSが同時にアクセスしないように設計されている。つまり、どちらか一方のOSが常時占有して使用するか、または各OSが時分割で排他的に使用して周辺機器を共有するかのどちらかが一般的である。 In general, a virtual machine system in which a plurality of operating systems (hereinafter simply referred to as “OS”) operates is designed so that a plurality of OSs do not access the same peripheral device at the same time. In other words, either one of the OSs is always occupied and used, or each OS is used exclusively in a time division manner to share the peripheral device.
後者の例としては、例えば、特開平7−225694号公報に開示された技術が知られている。この技術では、仮想計算機モニタ上で、各OSが周辺機器にアクセスすることを監視し、現在の周辺機器の使用状態を格納する管理テーブルを用いて、時分割で排他的にアクセスさせることで、複数のOSによる周辺機器の共有を可能としている。また、仮想計算機システムの例として、VMWARE(登録商標)が挙げられ、複数のOSによる周辺機器の共有を可能としている。 As an example of the latter, for example, a technique disclosed in JP-A-7-225694 is known. In this technology, on the virtual machine monitor, each OS is monitored to access the peripheral device, and the management table storing the current usage status of the peripheral device is used to allow exclusive access in a time division manner. Peripheral devices can be shared by multiple OSs. An example of a virtual machine system is VMWARE (registered trademark), which allows a plurality of OSs to share peripheral devices.
図5は、従来のシステム構成の一例を示すブロック図である。このシステムは、OS40、OS40のデバイスドライバ、およびネットワークデバイス42から構成されている。デバイスドライバ40は、バッファ41a、割込み管理部41b、およびポインタ管理部41cから構成されている。また、ネットワークデバイス42は、レジスタ42a、割込み管理部42bおよび送受信バッファ42cから構成されている。この送受信バッファ42cは、メモリ配列の先頭と末尾とを論理的に接続したリングバッファである。なお、図5において、Rは、デバイスドライバの読み込み開始ポインタであり、Wは、デバイスドライバの書き込み開始ポインタである。
FIG. 5 is a block diagram showing an example of a conventional system configuration. This system includes an
図6は、従来のシステムを模式的に表したブロック図である。このシステムは、CPU50、メインメモリ51およびネットワークデバイス42がシステムバス52を介して接続されている。ネットワークデバイス42は、送受信バッファ42cを備えている。このネットワークデバイス42のデータ送受信処理は、次のように行なわれる。すなわち、図6に示すように、システムバス52を介して、システムがメインメモリ51内に確保したデータ送受信用のバッファとネットワークデバイス42のデータ送受信用のバッファ42cとが接続され、両バッファ間でデータの送受信が行なわれる。ネットワークデバイス42では、ネットワークデバイス42の物理MAC/PHY層を介して外部のネットワークと接続して、データの送受信を行なっている。システムがデータを送受信するには、システムが確保したバッファ51およびネットワークデバイス42のデータ送受信用のバッファ42cの間において、データをやりとりし、ネットワークデバイス42が外部のネットワークとデータ送受信することで実現される。
FIG. 6 is a block diagram schematically showing a conventional system. In this system, a
システムがデータを送信するには、システムのデータ送受信バッファ51からネットワークデバイス42のデータ送受信バッファ42cに送信するデータをコピーする。そして、ネットワークデバイス42が、外部のネットワークにデータを送信する。逆に、システムがデータを取得するには、ネットワークデバイス42のデータ送受信バッファ42cからシステム用のデータ送受信バッファ51にデータをコピーする。予め、ネットワークデバイス42では、外部のネットワークから自分宛のデータを取得して、ネットワークデバイス用のデータ送受信バッファ42cに格納している。
しかしながら、特開平7−225694号公報に開示された技術では、例えば、ネットワークデバイス、I2C、IEEE、FDDIなどの周辺機器に対しては、データを受信した際に、どちらのOSに対して処理を行なわせるかを判定できない。このため、データ受信時にはこの技術を適用することはできない。 However, in the technique disclosed in Japanese Patent Laid-Open No. 7-225694, for example, a peripheral device such as a network device, I2C, IEEE, or FDDI performs processing for which OS when data is received. I can't decide what to do. For this reason, this technique cannot be applied when receiving data.
また、仮想計算機の例として挙げられるVMWAREなどでは、例えばネットワークデバイスに対して、複数のOSによる共有が可能となっている。しかしながら、データ送受信時には、ネットワークデバイスのバッファとは直接やり取りを行なわず、仮想デバイスに対して一度コピー動作を行なっている。このため、性能低下が生じている。また、仮想デバイス内に、コピー動作のためのバッファを余計に確保する必要がある。 In addition, VMWARE, which is an example of a virtual machine, can be shared by a plurality of OSs with respect to, for example, a network device. However, at the time of data transmission / reception, the network device buffer is not directly exchanged, and a copy operation is performed once for the virtual device. For this reason, performance degradation has occurred. In addition, it is necessary to secure an extra buffer for the copy operation in the virtual device.
本発明は、このような事情に鑑みてなされたものであり、複数のOSが動作する仮想計算機システムに関し、複数のOSから同一のネットワークデバイスを共有し、データの送受信の際にもコピー動作による性能低下が生じず、余計なバッファも不要とすることができる仮想計算機システムおよび仮想計算機システムの制御方法を提供することを目的とする。 The present invention has been made in view of such circumstances, and relates to a virtual computer system in which a plurality of OSs operate. The same network device is shared from a plurality of OSs, and data is transmitted and received by a copy operation. It is an object of the present invention to provide a virtual machine system and a control method for the virtual machine system that do not cause performance degradation and can eliminate an unnecessary buffer.
(1)上記の目的を達成するために、本発明は、以下のような手段を講じた。すなわち、本発明の仮想計算機システムは、複数のオペレーティングシステムと、外部ネットワークとデータの送受信を行なうネットワークデバイスと、前記各オペレーティングシステムのそれぞれに対応して設けられ、前記オペレーティングシステムの指示に基づいて、前記ネットワークデバイスを制御する複数のデバイスドライバと、前記各デバイスドライバから指示を受けて、各指示に応じて前記ネットワークデバイスを制御する一方、前記ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なう仮想デバイスと、を備えることを特徴としている。 (1) In order to achieve the above object, the present invention takes the following measures. That is, the virtual machine system of the present invention is provided corresponding to each of a plurality of operating systems, a network device for transmitting / receiving data to / from an external network, and each of the operating systems, and based on instructions of the operating system, A plurality of device drivers for controlling the network device and instructions from the device drivers, and controlling the network device according to the instructions, while receiving an interrupt instruction from the network device, the device drivers And a virtual device that interrupts the device.
このように、仮想デバイスが、各デバイスドライバから指示を受けて、各指示に応じてネットワークデバイスを制御する一方、ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なうので、データ受信の動作を複数のオペレーティングシステムに行なわせることが可能となる。 In this way, the virtual device receives instructions from each device driver and controls the network device according to each instruction, while receiving an interrupt instruction from the network device and interrupting each device driver, Data receiving operation can be performed by a plurality of operating systems.
(2)また、本発明の仮想計算機システムは、複数のオペレーティングシステムと、外部ネットワークとデータの送受信を行なうネットワークデバイスと、前記各オペレーティングシステムのそれぞれに対応して設けられ、前記オペレーティングシステムの指示に基づいて、前記ネットワークデバイスを制御する複数のデバイスドライバと、を備えると共に、前記ネットワークデバイスは、前記各デバイスドライバから指示を受けて、各指示に応じて前記ネットワークデバイスを制御する一方、前記ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なう仮想デバイスを備えることを特徴としている。 (2) A virtual machine system according to the present invention is provided corresponding to each of a plurality of operating systems, a network device for transmitting / receiving data to / from an external network, and each of the operating systems. A plurality of device drivers for controlling the network device, and the network device receives instructions from the device drivers and controls the network device according to the instructions, while the network device A virtual device that receives an interrupt instruction from the device and interrupts each of the device drivers.
このように、ネットワークデバイスが備える仮想デバイスが、各デバイスドライバから指示を受けて、各指示に応じてネットワークデバイスを制御する一方、ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なうので、データ受信の動作を複数のオペレーティングシステムに行なわせることが可能となる。 As described above, the virtual device included in the network device receives an instruction from each device driver and controls the network device according to each instruction, while receiving an interrupt instruction from the network device and interrupts each device driver. Therefore, it is possible to cause a plurality of operating systems to perform the data reception operation.
(3)また、本発明の仮想計算機システムにおいて、前記仮想デバイスは、前記各デバイスドライバからの指示に基づいて、前記ネットワークデバイスの実レジスタに対して、値の設定を行なう仮想レジスタ部と、前記各デバイスドライバからの割り込み登録設定を受ける一方、前記ネットワークデバイスから割り込みを受けて前記各デバイスドライバに対して割り込みを行なう割り込み制御部と、前記各デバイスドライバから、前記ネットワークデバイスの実レジスタの読み取り開始ポインタおよび書き込み開始ポインタの値についての指示を受けて、前記ネットワークデバイスの実レジスタに対して設定する読み取り開始ポインタおよび書き込み開始ポインタの値を決定するポインタ管理部と、を備えることを特徴としている。 (3) In the virtual computer system of the present invention, the virtual device is configured to set a value for a real register of the network device based on an instruction from each device driver; While receiving an interrupt registration setting from each device driver, an interrupt control unit that receives an interrupt from the network device and interrupts each device driver, and starts reading the real register of the network device from each device driver And a pointer management unit that receives an instruction about the value of the pointer and the write start pointer and determines the value of the read start pointer and the write start pointer set for the real register of the network device.
この構成により、コピー動作を行なうことなくデータ受信を行なうことができるので、コピー動作による性能低下を回避することが可能となる。また、余分なバッファを設ける必要がなくなるため、メモリ資源の節約および有効活用が可能となる。 With this configuration, data reception can be performed without performing a copy operation, so that it is possible to avoid performance degradation due to the copy operation. Further, since it is not necessary to provide an extra buffer, memory resources can be saved and effectively used.
(4)また、本発明の仮想計算機システムにおいて、前記仮想レジスタ部は、少なくとも、前記各デバイスドライバから指定された読み取り開始ポインタおよび書き込み開始ポインタの値を保持する第1のレジスタと、前記ネットワークデバイスの実レジスタに設定する読み取り開始ポインタおよび書き込み開始ポインタの値を保持する第2のレジスタと、を備えることを特徴としている。 (4) In the virtual computer system of the present invention, the virtual register unit includes at least a first register that holds values of a read start pointer and a write start pointer designated by each device driver, and the network device. And a second register that holds the values of the read start pointer and the write start pointer set in the real register.
この構成により、仮想デバイスが、各デバイスドライバに代わってネットワークデバイスに対する処理を行なうことが可能となり、データ受信の動作を複数のオペレーティングシステムに行なわせることが可能となる。 With this configuration, the virtual device can perform processing for the network device in place of each device driver, and a plurality of operating systems can perform data reception operations.
(5)また、本発明の仮想計算機システムにおいて、前記ネットワークデバイスの実レジスタは、リングバッファであることを特徴としている。 (5) In the virtual machine system of the present invention, the real register of the network device is a ring buffer.
この構成により、固定長のメモリを有効に活用することができると共に、データが頻繁に更新される場合でも、適切な処理を行なうことが可能となる。 With this configuration, a fixed-length memory can be used effectively, and appropriate processing can be performed even when data is frequently updated.
(6)また、本発明の仮想計算機システムにおいて、前記リングバッファは、複数の読み取りポインタと、少なくとも一つの書き込みポインタとを備え、前記仮想デバイスは、前記ネットワークデバイスに対して、最も後方の読み取りポインタを実レジスタに設定することを特徴としている。 (6) In the virtual computer system of the present invention, the ring buffer includes a plurality of read pointers and at least one write pointer, and the virtual device is the rearmost read pointer with respect to the network device. Is set to a real register.
この構成により、最も後方の読み取りポインタよりも前にデータを書き込まないように制御することが可能となる。また、コピー動作を行なうことなくデータ受信を行なうことができるので、コピー動作による性能低下を回避することが可能となる。また、余分なバッファを設ける必要がなくなるため、メモリ資源の節約および有効活用が可能となる。 With this configuration, it is possible to control so that data is not written before the rearmost read pointer. In addition, since data can be received without performing a copy operation, it is possible to avoid performance degradation due to the copy operation. Further, since it is not necessary to provide an extra buffer, memory resources can be saved and effectively used.
(7)また、本発明の仮想計算機システムの制御方法は、複数のオペレーティングシステムと、外部ネットワークとデータの送受信を行なうネットワークデバイスと、前記各オペレーティングシステムのそれぞれに対応して設けられ、前記オペレーティングシステムの指示に基づいて、前記ネットワークデバイスを制御する複数のデバイスドライバと、仮想デバイスと、から構成される仮想計算機システムの制御方法であって、前記仮想デバイスにおいて、前記各デバイスドライバから指示を受けるステップと、前記各指示に応じて前記ネットワークデバイスを制御するステップと、前記ネットワークデバイスから割り込み指示を受けるステップと、前記各デバイスドライバに対して割り込みを行なうステップと、を少なくとも含むことを特徴としている。 (7) Also, the virtual computer system control method of the present invention is provided corresponding to each of a plurality of operating systems, a network device for transmitting / receiving data to / from an external network, and each of the operating systems. A virtual computer system control method comprising a plurality of device drivers for controlling the network device and a virtual device based on the instructions of the virtual device, wherein the virtual device receives instructions from the device drivers. And at least a step of controlling the network device according to each instruction, a step of receiving an interrupt instruction from the network device, and a step of interrupting each device driver. It is set to.
このように、仮想デバイスが、各デバイスドライバから指示を受けて、各指示に応じてネットワークデバイスを制御する一方、ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なうので、データ受信の動作を複数のオペレーティングシステムに行なわせることが可能となる。 In this way, the virtual device receives instructions from each device driver and controls the network device according to each instruction, while receiving an interrupt instruction from the network device and interrupting each device driver, Data receiving operation can be performed by a plurality of operating systems.
本発明によれば、複数のオペレーティングシステムから仮想デバイスを介して周辺機器にアクセスすることによって、複数のオペレーティングシステムから同一の周辺機器の制御が可能となる。例えば、複数のオペレーティングシステムから仮想デバイスを介してネットワークデバイスにアクセスする場合は、データの送受信動作において、データのバッファ間のコピー動作を行なうことによる性能低下を回避することができると共に、そのためのバッファを設ける必要がなくなる。 According to the present invention, by accessing a peripheral device from a plurality of operating systems via a virtual device, the same peripheral device can be controlled from the plurality of operating systems. For example, when accessing a network device from a plurality of operating systems via a virtual device, it is possible to avoid performance degradation caused by performing a copying operation between data buffers in a data transmission / reception operation, and a buffer for the same. Need not be provided.
(第1の実施形態)
次に、本発明の実施の形態について、図面を参照しながら説明する。図1は、本発明の仮想計算機システムの概略構成を示すブロック図である。この仮想計算機システムは、第1のOS1および第1のデバイスドライバ1aと、第2のOS2および第2のデバイスドライバ2aと、外部のネットワークとデータ送受信を行なうネットワークデバイス3と、第1のOS1または第2のOS2からネットワークデバイス3の共有を可能とする仮想デバイス4と、で構成されている。第1のデバイスドライバ1aおよび第2のデバイスドライバ2aは、それぞれバッファ1b、2b、ポインタ管理部1c、2c、割込み管理部1d、2dとから構成されている。また、ネットワークデバイス3は、レジスタ3a、送受信バッファ3b、および割込み管理部3cにより構成されている。但し、これはあくまでも例示であって、OSおよびそのデバイスドライバは2つのみに限定されるわけではない。本実施形態では、OSおよびそのデバイスドライバが2つずつである場合を例にとって説明する。
(First embodiment)
Next, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a schematic configuration of a virtual machine system of the present invention. The virtual computer system includes a first OS 1 and a first device driver 1a, a second OS 2 and a
仮想デバイス4は、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aから要求を受け、ネットワークデバイス3の実レジスタに対して、実際に値の設定を行なう仮想レジスタ部4aと、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aからの割込み登録設定を行ない、さらに、ネットワークデバイス3から割り込みを受けて、第1のOS1または第2のOS2に対して割り込みを行なう割り込み管理部4bと、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aからネットワークデバイス3のバッファの読み取り開始ポインタまたは書き込み開始ポインタの指定を受けて、実際にネットワークデバイス3に対して設定するバッファの読み取り開始ポインタまたは書き込み開始ポインタの値を決定するポインタ管理部4cと、から構成されている。なお、図1において、r1は、第1のOS1用の読み込み開始ポインタであり、r2は、第2のOS2用の読み込み開始ポインタである。また、Rは、各デバイスドライバの読み込み開始ポインタであり、Wは、各デバイスドライバの書き込み開始ポインタである。
The
仮想レジスタ部4aは、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aから指定された読み取り開始ポインタまたは書き込み開始ポインタを保持するレジスタを備え、さらに、実際にネットワークデバイス3に設定する読み取り開始ポインタ、書き込み開始ポインタの値を保持するレジスタを備える。なお、仮想レジスタ部4aは、割り込みマスクレジスタなどネットワークデバイス3の実レジスタが備えているものは全て備えている。
The
本実施形態に係るシステム構成では、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aは、デバイス初期化設定、データ送受信設定、レジスタ設定、割込み設定など、通常の実デバイスに行なっていた設定を、同じように仮想デバイス4に対して行なう。
In the system configuration according to the present embodiment, the first device driver 1a or the
仮想デバイス4は、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aからデバイスの初期化、データ送受信、割り込みなどの設定を受けると、実際のネットワークデバイス3に対してこれらの処理を行なう。例えば、デバイスの初期化処理では、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aごとにネットワークデバイス3の初期化を複数回行なうのではなく、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aが仮想デバイス4にデバイス初期化の設定を行なうと、仮想デバイス4が実際のネットワークデバイス3に対して、一度だけ初期化を行なうようにする。
When the
また、データ送受信処理では、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aが仮想デバイス4に対して、データの転送元、転送先、転送サイズを設定することで、仮想デバイス4が実際のネットワークデバイス3とデータ転送を行なう。また、割込み処理では、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aが仮想デバイス4に対して割込み登録設定を行なうと、仮想デバイス4が実際のネットワークデバイス3に対して割込み登録を行なう。仮想デバイス4は、ネットワークデバイス3から割り込みを受けると、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aに対して割り込みを行なう。
In the data transmission / reception processing, the first device driver 1a or the
次に、仮想デバイス4を介した第1のデバイスドライバ1aまたは第2のデバイスドライバ2aによるネットワークデバイス3の初期化、データ送受信、割込みの各処理について説明する。本実施形態では、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aは、常に仮想デバイス4を介して、ネットワークデバイス3に対して、データを送受信する。第1のデバイスドライバ1aまたは第2のデバイスドライバ2aは、これまでと同じように通常の実デバイスに対して行なっていた設定を、仮想デバイス4に対して行なう。
Next, each process of initialization, data transmission / reception, and interruption of the network device 3 by the first device driver 1a or the
仮想デバイス4を介して、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aがネットワークデバイス3とデータを送受信する動作について説明する。例えば、VMWARE(登録商標)のように、従来の仮想デバイスを用いた送受信では図5および図6に示したように、仮想デバイス内にバッファを用意し、データ送受信時に、一旦仮想デバイスに対してバッファのコピーが行なわれていた。そのため、性能の低下が起こり、また、仮想デバイスでのコピー処理のために、余計なバッファが必要となっていた。
An operation in which the first device driver 1a or the
これに対し、本実施形態では、仮想デバイス4でコピー動作を行なわずに、複数のOSのデバイスドライバ(第1のデバイスドライバ1aまたは第2のデバイスドライバ2a)の送受信バッファと、ネットワークデバイス3の送受信バッファの間でデータを転送して、データ送受信を行なう。このため、従来技術と比べて、性能の低下もなく、余計なバッファが必要ではなくなる。また、上記のネットワークデバイス3の送受信バッファは、リングバッファを想定している。
On the other hand, in the present embodiment, the
仮想デバイス4は、データ送受信を行なうためには、ネットワークデバイス3の初期化処理、ネットワークデバイス3の割り込み処理、ネットワークデバイス3のデータ送受信バッファの読み込み開始ポインタおよび書き込み開始ポインタの設定、ネットワークデバイスの送受信バッファのデータ転送が必要である。
In order to perform data transmission / reception, the
仮想デバイス4を介したネットワークデバイス3の初期化処理は、図2に示す手順で行われる。図2は、ネットワークデバイスの初期化処理の手順を示すフローチャートである。第1のデバイスドライバ1aまたは第2のデバイスドライバ2aから初期化設定が行なわれても、仮想デバイス4は、実際のネットワークデバイス3に対して1回だけ初期化設定を行なう。既に、ネットワークデバイス3に対して初期化処理が行なわれている場合は、初期化処理は行なわない。
The initialization process of the network device 3 via the
図2に示すように、第1または第2のOS2のデバイスドライバが仮想デバイス4に対してデバイスの初期化処理を行なう(ステップS1)。仮想デバイス4は、ネットワークデバイス3に対して初期化処理が行なわれているかどうかを判断し(ステップS2)、初期化処理が行なわれていない場合のみ、実際にネットワークデバイス3の初期化処理を行なう。仮想デバイス4が行なうネットワークデバイス3の初期化の手順は、一般にOSのデバイスドライバがネットワークデバイスに対して行なう設定と同じである。
As shown in FIG. 2, the device driver of the first or second OS 2 performs device initialization processing for the virtual device 4 (step S1). The
すなわち、まず、ネットワークデバイスの初期化処理として、実レジスタのリセットレジスタに書込み、リセット処理を行なう(ステップS3)。次に、割り込みステータスレジスタや割り込みマスクレジスタなど、ネットワークデバイスの各レジスタをクリアする(ステップS4)。MACアドレスを物理アドレスレジスタに設定する(ステップS5)。 That is, first, as initialization processing of the network device, writing is performed to the reset register of the real register, and reset processing is performed (step S3). Next, each register of the network device such as the interrupt status register and the interrupt mask register is cleared (step S4). The MAC address is set in the physical address register (step S5).
次に、ネットワークデバイスの送受信バッファをクリアし、ネットワークデバイスの送受信バッファをリングバッファとして使用するため、送受信で用いるバッファの格納開始位置を示す格納開始レジスタ、格納終了位置を示す格納終了レジスタ、現在の書き込み開始位置を示す書き込み開始ポインタを格納する書込み開始レジスタ、現在の読み込み開始位置を示す読み込み開始ポインタを格納する読み込み開始レジスタなどの各レジスタをクリアする(ステップS6)。また、データの送受信通知を割り込みにより受けるため、割り込み関連のレジスタを初期化し、割り込みマスクを解除して割り込み受付可能状態にする(ステップS7)。 Next, to clear the transmission / reception buffer of the network device and use the transmission / reception buffer of the network device as a ring buffer, the storage start register indicating the storage start position of the buffer used for transmission / reception, the storage end register indicating the storage end position, the current Each register such as a write start register for storing a write start pointer indicating the write start position and a read start register for storing a read start pointer indicating the current read start position is cleared (step S6). In addition, in order to receive a data transmission / reception notification by an interrupt, an interrupt-related register is initialized, the interrupt mask is released, and an interrupt acceptance state is set (step S7).
次に、割込み処理について説明する。図3は、本実施形態に係る割込み処理の手順を示すフローチャートである。図3に示すように、まず、OSの第1のデバイスドライバ1aまたは第2のデバイスドライバ2aは、仮想デバイス4に対して、割り込みハンドラの登録など割り込みの設定を行なう(ステップT1)。次に、OSの第1のデバイスドライバ1aまたは第2のデバイスドライバ2aが仮想デバイス4に対して、読み込み開始ポインタまたは書き込み開始ポインタの設定を行なう(ステップT2)。
Next, interrupt processing will be described. FIG. 3 is a flowchart showing a procedure of interrupt processing according to the present embodiment. As shown in FIG. 3, first, the first device driver 1a or the
ネットワークデバイス3のバッファ3bと、第1のデバイスドライバ1aのバッファ1bまたは第2のデバイスドライバ2aのバッファ2bとの間で、データ転送を行なう(ステップT3)。仮想デバイス4は、管理している複数のデバイスドライバの読み込み開始ポインタを更新する(ステップT4)。仮想デバイス4は、ポインタ管理部4cが複数のネットワークドライバの読み込み開始ポインタからネットワークデバイス3に設定する読み込み開始ポインタを決定する。設定する読み込み開始ポインタは、複数のネットワークドライバのうち、最も後方のポインタとする(ステップT5)。最後に、仮想デバイス4は、読み込み開始ポインタをネットワークデバイス3のレジスタ3aに入力して更新する(ステップT6)。
Data transfer is performed between the
ネットワークデバイス3の送受信バッファ3bは、リングバッファであることを想定している。この「リングバッファ」とは、メモリ配列の先頭と末尾を論理的に接続したもので、メモリ配列の末尾の次はメモリ配列の先頭に戻るようにしてバッファを構成となる。固定長のメモリを有効に利用でき、頻繁にデータが更新される場合に適したバッファ構成である。リングバッファには、読み取り開始ポインタと書き込み開始ポインタが存在する。書き込み開始ポインタは読み込み開始ポインタを超えて書き込むことはできない。
It is assumed that the transmission /
一般的に、受信バッファでは、書き込み開始ポインタはハード側が制御し、読み込み開始ポインタはソフト側が制御する。送信バッファでは書き込み開始ポインタはソフト側が制御し、読み込み開始ポインタはハード側が制御する。 In general, in the reception buffer, the write start pointer is controlled by the hardware side, and the read start pointer is controlled by the software side. In the transmission buffer, the write start pointer is controlled by the software side, and the read start pointer is controlled by the hardware side.
次に、仮想デバイス4を介したネットワークデバイス3のデータ受信時の処理について説明する。一般に、OSのネットワークデバイスドライバでは、自身宛に送信されたデータかを判定し、自分宛でなければ、パケットデータの破棄を行なう。本実施形態では、ネットワークデバイス3で取得したデータを、仮想デバイス4側でどちらのOSに対するデータかを判断するのではなく、両方のOSのネットワークデバイスドライバに、データを送信して処理を行なわせる。
Next, processing when data is received by the network device 3 via the
データを受信する時には、ネットワークデバイス3から仮想デバイス4に対して割込みが発生し、仮想デバイスから第1のデバイスドライバ1aおよび第2のデバイスドライバ2aの両方に対して、OSのネットワークデバイスドライバに対して割り込みを掛けて、バッファ間の転送を行なって、データの転送を行なう。ここで、第1のデバイスドライバ1aおよび第2のデバイスドライバ2aは、それぞれ読み込みを行ない、読み込んだデータが自分宛でない場合は、それを破棄する。
When data is received, an interrupt is generated from the network device 3 to the
本実施形態において実装するネットワークの受信バッファは、1つの読み取り開始ポインタと1つの書き込み開始ポインタを備えたリングバッファであり、最も後方の読み取り開始ポインタを越えて、仮想デバイスを介してデータを書き込まないように制御する。 The network receive buffer implemented in the present embodiment is a ring buffer having one read start pointer and one write start pointer, and does not write data through the virtual device beyond the rearmost read start pointer. To control.
仮想デバイス4は、ネットワークデバイス3の受信バッファからそれぞれのOSのデバイスドライバの受信バッファにデータ転送を行なうように、ネットワークデバイスに対して設定する。なお、データ転送は、ネットワークデバイス3の受信バッファと、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aの受信バッファ1bまたはバッファ2bの間で直接行なわれる。そして、仮想デバイス4は、データの読み取り処理後に、仮想デバイス4の仮想レジスタ部4aに、読み取り開始ポインタを更新する。もう一方の読み取り開始ポインタと比較して、最も後方の読み取り開始ポインタであるかを判定し、読み取り開始ポインタが最も後方である場合に、実際のネットワークデバイス3の実レジスタに読み取り開始ポインタを更新する。
The
図4は、仮想デバイス4を介した、ネットワークデバイス3のデータ送信時の処理を示すフローチャートである。ネットワークデバイス3の送信バッファ3bは、読み取り開始ポインタと書き込み開始ポインタを1つずつ備えたリングバッファであり、読み取り開始ポインタを越えて、データを書き込まないように制御する。まず、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aからのデータ書き込み要求がくると(ステップR1)、仮想デバイス4は、第1のデバイスドライバ1aまたは第2のデバイスドライバ2aの送信バッファ1bまたは送信バッファ2bから、実際のネットワークデバイス3の送信バッファへデータ転送を行なうように設定する(ステップR2)。次に、仮想デバイス4は、仮想デバイス4の仮想レジスタ部4aに、書き込み開始ポインタを更新する(ステップR3)。次に、ネットワークデバイス3のレジスタ3aに、書き込み開始ポインタの値を更新する(ステップR4)。
FIG. 4 is a flowchart showing processing at the time of data transmission of the network device 3 via the
このように複数のOSのデバイスドライバからのデータ送信は、シーケンシャルに行なう。第1のデバイスドライバ1aまたは第2のデバイスドライバ2aとネットワークデバイス3との間で、バッファ転送を行なって、データを送信する。送信完了の割り込みは、バッファ間転送を行なった第1のデバイスドライバ1aまたは第2のデバイスドライバ2aに対してそれぞれ行なう。
In this way, data transmission from a plurality of OS device drivers is performed sequentially. Data is transmitted by performing buffer transfer between the first device driver 1 a or the
(第2の実施形態)
第1の実施形態では、ネットワークデバイス3の共有を、仮想デバイス4を別途備えることで実現したが、第2の実施形態では、仮想デバイス4の機能をネットワークデバイス3に持たせることにより実現する。ネットワークデバイスに複数のOS用の読み取り開始ポインタを格納するレジスタを用意し、複数のOSのデバイスドライバから制御を受け、データ送受信を行なう。図1で示したネットワークデバイスに、従来備えているレジスタに加えて、第1のOS1用の読み込み開始ポインタを格納するレジスタ、第2のOS2用の読み込み開始ポインタを格納するレジスタの2つを用意する。また、第1のOS1用の読み込み開始ポインタと第2のOS2用の読み込み開始ポインタの2つから、ネットワークデバイスに設定する読み込み開始ポインタを求めるポインタ管理部を設ける。ポインタ管理部から出力された読み込み開始ポインタは、ネットワークデバイスの読み込み開始ポインタを格納するレジスタに対して設定される。
(Second Embodiment)
In the first embodiment, sharing of the network device 3 is realized by separately providing the
逆に、書込みを行なう場合は、第1のOS1用の書き込み開始ポインタを格納するレジスタ、第2のOS2用の書き込みポインタを格納するレジスタの2つを別途用意する。第1のOS1用の書き込み開始ポインタと第2のOS2用の書き込み開始ポインタの2つから、ネットワークデバイスに設定する書き込み開始ポインタを求めるポインタ出力部を設ける。ポインタ管理部は、このポインタ出力部として機能する。ポインタ出力部としてのポインタ管理部から出力された書き込み開始ポインタはネットワークデバイスの読み込み開始ポインタを格納するレジスタに対して保存する。データ送受信処理の流れは、第1の実施形態と同様であるので、省略する。 On the other hand, when writing, two registers, a register for storing the write start pointer for the first OS1 and a register for storing the write pointer for the second OS2, are prepared separately. A pointer output unit for obtaining a write start pointer to be set in the network device is provided from the two write start pointers for the first OS1 and the second OS2. The pointer management unit functions as this pointer output unit. The write start pointer output from the pointer management unit as the pointer output unit is stored in a register that stores the read start pointer of the network device. Since the flow of data transmission / reception processing is the same as that in the first embodiment, a description thereof will be omitted.
以上のように、本発明の実施形態について説明を行なったが、今回開示した実施形態は全ての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内での全ての変更が含まれる。 As mentioned above, although embodiment of this invention was described, it should be thought that embodiment disclosed this time is an illustration and restrictive at no points. The scope of the present invention is defined by the terms of the claims, and includes meanings equivalent to the terms of the claims and all modifications within the scope.
1 第1のOS
1a 第1のデバイスドライバ
1b バッファ
1c ポインタ管理部
1d 割込み管理部
2 第2のOS
2a 第2のデバイスドライバ
2b バッファ
2c ポインタ管理部
2d 割込み管理部
3 ネットワークデバイス
3a レジスタ
3b 送受信バッファ
3c 割込み管理部
4 仮想デバイス
4a 仮想レジスタ部
4b 割込み管理部
4c ポインタ管理部
1 First OS
1a 1st device driver 1b buffer 1c pointer management unit 1d interrupt management unit 2 second OS
2a
Claims (7)
外部ネットワークとデータの送受信を行なうネットワークデバイスと、
前記各オペレーティングシステムのそれぞれに対応して設けられ、前記オペレーティングシステムの指示に基づいて、前記ネットワークデバイスを制御する複数のデバイスドライバと、
前記各デバイスドライバから指示を受けて、各指示に応じて前記ネットワークデバイスを制御する一方、前記ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なう仮想デバイスと、を備えることを特徴とする仮想計算機システム。 Multiple operating systems,
A network device that transmits and receives data to and from an external network;
A plurality of device drivers that are provided corresponding to each of the operating systems and that control the network device based on instructions of the operating system;
A virtual device that receives an instruction from each device driver and controls the network device according to each instruction, and receives an interrupt instruction from the network device and interrupts the device driver. Virtual computer system characterized by
外部ネットワークとデータの送受信を行なうネットワークデバイスと、
前記各オペレーティングシステムのそれぞれに対応して設けられ、前記オペレーティングシステムの指示に基づいて、前記ネットワークデバイスを制御する複数のデバイスドライバと、を備えると共に、
前記ネットワークデバイスは、前記各デバイスドライバから指示を受けて、各指示に応じて前記ネットワークデバイスを制御する一方、前記ネットワークデバイスから割り込み指示を受けて、前記各デバイスドライバに対して割り込みを行なう仮想デバイスを備えることを特徴とする仮想計算機システム。 Multiple operating systems,
A network device that transmits and receives data to and from an external network;
A plurality of device drivers provided corresponding to each of the operating systems and controlling the network device based on instructions of the operating system;
The network device receives an instruction from each device driver and controls the network device according to each instruction, while receiving an interrupt instruction from the network device and interrupting each device driver A virtual computer system comprising:
前記各デバイスドライバからの指示に基づいて、前記ネットワークデバイスの実レジスタに対して、値の設定を行なう仮想レジスタ部と、
前記各デバイスドライバからの割り込み登録設定を受ける一方、前記ネットワークデバイスから割り込みを受けて前記各デバイスドライバに対して割り込みを行なう割り込み制御部と、
前記各デバイスドライバから、前記ネットワークデバイスの実レジスタの読み取り開始ポインタおよび書き込み開始ポインタの値についての指示を受けて、前記ネットワークデバイスの実レジスタに対して設定する読み取り開始ポインタおよび書き込み開始ポインタの値を決定するポインタ管理部と、を備えることを特徴とする請求項1または請求項2記載の仮想計算機システム。 The virtual device is
Based on an instruction from each device driver, a virtual register unit that sets a value for a real register of the network device;
While receiving an interrupt registration setting from each device driver, an interrupt control unit that receives an interrupt from the network device and interrupts each device driver;
In response to instructions from the device drivers regarding the values of the read start pointer and the write start pointer of the real register of the network device, the values of the read start pointer and the write start pointer to be set for the real register of the network device are set. The virtual machine system according to claim 1, further comprising: a pointer management unit for determining.
前記仮想デバイスは、前記ネットワークデバイスに対して、最も後方の読み取りポインタを実レジスタに設定することを特徴とする請求項5記載の仮想計算機システム。 The ring buffer includes a plurality of read pointers and at least one write pointer;
6. The virtual computer system according to claim 5, wherein the virtual device sets a rearmost read pointer in the real register with respect to the network device.
前記仮想デバイスにおいて、前記各デバイスドライバから指示を受けるステップと、
前記各指示に応じて前記ネットワークデバイスを制御するステップと、
前記ネットワークデバイスから割り込み指示を受けるステップと、
前記各デバイスドライバに対して割り込みを行なうステップと、を少なくとも含むことを特徴とする仮想計算機システムの制御方法。 A plurality of operating systems, a network device that transmits / receives data to / from an external network, and a plurality of device drivers that are provided corresponding to each of the operating systems and that control the network device based on instructions from the operating system And a virtual computer system control method comprising a virtual device,
Receiving instructions from the device drivers in the virtual device;
Controlling the network device in response to each instruction;
Receiving an interrupt instruction from the network device;
A method of controlling the virtual machine system, comprising: at least interrupting each of the device drivers.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007336441A JP2009157731A (en) | 2007-12-27 | 2007-12-27 | Virtual computer system and control method of virtual computer system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007336441A JP2009157731A (en) | 2007-12-27 | 2007-12-27 | Virtual computer system and control method of virtual computer system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2009157731A true JP2009157731A (en) | 2009-07-16 |
Family
ID=40961675
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2007336441A Withdrawn JP2009157731A (en) | 2007-12-27 | 2007-12-27 | Virtual computer system and control method of virtual computer system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2009157731A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9396000B2 (en) | 2010-06-25 | 2016-07-19 | Intel Corporation | Methods and systems to permit multiple virtual machines to separately configure and access a physical device |
| JP2018133758A (en) * | 2017-02-17 | 2018-08-23 | 日本電信電話株式会社 | Communication system between virtual machines |
-
2007
- 2007-12-27 JP JP2007336441A patent/JP2009157731A/en not_active Withdrawn
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9396000B2 (en) | 2010-06-25 | 2016-07-19 | Intel Corporation | Methods and systems to permit multiple virtual machines to separately configure and access a physical device |
| JP2018133758A (en) * | 2017-02-17 | 2018-08-23 | 日本電信電話株式会社 | Communication system between virtual machines |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11372680B2 (en) | RDMA (remote direct memory access) data transfer in a virtual environment | |
| US8516163B2 (en) | Hardware-based concurrent direct memory access (DMA) engines on serial rapid input/output SRIO interface | |
| JP4580845B2 (en) | Task execution device | |
| US8726093B2 (en) | Method and system for maintaining direct hardware access in the event of network interface card failure | |
| US7111092B1 (en) | Buffer management technique for a hypertransport data path protocol | |
| JP3807250B2 (en) | Cluster system, computer and program | |
| CN108025685B (en) | Vehicle control device | |
| US7117308B1 (en) | Hypertransport data path protocol | |
| KR20150067332A (en) | Inter-core communication apparatus and method | |
| JP2008529109A (en) | RNIC-based offload of iSCSI data movement function by target | |
| US7564860B2 (en) | Apparatus and method for workflow-based routing in a distributed architecture router | |
| US9558149B2 (en) | Dual system | |
| US8135960B2 (en) | Multiprocessor electronic circuit including a plurality of processors and electronic data processing system | |
| CN114172695B (en) | Method, device, equipment and storage medium for forwarding serial fireproof wall message | |
| JP2006338538A (en) | Stream processor | |
| JP2009157731A (en) | Virtual computer system and control method of virtual computer system | |
| JP4259390B2 (en) | Parallel processing unit | |
| CN104572315A (en) | Inter-subsystem communication method, communication entities and distributed communication system | |
| JPWO2004046926A1 (en) | Event notification method, device, and processor system | |
| US6832310B1 (en) | Manipulating work queue elements via a hardware adapter and software driver | |
| EP1936514B1 (en) | Apparatus and method for controlling issue of requests to another operation processing device | |
| US20200034213A1 (en) | Node device, parallel computer system, and method of controlling parallel computer system | |
| JP2014059661A (en) | Information processing device, method of controlling the same, and program | |
| JP3130892B2 (en) | Redundant system | |
| JP2023119512A (en) | Control device, control method, control program, and vehicle |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110301 |