JP2014235578A - Virtual machine system, control method of sr-iov compatible device - Google Patents

Virtual machine system, control method of sr-iov compatible device Download PDF

Info

Publication number
JP2014235578A
JP2014235578A JP2013116739A JP2013116739A JP2014235578A JP 2014235578 A JP2014235578 A JP 2014235578A JP 2013116739 A JP2013116739 A JP 2013116739A JP 2013116739 A JP2013116739 A JP 2013116739A JP 2014235578 A JP2014235578 A JP 2014235578A
Authority
JP
Japan
Prior art keywords
link
virtual
guest
mode
iov
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2013116739A
Other languages
Japanese (ja)
Other versions
JP5917441B2 (en
Inventor
史朗 野原
Shiro Nohara
史朗 野原
良太 野口
Ryota Noguchi
良太 野口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2013116739A priority Critical patent/JP5917441B2/en
Publication of JP2014235578A publication Critical patent/JP2014235578A/en
Application granted granted Critical
Publication of JP5917441B2 publication Critical patent/JP5917441B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To emulate VF in an SR-IOV compatible device.SOLUTION: In a virtual machine system in which a guest OS operates on a virtual machine by a virtualization mechanism, an SR-IOV compatible device comprises Physical Function (PF) and Virtual Function (VF). The virtualization mechanism monitors the PF, sets a first mode when a link state of the PF of a monitoring target is in a link-up state, sets a second mode when in a link-down state, and emulates the link-down state of the VF by inhibiting the SR-IOV compatible device related to the VF from responding to a command related to the VF from the guest OS when the second mode is set.

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).

PCI−SIG,Single Root I/O Virtualization and Sharing Specification Revision 1.1,2010年1月20日,P.17PCI-SIG, Single Root I / O Virtualization and Sharing Specification Revision 1.1, January 20, 2010, p. 17

例えば、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.

2つのNICを用いてネットワーク冗長化を行った仮想計算機システムの構成例を示す模式図である。FIG. 3 is a schematic diagram illustrating a configuration example of a virtual machine system in which network redundancy is performed using two NICs. SR−IOV対応のNICを用いて通信ネットワークの冗長化を行った仮想計算機システムの構成例を示す模式図である。It is a schematic diagram showing a configuration example of a virtual machine system in which a communication network is made redundant using an SR-IOV compatible NIC. 仮想計算機システムの構成例を示すブロック図である。It is a block diagram which shows the structural example of a virtual machine system. PCIコンフィグレーションレジスタのフォーマット例を示す。The format example of a PCI configuration register is shown. 監視対象デバイス管理テーブルの構成例である。It is an example of a structure of a monitoring object device management table. PFリンク状態管理テーブルの構成例である。It is a structural example of a PF link state management table. パススルーモードの場合における仮想計算機システムの動作例を説明する図である。It is a figure explaining the operation example of the virtual machine system in the case of pass-through mode. エミュレーションモードの場合における仮想計算機システムの動作例を説明する図である。It is a figure explaining the operation example of the virtual machine system in the case of emulation mode. PFリンク状態管理テーブルの作成処理の一例を示すフローチャートである。It is a flowchart which shows an example of the creation process of a PF link state management table. PFのリンク状態の変化を検知する処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process which detects the change of the link state of PF. モード切替部における処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process in a mode switching part. VF MMIOエミュレーション部における処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process in a VF MMIO emulation part.

以下、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 physical computer 10 includes NICs 21 and 21. The hypervisor 19 virtualizes the resources of the NICs 21 and 21 included in the physical computer 10 as virtual NICs 22 and 22 and allocates them to the virtual computers.

仮想計算機12上のゲストOS13で動作する冗長化ソフトウェア131は、仮想NIC22、22を用いて通信ネットワークの冗長構成1001を組む。これにより、一方のNIC21がリンクダウン状態となっても、他方のNIC21がリンクアップ状態であれば、ゲストOS13は、リンクアップ状態の仮想NIC22を用いて、通信ネットワーク90との通信を継続できる。ここで、リンクアップとは、NIC21が通信ネットワーク90と通信可能な状態をいう。リンクダウンとは、NIC21が通信ネットワーク90と通信不可能な状態をいう。   Redundant software 131 operating on the guest OS 13 on the virtual machine 12 forms a redundant configuration 1001 of a communication network using the virtual NICs 22 and 22. Thereby, even if one NIC 21 is in the link-down state, the guest OS 13 can continue communication with the communication network 90 using the virtual NIC 22 in the link-up state if the other NIC 21 is in the link-up state. Here, the link up refers to a state in which the NIC 21 can communicate with the communication network 90. Link down refers to a state in which the NIC 21 cannot communicate with the communication network 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 compatible device 30 has a function of realizing a plurality of virtual NICs on one device. The SR-IOV compatible device has a PF 34 corresponding to a physical NIC and a VF 32 realized as a virtual NIC. The VF 32 communicates with an external communication network 90 via the PF 34. A plurality of VFs 32 may be associated with one PF 34.

物理計算機10は、SR−IOV対応デバイス30、30を備える。ハイパバイザ19は、物理計算機10の備えるVF32のリソースをVF33、33として仮想計算機12に割り当てる。   The physical computer 10 includes SR-IOV compatible devices 30 and 30. The hypervisor 19 allocates the resources of the VF 32 included in the physical computer 10 to the virtual computer 12 as VFs 33 and 33.

仮想計算機12上のゲストOS13で動作する冗長化ソフトウェア131は、VF33、33を用いて通信ネットワークの冗長構成1101を組む。これにより、一方のVF33がリンクダウン状態となっても、他方のVF33がリンクアップ状態であれば、ゲストOS13は、リンクアップ状態のVF33を用いて、通信ネットワーク90との通信を継続できる。   The redundancy software 131 operating on the guest OS 13 on the virtual computer 12 forms a redundant configuration 1101 of the communication network using the VFs 33 and 33. As a result, even if one VF 33 is in the link-down state, the guest OS 13 can continue communication with the communication network 90 using the VF 33 in the link-up state if the other VF 33 is in the link-up state.

SR−IOV対応デバイス30において、PF34がリンクダウンすると、VF32は外部の通信ネットワーク90と通信できなくなる。   In the SR-IOV compatible device 30, when the PF 34 is linked down, the VF 32 cannot communicate with the external communication network 90.

冗長化ソフトウェア131は、現用系のVF33が外部の通信ネットワークと通信できない場合、待機系のVF33に切り替える。つまり、冗長化ソフトウェア131は、現用系のVF33のリンクダウンを検知すると、待機系のVF33に切り替える。よって、SR−IOV対応デバイス30は、PF34がリンクダウンした時には、そのPF34に対応するVF32のリンク状態を「リンクダウン状態」としなければならない。   The redundancy software 131 switches to the standby VF 33 when the active VF 33 cannot communicate with the external communication network. That is, when the redundancy software 131 detects a link down of the active VF 33, the redundancy software 131 switches to the standby VF 33. Therefore, when the PF 34 is linked down, the SR-IOV compatible device 30 must set the link state of the VF 32 corresponding to the PF 34 to the “link down state”.

ところが、PF34とVF32との間のリンク状態の関係については、SR−IOV規格で規定されていない。そのため、PF34がリンクダウンとなっても、VF32を「リンクダウン状態」とせずに、VF32を「リンクアップ状態」のままとするSR−IOV対応デバイスが存在する。   However, the link state relationship between the PF 34 and the VF 32 is not defined in the SR-IOV standard. For this reason, even if the PF 34 is linked down, there is an SR-IOV compatible device that keeps the VF 32 in the “link up state” without setting the VF 32 in the “link down state”.

このような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 PF 34 is linked down and the active VF 32 cannot communicate with the external communication network 90, the VF 32 remains in the “link up state”. From the software 131, the VF 33 appears as a “link up state”. Therefore, the redundancy software 131 cannot switch the active VF 33 to the standby VF 33 even though the PF 34 is linked down. That is, the redundancy software 131 cannot normally perform communication network redundancy.
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 physical computer 10 and a hypervisor 11.

物理計算機10は、物理CPU41と、物理メモリ42と、記憶デバイス(不図示)、SR−IOV対応デバイス30とを備える。   The physical computer 10 includes a physical CPU 41, a physical memory 42, a storage device (not shown), and an SR-IOV compatible device 30.

物理CPU41は、物理計算機10に係るI/Oを処理したり、様々なコンピュータプログラム(以下「プログラム」という)を実行したりする。   The physical CPU 41 processes I / O related to the physical computer 10 and executes various computer programs (hereinafter referred to as “programs”).

物理メモリ42は、様々なプログラム及びデータ等を一時的に保持する。物理メモリ42内の記憶媒体は、揮発性メモリで良い。揮発性メモリは、DRAM(Dynamic Random Access Memory)等であっても良い。物理メモリ42は、メモリの領域(ページ)を管理するためのページテーブル52を有する。   The physical memory 42 temporarily stores various programs and data. The storage medium in the physical memory 42 may be a volatile memory. The volatile memory may be a DRAM (Dynamic Random Access Memory) or the like. The physical memory 42 has a page table 52 for managing a memory area (page).

記憶デバイス(不図示)は、様々なプログラム及びデータ等を保持する。記憶デバイス内の記憶媒体は、不揮発性メモリでよい。不揮発性メモリは、追記型のメモリ、例えば、フラッシュメモリ、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. Non-volatile memory is write-once memory, for example, flash memory, MRAM (Magnetic Random Access Memory), PRAM (Phase Change Random Access Memory), 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 compatible device 30 is a PCI device compatible with SR-IOV. The SR-IOV compatible device 30 may be a NIC. The SR-IOV compatible device 30 includes, for example, a PCI configuration register 51, a PF 34, and a VF 32.

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 PCI configuration 51.

図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-byte area 401 from the address “0x00” of the PCI configuration 51. “Device 1D” is stored in the 2-byte area 402 from the address “0x02”. The “subsystem vendor ID” is stored in the 2-byte area 403 from the address “0x2C”. “Subsystem device ID” is stored in an area 404 of 2 bytes from the address “0x2E”. With these four pieces of information, the type of PCI device can be determined. Returning to the description of FIG.

PF34は、SR−IOV対応デバイス30において、従来のPCIデバイスの機能を指す。本実施例の場合、このPF34は、物理的なNICに該当する。   The PF 34 indicates a function of a conventional PCI device in the SR-IOV compatible device 30. In the case of this embodiment, the PF 34 corresponds to a physical NIC.

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 VF 32 shares the resource of the PF 34 in the SR-IOV compatible device 30. When a plurality of VFs 32 are associated with one PF 34, the plurality of VFs 32 share the resources of the one PF 34. In the case of the present embodiment, the VF 32 corresponds to a virtual NIC. The VF 32 is recognized as a PCI device by the virtual machine 12. That is, in this embodiment, the virtual machine 12 recognizes the VF 32 as a virtual NIC (VF 321). Therefore, when the PF 34 is linked down, the virtual machine 12 cannot access the communication network 90 via the VF 32 (VF 321) sharing the resource of the PF 34.

仮想計算機12は、仮想的なリソース(以下「仮想リソース」という)である、仮想CPU323と、仮想メモリ322とを有する。これらの仮想リソースは、ハイパバイザ11が、物理計算機10のリソースを割り当てることによって実現される。仮想計算機12上では、ゲストOS13が実行される。つまり、ゲストOS13は、仮想計算機12の仮想リソースを通常のリソースとして認識する。よって、ゲストOS13は、VF321(VF32)を介して通信ネットワーク90にアクセスすることができる。   The virtual computer 12 includes a virtual CPU 323 and a virtual memory 322 which are virtual resources (hereinafter referred to as “virtual resources”). These virtual resources are realized by the hypervisor 11 assigning resources of the physical computer 10. On the virtual machine 12, a guest OS 13 is executed. That is, the guest OS 13 recognizes the virtual resource of the virtual machine 12 as a normal resource. Therefore, the guest OS 13 can access the communication network 90 via the VF 321 (VF 32).

ハイパバイザ11は、仮想化機構の一種であり、物理CPU41及び物理メモリ42を論理的に分割してなる論理リソースを、仮想計算機12に仮想リソースとして割り当てる。これにより、仮想計算機12が実現される。仮想化機構の一種であるハイパバイザ11は、物理計算機10上で動作するソフトウェアであっても良いし、物理計算機10に備えられたハードウェアであっても良いし、物理計算機10とは別の装置であっても良いし、又はこれらの組み合わせであっても良い。   The hypervisor 11 is a kind of virtualization mechanism, and allocates logical resources obtained by logically dividing the physical CPU 41 and the physical memory 42 to the virtual machine 12 as virtual resources. Thereby, the virtual machine 12 is realized. The hypervisor 11, which is a kind of virtualization mechanism, may be software that operates on the physical computer 10, may be hardware included in the physical computer 10, or may be a device different from the physical computer 10. Or a combination thereof.

ハイパバイザ11は、PF監視部101と、VF MMIOエミュレーション部102と、論理CPU割込ハンドラ103と、モード切替部104とを有する。また、ハイパバイザ11は、監視対象デバイス管理テーブル300と、PFリンク状態管理テーブル200とを有する。   The hypervisor 11 includes a PF monitoring unit 101, a VF MMIO emulation unit 102, a logical CPU interrupt handler 103, and a mode switching unit 104. Further, the hypervisor 11 includes a monitoring target device management table 300 and a PF link state management table 200.

PF監視部101、モード切替部104、及びVF MMIOエミュレーション部102は、各処理を行う処理部として集積回路化するなどしてハードウェアで実現することもできる。以下の説明において、コンピュータプログラムが主語になる場合は、実際にはそのコンピュータプログラムを実行するCPUによって処理が行われるものとする。なお、各処理部をハードウェアで実現した場合にはその各処理部が主体となって各処理を行う。また、以下の説明では、「xxxテーブル」の表現にて各種情報を説明することがあるが、各種情報は、テーブル以外のデータ構造で表現されていてもよい。データ構造に依存しないことを示すために「xxxテーブル」を「xxx情報」と呼ぶことができる。以下、各テーブル200、300及び各部101〜104について説明する。   The PF monitoring unit 101, the mode switching unit 104, and the VF MMIO emulation unit 102 can also be realized by hardware by integrating them as processing units for performing each process. In the following description, when a computer program is the subject, it is assumed that processing is actually performed by a CPU that executes the computer program. When each processing unit is realized by hardware, each processing unit mainly performs each process. In the following description, various types of information may be described using the expression “xxx table”, but the various types of information may be expressed using a data structure other than a table. In order to show that it does not depend on the data structure, the “xxx table” can be called “xxx information”. Hereinafter, the tables 200 and 300 and the units 101 to 104 will be described.

図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 compatible device 30 having the PF 34 that needs to be monitored by the hypervisor 11 as an entry.

監視対象デバイス管理テーブル300は、フィールドとして、エントリ番号301と、ベンダID302と、デバイスID303と、サブシステムベンダID304と、サブシステムデバイスID305とを有する。つまり、監視対象デバイス管理テーブル300は、PCIデバイスの種類毎に異なるIDの組み合わせを有する。   The monitored device management table 300 includes an entry number 301, a vendor ID 302, a device ID 303, a subsystem vendor ID 304, and a subsystem device ID 305 as fields. That is, the monitoring target device management table 300 has different combinations of IDs for each type of PCI device.

例えば、図5において、エントリ番号「0」のエントリ300は、ベンダIDが「0xAAAA」、デバイスIDが「0xBBBB」、サブシステムベンダIDが「0xCCCC」、サブシステムデバイスIDが「0xDDDD」のデバイスに対応する。   For example, in FIG. 5, an entry 300 with an entry number “0” is a device with a vendor ID “0xAAAA”, a device ID “0xBBBB”, a subsystem vendor ID “0xCCCC”, and a subsystem device ID “0xDDDD”. Correspond.

ハイパバイザ11は、PCIコンフィグ51を参照して、監視対象デバイス管理テーブル300のエントリ300と一致するベンダID、デバイスID、サブシステムベンダID、及びサブシステムデバイスIDの組み合わせを有するデバイスの種類を特定し、その特定したデバイスの種類に係るPF34を監視対象とする。   The hypervisor 11 refers to the PCI configuration 51 and identifies the type of device having a combination of the vendor ID, device ID, subsystem vendor ID, and subsystem device ID that matches the entry 300 of the monitored device management table 300. The PF 34 related to the specified device type is set as a monitoring target.

監視対象デバイス管理テーブル300は、ハイパバイザ11に予め設定されていても良いし、ハイパバイザ11起動時に所定の処理によって自動的に生成されても良い。   The monitoring target device management table 300 may be set in the hypervisor 11 in advance, or may be automatically generated by a predetermined process when the hypervisor 11 is activated.

図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 34 as an entry 210.

PFリンク状態管理テーブル200は、フィールドとして、エントリ番号201と、セグメント番号202と、バス番号203と、デバイス番号204と、ファンクション番号205と、PFリンク状態206とを有する。   The PF link state management table 200 includes an entry number 201, a segment number 202, a bus number 203, a device number 204, a function number 205, and a PF link state 206 as fields.

セグメント番号202と、バス番号204と、デバイス番号204と、ファンクション番号205とを組み合わせた番号を「デバイス識別番号」といっても良い。つまり、1つのエントリ210が、1つのPF34に対応する。   A number obtained by combining the segment number 202, the bus number 204, the device number 204, and the function number 205 may be referred to as a “device identification number”. That is, one entry 210 corresponds to one PF 34.

PFリンク状態206は、PF34の現状のリンク状態が、「リンクアップ」又は「リンクダウン」の何れであるかを示す。例えば、PFリンク状態206が「1」の場合を「リンクアップ」、「0」の場合を「リンクダウン」としても良い。PFリンク状態206は、PF34のリンク状態の変化に伴って適宜更新される。   The PF link state 206 indicates whether the current link state of the PF 34 is “link up” or “link down”. For example, the case where the PF link state 206 is “1” may be “link up”, and the case where it is “0” may be “link down”. The PF link state 206 is appropriately updated as the link state of the PF 34 changes.

ハイパバイザ11は、監視対象デバイス管理テーブル300にエントリ310されているPCIデバイスの種類に基づいて特定される或るPF34のリンク状態を、このPFリンク状態管理テーブル200で管理する。   The hypervisor 11 manages the link state of a certain PF 34 specified based on the type of PCI device entered in the monitored device management table 300 using the PF link state management table 200.

例えば、図6において、エントリ番号「0」のエントリ210は、セグメント番号が「0x0」、バス番号が「0xaa」、デバイス番号が「0xa」、ファンクション番号が「0x0」のPF34のPFリンク状態が「リンクアップ」であることを示す。以下、図3の説明に戻る。   For example, in FIG. 6, the entry 210 with the entry number “0” has the PF link state of the PF 34 with the segment number “0x0”, the bus number “0xaa”, the device number “0xa”, and the function number “0x0”. Indicates “link up”. Returning to the description of FIG.

PF監視部101は、PFリンク状態管理テーブル200に格納されているPF34を監視する。つまり、PF監視部101は、PFリンク状態管理テーブル200に格納されている各PF34のリンク状態を、所定のタイミング(例えば、1秒間隔)で取得する。そして、PF監視部101は、その取得したリンク状態(つまり、リンクアップ又はリンクダウン)を、そのPF34に対応するエントリ210のPFリンク状態206に格納する。ここで、PFリンク状態206の変化を検知した場合、PF監視部101は、モード設定手段104に、モードの切替を要求する。   The PF monitoring unit 101 monitors the PF 34 stored in the PF link state management table 200. That is, the PF monitoring unit 101 acquires the link status of each PF 34 stored in the PF link status management table 200 at a predetermined timing (for example, at intervals of 1 second). Then, the PF monitoring unit 101 stores the acquired link state (that is, link up or link down) in the PF link state 206 of the entry 210 corresponding to the PF 34. Here, when a change in the PF link state 206 is detected, the PF monitoring unit 101 requests the mode setting unit 104 to switch the mode.

例えば、PFリンク状態206が「リンクアップ」から「リンクダウン」に変化したことを検知した場合、PF監視部101は、モード設定手段104に「エミュレーションモード」への切替を要求する。   For example, when it is detected that the PF link state 206 has changed from “link up” to “link down”, the PF monitoring unit 101 requests the mode setting unit 104 to switch to “emulation mode”.

例えば、PF34リンク状態206が「リンクダウン」から「リンクアップ」に変化したことを検知した場合、PF監視部101は、モード設定手段104に「パススルーモード」への切替を要求する。各モードの詳細については後述する。   For example, when it is detected that the PF 34 link state 206 has changed from “link down” to “link up”, the PF monitoring unit 101 requests the mode setting unit 104 to switch to the “pass-through mode”. Details of each mode will be described later.

モード切替部104は、ハイパバイザ11におけるVF32に係る動作モードを設定する。モード切替部104は、PF監視部101から「パススルーモード」への切替要求を受信した場合、ハイパバイザ11がパススルーモード(第1モード)で動作するように設定する。   The mode switching unit 104 sets an operation mode related to the VF 32 in the hypervisor 11. When the mode switching unit 104 receives a request to switch to the “pass-through mode” from the PF monitoring unit 101, the mode switching unit 104 sets the hypervisor 11 to operate in the pass-through mode (first mode).

例えば、モード切替部104は、物理メモリ42のページテーブル52のVF32に係るMMIO(Memory−Mapped I/O)領域に対応するValidビットを「ON」に設定する。これにより、ゲストOS13は、従来と同様にVF32にアクセスできる。   For example, the mode switching unit 104 sets the Valid bit corresponding to the MMIO (Memory-Mapped I / O) area related to the VF32 of the page table 52 of the physical memory 42 to “ON”. As a result, the guest OS 13 can access the VF 32 as in the conventional case.

モード切替部104は、PF監視部101から「エミュレーションモード」への切替要求を受信した場合、ハイパバイザ11がエミュレーションモード(第2モード)で動作するように設定する。   When the mode switching unit 104 receives a request to switch to the “emulation mode” from the PF monitoring unit 101, the mode switching unit 104 sets the hypervisor 11 to operate in the emulation mode (second mode).

例えば、モード切替部104は、物理メモリ42のページテーブル52のVF32に係るMMIO領域に対応するValidビットを「OFF」に設定する。この場合、ゲストOS13がVF32にアクセスした場合、ページフォルト(エラー)が発生する。つまり、エミュレーションモードでは、意図的にページフォルトを発生させているとも言える。   For example, the mode switching unit 104 sets the Valid bit corresponding to the MMIO area related to the VF32 of the page table 52 of the physical memory 42 to “OFF”. In this case, when the guest OS 13 accesses the VF 32, a page fault (error) occurs. In other words, it can be said that a page fault is intentionally generated in the emulation mode.

このページフォルトは、物理計算機10からハイパバイザ11に割込通知される。このページフォルトの割込通知を論理CPU割込ハンドラ103がトラップする。   This page fault is notified from the physical computer 10 to the hypervisor 11 as an interrupt. The logical CPU interrupt handler 103 traps this page fault interrupt notification.

論理CPU割込ハンドラ103は、物理計算機10からのページフォルト割込通知をトラップすると、VF MMIOエミュレーション部102に対して、エミュレーション要求を発行する。上述のとおり、このページフォルト割込通知は、モード切替部104によってエミュレーションモードが設定されている場合に発生する。   When the logical CPU interrupt handler 103 traps the page fault interrupt notification from the physical computer 10, it issues an emulation request to the VF MMIO emulation unit 102. As described above, this page fault interrupt notification occurs when the emulation mode is set by the mode switching unit 104.

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 MMIO emulation unit 102 emulates the VF32. The VF MMIO emulation unit 102 emulates the VF 32 by acting as if the guest OS 12 accessed the VF 32 of the SR-IOV compatible device 30 in response to the access to the VF 321 from the guest OS 13. That is, the guest OS 12 cannot distinguish whether the VF 32 included in the SR-IOV compatible device 30 is accessed or whether the VF emulated by the VF MMIO emulation unit 102 is accessed.

アクセスVF MMIOエミュレーション部102は、論理CPU割込ハンドラ103から、エミュレーション要求を受信すると、ゲストOS13からのVF32へのアクセス(コマンド)の応答を格納すべき記憶領域(以下「VF応答格納領域」という)に、VF32がリンクダウン状態である旨を格納する。そして、VF MMIOエミュレーション部102は、ゲストOS13に対して、VF32へのアクセスに対する完了通知(仮想I/O割込通知)を発行する。これにより、PF34がリンクダウンしている場合、ゲストOS13は、VF32がリンクダウン状態であることを正しく認識することができる。   When the access VF MMIO emulation unit 102 receives an emulation request from the logical CPU interrupt handler 103, the access VF MMIO emulation unit 102 stores a response to access (command) to the VF 32 from the guest OS 13 (hereinafter referred to as “VF response storage area”). ) Stores that the VF 32 is in the link down state. Then, the VF MMIO emulation unit 102 issues a completion notification (virtual I / O interrupt notification) for access to the VF 32 to the guest OS 13. Accordingly, when the PF 34 is linked down, the guest OS 13 can correctly recognize that the VF 32 is in the link down state.

以下、「パススルーモード」の場合と、「エミュレーションモード」の場合とにおける仮想計算機システムの動作例を、図面を用いて更に説明する。   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 mode switching unit 104 receives a request to switch to the “pass-through mode” from the PF monitoring unit 101, the mode switching unit 104 sets the valid bit 63 corresponding to the MMIO area related to the VF32 of the page table 52 of the physical memory 42 to “ON” ( S1101).

ゲストOS13は、例えば、SR−IOV対応デバイス30の有するコマンドI/Fレジスタ61に、VF32のリンク状態を取得するコマンド(以下「VFリンク状態取得コマンド」という)を書き込む(S1102)。   For example, the guest OS 13 writes a command for acquiring the link status of the VF 32 (hereinafter referred to as “VF link status acquisition command”) in the command I / F register 61 of the SR-IOV compatible device 30 (S1102).

ここで、Validビット63は「ON」なので、このVFリンク状態取得コマンドの書き込みは成功する。   Here, since the Valid bit 63 is “ON”, the writing of the VF link state acquisition command is successful.

SR−IOV対応デバイス30は、このコマンドI/Fレジスタ61に書き込まれたVFリンク状態取得コマンドに基づいて、VF応答格納領域62にVF32のリンク状態を書き込む(S1103)。本実施例では、PF34のリンク状態が「リンクアップ」の場合にこのパススルーモードとなるので、ここでは、SR−IOV対応デバイス30は、VF応答格納領域62に、VF32は「リンクアップ状態」である旨を書き込む。このVF応答格納領域62は、物理メモリ42に存在しても良いし、他の記憶領域に存在しても良い。   The SR-IOV compatible device 30 writes the link status of the VF 32 in the VF response storage area 62 based on the VF link status acquisition command written in the command I / F register 61 (S1103). In this embodiment, the pass-through mode is entered when the link state of the PF 34 is “link up”. Therefore, here, the SR-IOV compatible device 30 is in the VF response storage area 62 and the VF 32 is in the “link up state”. Write a message to that effect. The VF response storage area 62 may exist in the physical memory 42 or may exist in another storage area.

そして、物理計算機10が発行したコマンド完了通知をハイパバイザ11が受け、ゲストOS13に通知(仮想I/O割込通知)する(S1104)。   Then, the hypervisor 11 receives the command completion notification issued by the physical computer 10, and notifies the guest OS 13 (virtual I / O interrupt notification) (S1104).

ゲストOS13は、このコマンド完了通知を受けて、VF応答格納領域62からVF32のリンク状態を取得する(S1105)。これにより、ゲストOS13は、VF32が「リンクアップ状態」であることを認識する。   Upon receiving this command completion notification, the guest OS 13 acquires the link status of the VF 32 from the VF response storage area 62 (S1105). As a result, the guest OS 13 recognizes that the VF 32 is in the “link up state”.

ここで、仮に、仮想計算機システムが、上記の課題で述べたような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 VF 32 corresponding to the PF 34 is in the “link up state” even though the PF is “link down”.

しかし、本実施例に係る仮想計算機システムは、PF34のリンク状態が「リンクダウン」である場合、次のエミュレーションモードで動作するので、このような誤認識が発生しないのである。   However, since the virtual machine system according to the present embodiment operates in the next emulation mode when the link state of the PF 34 is “link down”, such erroneous recognition does not occur.

図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 mode switching unit 104 receives a request to switch to the “emulation mode” from the PF monitoring unit 101, the mode switching unit 104 sets the valid bit 63 corresponding to the MMIO area related to the VF32 of the page table 52 of the physical memory 42 to “OFF” ( S1201).

ゲストOS13は、コマンドI/Fレジスタ61に、VF32のVFリンク状態取得コマンドを書き込もうとする(S1202)。しかし、Validビット63が「OFF」なので、このVFリンク状態取得コマンドのアクセスは失敗する。   The guest OS 13 tries to write the VF link status acquisition command of VF32 into the command I / F register 61 (S1202). However, since the Valid bit 63 is “OFF”, the access of this VF link state acquisition command fails.

よって、物理計算機10は、ハイパバイザ11に、ページフォルト割込通知を発行する(S1203)。   Therefore, the physical computer 10 issues a page fault interrupt notification to the hypervisor 11 (S1203).

論理CPU割込ハンドラ103は、このページフォルト割込通知を検知すると、VF MMIOエミュレーション部102に、エミュレーション要求を発行する(S1204)。   When detecting the page fault interrupt notification, the logical CPU interrupt handler 103 issues an emulation request to the VF MMIO emulation unit 102 (S1204).

VF MMIOエミュレーション部102は、ゲストOS13からのコマンドがVFリンク状態取得コマンドである場合、VF応答格納領域62に、VF32は「リンクダウン状態」である旨を書き込む(S1205)。   When the command from the guest OS 13 is the VF link state acquisition command, the VF MMIO emulation unit 102 writes in the VF response storage area 62 that the VF 32 is “link down state” (S1205).

そして、VF MMIOエミュレーション部102は、ゲストOS13にコマンド完了通知(仮想I/O割込通知)を発行する(S1206)。   Then, the VF MMIO emulation unit 102 issues a command completion notification (virtual I / O interrupt notification) to the guest OS 13 (S1206).

ゲストOS13は、このコマンド完了通知を受けて、VF応答格納領62からVF32のリンク状態を取得する(S1206)。これにより、ゲストOS13は、VF32のリンク状態が「リンクダウン状態」であることを正しく認識できる。   Upon receiving this command completion notification, the guest OS 13 acquires the link status of the VF 32 from the VF response storage area 62 (S1206). Thereby, the guest OS 13 can correctly recognize that the link state of the VF 32 is the “link down state”.

上述の構成によれば、SR−IOV対応デバイス30に改修(実質的な改修)を加えなくても、ゲストOS13にVF32のリンク状態を正しく認識させることができる。また、仮想計算機12及び/又はゲストOS13に改修を加えなくても、ゲストOS13に正しいVF32のリンク状態を認識させることができる。つまり、物理計算機10がPF34とのリンク状態を正しくVF32のリンク状態が異なり得るに反映させることのできないSR−IOV対応デバイス30を備える場合であっても、その問題をハイパバイザ11内で吸収することができる。次に、各手段の処理の詳細について、図面を参照しながら説明する。   According to the above-described configuration, the guest OS 13 can be made to correctly recognize the link state of the VF 32 without modifying the SR-IOV compatible device 30 (substantial modification). Further, it is possible to make the guest OS 13 recognize the correct link state of the VF 32 without modifying the virtual machine 12 and / or the guest OS 13. That is, even when the physical computer 10 includes the SR-IOV compatible device 30 that cannot correctly reflect the link state with the PF 34 so that the link state of the VF 32 may be different, the problem is absorbed in the hypervisor 11. Can do. Next, details of processing of each means will be described with reference to the drawings.

図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 hypervisor 11 is activated.

PF監視部101は、仮想計算機システム内に未確認デバイスが残っているか否かを判定する(S101)。未確認デバイスが残っていない場合(S101:NO)、PF監視部101は、当該処理を終了する(END)。   The PF monitoring unit 101 determines whether or not an unconfirmed device remains in the virtual machine system (S101). If no unconfirmed device remains (S101: NO), the PF monitoring unit 101 ends the process (END).

未確認デバイスが残っている場合(S101:YES)、PF監視部101は、未確認デバイスの1つを選択する(S102)。そして、PF監視部101は、その選択した未確認デバイスのPCIコンフィグ51を参照し、そのデバイスのデバイス識別情報を特定する(S103)。   When an unconfirmed device remains (S101: YES), the PF monitoring unit 101 selects one of the unconfirmed devices (S102). Then, the PF monitoring unit 101 refers to the PCI configuration 51 of the selected unconfirmed device and specifies device identification information of the device (S103).

PF監視部101は、その特定したデバイス識別情報が、監視対象デバイス管理テーブル300の何れかのエントリ310に一致するか否かを判定する(S104)。   The PF monitoring unit 101 determines whether the specified device identification information matches any entry 310 in the monitoring target device management table 300 (S104).

デバイス識別情報が監視対象デバイス管理テーブル300の何れかのエントリ310に一致した場合(S104:YES)、PF監視部101は、そのデバイスに係るPF34のセグメント番号、バス番号、デバイス番号及びファンクション番号を特定し、PFリンク状態管理テーブル200に新規エントリ210として登録する(S105)。このとき、PF監視部101は、この新規エントリ210のPFリンク状態206の初期値を「リンクダウン状態」としても良い。   When the device identification information matches any entry 310 in the monitoring target device management table 300 (S104: YES), the PF monitoring unit 101 displays the segment number, bus number, device number, and function number of the PF 34 related to the device. It is identified and registered as a new entry 210 in the PF link state management table 200 (S105). At this time, the PF monitoring unit 101 may set the initial value of the PF link state 206 of the new entry 210 to the “link down state”.

デバイス識別情報が監視対象デバイス管理テーブル300の何れのエントリ310にも一致しない場合(S104:NO)、PF監視部101は、そのままステップS101に戻る。   If the device identification information does not match any entry 310 in the monitoring target device management table 300 (S104: NO), the PF monitoring unit 101 returns to step S101 as it is.

以上の処理により、監視対象のデバイスに係るPF34が、PFリンク状態管理テーブル200に登録される。   Through the above processing, the PF 34 related to the device to be monitored is registered in the PF link state management table 200.

図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 34. This process may be repeatedly executed while the hypervisor 11 is in operation.

PF監視部101は、PFリンク状態管理テーブル200の最初のエントリ210を選択する(S201)。PF34監視手段101は、その選択したエントリ210に係るPF34のリンク状態を取得する(S202)。   The PF monitoring unit 101 selects the first entry 210 of the PF link state management table 200 (S201). The PF 34 monitoring unit 101 acquires the link state of the PF 34 related to the selected entry 210 (S202).

PF34監視手段は、その取得したリンク状態と、その選択したエントリに係るリンク状態とを比較し、リンク状態が変化しているか否かを判定する(S203)。リンク状態が変化していない場合(S203:NO)、PF監視部101は、ステップS210に進む。   The PF 34 monitoring unit compares the acquired link state with the link state related to the selected entry, and determines whether or not the link state has changed (S203). If the link state has not changed (S203: NO), the PF monitoring unit 101 proceeds to step S210.

リンク状態が変化している場合(S203:YES)、PF監視部101は、その選択したエントリ210のPFリンク状態206を、その取得したPF34のリンク状態に書き換える(S204)。   When the link state has changed (S203: YES), the PF monitoring unit 101 rewrites the PF link state 206 of the selected entry 210 with the acquired link state of the PF 34 (S204).

PF監視部101は、その取得したPF34のリンク状態が「リンクダウン」であるか否かを判定する(S205)。   The PF monitoring unit 101 determines whether or not the acquired link state of the PF 34 is “link down” (S205).

その取得したPF34のリンク状態が「リンクダウン」である場合(S205:YES)、PF監視部101は、モード切替部104に、「エミュレーションモード」への切替を要求し(S207)、ステップS210に進む。   When the acquired link state of the PF 34 is “link down” (S205: YES), the PF monitoring unit 101 requests the mode switching unit 104 to switch to the “emulation mode” (S207), and the process proceeds to step S210. move on.

その取得したPF34のリンク状態が「リンクアップ」である場合(S205:NO)、PF監視部101は、モード切替部104に、「パススルーモード」への切替を要求し(S206)、ステップS210に進む。   When the acquired link state of the PF 34 is “link up” (S205: NO), the PF monitoring unit 101 requests the mode switching unit 104 to switch to the “pass-through mode” (S206), and the process proceeds to step S210. move on.

ステップS210において、PF監視部101は、PFリンク状態管理テーブル200に未選択のエントリ210が残っているか否かを判定する(S210)。   In step S210, the PF monitoring unit 101 determines whether or not an unselected entry 210 remains in the PF link state management table 200 (S210).

PFリンク状態管理テーブル200に未選択のエントリ210が残っている場合(S210:YES)、PF監視部101は、未選択のエントリ210の中から次のエントリ210を選択し(S211)、ステップS202に戻る。   When the unselected entry 210 remains in the PF link state management table 200 (S210: YES), the PF monitoring unit 101 selects the next entry 210 from the unselected entries 210 (S211), and step S202. Return to.

PFリンク状態管理テーブル200に未選択のエントリ210が残っていない場合(S210:NO)、PF監視部101は、PFリンク状態管理テーブル200に格納されているエントリ210を全て未選択にする(S220)。そして、PF監視部101は、例えば1秒待機した後(S211)、ステップS201に戻る。つまり、PF監視部101は、PFリンク状態管理テーブル200に登録されている全てのエントリ210について一通りリンク状態を確認したので、また最初から各エントリのリンク状態を確認する。   When the unselected entry 210 does not remain in the PF link state management table 200 (S210: NO), the PF monitoring unit 101 unselects all the entries 210 stored in the PF link state management table 200 (S220). ). The PF monitoring unit 101 waits for 1 second, for example (S211), and then returns to step S201. That is, since the PF monitoring unit 101 has confirmed the link status for all the entries 210 registered in the PF link status management table 200, the PF monitoring unit 101 also checks the link status of each entry from the beginning.

以上の処理により、PFリンク状態管理テーブル200に登録されているPF34のリンク状態の変化を検知することができる。   With the above processing, a change in the link state of the PF 34 registered in the PF link state management table 200 can be detected.

図11は、モード切替部104における処理の一例を示すフローチャートである。   FIG. 11 is a flowchart illustrating an example of processing in the mode switching unit 104.

モード切替部104は、PF監視部101から発行されたモード切替要求(図10のステップS206、S207に対応)が、パススルーモードへの切替要求であるか、又はエミュレーションモードへの切替要求であるかを判定する(S301)。   The mode switching unit 104 determines whether the mode switching request (corresponding to steps S206 and S207 in FIG. 10) issued from the PF monitoring unit 101 is a switching request to the pass-through mode or a switching request to the emulation mode. Is determined (S301).

パススルーモードへの切替要求である場合(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 mode switching unit 104 sets the Valid bit 63 corresponding to the MMIO area related to VF32 of the page table 52 to “ON” (S302). End (END).

エミュレーションモードへの切替要求である場合(S303:エミュレーションモード)、モード切替部104は、ページテーブル52のVF32に係るMMIO領域に対応するValidビット63を「OFF」に設定し(S303)、当該処理を終了する(END)。   If the request is for switching to the emulation mode (S303: emulation mode), the mode switching unit 104 sets the Valid bit 63 corresponding to the MMIO area related to VF32 of the page table 52 to “OFF” (S303), End (END).

図12は、VF MMIOエミュレーション部102における処理の一例を示すフローチャートである。   FIG. 12 is a flowchart illustrating an example of processing in the VF MMIO emulation unit 102.

このVF MMIOエミュレーション部102は、上述の通り、VF32に係るMMIO領域に対応するValidビットが63「OFF」の場合に実行される。つまり、このVF MMIOエミュレーション部102は、ハイパバイザ11がエミュレーションモードの場合に実行される。   As described above, the VF MMIO emulation unit 102 is executed when the Valid bit corresponding to the MMIO area related to VF32 is 63 “OFF”. That is, the VF MMIO emulation unit 102 is executed when the hypervisor 11 is in the emulation mode.

VF MMIOエミュレーション部102は、ゲストOS13からのコマンドが、コマンドI/Fレジスタ61への書き込みであるか否かを判定する(S401)。   The VF MMIO emulation unit 102 determines whether or not the command from the guest OS 13 is a write to the command I / F register 61 (S401).

ゲストOS13からのコマンドがコマンドI/Fレジスタ61への書き込みでない場合(S401:NO)、VF MMIOエミュレーション部102は、ゲストOS13からのコマンドをそのままVF32に通し(S420)、当該処理を終了する(END)。   If the command from the guest OS 13 is not a write to the command I / F register 61 (S401: NO), the VF MMIO emulation unit 102 passes the command from the guest OS 13 through the VF 32 as it is (S420) and ends the processing ( END).

ゲストOS13からのコマンドがコマンドI/Fレジスタ61への書き込みである場合(S301:YES)、VF MMIOエミュレーション部102は、このコマンドがVFリンク状態取得コマンドであるか否かを判定する(S410)。   When the command from the guest OS 13 is writing to the command I / F register 61 (S301: YES), the VF MMIO emulation unit 102 determines whether this command is a VF link state acquisition command (S410). .

ゲストOS13からのコマンドがVF32リンク状態取得コマンドでない場合(S410:NO)、VF MMIOエミュレーション部102は、ゲストOS13からのコマンドをそのままVF32に通し(S420)、当該処理を終了する(END)。つまり、このコマンドは、通常通りコマンドI/Fレジスタ61に書き込まれる。   When the command from the guest OS 13 is not the VF32 link state acquisition command (S410: NO), the VF MMIO emulation unit 102 passes the command from the guest OS 13 as it is to the VF32 (S420) and ends the processing (END). That is, this command is written to the command I / F register 61 as usual.

ゲストOS13からのコマンドがVF32リンク状態取得コマンドである場合(S410:YES)、VF MMIOエミュレーション部102は、VF応答格納領域62に、VF32がリンクダウン状態である旨を書き込む(S411)。   When the command from the guest OS 13 is the VF32 link state acquisition command (S410: YES), the VF MMIO emulation unit 102 writes in the VF response storage area 62 that the VF32 is in the link down state (S411).

そして、VF MMIOエミュレーション部102は、ゲストOS13に対してコマンド完了通知(仮想I/O割込通知)を上げ(S412)、当該処理を終了する(END)。このコマンド完了通知を受けたゲストOS13は、VF応答格納領域62からVF32のリンク状態(つまり「リンクダウン状態」)を取得する。   Then, the VF MMIO emulation unit 102 raises a command completion notification (virtual I / O interrupt notification) to the guest OS 13 (S412), and ends the processing (END). Upon receiving this command completion notification, the guest OS 13 acquires the link state (that is, “link down state”) of the VF 32 from the VF response storage area 62.

上記の図12及び図13の処理により、図10及び図11に示したように、ゲストOS13は、PF34のリンク状態に対応したVF32のリンク状態を正しく取得することができる。つまり、ゲストOS13は、PF34がリンクダウンの場合には、VF32がリンクダウン状態であることを正しく認識することができる。   12 and 13, the guest OS 13 can correctly acquire the link state of the VF 32 corresponding to the link state of the PF 34, as shown in FIGS. That is, the guest OS 13 can correctly recognize that the VF 32 is in the link down state when the PF 34 is in the link down state.

上述した実施例は、本発明の説明のための例示であり、本発明の範囲をそれらの実施例にのみ限定する趣旨ではない。当業者は、本発明の要旨を逸脱することなしに、他の様々な態様で本発明を実施することができる。   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 hypervisor 11 detects the link down of the PF 34, writes that the VF 32 is in the link down state in the VF response storage area 62, and the guest OS 13 refers to the VF response storage area 62 to refer to the VF 32. For example, when the hypervisor 11 detects a link down of the PF 34, the hypervisor 11 may notify the guest OS 13 that the VF 32 corresponding to the PF 34 is in the link down state. good.

1…仮想計算機システム 10…物理計算機 11…ハイパバイザ 12…仮想計算機 13…ゲストOS 30…SR−IOV対応デバイス

DESCRIPTION OF SYMBOLS 1 ... Virtual computer system 10 ... Physical computer 11 ... Hypervisor 12 ... Virtual computer 13 ... Guest OS 30 ... SR-IOV corresponding device

Claims (8)

物理CPU(Central Processing Unit)と、物理メモリと、SR−IOV(Single Root I/O Virtualization)対応デバイスと、仮想化機構とを有し、
前記物理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モードが設定されている場合、前記ゲストOSからの前記VFに係るコマンドに対して、前記VFに係るSR−IOV対応デバイスに応答させる
請求項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.
前記仮想化機構は、前記第2モードが設定されている場合において、
前記ゲスト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.
前記第2モードの設定とは、前記ゲストOSからの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.
前記VFに係るコマンドの処理がエラーとなる設定とは、前記VFに係るSR−IOV対応デバイスが応答しないように、前記物理メモリにおいて、前記VFに係るMMIO(Memory−Mapped I/O)領域を特定するために参照されるフラグを、参照不可能な状態に設定することである
請求項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.
前記仮想化機構によって物理メモリを論理的に分割してなる論理資源を割り当てられた仮想計算機の仮想メモリであって、前記ゲストOSからのVFに係るコマンドの応答は前記仮想メモリ上の領域に格納するようになっており、
前記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.
前記仮想化機構は、監視対象に設定されたSR−IOV対応デバイスの有するPFのリンク状態を監視し、当該PFのリンク状態の変化を検知すると、モードの設定を変更する
請求項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(Central Processing Unit)と、物理メモリと、SR−IOV(Single Root I/O Virtualization)対応デバイスと、仮想化機構とを有し、
物理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.


JP2013116739A 2013-06-03 2013-06-03 Virtual computer system and SR-IOV compatible device control method Expired - Fee Related JP5917441B2 (en)

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 true JP2014235578A (en) 2014-12-15
JP5917441B2 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016126677A (en) * 2015-01-08 2016-07-11 富士通株式会社 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

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080140824A1 (en) * 2006-12-12 2008-06-12 Vinit Jain Partial link-down status for virtual ethernet adapters
JP2008146566A (en) * 2006-12-13 2008-06-26 Hitachi Ltd Computer, control method of virtual device and its program
JP2009223793A (en) * 2008-03-18 2009-10-01 Fujitsu Ltd Information processor, control method of information processor and computer program
JP2009301162A (en) * 2008-06-11 2009-12-24 Hitachi Ltd Computer system, device sharing method, and device sharing program
JP2012203636A (en) * 2011-03-25 2012-10-22 Hitachi Ltd Control method for virtual computer and computer
JP2013077076A (en) * 2011-09-29 2013-04-25 Hitachi Ltd Calculator device for controlling virtual calculator and method for controlling virtual calculator
JP2013084122A (en) * 2011-10-11 2013-05-09 Hitachi Ltd Virtual computer, virtual computer system, and virtual computer control method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080140824A1 (en) * 2006-12-12 2008-06-12 Vinit Jain Partial link-down status for virtual ethernet adapters
JP2008146566A (en) * 2006-12-13 2008-06-26 Hitachi Ltd Computer, control method of virtual device and its program
JP2009223793A (en) * 2008-03-18 2009-10-01 Fujitsu Ltd Information processor, control method of information processor and computer program
JP2009301162A (en) * 2008-06-11 2009-12-24 Hitachi Ltd Computer system, device sharing method, and device sharing program
JP2012203636A (en) * 2011-03-25 2012-10-22 Hitachi Ltd Control method for virtual computer and computer
JP2013077076A (en) * 2011-09-29 2013-04-25 Hitachi Ltd Calculator device for controlling virtual calculator and method for controlling virtual calculator
JP2013084122A (en) * 2011-10-11 2013-05-09 Hitachi Ltd Virtual computer, virtual computer system, and virtual computer control method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016126677A (en) * 2015-01-08 2016-07-11 富士通株式会社 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
US11126576B2 (en) 2017-12-20 2021-09-21 Nec Corporation Input/output execution device, device virtualization system, input/output execution method, and recording medium

Also Published As

Publication number Publication date
JP5917441B2 (en) 2016-05-11

Similar Documents

Publication Publication Date Title
US10394547B2 (en) Applying update to snapshots of virtual machine
US9489274B2 (en) System and method for performing efficient failover and virtual machine (VM) migration in virtual desktop infrastructure (VDI)
EP3608792B1 (en) Managed switching between one or more hosts and solid state drives (ssds) based on the nvme protocol to provide host storage services
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)
US9697024B2 (en) Interrupt management method, and computer implementing the interrupt management method
US8527666B2 (en) Accessing a configuration space of a virtual function
US20130219391A1 (en) Server and method for deploying virtual machines in network cluster
US9531668B2 (en) Micro server, method of allocating MAC address, and computer readable recording medium
US9131031B2 (en) Virtual computer system, virtual computer management program, and MAC address management method
JP2010003061A (en) Computer system and method for changing i/o configuration thereof
US10956189B2 (en) Methods for managing virtualized remote direct memory access devices
US20220327080A1 (en) PCIe DEVICE AND OPERATING METHOD THEREOF
CN107547258B (en) Method and device for realizing network policy
CN107145304B (en) Server, storage system and related method
JP5966466B2 (en) Backup control method and information processing apparatus
JP5917441B2 (en) Virtual computer system and SR-IOV compatible device control method
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
WO2016068902A1 (en) Including node and process identifiers in a transaction
JP5975003B2 (en) Virtualization control device, virtualization system, virtualization method, and virtualization control program.
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
US11029850B2 (en) System of controlling data rebalance and its method

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