JP5917441B2 - Virtual computer system and SR-IOV compatible device control method - Google Patents
Virtual computer system and SR-IOV compatible device control method Download PDFInfo
- Publication number
- JP5917441B2 JP5917441B2 JP2013116739A JP2013116739A JP5917441B2 JP 5917441 B2 JP5917441 B2 JP 5917441B2 JP 2013116739 A JP2013116739 A JP 2013116739A JP 2013116739 A JP2013116739 A JP 2013116739A JP 5917441 B2 JP5917441 B2 JP 5917441B2
- Authority
- JP
- Japan
- Prior art keywords
- link
- virtual
- guest
- iov
- mode
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Hardware Redundancy (AREA)
Description
本発明は、仮想計算機及びSR−IOV対応デバイスの技術に関する。 The present invention relates to a technology of a virtual machine and an SR-IOV compatible device.
物理計算機上に複数の仮想計算機を構築する仮想計算機システムが実用化されている。仮想計算機システムを用いることで、物理計算機のリソースの効率的な利用、システムの導入及び運用に要するコストの削減等が期待できる。近年では、ミッションクリティカルなシステムにおいても仮想計算機システムの導入が進んでおり、仮想計算機システムにも信頼性及び可用性の向上が求められている。 A virtual computer system for constructing a plurality of virtual computers on a physical computer has been put into practical use. By using a virtual computer system, it is possible to expect efficient use of physical computer resources, reduction of costs required for system introduction and operation, and the like. In recent years, the introduction of virtual computer systems has progressed even in mission-critical systems, and the reliability and availability of virtual computer systems are also demanded.
可用性を向上させる手法のひとつに冗長化手法がある。例えば、通信ネットワークの冗長化手法としては、物理計算機に複数のNIC(Network Interface Card)を備えておき、現用系のNICがリンクダウンした場合に、待機系のNICに切り替えることによって通信を継続する手法がある。 One technique for improving availability is a redundancy technique. For example, as a communication network redundancy method, a physical computer is provided with a plurality of NICs (Network Interface Cards), and communication is continued by switching to a standby NIC when the active NIC is linked down. There is a technique.
また、PCI(Peripheral Component Interconnect)デバイス側で仮想化をサポートするSR−IOV(Single Root I/O Virtualization)規格が策定された(非特許文献1)。 In addition, an SR-IOV (Single Root I / O Virtualization) standard that supports virtualization on the PCI (Peripheral Component Interconnect) device side has been formulated (Non-patent Document 1).
例えば、SR−IOV対応デバイス(NIC)を用いて仮想計算機の通信ネットワークを冗長化することが考えられる。しかし、SR−IOV規格に準拠したNICであっても、必ずしも全てのNICが完全に同じ動作をするわけではない。 For example, it is conceivable to make a communication network of virtual machines redundant by using an SR-IOV compatible device (NIC). However, even if the NIC conforms to the SR-IOV standard, not all NICs necessarily perform the same operation.
そこで、本発明の目的は、SR−IOV対応デバイスに動作の違いが存在する場合であっても、その違いを考慮することなく仮想計算機がSR−IOV対応デバイスに係る機能を利用できるようにすることにある。 Accordingly, an object of the present invention is to enable a virtual machine to use a function related to an SR-IOV compatible device without considering the difference even when there is a difference in operation between SR-IOV compatible devices. There is.
本発明の一実施例に係る仮想計算機システムは、物理CPU(Central Processing Unit)と、物理メモリと、SR−IOV対応デバイスと、仮想化機構とを有する。物理CPU及び物理メモリを論理的に分割してなる論理資源が仮想化機構によって割り当てられた仮想計算機上で、ゲストOS(Operating System)が稼動する。SR−IOV対応デバイスは、物理的なネットワークデバイスであるPF(Physical Function)と、PFに対応する仮想的なネットワークデバイスであるVF(Virtual Function)とを有する。仮想化機構は、PFのリンク状態を監視し、監視対象のPFのリンク状態が、リンクアップ状態の場合に第1モードを設定し、リンクダウン状態の場合に第2モードを設定し、第2モードが設定されている場合に、ゲストOSからのVFに係るコマンドに対して、VFに係るSR−IOV対応デバイスに応答させず、VFがリンクダウン状態である旨をエミュレートする。なお、「仮想化機構」は、例えば、後述のようにハイパバイザであるが、ハイパバイザのようなコンピュータプログラムを実行するプロセッサを有したハードウェアデバイス(例えば回路)であっても良い。 A virtual computer system according to an embodiment of the present invention includes a physical CPU (Central Processing Unit), a physical memory, an SR-IOV compatible device, and a virtualization mechanism. A guest OS (Operating System) runs on a virtual machine to which logical resources obtained by logically dividing a physical CPU and physical memory are allocated by a virtualization mechanism. The SR-IOV compatible device includes a PF (Physical Function) that is a physical network device and a VF (Virtual Function) that is a virtual network device corresponding to the PF. The virtualization mechanism monitors the link status of the PF, sets the first mode when the link status of the monitored PF is the link up status, sets the second mode when the link status is the link down status, and sets the second mode. When the mode is set, the SR-IOV compatible device related to the VF is not responded to the command related to the VF from the guest OS, and the fact that the VF is in the link down state is emulated. The “virtualization mechanism” is, for example, a hypervisor as described later, but may be a hardware device (for example, a circuit) having a processor that executes a computer program such as a hypervisor.
本発明によれば、SR−IOV対応デバイスに動作の違いが存在する場合であっても、その違いを考慮することなく仮想計算機がSR−IOV対応デバイスに係る機能を利用することができる。 According to the present invention, even when there is a difference in operation between SR-IOV compatible devices, the virtual machine can use the function related to the SR-IOV compatible device without considering the difference.
以下、SR−IOV対応デバイスを備える仮想計算機システムにおける実施例について、図面を用いて説明する。 Hereinafter, an embodiment in a virtual machine system including an SR-IOV compatible device will be described with reference to the drawings.
図1は、2つのNICを用いて通信ネットワークの冗長化を行った仮想計算機システムの構成例を示す模式図である。以下、図1を用いて、従来の通信ネットワークの冗長化の一例を説明する。 FIG. 1 is a schematic diagram showing a configuration example of a virtual machine system in which communication networks are made redundant using two NICs. Hereinafter, an example of redundancy of a conventional communication network will be described with reference to FIG.
物理計算機10は、NIC21、21を備える。ハイパバイザ19は、物理計算機10の備えるNIC21、21のリソースを仮想NIC22、22として仮想化し、仮想計算機に割り当てる。
The
仮想計算機12上のゲストOS13で動作する冗長化ソフトウェア131は、仮想NIC22、22を用いて通信ネットワークの冗長構成1001を組む。これにより、一方のNIC21がリンクダウン状態となっても、他方のNIC21がリンクアップ状態であれば、ゲストOS13は、リンクアップ状態の仮想NIC22を用いて、通信ネットワーク90との通信を継続できる。ここで、リンクアップとは、NIC21が通信ネットワーク90と通信可能な状態をいう。リンクダウンとは、NIC21が通信ネットワーク90と通信不可能な状態をいう。
図2は、SR−IOV対応デバイス(NIC)を用いて通信ネットワークの冗長化を行った仮想計算機システムの構成例を示す模式図である。以下、図2を用いて、SR−IOV対応デバイスを用いた一般的な通信ネットワークの冗長化の一例を示す。 FIG. 2 is a schematic diagram illustrating a configuration example of a virtual machine system in which communication network redundancy is performed using an SR-IOV compatible device (NIC). Hereinafter, an example of redundancy of a general communication network using SR-IOV compatible devices will be described with reference to FIG.
SR−IOV対応デバイス30は、1つのデバイス上で複数の仮想的なNICを実現する機能を有する。SR−IOV対応デバイスは、物理的なNICに相当するPF34と、仮想的なNICとして実現されるVF32とを有する。VF32は、PF34を介して外部の通信ネットワーク90と通信する。1つのPF34に複数のVF32が対応付けられても良い。
The SR-IOV
物理計算機10は、SR−IOV対応デバイス30、30を備える。ハイパバイザ19は、物理計算機10の備えるVF32のリソースをVF33、33として仮想計算機12に割り当てる。
The
仮想計算機12上のゲストOS13で動作する冗長化ソフトウェア131は、VF33、33を用いて通信ネットワークの冗長構成1101を組む。これにより、一方のVF33がリンクダウン状態となっても、他方のVF33がリンクアップ状態であれば、ゲストOS13は、リンクアップ状態のVF33を用いて、通信ネットワーク90との通信を継続できる。
The
SR−IOV対応デバイス30において、PF34がリンクダウンすると、VF32は外部の通信ネットワーク90と通信できなくなる。
In the SR-IOV
冗長化ソフトウェア131は、現用系のVF33が外部の通信ネットワークと通信できない場合、待機系のVF33に切り替える。つまり、冗長化ソフトウェア131は、現用系のVF33のリンクダウンを検知すると、待機系のVF33に切り替える。よって、SR−IOV対応デバイス30は、PF34がリンクダウンした時には、そのPF34に対応するVF32のリンク状態を「リンクダウン状態」としなければならない。
The
ところが、PF34とVF32との間のリンク状態の関係については、SR−IOV規格で規定されていない。そのため、PF34がリンクダウンとなっても、VF32を「リンクダウン状態」とせずに、VF32を「リンクアップ状態」のままとするSR−IOV対応デバイスが存在する。
However, the link state relationship between the
このようなSR−IOV対応デバイスを用いた場合、PF34がリンクダウンして現用系のVF32が外部の通信ネットワーク90と通信できなくなったとしても、VF32は「リンクアップ状態」のままなので、冗長化ソフトウェア131からは、VF33が「リンクアップ状態」として見えてしまう。そのため、冗長化ソフトウェア131は、PF34がリンクダウンしているにもかかわらず、現用系のVF33を待機系のVF33に切り替えることができない。つまり、冗長化ソフトウェア131は、通信ネットワークの冗長化を正常に実行することができない。
以下では、このような問題を解決する仮想計算機システムの実施例について説明する。
When such an SR-IOV-compatible device is used, even if the
Hereinafter, an embodiment of a virtual machine system that solves such a problem will be described.
図3は、仮想計算機システムの構成例を示すブロック図である。仮想計算機システムは、物理計算機10と、ハイパバイザ11とを有する。
FIG. 3 is a block diagram illustrating a configuration example of the virtual machine system. The virtual computer system includes a
物理計算機10は、物理CPU41と、物理メモリ42と、記憶デバイス(不図示)、SR−IOV対応デバイス30とを備える。
The
物理CPU41は、物理計算機10に係るI/Oを処理したり、様々なコンピュータプログラム(以下「プログラム」という)を実行したりする。
The
物理メモリ42は、様々なプログラム及びデータ等を一時的に保持する。物理メモリ42内の記憶媒体は、揮発性メモリで良い。揮発性メモリは、DRAM(Dynamic Random Access Memory)等であっても良い。物理メモリ42は、メモリの領域(ページ)を管理するためのページテーブル52を有する。
The
記憶デバイス(不図示)は、様々なプログラム及びデータ等を保持する。記憶デバイス内の記憶媒体は、不揮発性メモリでよい。不揮発性メモリは、追記型のメモリ、例えば、フラッシュメモリ、MRAM(Magnetic Random Access Memory:磁気抵抗メモリ)、PRAM(Phase Change Random Access Memory:相変化メモリ)、ReRAM(Resistance Random Access Memory:抵抗変化メモリ)などであっても良い。 A storage device (not shown) holds various programs and data. The storage medium in the storage device may be a non-volatile memory. The non-volatile memory is a write-once memory, for example, a flash memory, an MRAM (Magnetic Random Access Memory), a PRAM (Phase Change Random Access Memory), a ReRAM (Resistivity Random Memory Access Memory). ) Etc.
SR−IOV対応デバイス30は、SR−IOVに対応するPCIデバイスである。このSR−IOV対応デバイス30は、NICであって良い。SR−IOV対応デバイス30は、例えば、PCIコンフィグレーションレジスタ51と、PF34と、VF32とを有する。
The SR-IOV
PCIコンフィグレーションレジスタ(以下「PCIコンフィグ」という)51は、PCIデバイスに関する様々な情報を保持する。PCIコンフィグ51は、原則、全てのPCIデバイスが有する。
The PCI configuration register (hereinafter referred to as “PCI configuration”) 51 holds various information related to the PCI device. In principle, all PCI devices have the
図4は、PCIコンフィグレーションレジスタのフォーマット例を示す。
図4に示すように、PCIコンフィグ51のアドレス「0x00」から2バイトの領域401に「ベンダID」が格納される。アドレス「0x02」から2バイトの領域402に「デバイス1D」が格納される。アドレス「0x2C」から2バイトの領域403に「サブシステムベンダID」が格納される。アドレス「0x2E」から2バイトの領域404に「サブシステムデバイスID」が格納される。これら4つの情報で、PCIデバイスの種類を判別することができる。以下、図3の説明に戻る。
FIG. 4 shows a format example of the PCI configuration register.
As shown in FIG. 4, “vendor ID” is stored in a 2-
PF34は、SR−IOV対応デバイス30において、従来のPCIデバイスの機能を指す。本実施例の場合、このPF34は、物理的なNICに該当する。
The
VF32は、SR−IOV対応デバイス30において、PF34のリソースを共有する。1つのPF34に対して複数のVF32が対応付けられた場合、その複数のVF32は、その1つのPF34のリソースを共有する。本実施例の場合、このVF32は、仮想的なNICに該当する。VF32は、仮想計算機12にPCIデバイスとして認識される。つまり、本実施例の場合、仮想計算機12は、VF32を仮想的なNIC(VF321)として認識する。したがって、PF34がリンクダウンしている場合、仮想計算機12は、そのPF34のリソースを共有しているVF32(VF321)を介して、通信ネットワーク90にアクセスすることはできない。
The
仮想計算機12は、仮想的なリソース(以下「仮想リソース」という)である、仮想CPU323と、仮想メモリ322とを有する。これらの仮想リソースは、ハイパバイザ11が、物理計算機10のリソースを割り当てることによって実現される。仮想計算機12上では、ゲストOS13が実行される。つまり、ゲストOS13は、仮想計算機12の仮想リソースを通常のリソースとして認識する。よって、ゲストOS13は、VF321(VF32)を介して通信ネットワーク90にアクセスすることができる。
The
ハイパバイザ11は、仮想化機構の一種であり、物理CPU41及び物理メモリ42を論理的に分割してなる論理リソースを、仮想計算機12に仮想リソースとして割り当てる。これにより、仮想計算機12が実現される。仮想化機構の一種であるハイパバイザ11は、物理計算機10上で動作するソフトウェアであっても良いし、物理計算機10に備えられたハードウェアであっても良いし、物理計算機10とは別の装置であっても良いし、又はこれらの組み合わせであっても良い。
The
ハイパバイザ11は、PF監視部101と、VF MMIOエミュレーション部102と、論理CPU割込ハンドラ103と、モード切替部104とを有する。また、ハイパバイザ11は、監視対象デバイス管理テーブル300と、PFリンク状態管理テーブル200とを有する。
The
PF監視部101、モード切替部104、及びVF MMIOエミュレーション部102は、各処理を行う処理部として集積回路化するなどしてハードウェアで実現することもできる。以下の説明において、コンピュータプログラムが主語になる場合は、実際にはそのコンピュータプログラムを実行するCPUによって処理が行われるものとする。なお、各処理部をハードウェアで実現した場合にはその各処理部が主体となって各処理を行う。また、以下の説明では、「xxxテーブル」の表現にて各種情報を説明することがあるが、各種情報は、テーブル以外のデータ構造で表現されていてもよい。データ構造に依存しないことを示すために「xxxテーブル」を「xxx情報」と呼ぶことができる。以下、各テーブル200、300及び各部101〜104について説明する。
The
図5は、監視対象デバイス管理テーブル300の構成例を示す。
監視対象デバイス管理テーブル300は、ハイパバイザ11で監視する必要のあるPF34を有するSR−IOV対応デバイス30をエントリとして管理する。
FIG. 5 shows a configuration example of the monitoring target device management table 300.
The monitoring target device management table 300 manages the SR-IOV
監視対象デバイス管理テーブル300は、フィールドとして、エントリ番号301と、ベンダID302と、デバイスID303と、サブシステムベンダID304と、サブシステムデバイスID305とを有する。つまり、監視対象デバイス管理テーブル300は、PCIデバイスの種類毎に異なるIDの組み合わせを有する。
The monitored device management table 300 includes an
例えば、図5において、エントリ番号「0」のエントリ300は、ベンダIDが「0xAAAA」、デバイスIDが「0xBBBB」、サブシステムベンダIDが「0xCCCC」、サブシステムデバイスIDが「0xDDDD」のデバイスに対応する。
For example, in FIG. 5, an
ハイパバイザ11は、PCIコンフィグ51を参照して、監視対象デバイス管理テーブル300のエントリ300と一致するベンダID、デバイスID、サブシステムベンダID、及びサブシステムデバイスIDの組み合わせを有するデバイスの種類を特定し、その特定したデバイスの種類に係るPF34を監視対象とする。
The
監視対象デバイス管理テーブル300は、ハイパバイザ11に予め設定されていても良いし、ハイパバイザ11起動時に所定の処理によって自動的に生成されても良い。
The monitoring target device management table 300 may be set in the
図6は、PFリンク状態管理テーブル200の構成例を示す。
PFリンク状態管理テーブル200は、PF34の現状のリンク状態をエントリ210として管理する。
FIG. 6 shows a configuration example of the PF link state management table 200.
The PF link state management table 200 manages the current link state of the
PFリンク状態管理テーブル200は、フィールドとして、エントリ番号201と、セグメント番号202と、バス番号203と、デバイス番号204と、ファンクション番号205と、PFリンク状態206とを有する。
The PF link state management table 200 includes an
セグメント番号202と、バス番号204と、デバイス番号204と、ファンクション番号205とを組み合わせた番号を「デバイス識別番号」といっても良い。つまり、1つのエントリ210が、1つのPF34に対応する。
A number obtained by combining the
PFリンク状態206は、PF34の現状のリンク状態が、「リンクアップ」又は「リンクダウン」の何れであるかを示す。例えば、PFリンク状態206が「1」の場合を「リンクアップ」、「0」の場合を「リンクダウン」としても良い。PFリンク状態206は、PF34のリンク状態の変化に伴って適宜更新される。
The
ハイパバイザ11は、監視対象デバイス管理テーブル300にエントリ310されているPCIデバイスの種類に基づいて特定される或るPF34のリンク状態を、このPFリンク状態管理テーブル200で管理する。
The
例えば、図6において、エントリ番号「0」のエントリ210は、セグメント番号が「0x0」、バス番号が「0xaa」、デバイス番号が「0xa」、ファンクション番号が「0x0」のPF34のPFリンク状態が「リンクアップ」であることを示す。以下、図3の説明に戻る。
For example, in FIG. 6, the
PF監視部101は、PFリンク状態管理テーブル200に格納されているPF34を監視する。つまり、PF監視部101は、PFリンク状態管理テーブル200に格納されている各PF34のリンク状態を、所定のタイミング(例えば、1秒間隔)で取得する。そして、PF監視部101は、その取得したリンク状態(つまり、リンクアップ又はリンクダウン)を、そのPF34に対応するエントリ210のPFリンク状態206に格納する。ここで、PFリンク状態206の変化を検知した場合、PF監視部101は、モード設定手段104に、モードの切替を要求する。
The
例えば、PFリンク状態206が「リンクアップ」から「リンクダウン」に変化したことを検知した場合、PF監視部101は、モード設定手段104に「エミュレーションモード」への切替を要求する。
For example, when it is detected that the
例えば、PF34リンク状態206が「リンクダウン」から「リンクアップ」に変化したことを検知した場合、PF監視部101は、モード設定手段104に「パススルーモード」への切替を要求する。各モードの詳細については後述する。
For example, when it is detected that the
モード切替部104は、ハイパバイザ11におけるVF32に係る動作モードを設定する。モード切替部104は、PF監視部101から「パススルーモード」への切替要求を受信した場合、ハイパバイザ11がパススルーモード(第1モード)で動作するように設定する。
The
例えば、モード切替部104は、物理メモリ42のページテーブル52のVF32に係るMMIO(Memory−Mapped I/O)領域に対応するValidビットを「ON」に設定する。これにより、ゲストOS13は、従来と同様にVF32にアクセスできる。
For example, the
モード切替部104は、PF監視部101から「エミュレーションモード」への切替要求を受信した場合、ハイパバイザ11がエミュレーションモード(第2モード)で動作するように設定する。
When the
例えば、モード切替部104は、物理メモリ42のページテーブル52のVF32に係るMMIO領域に対応するValidビットを「OFF」に設定する。この場合、ゲストOS13がVF32にアクセスした場合、ページフォルト(エラー)が発生する。つまり、エミュレーションモードでは、意図的にページフォルトを発生させているとも言える。
For example, the
このページフォルトは、物理計算機10からハイパバイザ11に割込通知される。このページフォルトの割込通知を論理CPU割込ハンドラ103がトラップする。
This page fault is notified from the
論理CPU割込ハンドラ103は、物理計算機10からのページフォルト割込通知をトラップすると、VF MMIOエミュレーション部102に対して、エミュレーション要求を発行する。上述のとおり、このページフォルト割込通知は、モード切替部104によってエミュレーションモードが設定されている場合に発生する。
When the logical CPU interrupt
VF MMIOエミュレーション部102は、VF32をエミュレートする。VF MMIOエミュレーション部102は、ゲストOS13からのVF321へのアクセスに対して、ゲストOS12があたかもSR−IOV対応デバイス30の有するVF32にアクセスしたように振る舞うことによって、VF32をエミュレートする。つまり、ゲストOS12は、SR−IOV対応デバイス30の有するVF32にアクセスしたのか、それともVF MMIOエミュレーション部102によってエミュレートされたVFにアクセスしたのかを区別し得ない。
The VF
アクセスVF MMIOエミュレーション部102は、論理CPU割込ハンドラ103から、エミュレーション要求を受信すると、ゲストOS13からのVF32へのアクセス(コマンド)の応答を格納すべき記憶領域(以下「VF応答格納領域」という)に、VF32がリンクダウン状態である旨を格納する。そして、VF MMIOエミュレーション部102は、ゲストOS13に対して、VF32へのアクセスに対する完了通知(仮想I/O割込通知)を発行する。これにより、PF34がリンクダウンしている場合、ゲストOS13は、VF32がリンクダウン状態であることを正しく認識することができる。
When the access VF
以下、「パススルーモード」の場合と、「エミュレーションモード」の場合とにおける仮想計算機システムの動作例を、図面を用いて更に説明する。 Hereinafter, operation examples of the virtual machine system in the “pass-through mode” and the “emulation mode” will be further described with reference to the drawings.
図7は、パススルーモードの場合における仮想計算機システムの動作例を説明するための図である。 FIG. 7 is a diagram for explaining an operation example of the virtual machine system in the pass-through mode.
モード切替部104は、PF監視手段101から「パススルーモード」への切替要求を受信すると、物理メモリ42のページテーブル52のVF32に係るMMIO領域に対応するValidビット63を「ON」に設定する(S1101)。
When the
ゲストOS13は、例えば、SR−IOV対応デバイス30の有するコマンドI/Fレジスタ61に、VF32のリンク状態を取得するコマンド(以下「VFリンク状態取得コマンド」という)を書き込む(S1102)。
For example, the
ここで、Validビット63は「ON」なので、このVFリンク状態取得コマンドの書き込みは成功する。
Here, since the
SR−IOV対応デバイス30は、このコマンドI/Fレジスタ61に書き込まれたVFリンク状態取得コマンドに基づいて、VF応答格納領域62にVF32のリンク状態を書き込む(S1103)。本実施例では、PF34のリンク状態が「リンクアップ」の場合にこのパススルーモードとなるので、ここでは、SR−IOV対応デバイス30は、VF応答格納領域62に、VF32は「リンクアップ状態」である旨を書き込む。このVF応答格納領域62は、物理メモリ42に存在しても良いし、他の記憶領域に存在しても良い。
The SR-IOV
そして、物理計算機10が発行したコマンド完了通知をハイパバイザ11が受け、ゲストOS13に通知(仮想I/O割込通知)する(S1104)。
Then, the
ゲストOS13は、このコマンド完了通知を受けて、VF応答格納領域62からVF32のリンク状態を取得する(S1105)。これにより、ゲストOS13は、VF32が「リンクアップ状態」であることを認識する。
Upon receiving this command completion notification, the
ここで、仮に、仮想計算機システムが、上記の課題で述べたようなPFのリンク状態が「リンクアップ」から「リンクダウン」に変化した場合に、そのPFに対応するVFのリンク状態を「リンクアップ」と応答するSR−IOV対応デバイスを備えているとする。このSR−IOV対応デバイスは、PFのリンク状態が「リンクダウン」の場合、上記のステップS1103において、VF応答格納領域にVFは「リンクアップ状態」であると書き込む。例えば、SR−IOVデバイスが、PFがリンクダウンの時にもVFとVFとの間で通信を継続させるように設計されている場合等である。この場合、ゲストOSは、PFが「リンクダウン」しているにも関わらず、そのPF34に対応するVF32が「リンクアップ状態」であると誤認識してしまう。
Here, if the virtual machine system changes the link state of the PF as described in the above problem from “link up” to “link down”, the link state of the VF corresponding to the PF is changed to “link”. It is assumed that an SR-IOV compatible device responding “Up” is provided. When the link state of the PF is “link down”, the SR-IOV-compatible device writes in step S1103 that the VF is “link up state” in the VF response storage area. For example, when the SR-IOV device is designed to continue communication between VF even when the PF is linked down. In this case, the guest OS erroneously recognizes that the
しかし、本実施例に係る仮想計算機システムは、PF34のリンク状態が「リンクダウン」である場合、次のエミュレーションモードで動作するので、このような誤認識が発生しないのである。
However, since the virtual machine system according to the present embodiment operates in the next emulation mode when the link state of the
図8は、エミュレーションモードの場合における仮想計算機システムの動作例を説明するための図である。 FIG. 8 is a diagram for explaining an operation example of the virtual machine system in the emulation mode.
モード切替部104は、PF監視部101から「エミュレーションモード」への切替要求を受信すると、物理メモリ42のページテーブル52のVF32に係るMMIO領域に対応するValidビット63を「OFF」に設定する(S1201)。
When the
ゲストOS13は、コマンドI/Fレジスタ61に、VF32のVFリンク状態取得コマンドを書き込もうとする(S1202)。しかし、Validビット63が「OFF」なので、このVFリンク状態取得コマンドのアクセスは失敗する。
The
よって、物理計算機10は、ハイパバイザ11に、ページフォルト割込通知を発行する(S1203)。
Therefore, the
論理CPU割込ハンドラ103は、このページフォルト割込通知を検知すると、VF MMIOエミュレーション部102に、エミュレーション要求を発行する(S1204)。
When detecting the page fault interrupt notification, the logical CPU interrupt
VF MMIOエミュレーション部102は、ゲストOS13からのコマンドがVFリンク状態取得コマンドである場合、VF応答格納領域62に、VF32は「リンクダウン状態」である旨を書き込む(S1205)。
When the command from the
そして、VF MMIOエミュレーション部102は、ゲストOS13にコマンド完了通知(仮想I/O割込通知)を発行する(S1206)。
Then, the VF
ゲストOS13は、このコマンド完了通知を受けて、VF応答格納領62からVF32のリンク状態を取得する(S1206)。これにより、ゲストOS13は、VF32のリンク状態が「リンクダウン状態」であることを正しく認識できる。
Upon receiving this command completion notification, the
上述の構成によれば、SR−IOV対応デバイス30に改修(実質的な改修)を加えなくても、ゲストOS13にVF32のリンク状態を正しく認識させることができる。また、仮想計算機12及び/又はゲストOS13に改修を加えなくても、ゲストOS13に正しいVF32のリンク状態を認識させることができる。つまり、物理計算機10がPF34とのリンク状態を正しくVF32のリンク状態が異なり得るに反映させることのできないSR−IOV対応デバイス30を備える場合であっても、その問題をハイパバイザ11内で吸収することができる。次に、各手段の処理の詳細について、図面を参照しながら説明する。
According to the above-described configuration, the
図9は、PFリンク状態管理テーブル200の作成処理の一例を示すフローチャートである。このPFリンク状態管理テーブル200の作成処理は、ハイパバイザ11の起動時に実行されるとしても良い。
FIG. 9 is a flowchart illustrating an example of a process for creating the PF link state management table 200. The creation process of the PF link state management table 200 may be executed when the
PF監視部101は、仮想計算機システム内に未確認デバイスが残っているか否かを判定する(S101)。未確認デバイスが残っていない場合(S101:NO)、PF監視部101は、当該処理を終了する(END)。
The
未確認デバイスが残っている場合(S101:YES)、PF監視部101は、未確認デバイスの1つを選択する(S102)。そして、PF監視部101は、その選択した未確認デバイスのPCIコンフィグ51を参照し、そのデバイスのデバイス識別情報を特定する(S103)。
When an unconfirmed device remains (S101: YES), the
PF監視部101は、その特定したデバイス識別情報が、監視対象デバイス管理テーブル300の何れかのエントリ310に一致するか否かを判定する(S104)。
The
デバイス識別情報が監視対象デバイス管理テーブル300の何れかのエントリ310に一致した場合(S104:YES)、PF監視部101は、そのデバイスに係るPF34のセグメント番号、バス番号、デバイス番号及びファンクション番号を特定し、PFリンク状態管理テーブル200に新規エントリ210として登録する(S105)。このとき、PF監視部101は、この新規エントリ210のPFリンク状態206の初期値を「リンクダウン状態」としても良い。
When the device identification information matches any
デバイス識別情報が監視対象デバイス管理テーブル300の何れのエントリ310にも一致しない場合(S104:NO)、PF監視部101は、そのままステップS101に戻る。
If the device identification information does not match any
以上の処理により、監視対象のデバイスに係るPF34が、PFリンク状態管理テーブル200に登録される。
Through the above processing, the
図10は、PF34のリンク状態の変化を検知する処理の一例を示すフローチャートである。この処理は、ハイパバイザ11の稼働中、繰り返し実行されるとして良い。
FIG. 10 is a flowchart illustrating an example of a process for detecting a change in the link state of the
PF監視部101は、PFリンク状態管理テーブル200の最初のエントリ210を選択する(S201)。PF34監視手段101は、その選択したエントリ210に係るPF34のリンク状態を取得する(S202)。
The
PF34監視手段は、その取得したリンク状態と、その選択したエントリに係るリンク状態とを比較し、リンク状態が変化しているか否かを判定する(S203)。リンク状態が変化していない場合(S203:NO)、PF監視部101は、ステップS210に進む。
The
リンク状態が変化している場合(S203:YES)、PF監視部101は、その選択したエントリ210のPFリンク状態206を、その取得したPF34のリンク状態に書き換える(S204)。
When the link state has changed (S203: YES), the
PF監視部101は、その取得したPF34のリンク状態が「リンクダウン」であるか否かを判定する(S205)。
The
その取得したPF34のリンク状態が「リンクダウン」である場合(S205:YES)、PF監視部101は、モード切替部104に、「エミュレーションモード」への切替を要求し(S207)、ステップS210に進む。
When the acquired link state of the
その取得したPF34のリンク状態が「リンクアップ」である場合(S205:NO)、PF監視部101は、モード切替部104に、「パススルーモード」への切替を要求し(S206)、ステップS210に進む。
When the acquired link state of the
ステップS210において、PF監視部101は、PFリンク状態管理テーブル200に未選択のエントリ210が残っているか否かを判定する(S210)。
In step S210, the
PFリンク状態管理テーブル200に未選択のエントリ210が残っている場合(S210:YES)、PF監視部101は、未選択のエントリ210の中から次のエントリ210を選択し(S211)、ステップS202に戻る。
When the
PFリンク状態管理テーブル200に未選択のエントリ210が残っていない場合(S210:NO)、PF監視部101は、PFリンク状態管理テーブル200に格納されているエントリ210を全て未選択にする(S220)。そして、PF監視部101は、例えば1秒待機した後(S211)、ステップS201に戻る。つまり、PF監視部101は、PFリンク状態管理テーブル200に登録されている全てのエントリ210について一通りリンク状態を確認したので、また最初から各エントリのリンク状態を確認する。
When the
以上の処理により、PFリンク状態管理テーブル200に登録されているPF34のリンク状態の変化を検知することができる。
With the above processing, a change in the link state of the
図11は、モード切替部104における処理の一例を示すフローチャートである。
FIG. 11 is a flowchart illustrating an example of processing in the
モード切替部104は、PF監視部101から発行されたモード切替要求(図10のステップS206、S207に対応)が、パススルーモードへの切替要求であるか、又はエミュレーションモードへの切替要求であるかを判定する(S301)。
The
パススルーモードへの切替要求である場合(S301:パススルーモード)、モード切替部104は、ページテーブル52のVF32に係るMMIO領域に対応するValidビット63を「ON」に設定し(S302)、当該処理を終了する(END)。
When the request is for switching to the pass-through mode (S301: pass-through mode), the
エミュレーションモードへの切替要求である場合(S303:エミュレーションモード)、モード切替部104は、ページテーブル52のVF32に係るMMIO領域に対応するValidビット63を「OFF」に設定し(S303)、当該処理を終了する(END)。
If the request is for switching to the emulation mode (S303: emulation mode), the
図12は、VF MMIOエミュレーション部102における処理の一例を示すフローチャートである。
FIG. 12 is a flowchart illustrating an example of processing in the VF
このVF MMIOエミュレーション部102は、上述の通り、VF32に係るMMIO領域に対応するValidビットが63「OFF」の場合に実行される。つまり、このVF MMIOエミュレーション部102は、ハイパバイザ11がエミュレーションモードの場合に実行される。
As described above, the VF
VF MMIOエミュレーション部102は、ゲストOS13からのコマンドが、コマンドI/Fレジスタ61への書き込みであるか否かを判定する(S401)。
The VF
ゲストOS13からのコマンドがコマンドI/Fレジスタ61への書き込みでない場合(S401:NO)、VF MMIOエミュレーション部102は、ゲストOS13からのコマンドをそのままVF32に通し(S420)、当該処理を終了する(END)。
If the command from the
ゲストOS13からのコマンドがコマンドI/Fレジスタ61への書き込みである場合(S301:YES)、VF MMIOエミュレーション部102は、このコマンドがVFリンク状態取得コマンドであるか否かを判定する(S410)。
When the command from the
ゲストOS13からのコマンドがVF32リンク状態取得コマンドでない場合(S410:NO)、VF MMIOエミュレーション部102は、ゲストOS13からのコマンドをそのままVF32に通し(S420)、当該処理を終了する(END)。つまり、このコマンドは、通常通りコマンドI/Fレジスタ61に書き込まれる。
When the command from the
ゲストOS13からのコマンドがVF32リンク状態取得コマンドである場合(S410:YES)、VF MMIOエミュレーション部102は、VF応答格納領域62に、VF32がリンクダウン状態である旨を書き込む(S411)。
When the command from the
そして、VF MMIOエミュレーション部102は、ゲストOS13に対してコマンド完了通知(仮想I/O割込通知)を上げ(S412)、当該処理を終了する(END)。このコマンド完了通知を受けたゲストOS13は、VF応答格納領域62からVF32のリンク状態(つまり「リンクダウン状態」)を取得する。
Then, the VF
上記の図12及び図13の処理により、図10及び図11に示したように、ゲストOS13は、PF34のリンク状態に対応したVF32のリンク状態を正しく取得することができる。つまり、ゲストOS13は、PF34がリンクダウンの場合には、VF32がリンクダウン状態であることを正しく認識することができる。
12 and 13, the
上述した実施例は、本発明の説明のための例示であり、本発明の範囲をそれらの実施例にのみ限定する趣旨ではない。当業者は、本発明の要旨を逸脱することなしに、他の様々な態様で本発明を実施することができる。 The above-described embodiments are examples for explaining the present invention, and are not intended to limit the scope of the present invention only to these embodiments. Those skilled in the art can implement the present invention in various other modes without departing from the gist of the present invention.
上述した実施例では、ハイパバイザ11がPF34のリンクダウンを検知してVF応答格納領域62にVF32がリンクダウン状態である旨をライトし、ゲストOS13はそのVF応答格納領域62を参照することでVF32がリンクダウン状態であることを認識しているが、例えば、ハイパバイザ11はPF34のリンクダウンを検知した場合、そのPF34に対応するVF32がリンクダウン状態となった旨をゲストOS13に通知するとしても良い。
In the above-described embodiment, the
1…仮想計算機システム 10…物理計算機 11…ハイパバイザ 12…仮想計算機 13…ゲストOS 30…SR−IOV対応デバイス
DESCRIPTION OF
Claims (8)
前記物理CPU及び前記物理メモリを論理的に分割してなる論理資源が前記仮想化機構によって割り当てられた仮想計算機上で、ゲストOS(Operating System)が稼動する仮想計算機システムにおいて、
前記SR−IOV対応デバイスは、物理的なネットワークデバイスであるPF(Physical Function)と、前記PFに対応する仮想的なネットワークデバイスであるVF(Virtual Function)とを有し、
前記仮想化機構は、
前記PFのリンク状態を監視し、
監視対象のPFのリンク状態が、リンクアップ状態の場合に第1モードを設定し、リンクダウン状態の場合に第2モードを設定し、
前記第2モードが設定されている場合に、前記ゲストOSからのVFに係るコマンドに対して、前記VFに係るSR−IOV対応デバイスに応答させず、前記VFがリンクダウン状態である旨をエミュレートする
仮想計算機システム。
A physical CPU (Central Processing Unit), a physical memory, a SR-IOV (Single Root I / O Virtualization) compatible device, and a virtualization mechanism;
In a virtual machine system in which a guest OS (Operating System) runs on a virtual machine to which logical resources obtained by logically dividing the physical CPU and the physical memory are allocated by the virtualization mechanism,
The SR-IOV compatible device has a PF (Physical Function) that is a physical network device and a VF (Virtual Function) that is a virtual network device corresponding to the PF,
The virtualization mechanism is:
Monitor the link status of the PF,
The first mode is set when the link status of the monitored PF is the link up state, and the second mode is set when the link state is the link down state.
When the second mode is set, the SR-IOV compatible device related to the VF is not responded to the command related to the VF from the guest OS, and the fact that the VF is in the link down state is emulated. Virtual computer system to rate.
請求項1に記載の仮想計算機システム。
2. The virtual device according to claim 1, wherein, when the first mode is set, the virtualization mechanism causes the SR-IOV compatible device related to the VF to respond to the command related to the VF from the guest OS. Computer system.
前記ゲストOSからのVFに係るコマンドがVFのリンク状態を取得する旨のコマンドである場合に、前記VFに係るSR−IOV対応デバイスに応答させず、前記VFがリンクダウン状態である旨をエミュレートし、
前記ゲストOSからのVFに係るコマンドがVFのリンク状態を取得する旨のコマンドでない場合は、前記VFに係るSR−IOVデバイスに応答させる
請求項2に記載の仮想計算機システム。
The virtualization mechanism, when the second mode is set,
When the command related to the VF from the guest OS is a command for obtaining the link status of the VF, the SR-IOV compatible device related to the VF is not responded and the fact that the VF is in the link down status is emulated. Rate and
3. The virtual machine system according to claim 2, wherein, when the command related to the VF from the guest OS is not a command for acquiring the link state of the VF, the virtual machine system according to claim 2 is caused to respond to the SR-IOV device related to the VF.
前記仮想化機構は、前記VFに係るコマンドの処理のエラーを検知して、前記VFがリンクダウン状態である旨をエミュレートする
請求項1乃至3の何れか1項に記載の仮想計算機システム。
The setting of the second mode is to set the processing of the command related to the VF from the guest OS to be an error,
4. The virtual computer system according to claim 1, wherein the virtualization mechanism detects an error in processing a command related to the VF and emulates that the VF is in a link down state. 5.
請求項4に記載の仮想計算機システム。
The setting that causes an error in the processing of the command related to the VF means that an MMIO (Memory-Mapped I / O) area related to the VF is set in the physical memory so that the SR-IOV compatible device related to the VF does not respond. The virtual computer system according to claim 4, wherein a flag referred to for identification is set to a state in which reference is impossible.
前記VFがリンクダウン状態である旨のエミュレートとは、前記ゲストOSからのVFに係るコマンドの応答が格納される仮想メモリ上の領域に対応する物理メモリ上の領域に、前記VFがリンクダウン状態である旨を書き込むことである
請求項1乃至5の何れか1項に記載の仮想計算機システム。
A virtual memory of a virtual machine to which a logical resource obtained by logically dividing physical memory by the virtualization mechanism is allocated, and a response to a command related to a VF from the guest OS is stored in an area on the virtual memory Is supposed to
Emulation that the VF is in a link-down state means that the VF is linked down to an area on the physical memory corresponding to an area on the virtual memory in which a response to a command related to the VF from the guest OS is stored. The virtual machine system according to claim 1, wherein a state information is written.
請求項1乃至6の何れか1項に記載の仮想計算機システム。
The virtualization mechanism monitors a PF link state of an SR-IOV-compatible device set as a monitoring target, and changes a mode setting when a change in the link state of the PF is detected. The virtual computer system according to any one of the above.
物理CPU及び物理メモリを論理的に分割してなる論理資源が前記仮想化機構によって割り当てられた仮想計算機上で、ゲストOS(Operating System)が稼動する仮想計算機システムにおいて、
前記SR−IOV対応デバイスは、物理的なネットワークデバイスであるPF(Physical Function)と、前記PFに対応する仮想的なネットワークデバイスであるVF(Virtual Function)とを有し、
前記仮想化機構において、前記PFのリンク状態を監視し、監視対象のPFのリンク状態が、リンクアップ状態の場合に第1モードを設定し、リンクダウン状態の場合に第2モードを設定し、前記第2モードが設定されている場合に、前記ゲストOSからのVFに係るコマンドに対して、前記VFに係るSR−IOV対応デバイスに応答させず、前記VFがリンクダウン状態である旨をエミュレートする
SR−IOV対応デバイスの制御方法。
A physical CPU (Central Processing Unit), a physical memory, a SR-IOV (Single Root I / O Virtualization) compatible device, and a virtualization mechanism;
In a virtual machine system in which a guest OS (Operating System) runs on a virtual machine to which a logical resource obtained by logically dividing a physical CPU and a physical memory is allocated by the virtualization mechanism,
The SR-IOV compatible device has a PF (Physical Function) that is a physical network device and a VF (Virtual Function) that is a virtual network device corresponding to the PF,
In the virtualization mechanism, the link status of the PF is monitored, the first mode is set when the link status of the monitored PF is a link-up status, and the second mode is set when the link-down status is set, When the second mode is set, the SR-IOV compatible device related to the VF is not responded to the command related to the VF from the guest OS, and the fact that the VF is in the link down state is emulated. A method for controlling an SR-IOV compatible device to rate.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013116739A JP5917441B2 (en) | 2013-06-03 | 2013-06-03 | Virtual computer system and SR-IOV compatible device control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013116739A JP5917441B2 (en) | 2013-06-03 | 2013-06-03 | Virtual computer system and SR-IOV compatible device control method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014235578A JP2014235578A (en) | 2014-12-15 |
JP5917441B2 true JP5917441B2 (en) | 2016-05-11 |
Family
ID=52138232
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013116739A Expired - Fee Related JP5917441B2 (en) | 2013-06-03 | 2013-06-03 | Virtual computer system and SR-IOV compatible device control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5917441B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6424632B2 (en) * | 2015-01-08 | 2018-11-21 | 富士通株式会社 | Load calculation method, load calculation program and load calculation device |
WO2019124450A1 (en) * | 2017-12-20 | 2019-06-27 | 日本電気株式会社 | Input/output execution device, device virtualization system, input/output execution method, and recording medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7793139B2 (en) * | 2006-12-12 | 2010-09-07 | International Business Machines Corporation | Partial link-down status for virtual Ethernet adapters |
JP4295783B2 (en) * | 2006-12-13 | 2009-07-15 | 株式会社日立製作所 | Computer and virtual device control method |
JP5251188B2 (en) * | 2008-03-18 | 2013-07-31 | 富士通株式会社 | Information processing apparatus, information processing apparatus control method, and computer program |
JP4934642B2 (en) * | 2008-06-11 | 2012-05-16 | 株式会社日立製作所 | Computer system |
JP5585844B2 (en) * | 2011-03-25 | 2014-09-10 | 株式会社日立製作所 | Virtual computer control method and computer |
JP5733628B2 (en) * | 2011-09-29 | 2015-06-10 | 株式会社日立製作所 | Computer apparatus for controlling virtual machine and control method of virtual machine |
JP5846836B2 (en) * | 2011-10-11 | 2016-01-20 | 株式会社日立製作所 | Virtual machine, virtual machine system, and virtual machine control method |
-
2013
- 2013-06-03 JP JP2013116739A patent/JP5917441B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014235578A (en) | 2014-12-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3608792B1 (en) | Managed switching between one or more hosts and solid state drives (ssds) based on the nvme protocol to provide host storage services | |
US9489274B2 (en) | System and method for performing efficient failover and virtual machine (VM) migration in virtual desktop infrastructure (VDI) | |
US9858102B2 (en) | Data path failover method for SR-IOV capable ethernet controller | |
US9912535B2 (en) | System and method of performing high availability configuration and validation of virtual desktop infrastructure (VDI) | |
JP6029550B2 (en) | Computer control method and computer | |
US8527666B2 (en) | Accessing a configuration space of a virtual function | |
US20130219391A1 (en) | Server and method for deploying virtual machines in network cluster | |
JP2013250950A (en) | Computer system, virtualization mechanism and control method of computer system | |
JP2010003061A (en) | Computer system and method for changing i/o configuration thereof | |
US9131031B2 (en) | Virtual computer system, virtual computer management program, and MAC address management method | |
US11995019B2 (en) | PCIe device with changeable function types and operating method thereof | |
US20160239323A1 (en) | Virtual Remote Direct Memory Access Management | |
US20170075816A1 (en) | Storage system | |
US20120198446A1 (en) | Computer System and Control Method Therefor | |
CN107145304B (en) | Server, storage system and related method | |
US20150082014A1 (en) | Virtual Storage Devices Formed by Selected Partitions of a Physical Storage Device | |
JP5917441B2 (en) | Virtual computer system and SR-IOV compatible device control method | |
JP5966466B2 (en) | Backup control method and information processing apparatus | |
WO2017056220A1 (en) | Computer system, command transfer method, and transfer device | |
US10466916B2 (en) | System and method of dynamic write protect of storage devices exposed by baseboard management controller (BMC) | |
CN107147516B (en) | Server, storage system and related method | |
US20150269092A1 (en) | Information processing device and shared memory management method | |
US9740641B2 (en) | Information processing device, I/O system, and I/O control method | |
JP6035993B2 (en) | Information processing apparatus, apparatus management method, and apparatus management program | |
CN112580086B (en) | Access protection method, device and equipment for configuration file and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150423 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160311 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20160315 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160406 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5917441 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |